summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-05-18 15:34:28 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-05-18 15:34:28 (GMT)
commit674f45036710a7bf230ca3dae86aa9ca37ff9ed1 (patch)
tree00e6d009398af054454608d96f2ab9c740043cb6 /src
parentca8d4218d2a7b888e04bd40c22cc090fb7cd207d (diff)
downloadhdf5-674f45036710a7bf230ca3dae86aa9ca37ff9ed1.zip
hdf5-674f45036710a7bf230ca3dae86aa9ca37ff9ed1.tar.gz
hdf5-674f45036710a7bf230ca3dae86aa9ca37ff9ed1.tar.bz2
[svn-r22379] make the file and memory MPI datatypes as default properties in the
DXPL so that we don't have to insert and remove them everytime we perform collective I/O.
Diffstat (limited to 'src')
-rw-r--r--src/H5Dmpio.c9
-rw-r--r--src/H5FDmpi.c49
-rw-r--r--src/H5FDmpi.h7
-rw-r--r--src/H5Pdxpl.c20
4 files changed, 26 insertions, 59 deletions
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 45cf6a1..9b8fa27 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -1542,15 +1542,13 @@ static herr_t
H5D__final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
hsize_t mpi_buf_count, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type)
{
- hbool_t plist_is_setup = FALSE; /* Whether the dxpl has been customized */
herr_t ret_value = SUCCEED;
FUNC_ENTER_STATIC
/* Pass buf type, file type to the file driver. */
- if(H5FD_mpi_setup_collective(io_info->dxpl_id, *mpi_buf_type, *mpi_file_type) < 0)
+ if(H5FD_mpi_setup_collective(io_info->dxpl_id, mpi_buf_type, mpi_file_type) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties")
- plist_is_setup = TRUE;
if(io_info->op_type == H5D_IO_OP_WRITE) {
if((io_info->io_ops.single_write)(io_info, type_info, mpi_buf_count, NULL, NULL) < 0)
@@ -1562,11 +1560,6 @@ H5D__final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf
} /* end else */
done:
- /* Reset the dxpl settings */
- if(plist_is_setup)
- if(H5FD_mpi_teardown_collective(io_info->dxpl_id) < 0)
- HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "unable to reset dxpl values")
-
#ifdef H5D_DEBUG
if(H5DEBUG(D))
HDfprintf(H5DEBUG(D),"ret_value before leaving final_collective_io=%d\n",ret_value);
diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c
index ff2c87d..afc5536 100644
--- a/src/H5FDmpi.c
+++ b/src/H5FDmpi.c
@@ -466,7 +466,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype btype, MPI_Datatype ftype)
+H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype *btype, MPI_Datatype *ftype)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
@@ -478,56 +478,15 @@ H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype btype, MPI_Datatype ftype)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list")
/* Set buffer MPI type */
- if(H5P_insert(plist,H5FD_MPI_XFER_MEM_MPI_TYPE_NAME,H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE,&btype,NULL,NULL,NULL,NULL,NULL,NULL)<0)
+ if(H5P_set(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, btype) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property")
- /* Set file MPI type */
- if(H5P_insert(plist,H5FD_MPI_XFER_FILE_MPI_TYPE_NAME,H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE,&ftype,NULL,NULL,NULL,NULL,NULL,NULL)<0)
+ /* Set File MPI type */
+ if(H5P_set(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, ftype) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property")
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD_mpi_setup_collective() */
-
-/*-------------------------------------------------------------------------
- * Function: H5FD_mpi_teardown_collective
- *
- * Purpose: Remove the temporary MPI-I/O properties from dxpl.
- *
- * Return: Success: Non-negative
- * Failure: Negative
- *
- * Programmer: Quincey Koziol
- * Monday, June 17, 2002
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5FD_mpi_teardown_collective(hid_t dxpl_id)
-{
- H5P_genplist_t *plist; /* Property list pointer */
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Check arguments */
- if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER)))
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list")
-
- /* Remove buffer MPI type */
- if(H5P_remove(dxpl_id,plist,H5FD_MPI_XFER_MEM_MPI_TYPE_NAME)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property")
-
- /* Remove file MPI type */
- if(H5P_remove(dxpl_id,plist,H5FD_MPI_XFER_FILE_MPI_TYPE_NAME)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5FD_mpi_teardown_collective() */
-
#endif /* H5_HAVE_PARALLEL */
-
diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h
index b9998dd..9ca2966 100644
--- a/src/H5FDmpi.h
+++ b/src/H5FDmpi.h
@@ -81,10 +81,8 @@ typedef struct H5FD_class_mpi_t {
/* ======== Temporary data transfer properties ======== */
/* Definitions for memory MPI type property */
#define H5FD_MPI_XFER_MEM_MPI_TYPE_NAME "H5FD_mpi_mem_mpi_type"
-#define H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE sizeof(MPI_Datatype)
/* Definitions for file MPI type property */
#define H5FD_MPI_XFER_FILE_MPI_TYPE_NAME "H5FD_mpi_file_mpi_type"
-#define H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE sizeof(MPI_Datatype)
/*
* The view is set to this value
@@ -105,9 +103,8 @@ H5_DLL herr_t H5FD_mpi_comm_info_free(MPI_Comm *comm, MPI_Info *info);
H5_DLL herr_t H5FD_mpio_wait_for_left_neighbor(H5FD_t *file);
H5_DLL herr_t H5FD_mpio_signal_right_neighbor(H5FD_t *file);
#endif /* NOT_YET */
-H5_DLL herr_t H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype btype,
- MPI_Datatype ftype);
-H5_DLL herr_t H5FD_mpi_teardown_collective(hid_t dxpl_id);
+H5_DLL herr_t H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype *btype,
+ MPI_Datatype *ftype);
/* Driver specific methods */
H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file);
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index e9b443b..1bdee97 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -120,7 +120,12 @@
#define H5D_XFER_XFORM_DEL H5P_dxfr_xform_del
#define H5D_XFER_XFORM_COPY H5P_dxfr_xform_copy
#define H5D_XFER_XFORM_CLOSE H5P_dxfr_xform_close
-
+/* Definitions for memory MPI type property */
+#define H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE sizeof(MPI_Datatype)
+#define H5FD_MPI_XFER_MEM_MPI_TYPE_DEF MPI_DATATYPE_NULL
+/* Definitions for file MPI type property */
+#define H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE sizeof(MPI_Datatype)
+#define H5FD_MPI_XFER_FILE_MPI_TYPE_DEF MPI_DATATYPE_NULL
/******************/
/* Local Typedefs */
@@ -208,6 +213,8 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
unsigned def_mpio_chunk_opt_ratio = H5D_XFER_MPIO_CHUNK_OPT_RATIO_DEF;
H5D_mpio_actual_chunk_opt_mode_t def_mpio_actual_chunk_opt_mode = H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_DEF;
H5D_mpio_actual_io_mode_t def_mpio_actual_io_mode = H5D_MPIO_ACTUAL_IO_MODE_DEF;
+ MPI_Datatype btype = H5FD_MPI_XFER_MEM_MPI_TYPE_DEF; /* Default value for MPI buffer type */
+ MPI_Datatype ftype = H5FD_MPI_XFER_FILE_MPI_TYPE_DEF; /* Default value for MPI file type */
#endif /* H5_HAVE_PARALLEL */
H5Z_EDC_t enable_edc = H5D_XFER_EDC_DEF; /* Default value for EDC property */
H5Z_cb_t filter_cb = H5D_XFER_FILTER_CB_DEF; /* Default value for filter callback */
@@ -285,6 +292,17 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass)
/* Register the actual io mode property. */
if(H5P_register_real(pclass, H5D_MPIO_ACTUAL_IO_MODE_NAME, H5D_MPIO_ACTUAL_IO_MODE_SIZE, &def_mpio_actual_io_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
+
+ /* Register the MPI memory type property */
+ if(H5P_register_real(pclass, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE,
+ &btype, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
+
+ /* Register the MPI file type property */
+ if(H5P_register_real(pclass, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE,
+ &ftype, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
+
#endif /* H5_HAVE_PARALLEL */
/* Register the EDC property */