summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-09-16 17:35:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-09-16 17:35:31 (GMT)
commit9b152820077fc8ddff99704b8cc3e1a63ce4093c (patch)
treeeb470ebab67e13a4b690096e9fa2fae09a366dca /src
parent58b49c8302b3adc3890f7f0c7b4da291fd34562a (diff)
downloadhdf5-9b152820077fc8ddff99704b8cc3e1a63ce4093c.zip
hdf5-9b152820077fc8ddff99704b8cc3e1a63ce4093c.tar.gz
hdf5-9b152820077fc8ddff99704b8cc3e1a63ce4093c.tar.bz2
[svn-r7481] Purpose:
Bug fix Description: The MPI_File_set_size() routine on ASCI Red is not able to extend files so that they are larger than 2GB. Solution: Add an extra macro which controls whether MPI_File_set_size() can handle >2GB offsets or if our "older" way of reading a byte, then writing a byte at the appropriate offset should be used. Platforms tested: FreeBSD 4.9 (sleipnir) h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5FDmpio.c22
-rw-r--r--src/H5config.h.in15
2 files changed, 24 insertions, 13 deletions
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 7a32a2b..e245b3c 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -2024,7 +2024,7 @@ H5FD_mpio_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned closing)
int mpi_code; /* mpi return code */
MPI_Offset mpi_off;
herr_t ret_value=SUCCEED;
-#ifdef OLD_WAY
+#ifndef H5_MPI_FILE_SET_SIZE_BIG
uint8_t byte=0;
MPI_Status mpi_stat;
#endif /* OLD_WAY */
@@ -2038,7 +2038,7 @@ H5FD_mpio_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned closing)
assert(file);
assert(H5FD_MPIO==file->pub.driver_id);
-#ifdef OLD_WAY
+#ifndef H5_MPI_FILE_SET_SIZE_BIG
/* Portably initialize MPI status variable */
HDmemset(&mpi_stat,0,sizeof(MPI_Status));
#endif /* OLD_WAY */
@@ -2048,7 +2048,14 @@ H5FD_mpio_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned closing)
* we can't just check whether EOF<EOA like with other drivers.
* Therefore we'll just read the byte at EOA-1 and then write it back. */
if(file->eoa>file->last_eoa) {
-#ifdef OLD_WAY
+#ifdef H5_MPI_FILE_SET_SIZE_BIG
+ if (H5FD_mpio_haddr_to_MPIOff(file->eoa, &mpi_off)<0)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "cannot convert from haddr_t to MPI_Offset");
+
+ /* Extend the file's size */
+ if (MPI_SUCCESS != (mpi_code=MPI_File_set_size(file->f, mpi_off)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code);
+#else /* H5_MPI_FILE_SET_SIZE_BIG */
if (0==file->mpi_rank) {
if (H5FD_mpio_haddr_to_MPIOff(file->eoa-1, &mpi_off)<0)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "cannot convert from haddr_t to MPI_Offset");
@@ -2057,13 +2064,7 @@ H5FD_mpio_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned closing)
if (MPI_SUCCESS != (mpi_code=MPI_File_write_at(file->f, mpi_off, &byte, 1, MPI_BYTE, &mpi_stat)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mpi_code);
} /* end if */
-#else /* OLD_WAY */
- if (H5FD_mpio_haddr_to_MPIOff(file->eoa, &mpi_off)<0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "cannot convert from haddr_t to MPI_Offset");
-
- /* Extend the file's size */
- if (MPI_SUCCESS != (mpi_code=MPI_File_set_size(file->f, mpi_off)))
- HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code);
+#endif /* H5_MPI_FILE_SET_SIZE_BIG */
/* Don't let any proc return until all have extended the file.
* (Prevents race condition where some processes go ahead and write
@@ -2073,7 +2074,6 @@ H5FD_mpio_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned closing)
*/
if (MPI_SUCCESS!= (mpi_code=MPI_Barrier(file->comm)))
HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code);
-#endif /* OLD_WAY */
/* Update the 'last' eoa value */
file->last_eoa=file->eoa;
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 4be13d1..6e8e6d0 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -128,6 +128,9 @@
/* Define to 1 if you have the `globus_io' library (-lglobus_io). */
#undef HAVE_LIBGLOBUS_IO
+/* Define to 1 if you have the `lmpe' library (-llmpe). */
+#undef HAVE_LIBLMPE
+
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
@@ -179,6 +182,9 @@
/* Define if we have MPE support */
#undef HAVE_MPE
+/* Define to 1 if you have the <mpe.h> header file. */
+#undef HAVE_MPE_H
+
/* Define to 1 if you have the <netinet/tcp.h> header file. */
#undef HAVE_NETINET_TCP_H
@@ -334,9 +340,14 @@
/* Define if `__tm_gmtoff' is a member of `struct tm' */
#undef HAVE___TM_GMTOFF
-/* Define if your system has a working `malloc' function. */
+/* Define if your system's `malloc' function returns a valid pointer for
+ 0-byte allocations. */
#undef MALLOC_WORKS
+/* Define if your system's `MPI_File_set_size' function works for files over
+ 2GB. */
+#undef MPI_FILE_SET_SIZE_BIG
+
/* Define if shared writing must be disabled (CodeWarrior only) */
#undef NO_SHARED_WRITING
@@ -355,7 +366,7 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-/* Width for printf() for type `long long' or `__int64', us. `ll' */
+/* Width for printf() for type `long long' or `__int64', use `ll' */
#undef PRINTF_LL_WIDTH
/* The size of a `char', as computed by sizeof. */