summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>1998-04-13 04:31:23 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>1998-04-13 04:31:23 (GMT)
commit33a49221fccc5adc7ec9c5a556be4f6cb72f4e34 (patch)
tree9eab81feeb1694e8700bcb2e282d4df673bc2dbd /src/H5P.c
parent1a7e4bcd6c61b8f89001b8de9946995e579e1e79 (diff)
downloadhdf5-33a49221fccc5adc7ec9c5a556be4f6cb72f4e34.zip
hdf5-33a49221fccc5adc7ec9c5a556be4f6cb72f4e34.tar.gz
hdf5-33a49221fccc5adc7ec9c5a556be4f6cb72f4e34.tar.bz2
[svn-r343] First implementation of collective access support.
H5D.c Changed H5D_write and H5D_read to recognize collective transfer requests. Current algorithm puts the xfer-mode in the file->mpio structure. Not thread safe. Need to revise it to pass transfer parameter as a function parameters to the lower levels. H5Dprivate.h H5Dpublic.h Added xfer_mode to the transfer property list structure. Added defination of transfer modes, H5D_XFER_INDEPENDENT and H5D_XFER_COLLECTIVE. H5Farray.c Added code to handle collective access requests. Currently works for one contiguous block at a time. Need to revise it with the MPIO low level calls to combine all blocks as one truely collective call. H5P.c H5Ppublic.h Added H5Pset_xfer and H5Pget_xfer routines that can set and get the transfer mode of a data transfer property list.
Diffstat (limited to 'src/H5P.c')
-rw-r--r--src/H5P.c105
1 files changed, 103 insertions, 2 deletions
diff --git a/src/H5P.c b/src/H5P.c
index 25f9f31..d06aa2a 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -1850,6 +1850,7 @@ H5Pget_preserve (hid_t plist_id)
+#ifdef HAVE_PARALLEL
/*-------------------------------------------------------------------------
* Function: H5Pset_mpi
*
@@ -1903,7 +1904,6 @@ H5Pget_preserve (hid_t plist_id)
*
*-------------------------------------------------------------------------
*/
-#ifdef HAVE_PARALLEL
herr_t
H5Pset_mpi (hid_t tid, MPI_Comm comm, MPI_Info info, unsigned access_mode)
{
@@ -1964,6 +1964,7 @@ H5Pset_mpi (hid_t tid, MPI_Comm comm, MPI_Info info, unsigned access_mode)
#endif /*HAVE_PARALLEL*/
+#ifdef HAVE_PARALLEL
/*-------------------------------------------------------------------------
* Function: H5Pget_mpi
*
@@ -1983,7 +1984,6 @@ H5Pset_mpi (hid_t tid, MPI_Comm comm, MPI_Info info, unsigned access_mode)
*
*-------------------------------------------------------------------------
*/
-#ifdef HAVE_PARALLEL
herr_t
H5Pget_mpi (hid_t tid, MPI_Comm *comm, MPI_Info *info, unsigned *access_mode)
{
@@ -2012,6 +2012,107 @@ H5Pget_mpi (hid_t tid, MPI_Comm *comm, MPI_Info *info, unsigned *access_mode)
#endif /*HAVE_PARALLEL*/
+#ifdef HAVE_PARALLEL
+/*-------------------------------------------------------------------------
+ * Function: H5Pset_xfer
+ *
+ * Signature: herr_t H5Pset_xfer(hid_t tid, H5D_transfer_t data_xfer_mode)
+ *
+ * Purpose: Set the transfer mode of the dataset transfer property list.
+ * The list can then be used to control the I/O transfer mode
+ * during dataset accesses. This function is available only
+ * in the parallel HDF5 library and is not a collective function.
+ *
+ * Parameters:
+ * hid_t tid
+ * ID of a dataset transfer property list
+ * H5D_transfer_t data_xfer_mode
+ * data transfer modes:
+ * H5ACC_INDEPENDENT
+ * Use independent I/O access.
+ * H5ACC_COLLECTIVE
+ * Use MPI collective I/O access.
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Albert Cheng
+ * April 2, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pset_xfer (hid_t tid, H5D_transfer_t data_xfer_mode)
+{
+ H5D_xfer_t *plist = NULL;
+
+ FUNC_ENTER(H5Pset_xfer, FAIL);
+
+ /* Check arguments */
+ if (H5P_DATASET_XFER != H5Pget_class(tid) ||
+ NULL == (plist = H5I_object(tid))) {
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a dataset transfer property list");
+ }
+
+ switch (data_xfer_mode){
+ case H5D_XFER_INDEPENDENT:
+ case H5D_XFER_COLLECTIVE:
+ plist->xfer_mode = data_xfer_mode;
+ break;
+ default:
+ HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,
+ "invalid dataset transfer mode");
+ }
+
+ FUNC_LEAVE(SUCCEED);
+}
+#endif /*HAVE_PARALLEL*/
+
+
+#ifdef HAVE_PARALLEL
+/*-------------------------------------------------------------------------
+ * Function: H5Pget_xfer
+ *
+ * Purpose: Reads the transfer mode current set in the property list.
+ * This function is available only in the parallel HDF5 library
+ * and is not a collective function.
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: FAIL
+ *
+ * Programmer: Albert Cheng
+ * April 2, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Pget_xfer (hid_t tid, H5D_transfer_t *data_xfer_mode)
+{
+ H5D_xfer_t *plist = NULL;
+
+ FUNC_ENTER (H5Pget_xfer, FAIL);
+
+ /* Check arguments */
+ if (H5P_DATASET_XFER != H5Pget_class(tid) ||
+ NULL == (plist = H5I_object(tid))) {
+ HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
+ "not a dataset transfer property list");
+ }
+
+ *data_xfer_mode = plist->xfer_mode;
+
+ FUNC_LEAVE (SUCCEED);
+}
+#endif /*HAVE_PARALLEL*/
+
+
/*--------------------------------------------------------------------------
NAME
H5Pcopy