summaryrefslogtreecommitdiffstats
path: root/src/H5FDmpio.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-12-23 14:54:47 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-12-23 14:54:47 (GMT)
commitcbd0460b1b2c94611cb02f9d6f240b4d24ce8fe2 (patch)
tree32f2ad80e8d05c2bb5440f0459cb1bce8d8fb976 /src/H5FDmpio.c
parent443bc1200f2ef81136b1ac2822873bc06ac926bd (diff)
downloadhdf5-cbd0460b1b2c94611cb02f9d6f240b4d24ce8fe2.zip
hdf5-cbd0460b1b2c94611cb02f9d6f240b4d24ce8fe2.tar.gz
hdf5-cbd0460b1b2c94611cb02f9d6f240b4d24ce8fe2.tar.bz2
[svn-r25921] - wrap MPI 3 usage with MPI_VERSION compile time check.
- build out unbuffered stdout/err for windows
Diffstat (limited to 'src/H5FDmpio.c')
-rw-r--r--src/H5FDmpio.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 73237b7..4f48e27 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -1454,10 +1454,16 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add
int mpi_code; /* mpi return code */
MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */
int size_i; /* Integer copy of 'size' to read */
+#if MPI_VERSION == 3
MPI_Count bytes_read; /* Number of bytes read in */
- int n;
MPI_Count type_size; /* MPI datatype used for I/O's size */
MPI_Count io_size; /* Actual number of bytes requested */
+#else
+ int bytes_read; /* Number of bytes read in */
+ int type_size; /* MPI datatype used for I/O's size */
+ int io_size; /* Actual number of bytes requested */
+#endif
+ int n;
H5P_genplist_t *plist = NULL; /* Property list pointer */
hbool_t use_view_this_time = FALSE;
herr_t ret_value = SUCCEED;
@@ -1574,11 +1580,19 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add
}
/* How many bytes were actually read? */
- if (MPI_SUCCESS != (mpi_code=MPI_Get_elements_x(&mpi_stat, buf_type, &bytes_read)))
+#if MPI_VERSION == 3
+ if (MPI_SUCCESS != (mpi_code = MPI_Get_elements_x(&mpi_stat, buf_type, &bytes_read)))
+#else
+ if (MPI_SUCCESS != (mpi_code = MPI_Get_elements(&mpi_stat, MPI_BYTE, &bytes_read)))
+#endif
HMPI_GOTO_ERROR(FAIL, "MPI_Get_elements failed", mpi_code)
/* Get the type's size */
- if (MPI_SUCCESS != (mpi_code=MPI_Type_size_x(buf_type,&type_size)))
+#if MPI_VERSION == 3
+ if (MPI_SUCCESS != (mpi_code = MPI_Type_size_x(buf_type, &type_size)))
+#else
+ if (MPI_SUCCESS != (mpi_code = MPI_Type_size(buf_type, &type_size)))
+#endif
HMPI_GOTO_ERROR(FAIL, "MPI_Type_size failed", mpi_code)
/* Compute the actual number of bytes requested */
@@ -1734,10 +1748,16 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
MPI_Status mpi_stat; /* Status from I/O operation */
MPI_Datatype buf_type = MPI_BYTE; /* MPI description of the selection in memory */
int mpi_code; /* MPI return code */
+#if MPI_VERSION == 3
MPI_Count bytes_written;
- int size_i;
MPI_Count type_size; /* MPI datatype used for I/O's size */
MPI_Count io_size; /* Actual number of bytes requested */
+#else
+ int bytes_written;
+ int type_size; /* MPI datatype used for I/O's size */
+ int io_size; /* Actual number of bytes requested */
+#endif
+ int size_i;
hbool_t use_view_this_time = FALSE;
H5P_genplist_t *plist = NULL; /* Property list pointer */
herr_t ret_value = SUCCEED;
@@ -1864,11 +1884,19 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
}
/* How many bytes were actually written? */
+#if MPI_VERSION == 3
if(MPI_SUCCESS != (mpi_code = MPI_Get_elements_x(&mpi_stat, buf_type, &bytes_written)))
+#else
+ if(MPI_SUCCESS != (mpi_code = MPI_Get_elements(&mpi_stat, MPI_BYTE, &bytes_written)))
+#endif
HMPI_GOTO_ERROR(FAIL, "MPI_Get_elements failed", mpi_code)
/* Get the type's size */
+#if MPI_VERSION == 3
if(MPI_SUCCESS != (mpi_code = MPI_Type_size_x(buf_type, &type_size)))
+#else
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_size(buf_type, &type_size)))
+#endif
HMPI_GOTO_ERROR(FAIL, "MPI_Type_size failed", mpi_code)
/* Compute the actual number of bytes requested */