diff options
Diffstat (limited to 'src/H5Pdxpl.c')
-rw-r--r-- | src/H5Pdxpl.c | 149 |
1 files changed, 118 insertions, 31 deletions
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 0e81727..ea292e6 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -98,14 +98,20 @@ #define H5D_XFER_MPIO_CHUNK_OPT_HARD_DEF H5FD_MPIO_CHUNK_DEFAULT #define H5D_XFER_MPIO_CHUNK_OPT_NUM_SIZE sizeof(unsigned) #define H5D_XFER_MPIO_CHUNK_OPT_NUM_DEF H5D_ONE_LINK_CHUNK_IO_THRESHOLD -#define H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE sizeof(unsigned) +#define H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE sizeof(unsigned) #define H5D_XFER_MPIO_CHUNK_OPT_RATIO_DEF H5D_MULTI_CHUNK_IO_COL_THRESHOLD +/* Definitions for chunk opt mode property. */ +#define H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE sizeof(H5D_mpio_actual_chunk_opt_mode_t) +#define H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_DEF H5D_MPIO_NO_CHUNK_OPTIMIZATION +/* Definitions for chunk io mode property. */ +#define H5D_MPIO_ACTUAL_IO_MODE_SIZE sizeof(H5D_mpio_actual_io_mode_t) +#define H5D_MPIO_ACTUAL_IO_MODE_DEF H5D_MPIO_NO_COLLECTIVE /* Definitions for EDC property */ -#define H5D_XFER_EDC_SIZE sizeof(H5Z_EDC_t) -#define H5D_XFER_EDC_DEF H5Z_ENABLE_EDC +#define H5D_XFER_EDC_SIZE sizeof(H5Z_EDC_t) +#define H5D_XFER_EDC_DEF H5Z_ENABLE_EDC /* Definitions for filter callback function property */ -#define H5D_XFER_FILTER_CB_SIZE sizeof(H5Z_cb_t) -#define H5D_XFER_FILTER_CB_DEF {NULL,NULL} +#define H5D_XFER_FILTER_CB_SIZE sizeof(H5Z_cb_t) +#define H5D_XFER_FILTER_CB_DEF {NULL,NULL} /* Definitions for type conversion callback function property */ #define H5D_XFER_CONV_CB_SIZE sizeof(H5T_conv_cb_t) #define H5D_XFER_CONV_CB_DEF {NULL,NULL} @@ -202,6 +208,8 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) H5FD_mpio_collective_opt_t def_mpio_collective_opt_mode = H5D_XFER_MPIO_COLLECTIVE_OPT_DEF; unsigned def_mpio_chunk_opt_num = H5D_XFER_MPIO_CHUNK_OPT_NUM_DEF; 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; #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 */ @@ -209,7 +217,7 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) void *def_xfer_xform = H5D_XFER_XFORM_DEF; /* Default value for data transform */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_reg_prop) + FUNC_ENTER_NOAPI_NOINIT /* Register the max. temp buffer size property */ if(H5P_register_real(pclass, H5D_XFER_MAX_TEMP_BUF_NAME, H5D_XFER_MAX_TEMP_BUF_SIZE, &def_max_temp_buf, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -264,7 +272,7 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL - /* Register the I/O transfer mode property */ + /* Register the I/O transfer mode properties */ if(H5P_register_real(pclass, H5D_XFER_IO_XFER_MODE_NAME, H5D_XFER_IO_XFER_MODE_SIZE, &def_io_xfer_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") if(H5P_register_real(pclass, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE, &def_mpio_collective_opt_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -275,6 +283,14 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") if(H5P_register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE, &def_mpio_chunk_opt_ratio, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the chunk optimization mode property. */ + if(H5P_register_real(pclass, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE, &def_mpio_actual_chunk_opt_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* 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") #endif /* H5_HAVE_PARALLEL */ /* Register the EDC property */ @@ -326,7 +342,7 @@ H5P_dxfr_create(hid_t dxpl_id, void UNUSED *create_data) H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_create) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) @@ -376,7 +392,7 @@ H5P_dxfr_copy(hid_t dst_dxpl_id, hid_t src_dxpl_id, void UNUSED *copy_data) H5P_genplist_t *src_plist; /* Source property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_copy) + FUNC_ENTER_NOAPI_NOINIT if(NULL == (dst_plist = (H5P_genplist_t *)H5I_object(dst_dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") @@ -427,7 +443,7 @@ H5P_dxfr_close(hid_t dxpl_id, void UNUSED *close_data) H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_close) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) @@ -467,7 +483,7 @@ H5P_dxfr_xform_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_xform_del) + FUNC_ENTER_NOAPI_NOINIT HDassert(value); @@ -499,7 +515,7 @@ H5P_dxfr_xform_copy(const char UNUSED *name, size_t UNUSED size, void *value) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_xform_copy) + FUNC_ENTER_NOAPI_NOINIT HDassert(value); @@ -530,7 +546,7 @@ H5P_dxfr_xform_close(const char UNUSED *name, size_t UNUSED size, void *value) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_xform_close) + FUNC_ENTER_NOAPI_NOINIT HDassert(value); @@ -564,7 +580,7 @@ H5Pset_data_transform(hid_t plist_id, const char *expression) H5Z_data_xform_t *data_xform_prop = NULL; /* New data xform property */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_data_transform, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", plist_id, expression); /* Check arguments */ @@ -630,7 +646,7 @@ H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size) char* pexp; ssize_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_data_transform, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "ixz", plist_id, expression, size); /* Get the plist structure */ @@ -698,7 +714,7 @@ H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_buffer, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iz*x*x", plist_id, size, tconv, bkg); /* Check arguments */ @@ -745,7 +761,7 @@ H5Pget_buffer(hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/) size_t size; /* Type conversion buffer size */ size_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Pget_buffer, 0) + FUNC_ENTER_API(0) H5TRACE3("z", "ixx", plist_id, tconv, bkg); /* Get the plist structure */ @@ -797,7 +813,7 @@ H5Pset_preserve(hid_t plist_id, hbool_t status) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_preserve, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ib", plist_id, status); /* Get the plist structure */ @@ -837,7 +853,7 @@ H5Pget_preserve(hid_t plist_id) H5P_genplist_t *plist; /* Property list pointer */ int ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_preserve, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", plist_id); /* Get the plist structure */ @@ -879,7 +895,7 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_edc_check, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iZe", plist_id, check); /* Check argument */ @@ -922,7 +938,7 @@ H5Pget_edc_check(hid_t plist_id) H5P_genplist_t *plist; /* Property list pointer */ H5Z_EDC_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_edc_check, H5Z_ERROR_EDC) + FUNC_ENTER_API(H5Z_ERROR_EDC) H5TRACE1("Ze", "i", plist_id); /* Get the plist structure */ @@ -965,7 +981,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data) herr_t ret_value=SUCCEED; /* return value */ H5Z_cb_t cb_struct; - FUNC_ENTER_API(H5Pset_filter_callback, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ix*x", plist_id, func, op_data); /* Get the plist structure */ @@ -1007,7 +1023,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat herr_t ret_value=SUCCEED; /* return value */ H5T_conv_cb_t cb_struct; - FUNC_ENTER_API(H5Pset_type_conv_cb, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ix*x", plist_id, op, operate_data); /* Get the plist structure */ @@ -1049,7 +1065,7 @@ H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op, void **operate_d H5T_conv_cb_t cb_struct; herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_type_conv_cb, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*x**x", plist_id, op, operate_data); /* Get the plist structure */ @@ -1094,7 +1110,7 @@ H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/, double *middle/*out*/, H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_btree_ratios, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "ixxx", plist_id, left, middle, right); /* Get the plist structure */ @@ -1148,7 +1164,7 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_btree_ratios, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iddd", plist_id, left, middle, right); /* Check arguments */ @@ -1201,7 +1217,7 @@ H5P_set_vlen_mem_manager(H5P_genplist_t *plist, H5MM_allocate_t alloc_func, { herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5P_set_vlen_mem_manager, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(plist); @@ -1248,7 +1264,7 @@ H5Pset_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t alloc_func, H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_vlen_mem_manager, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "ix*xx*x", plist_id, alloc_func, alloc_info, free_func, free_info); @@ -1288,7 +1304,7 @@ H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func/*out*/, H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_vlen_mem_manager, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "ixxxx", plist_id, alloc_func, alloc_info, free_func, free_info); /* Get the plist structure */ @@ -1342,7 +1358,7 @@ H5Pset_hyper_vector_size(hid_t plist_id, size_t vector_size) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_hyper_vector_size, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iz", plist_id, vector_size); /* Check arguments */ @@ -1382,7 +1398,7 @@ H5Pget_hyper_vector_size(hid_t plist_id, size_t *vector_size/*out*/) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_hyper_vector_size, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, vector_size); /* Get the plist structure */ @@ -1398,3 +1414,74 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_hyper_vector_size() */ + +#ifdef H5_HAVE_PARALLEL +/*------------------------------------------------------------------------- + * Function: H5Pget_mpio_actual_chunk_opt_mode + * + * Purpose: Retrieves the chunked io optimization scheme that library chose + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jacob Gruber + * Wednesday, May 4, 2011 + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode) +{ + H5P_genplist_t *plist; + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*Do", plist_id, actual_chunk_opt_mode); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Return values */ + if(actual_chunk_opt_mode) + if(H5P_get(plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, actual_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_mpio_actual_chunk_opt_mode() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_mpio_actual_io_mode + * + * Purpose: Retrieves the type of I/O actually preformed when collective I/O + * is requested. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jacob Gruber + * Wednesday, May 4, 2011 + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode) +{ + H5P_genplist_t *plist; + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*Di", plist_id, actual_io_mode); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Return values */ + if(actual_io_mode) + if(H5P_get(plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, actual_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_mpio_actual_io_mode() */ +#endif /* H5_HAVE_PARALLEL */ + |