common/ompio: fix a floating point division problem
This commit fixes a problem reported on the mailing list with individual writes larger than 512 MB. The culprit is a floating point division of two large, close values. Changing the datatypes from float to double (which is what is being used in the fcoll components) fixes the problem. See issue #6285 and https://forum.hdfgroup.org/t/cannot-write-more-than-512-mb-in-1d/5118 Thanks for Axel Huebl and René Widera for reporting the issue. Signed-off-by: Edgar Gabriel <egabriel@central.uh.edu> (cherry picked from commit c0f8ce0fff4684b670135043dd150abc9d83d988)
Этот коммит содержится в:
родитель
fb39c7f7e6
Коммит
d1e8779fe3
@ -9,7 +9,7 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2008-2018 University of Houston. All rights reserved.
|
* Copyright (c) 2008-2019 University of Houston. All rights reserved.
|
||||||
* Copyright (c) 2018 Research Organization for Information Science
|
* Copyright (c) 2018 Research Organization for Information Science
|
||||||
* and Technology (RIST). All rights reserved.
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
@ -33,8 +33,8 @@
|
|||||||
|
|
||||||
#include "common_ompio.h"
|
#include "common_ompio.h"
|
||||||
#include "common_ompio_request.h"
|
#include "common_ompio_request.h"
|
||||||
#include "math.h"
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
#if OPAL_CUDA_SUPPORT
|
#if OPAL_CUDA_SUPPORT
|
||||||
#include "common_ompio_cuda.h"
|
#include "common_ompio_cuda.h"
|
||||||
@ -132,7 +132,7 @@ int mca_common_ompio_file_read (ompio_file_t *fh,
|
|||||||
else {
|
else {
|
||||||
bytes_per_cycle = OMPIO_MCA_GET(fh, cycle_buffer_size);
|
bytes_per_cycle = OMPIO_MCA_GET(fh, cycle_buffer_size);
|
||||||
}
|
}
|
||||||
cycles = ceil((float)max_data/bytes_per_cycle);
|
cycles = ceil((double)max_data/bytes_per_cycle);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
printf ("Bytes per Cycle: %d Cycles: %d max_data:%d \n",bytes_per_cycle, cycles, max_data);
|
printf ("Bytes per Cycle: %d Cycles: %d max_data:%d \n",bytes_per_cycle, cycles, max_data);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2008-2018 University of Houston. All rights reserved.
|
* Copyright (c) 2008-2019 University of Houston. All rights reserved.
|
||||||
* Copyright (c) 2015-2018 Research Organization for Information Science
|
* Copyright (c) 2015-2018 Research Organization for Information Science
|
||||||
* and Technology (RIST). All rights reserved.
|
* and Technology (RIST). All rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
@ -31,8 +31,8 @@
|
|||||||
|
|
||||||
#include "common_ompio.h"
|
#include "common_ompio.h"
|
||||||
#include "common_ompio_request.h"
|
#include "common_ompio_request.h"
|
||||||
#include "math.h"
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
#if OPAL_CUDA_SUPPORT
|
#if OPAL_CUDA_SUPPORT
|
||||||
#include "common_ompio_cuda.h"
|
#include "common_ompio_cuda.h"
|
||||||
@ -116,7 +116,7 @@ int mca_common_ompio_file_write (ompio_file_t *fh,
|
|||||||
else {
|
else {
|
||||||
bytes_per_cycle = OMPIO_MCA_GET(fh, cycle_buffer_size);
|
bytes_per_cycle = OMPIO_MCA_GET(fh, cycle_buffer_size);
|
||||||
}
|
}
|
||||||
cycles = ceil((float)max_data/bytes_per_cycle);
|
cycles = ceil((double)max_data/bytes_per_cycle);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
printf ("Bytes per Cycle: %d Cycles: %d\n", bytes_per_cycle, cycles);
|
printf ("Bytes per Cycle: %d Cycles: %d\n", bytes_per_cycle, cycles);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user