diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-04-30 22:03:39 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-04-30 22:03:39 (GMT) |
commit | d10927793d8e52f9dac39eae8a42c8dedc0796ea (patch) | |
tree | d5645d9e15d4d1aabafccfded680cf3e6d213afa /src | |
parent | c09284bb0216ad9145998abd0a2ca59597b0b205 (diff) | |
download | hdf5-d10927793d8e52f9dac39eae8a42c8dedc0796ea.zip hdf5-d10927793d8e52f9dac39eae8a42c8dedc0796ea.tar.gz hdf5-d10927793d8e52f9dac39eae8a42c8dedc0796ea.tar.bz2 |
[svn-r25139] - switch to latest mercury
- evict metadata KVs for objects
- add H5Aprefetch/evict
- some code refactoring and bug fixing.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FF.c | 117 | ||||
-rw-r--r-- | src/H5FFpublic.h | 11 | ||||
-rw-r--r-- | src/H5M.c | 2 | ||||
-rw-r--r-- | src/H5Mpublic.h | 6 | ||||
-rw-r--r-- | src/H5VLiod.c | 244 | ||||
-rw-r--r-- | src/H5VLiod_analysis.c | 31 | ||||
-rw-r--r-- | src/H5VLiod_attr.c | 94 | ||||
-rw-r--r-- | src/H5VLiod_client.c | 107 | ||||
-rw-r--r-- | src/H5VLiod_client.h | 20 | ||||
-rw-r--r-- | src/H5VLiod_common.c | 335 | ||||
-rw-r--r-- | src/H5VLiod_common.h | 154 | ||||
-rw-r--r-- | src/H5VLiod_dset.c | 288 | ||||
-rw-r--r-- | src/H5VLiod_dtype.c | 17 | ||||
-rw-r--r-- | src/H5VLiod_encdec.c | 2 | ||||
-rw-r--r-- | src/H5VLiod_file.c | 13 | ||||
-rw-r--r-- | src/H5VLiod_group.c | 12 | ||||
-rw-r--r-- | src/H5VLiod_index.c | 6 | ||||
-rw-r--r-- | src/H5VLiod_link.c | 18 | ||||
-rw-r--r-- | src/H5VLiod_map.c | 132 | ||||
-rw-r--r-- | src/H5VLiod_obj.c | 43 | ||||
-rw-r--r-- | src/H5VLiod_server.c | 3462 | ||||
-rw-r--r-- | src/H5VLiod_server.h | 72 | ||||
-rw-r--r-- | src/H5VLiod_trans.c | 62 | ||||
-rw-r--r-- | src/H5VLiod_view.c | 8 |
24 files changed, 1264 insertions, 3992 deletions
@@ -3398,6 +3398,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Oget_comment_by_name_ff() */ +#if 0 /*------------------------------------------------------------------------- * Function: H5Ocopy_ff @@ -3480,6 +3481,7 @@ H5Ocopy_ff(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, done: FUNC_LEAVE_API(ret_value) } /* end H5Ocopy_ff() */ +#endif /*------------------------------------------------------------------------- @@ -4255,6 +4257,121 @@ done: /*------------------------------------------------------------------------- + * Function: H5Aprefetch_ff + * + * Purpose: Prefetched a Dataset from Central Storage to Burst Buffer. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * February 2014 + * + *------------------------------------------------------------------------- + */ +H5_DLL herr_t H5Aprefetch_ff(hid_t attr_id, hid_t rcxt_id, hrpl_t *replica_id, + hid_t aapl_id, hid_t estack_id) +{ + H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ + void **req = NULL; /* pointer to plugin generate requests (Stays NULL if plugin does not support async */ + void *attr = NULL; /* pointer to attr object */ + H5VL_t *vol_plugin; /* VOL plugin information */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + + /* get the map object */ + if(NULL == (attr = (void *)H5I_object_verify(attr_id, H5I_ATTR))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid attribute identifier") + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(attr_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + + if(H5P_DEFAULT != aapl_id) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "attribute access property list must be H5P_DEFAULT") + + if(estack_id != H5_EVENT_STACK_NULL) { + /* create the private request */ + if(NULL == (request = (H5_priv_request_t *)H5MM_calloc(sizeof(H5_priv_request_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); + request->req = NULL; + req = &request->req; + request->next = NULL; + request->vol_plugin = vol_plugin; + vol_plugin->nrefs ++; + } + + /* Get the data through the IOD VOL */ + if((ret_value = H5VL_iod_prefetch(attr, rcxt_id, replica_id, aapl_id, req)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't prefetch attribute") + + if(request && *req) { + if(H5ES_insert(estack_id, request) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to insert request in event stack"); + } + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Aprefetch_ff() */ + + +/*------------------------------------------------------------------------- + * Function: H5Aevict_ff + * + * Purpose: Evicts a Dataset from Burst Buffer. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mohamad Chaarawi + * February 2014 + * + *------------------------------------------------------------------------- + */ +H5_DLL herr_t H5Aevict_ff(hid_t attr_id, uint64_t c_version, hid_t aapl_id, hid_t estack_id) +{ + H5_priv_request_t *request = NULL; /* private request struct inserted in event queue */ + void **req = NULL; /* pointer to plugin generated request pointer */ + void *attr = NULL; /* pointer to attr object */ + H5VL_t *vol_plugin; /* VOL plugin information */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + + /* get the map object */ + if(NULL == (attr = (void *)H5I_object_verify(attr_id, H5I_ATTR))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid attribute identifier") + /* get the plugin pointer */ + if (NULL == (vol_plugin = (H5VL_t *)H5I_get_aux(attr_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "ID does not contain VOL information") + + if(H5P_DEFAULT != aapl_id) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "attribute access property list must be H5P_DEFAULT") + + if(estack_id != H5_EVENT_STACK_NULL) { + /* create the private request */ + if(NULL == (request = (H5_priv_request_t *)H5MM_calloc(sizeof(H5_priv_request_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); + request->req = NULL; + req = &request->req; + request->next = NULL; + request->vol_plugin = vol_plugin; + vol_plugin->nrefs ++; + } + + /* Get the data through the IOD VOL */ + if((ret_value = H5VL_iod_evict(attr, c_version, aapl_id, req)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't evict attribute") + + if(request && *req) { + if(H5ES_insert(estack_id, request) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to insert request in event stack"); + } + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Aevict_ff() */ + + +/*------------------------------------------------------------------------- * Function: H5Dprefetch_ff * * Purpose: Prefetched a Dataset from Central Storage to Burst Buffer. diff --git a/src/H5FFpublic.h b/src/H5FFpublic.h index 4f07449..c190640 100644 --- a/src/H5FFpublic.h +++ b/src/H5FFpublic.h @@ -169,9 +169,9 @@ H5_DLL herr_t H5Oget_comment_ff(hid_t loc_id, char *comment, size_t bufsize, ssi hid_t rcxt_id, hid_t estack_id); H5_DLL herr_t H5Oget_comment_by_name_ff(hid_t loc_id, const char *name, char *comment, size_t bufsize, ssize_t *ret, hid_t lapl_id, hid_t rcxt_id, hid_t estack_id); -H5_DLL herr_t H5Ocopy_ff(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, - const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id, - hid_t trans_id, hid_t estack_id); +//H5_DLL herr_t H5Ocopy_ff(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, +//const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id, +//hid_t trans_id, hid_t estack_id); H5_DLL herr_t H5Oget_info_ff(hid_t object_id, H5O_ff_info_t *object_info, hid_t rcxt_id, hid_t estack_id); H5_DLL herr_t H5Oget_info_by_name_ff(hid_t loc_id, const char *object_name, @@ -179,12 +179,8 @@ H5_DLL herr_t H5Oget_info_by_name_ff(hid_t loc_id, const char *object_name, hid_t rcxt_id, hid_t estack_id); H5_DLL herr_t H5Oclose_ff(hid_t object_id, hid_t estack_id); -#if 0 H5_DLL herr_t H5Aprefetch_ff(hid_t attr_id, hid_t rcxt_id, hrpl_t *replica_id, hid_t aapl_id, hid_t estack_id); -H5_DLL herr_t H5Aevict_ff(hid_t attr_id, uint64_t c_version, hid_t aapl_id, hid_t estack_id); -#endif - H5_DLL herr_t H5Gprefetch_ff(hid_t grp_id, hid_t rcxt_id, hrpl_t *replica_id, hid_t gapl_id, hid_t estack_id); H5_DLL herr_t H5Tprefetch_ff(hid_t type_id, hid_t rcxt_id, hrpl_t *replica_id, @@ -194,6 +190,7 @@ H5_DLL herr_t H5Dprefetch_ff(hid_t dset_id, hid_t rcxt_id, hrpl_t *replica_id, H5_DLL herr_t H5Mprefetch_ff(hid_t map_id, hid_t rcxt_id, hrpl_t *replica_id, hid_t mapl_id, hid_t estack_id); +H5_DLL herr_t H5Aevict_ff(hid_t attr_id, uint64_t c_version, hid_t aapl_id, hid_t estack_id); H5_DLL herr_t H5Devict_ff(hid_t dset_id, uint64_t c_version, hid_t dapl_id, hid_t estack_id); H5_DLL herr_t H5Mevict_ff(hid_t map_id, uint64_t c_version, hid_t mapl_id, hid_t estack_id); H5_DLL herr_t H5Gevict_ff(hid_t grp_id, uint64_t c_version, hid_t gapl_id, hid_t estack_id); @@ -733,6 +733,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Mexists_ff */ +#if 0 /*------------------------------------------------------------------------- * Function: H5Miterate_ff @@ -778,6 +779,7 @@ H5Miterate_ff(hid_t map_id, hid_t key_mem_type_id, hid_t value_mem_type_id, done: FUNC_LEAVE_API(ret_value) } /* end H5Miterate */ +#endif /*------------------------------------------------------------------------- diff --git a/src/H5Mpublic.h b/src/H5Mpublic.h index 4a8b8a2..44ae350 100644 --- a/src/H5Mpublic.h +++ b/src/H5Mpublic.h @@ -43,7 +43,7 @@ extern "C" { #endif /* Typedef for H5Miterate() callbacks */ -typedef herr_t (*H5M_iterate_func_t)(const void *key, const void *value, void *context); +//typedef herr_t (*H5M_iterate_func_t)(const void *key, const void *value, void *context); /*********************/ /* Public Prototypes */ @@ -62,8 +62,8 @@ H5_DLL herr_t H5Mget_types_ff(hid_t map_id, hid_t *key_type_id, hid_t *val_type_ H5_DLL herr_t H5Mget_count_ff(hid_t map_id, hsize_t *count, hid_t rcxt_id, hid_t estack_id); H5_DLL herr_t H5Mexists_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, hbool_t *exists, hid_t rcxt_id, hid_t estack_id); -H5_DLL herr_t H5Miterate_ff(hid_t map_id, hid_t key_mem_type_id, hid_t value_mem_type_id, - H5M_iterate_func_t callback_func, void *context, hid_t rcxt_id); +//H5_DLL herr_t H5Miterate_ff(hid_t map_id, hid_t key_mem_type_id, hid_t value_mem_type_id, +//H5M_iterate_func_t callback_func, void *context, hid_t rcxt_id); H5_DLL herr_t H5Mdelete_ff(hid_t map_id, hid_t key_mem_type_id, const void *key, hid_t trans_id, hid_t estack_id); H5_DLL herr_t H5Mclose_ff(hid_t map_id, hid_t estack_id); diff --git a/src/H5VLiod.c b/src/H5VLiod.c index 145e0a2..4072517 100644 --- a/src/H5VLiod.c +++ b/src/H5VLiod.c @@ -43,78 +43,6 @@ #define H5VL_IOD_MAX_ADDR_NAME 256 -/* function shipper IDs for different routines */ -static hg_id_t H5VL_EFF_INIT_ID; -static hg_id_t H5VL_EFF_FINALIZE_ID; -static hg_id_t H5VL_ANALYSIS_EXECUTE_ID; -static hg_id_t H5VL_FILE_CREATE_ID; -static hg_id_t H5VL_FILE_OPEN_ID; -static hg_id_t H5VL_FILE_CLOSE_ID; -static hg_id_t H5VL_ATTR_CREATE_ID; -static hg_id_t H5VL_ATTR_OPEN_ID; -static hg_id_t H5VL_ATTR_READ_ID; -static hg_id_t H5VL_ATTR_WRITE_ID; -static hg_id_t H5VL_ATTR_EXISTS_ID; -static hg_id_t H5VL_ATTR_ITERATE_ID; -static hg_id_t H5VL_ATTR_RENAME_ID; -static hg_id_t H5VL_ATTR_REMOVE_ID; -static hg_id_t H5VL_ATTR_CLOSE_ID; -static hg_id_t H5VL_GROUP_CREATE_ID; -static hg_id_t H5VL_GROUP_OPEN_ID; -static hg_id_t H5VL_GROUP_CLOSE_ID; -static hg_id_t H5VL_MAP_CREATE_ID; -static hg_id_t H5VL_MAP_OPEN_ID; -static hg_id_t H5VL_MAP_SET_ID; -static hg_id_t H5VL_MAP_GET_ID; -static hg_id_t H5VL_MAP_GET_COUNT_ID; -static hg_id_t H5VL_MAP_EXISTS_ID; -static hg_id_t H5VL_MAP_ITERATE_ID; -static hg_id_t H5VL_MAP_DELETE_ID; -static hg_id_t H5VL_MAP_CLOSE_ID; -static hg_id_t H5VL_DSET_CREATE_ID; -static hg_id_t H5VL_DSET_OPEN_ID; -static hg_id_t H5VL_DSET_READ_ID; -static hg_id_t H5VL_DSET_GET_VL_SIZE_ID; -static hg_id_t H5VL_DSET_WRITE_ID; -static hg_id_t H5VL_DSET_SET_EXTENT_ID; -static hg_id_t H5VL_DSET_CLOSE_ID; -static hg_id_t H5VL_DTYPE_COMMIT_ID; -static hg_id_t H5VL_DTYPE_OPEN_ID; -static hg_id_t H5VL_DTYPE_CLOSE_ID; -static hg_id_t H5VL_LINK_CREATE_ID; -static hg_id_t H5VL_LINK_MOVE_ID; -static hg_id_t H5VL_LINK_ITERATE_ID; -static hg_id_t H5VL_LINK_EXISTS_ID; -static hg_id_t H5VL_LINK_GET_INFO_ID; -static hg_id_t H5VL_LINK_GET_VAL_ID; -static hg_id_t H5VL_LINK_REMOVE_ID; -static hg_id_t H5VL_OBJECT_OPEN_BY_TOKEN_ID; -static hg_id_t H5VL_OBJECT_OPEN_ID; -static hg_id_t H5VL_OBJECT_COPY_ID; -static hg_id_t H5VL_OBJECT_EXISTS_ID; -static hg_id_t H5VL_OBJECT_VISIT_ID; -static hg_id_t H5VL_OBJECT_SET_COMMENT_ID; -static hg_id_t H5VL_OBJECT_GET_COMMENT_ID; -static hg_id_t H5VL_OBJECT_GET_INFO_ID; -static hg_id_t H5VL_RC_ACQUIRE_ID; -static hg_id_t H5VL_RC_RELEASE_ID; -static hg_id_t H5VL_RC_PERSIST_ID; -static hg_id_t H5VL_RC_SNAPSHOT_ID; -static hg_id_t H5VL_TR_START_ID; -static hg_id_t H5VL_TR_FINISH_ID; -static hg_id_t H5VL_TR_SET_DEPEND_ID; -static hg_id_t H5VL_TR_SKIP_ID; -static hg_id_t H5VL_TR_ABORT_ID; -static hg_id_t H5VL_PREFETCH_ID; -static hg_id_t H5VL_EVICT_ID; -static hg_id_t H5VL_CANCEL_OP_ID; -static hg_id_t H5VL_VIEW_CREATE_ID; -#ifdef H5_HAVE_INDEXING -static hg_id_t H5VL_DSET_SET_INDEX_INFO_ID; -static hg_id_t H5VL_DSET_GET_INDEX_INFO_ID; -static hg_id_t H5VL_DSET_RM_INDEX_INFO_ID; -#endif - /* global AXE list struct */ typedef struct H5VL_iod_axe_list_t { H5VL_iod_request_t *head; @@ -177,19 +105,19 @@ static herr_t H5VL_iod_link_create(H5VL_link_create_type_t create_type, void *ob static herr_t H5VL_iod_link_move(void *src_obj, H5VL_loc_params_t loc_params1, void *dst_obj, H5VL_loc_params_t loc_params2, hbool_t copy_flag, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_iod_link_iterate(void *obj, H5VL_loc_params_t loc_params, hbool_t recursive, - H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, - H5L_iterate_t op, void *op_data, hid_t dxpl_id, void **req); +//static herr_t H5VL_iod_link_iterate(void *obj, H5VL_loc_params_t loc_params, hbool_t recursive, +//H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, +//H5L_iterate_t op, void *op_data, hid_t dxpl_id, void **req); static herr_t H5VL_iod_link_get(void *obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); static herr_t H5VL_iod_link_remove(void *obj, H5VL_loc_params_t loc_params, hid_t dxpl_id, void **req); /* Object callbacks */ static void *H5VL_iod_object_open(void *obj, H5VL_loc_params_t loc_params, H5I_type_t *opened_type, hid_t dxpl_id, void **req); -static herr_t H5VL_iod_object_copy(void *src_obj, H5VL_loc_params_t loc_params1, const char *src_name, - void *dst_obj, H5VL_loc_params_t loc_params2, const char *dst_name, - hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req); -static herr_t H5VL_iod_object_visit(void *obj, H5VL_loc_params_t loc_params, H5_index_t idx_type, - H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t dxpl_id, void **req); +//static herr_t H5VL_iod_object_copy(void *src_obj, H5VL_loc_params_t loc_params1, const char *src_name, +//void *dst_obj, H5VL_loc_params_t loc_params2, const char *dst_name, +//hid_t ocpypl_id, hid_t lcpl_id, hid_t dxpl_id, void **req); +//static herr_t H5VL_iod_object_visit(void *obj, H5VL_loc_params_t loc_params, H5_index_t idx_type, +//H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t dxpl_id, void **req); static herr_t H5VL_iod_object_get(void *obj, H5VL_loc_params_t loc_params, H5VL_object_get_t get_type, hid_t dxpl_id, void **req, va_list arguments); static herr_t H5VL_iod_object_misc(void *obj, H5VL_loc_params_t loc_params, H5VL_object_misc_t misc_type, hid_t dxpl_id, void **req, va_list arguments); @@ -262,14 +190,14 @@ static H5VL_class_t H5VL_iod_g = { { /* link_cls */ H5VL_iod_link_create, /* create */ H5VL_iod_link_move, /* move */ - H5VL_iod_link_iterate, /* iterate */ + NULL, /* iterate */ H5VL_iod_link_get, /* get */ H5VL_iod_link_remove /* remove */ }, { /* object_cls */ H5VL_iod_object_open, /* open */ - H5VL_iod_object_copy, /* copy */ - H5VL_iod_object_visit, /* visit */ + NULL, /* copy */ + NULL, /* visit */ H5VL_iod_object_get, /* get */ H5VL_iod_object_misc, /* misc */ NULL, /* optional */ @@ -682,6 +610,7 @@ EFF_init(MPI_Comm comm, MPI_Info UNUSED info) /* initialize Mercury stuff */ network_class = NA_MPI_Init(NULL, 0); + //network_class = NA_Initialize("tcp@mpi://0.0.0.0:0", 0); if (HG_SUCCESS != HG_Init(network_class)) { fprintf(stderr, "Failed to initialize Mercury\n"); @@ -695,101 +624,7 @@ EFF_init(MPI_Comm comm, MPI_Info UNUSED info) PEER = ion_target; /* Register function and encoding/decoding functions */ - H5VL_EFF_INIT_ID = MERCURY_REGISTER("eff_init", eff_init_in_t, ret_t); - H5VL_EFF_FINALIZE_ID = MERCURY_REGISTER("eff_finalize", ret_t, ret_t); - - H5VL_ANALYSIS_EXECUTE_ID = MERCURY_REGISTER("analysis_execute", - analysis_execute_in_t, - analysis_execute_out_t); - - H5VL_FILE_CREATE_ID = MERCURY_REGISTER("file_create", file_create_in_t, file_create_out_t); - H5VL_FILE_OPEN_ID = MERCURY_REGISTER("file_open", file_open_in_t, file_open_out_t); - H5VL_FILE_CLOSE_ID = MERCURY_REGISTER("file_close", file_close_in_t, ret_t); - - H5VL_ATTR_CREATE_ID = MERCURY_REGISTER("attr_create", attr_create_in_t, attr_create_out_t); - H5VL_ATTR_OPEN_ID = MERCURY_REGISTER("attr_open", attr_open_in_t, attr_open_out_t); - H5VL_ATTR_READ_ID = MERCURY_REGISTER("attr_read", attr_io_in_t, ret_t); - H5VL_ATTR_WRITE_ID = MERCURY_REGISTER("attr_write", attr_io_in_t, ret_t); - H5VL_ATTR_EXISTS_ID = MERCURY_REGISTER("attr_exists", attr_op_in_t, htri_t); - H5VL_ATTR_ITERATE_ID = MERCURY_REGISTER("attr_iterate", attr_op_in_t, ret_t); - H5VL_ATTR_RENAME_ID = MERCURY_REGISTER("attr_rename", attr_rename_in_t, ret_t); - H5VL_ATTR_REMOVE_ID = MERCURY_REGISTER("attr_remove", attr_op_in_t, ret_t); - H5VL_ATTR_CLOSE_ID = MERCURY_REGISTER("attr_close", attr_close_in_t, ret_t); - - H5VL_GROUP_CREATE_ID = MERCURY_REGISTER("group_create", group_create_in_t, group_create_out_t); - H5VL_GROUP_OPEN_ID = MERCURY_REGISTER("group_open", group_open_in_t, group_open_out_t); - H5VL_GROUP_CLOSE_ID = MERCURY_REGISTER("group_close", group_close_in_t, ret_t); - - H5VL_MAP_CREATE_ID = MERCURY_REGISTER("map_create", map_create_in_t, map_create_out_t); - H5VL_MAP_OPEN_ID = MERCURY_REGISTER("map_open", map_open_in_t, map_open_out_t); - H5VL_MAP_SET_ID = MERCURY_REGISTER("map_set", map_set_in_t, ret_t); - H5VL_MAP_GET_ID = MERCURY_REGISTER("map_get", map_get_in_t, map_get_out_t); - H5VL_MAP_GET_COUNT_ID = MERCURY_REGISTER("map_get_count", map_get_count_in_t, int64_t); - H5VL_MAP_ITERATE_ID = MERCURY_REGISTER("map_iterate", map_op_in_t, ret_t); - H5VL_MAP_EXISTS_ID = MERCURY_REGISTER("map_exists", map_op_in_t, hbool_t); - H5VL_MAP_DELETE_ID = MERCURY_REGISTER("map_delete", map_op_in_t, ret_t); - H5VL_MAP_CLOSE_ID = MERCURY_REGISTER("map_close", map_close_in_t, ret_t); - - H5VL_DSET_CREATE_ID = MERCURY_REGISTER("dset_create", dset_create_in_t, dset_create_out_t); - H5VL_DSET_OPEN_ID = MERCURY_REGISTER("dset_open", dset_open_in_t, dset_open_out_t); - H5VL_DSET_READ_ID = MERCURY_REGISTER("dset_read", dset_io_in_t, dset_read_out_t); - H5VL_DSET_GET_VL_SIZE_ID = MERCURY_REGISTER("dset_get_vl_size", dset_io_in_t, dset_read_out_t); - H5VL_DSET_WRITE_ID = MERCURY_REGISTER("dset_write", dset_io_in_t, ret_t); - H5VL_DSET_SET_EXTENT_ID = MERCURY_REGISTER("dset_set_extent", - dset_set_extent_in_t, ret_t); - H5VL_DSET_CLOSE_ID = MERCURY_REGISTER("dset_close", dset_close_in_t, ret_t); - - H5VL_DTYPE_COMMIT_ID = MERCURY_REGISTER("dtype_commit", dtype_commit_in_t, dtype_commit_out_t); - H5VL_DTYPE_OPEN_ID = MERCURY_REGISTER("dtype_open", dtype_open_in_t, dtype_open_out_t); - H5VL_DTYPE_CLOSE_ID = MERCURY_REGISTER("dtype_close", dtype_close_in_t, ret_t); - - H5VL_LINK_CREATE_ID = MERCURY_REGISTER("link_create", link_create_in_t, ret_t); - H5VL_LINK_MOVE_ID = MERCURY_REGISTER("link_move", link_move_in_t, ret_t); - H5VL_LINK_EXISTS_ID = MERCURY_REGISTER("link_exists", link_op_in_t, htri_t); - H5VL_LINK_GET_INFO_ID = MERCURY_REGISTER("link_get_info", link_op_in_t, linfo_t); - H5VL_LINK_GET_VAL_ID = MERCURY_REGISTER("link_get_val", link_get_val_in_t, - link_get_val_out_t); - H5VL_LINK_ITERATE_ID = MERCURY_REGISTER("link_iterate", link_op_in_t, ret_t); - H5VL_LINK_REMOVE_ID = MERCURY_REGISTER("link_remove", link_op_in_t, ret_t); - - H5VL_OBJECT_OPEN_BY_TOKEN_ID = MERCURY_REGISTER("object_open_by_token", - object_token_in_t, iod_handles_t); - H5VL_OBJECT_OPEN_ID = MERCURY_REGISTER("object_open", object_op_in_t, object_open_out_t); - H5VL_OBJECT_COPY_ID = MERCURY_REGISTER("object_copy", object_copy_in_t, ret_t); - H5VL_OBJECT_EXISTS_ID = MERCURY_REGISTER("object_exists", object_op_in_t, htri_t); - H5VL_OBJECT_VISIT_ID = MERCURY_REGISTER("object_visit", object_op_in_t, ret_t); - H5VL_OBJECT_SET_COMMENT_ID = MERCURY_REGISTER("set_comment", object_set_comment_in_t, ret_t); - H5VL_OBJECT_GET_COMMENT_ID = MERCURY_REGISTER("get_comment", object_get_comment_in_t, - object_get_comment_out_t); - H5VL_OBJECT_GET_INFO_ID = MERCURY_REGISTER("object_get_info", object_op_in_t, oinfo_t); - - H5VL_RC_ACQUIRE_ID = MERCURY_REGISTER("read_context_acquire", - rc_acquire_in_t, rc_acquire_out_t); - H5VL_RC_RELEASE_ID = MERCURY_REGISTER("read_context_release", rc_release_in_t, ret_t); - H5VL_RC_PERSIST_ID = MERCURY_REGISTER("read_context_persist", rc_persist_in_t, ret_t); - H5VL_RC_SNAPSHOT_ID = MERCURY_REGISTER("read_context_snapshot", rc_snapshot_in_t, ret_t); - - H5VL_TR_START_ID = MERCURY_REGISTER("transaction_start", tr_start_in_t, ret_t); - H5VL_TR_FINISH_ID = MERCURY_REGISTER("transaction_finish", tr_finish_in_t, ret_t); - H5VL_TR_SET_DEPEND_ID = MERCURY_REGISTER("transaction_set_depend",tr_set_depend_in_t, ret_t); - H5VL_TR_SKIP_ID = MERCURY_REGISTER("transaction_skip", tr_skip_in_t, ret_t); - H5VL_TR_ABORT_ID = MERCURY_REGISTER("transaction_abort",tr_abort_in_t, ret_t); - - H5VL_PREFETCH_ID = MERCURY_REGISTER("prefetch", prefetch_in_t, hrpl_t); - H5VL_EVICT_ID = MERCURY_REGISTER("evict", evict_in_t, ret_t); - - H5VL_VIEW_CREATE_ID = MERCURY_REGISTER("view_create", view_create_in_t, view_create_out_t); - -#ifdef H5_HAVE_INDEXING - H5VL_DSET_SET_INDEX_INFO_ID = MERCURY_REGISTER("dset_set_index_info", - dset_set_index_info_in_t, ret_t); - H5VL_DSET_GET_INDEX_INFO_ID = MERCURY_REGISTER("dset_get_index_info", - dset_get_index_info_in_t, dset_get_index_info_out_t); - H5VL_DSET_RM_INDEX_INFO_ID = MERCURY_REGISTER("dset_rm_index_info", - dset_rm_index_info_in_t, ret_t); -#endif - - H5VL_CANCEL_OP_ID = MERCURY_REGISTER("cancel_op", uint64_t, uint8_t); + EFF__mercury_register_callbacks(); /* forward the init call to the ION and wait for its completion */ if(HG_SUCCESS != HG_Forward(PEER, H5VL_EFF_INIT_ID, &num_procs, &ret_value, &hg_req)) { @@ -3328,7 +3163,7 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate vlen lengths buffer"); /* Register vl_lengths buffer */ - HG_Bulk_handle_create(vl_lengths, vl_lengths_size, HG_BULK_READWRITE, bulk_handle); + HG_Bulk_handle_create(1, &vl_lengths, &vl_lengths_size, HG_BULK_READWRITE, bulk_handle); } /* end if */ else { /* for non vlen data, create the bulk handle to recieve the data in */ @@ -3464,7 +3299,6 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, H5P_genplist_t *plist = NULL; hg_bulk_t *bulk_handle = NULL; hg_bulk_t *vl_len_bulk_handle = NULL; - hg_bulk_segment_t *vl_segments = NULL; char *vl_lengths = NULL; H5S_t *mem_space = NULL; H5S_t *file_space = NULL; @@ -3584,7 +3418,7 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, if(raw_cs_scope) { /* compute checksum and create bulk handle */ if(H5VL_iod_pre_write(mem_type_id, mem_space, buf, &internal_cs, &vl_len_cs, - bulk_handle, vl_len_bulk_handle, &vl_segments, &vl_lengths) < 0) + bulk_handle, vl_len_bulk_handle, &vl_lengths) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't generate write parameters"); } else { @@ -3593,7 +3427,7 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, #endif /* compute checksum and create bulk handle */ if(H5VL_iod_pre_write(mem_type_id, mem_space, buf, NULL, NULL, bulk_handle, - vl_len_bulk_handle, &vl_segments, &vl_lengths) < 0) + vl_len_bulk_handle, &vl_lengths) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't generate write parameters"); internal_cs = 0; } @@ -3652,7 +3486,6 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, info->bulk_handle = bulk_handle; info->vl_len_bulk_handle = vl_len_bulk_handle; info->vl_lengths = vl_lengths; - info->vl_segments = vl_segments; #ifdef H5_HAVE_INDEXING /* setup extra info required for the index post_update operation */ info->idx_handle = dset->idx_handle; @@ -4852,7 +4685,7 @@ H5VL_iod_attribute_read(void *_attr, hid_t type_id, void *buf, hid_t dxpl_id, vo HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "can't allocate a buld data transfer handle"); /* Register memory with bulk_handle */ - if(HG_SUCCESS != HG_Bulk_handle_create(buf, size, HG_BULK_READWRITE, bulk_handle)) + if(HG_SUCCESS != HG_Bulk_handle_create(1, &buf, &size, HG_BULK_READWRITE, bulk_handle)) HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "can't create Bulk Data Handle"); if(NULL == (parent_reqs = (H5VL_iod_request_t **) @@ -4983,7 +4816,7 @@ H5VL_iod_attribute_write(void *_attr, hid_t type_id, const void *buf, hid_t dxpl HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "can't allocate a bulk data transfer handle"); /* Register memory */ - if(HG_SUCCESS != HG_Bulk_handle_create(buf, size, HG_BULK_READ_ONLY, bulk_handle)) + if(HG_SUCCESS != HG_Bulk_handle_create(1, &buf, &size, HG_BULK_READ_ONLY, bulk_handle)) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "can't create Bulk Data Handle"); if(NULL == (parent_reqs = (H5VL_iod_request_t **) @@ -5849,7 +5682,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_link_move() */ - +#if 0 /*------------------------------------------------------------------------- * Function: H5VL_iod_link_iterate @@ -5878,7 +5711,7 @@ static herr_t H5VL_iod_link_iterate(void UNUSED *_obj, H5VL_loc_params_t UNUSED FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5VL_iod_link_iterate() */ - +#endif /*------------------------------------------------------------------------- * Function: H5VL_iod_link_get @@ -7589,7 +7422,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_object_open_by_addr */ #endif - +#if 0 /*------------------------------------------------------------------------- * Function: H5VL_iod_object_copy @@ -7672,7 +7505,8 @@ H5VL_iod_object_copy(void *_src_obj, H5VL_loc_params_t UNUSED loc_params1, const done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_object_copy() */ - +#endif +#if 0 /*------------------------------------------------------------------------- * Function: H5VL_iod_object_visit @@ -7700,7 +7534,7 @@ static herr_t H5VL_iod_object_visit(void UNUSED *_obj, H5VL_loc_params_t UNUSED FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5VL_iod_object_visit() */ - +#endif /*------------------------------------------------------------------------- * Function: H5VL_iod_object_misc @@ -8461,12 +8295,12 @@ H5VL_iod_map_set(void *_map, hid_t key_mem_type_id, const void *key, if(H5T_VLEN == val_type_class) { /* if this is a VL type buffer, set the buffer pointer to the actual data (the p pointer) */ - if(HG_SUCCESS != HG_Bulk_handle_create(((const hvl_t *)value)->p, val_size, + if(HG_SUCCESS != HG_Bulk_handle_create(1, &((const hvl_t *)value)->p, &val_size, HG_BULK_READ_ONLY, value_handle)) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "can't create Bulk Data Handle"); } else { - if(HG_SUCCESS != HG_Bulk_handle_create(value, val_size, HG_BULK_READ_ONLY, value_handle)) + if(HG_SUCCESS != HG_Bulk_handle_create(1, &value, &val_size, HG_BULK_READ_ONLY, value_handle)) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "can't create Bulk Data Handle"); } /* get the TR object */ @@ -8571,13 +8405,14 @@ H5VL_iod_map_get(void *_map, hid_t key_mem_type_id, const void *key, create the bulk handle */ if(!val_is_vl) { /* Register memory with bulk_handle */ - if(HG_SUCCESS != HG_Bulk_handle_create(value, val_size, + if(HG_SUCCESS != HG_Bulk_handle_create(1, &value, &val_size, HG_BULK_READWRITE, value_handle)) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't create Bulk Data Handle"); } else { + size_t temp_size = 1; /* Register memory with bulk_handle */ - if(HG_SUCCESS != HG_Bulk_handle_create(value, (size_t)1, + if(HG_SUCCESS != HG_Bulk_handle_create(1, &value, &temp_size, HG_BULK_READWRITE, &dummy_handle)) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't create Bulk Data Handle"); } @@ -8822,17 +8657,6 @@ done: } /* end H5VL_iod_map_exists() */ herr_t -H5VL_iod_map_iterate(void UNUSED *map, hid_t UNUSED key_mem_type_id, hid_t UNUSED value_mem_type_id, - H5M_iterate_func_t UNUSED callback_func, void UNUSED *context) -{ - //herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5VL_iod_map_iterate() */ - -herr_t H5VL_iod_map_delete(void *_map, hid_t key_mem_type_id, const void *key, hid_t trans_id, void **req) { @@ -9764,6 +9588,8 @@ H5VL_iod_evict(void *_obj, uint64_t c_version, hid_t apl_id, void **req) H5VL_iod_dset_t *dset = (H5VL_iod_dset_t *)obj; input.iod_id = dset->remote_dset.iod_id; input.iod_oh = dset->remote_dset.iod_oh; + input.mdkv_id = dset->remote_dset.mdkv_id; + input.attrkv_id = dset->remote_dset.attrkv_id; break; } case H5I_DATATYPE: @@ -9771,6 +9597,8 @@ H5VL_iod_evict(void *_obj, uint64_t c_version, hid_t apl_id, void **req) H5VL_iod_dtype_t *dtype = (H5VL_iod_dtype_t *)obj; input.iod_id = dtype->remote_dtype.iod_id; input.iod_oh = dtype->remote_dtype.iod_oh; + input.mdkv_id = dtype->remote_dtype.mdkv_id; + input.attrkv_id = dtype->remote_dtype.attrkv_id; break; } case H5I_GROUP: @@ -9778,6 +9606,8 @@ H5VL_iod_evict(void *_obj, uint64_t c_version, hid_t apl_id, void **req) H5VL_iod_group_t *group = (H5VL_iod_group_t *)obj; input.iod_id = group->remote_group.iod_id; input.iod_oh = group->remote_group.iod_oh; + input.mdkv_id = group->remote_group.mdkv_id; + input.attrkv_id = group->remote_group.attrkv_id; break; } case H5I_MAP: @@ -9785,6 +9615,8 @@ H5VL_iod_evict(void *_obj, uint64_t c_version, hid_t apl_id, void **req) H5VL_iod_map_t *map = (H5VL_iod_map_t *)obj; input.iod_id = map->remote_map.iod_id; input.iod_oh = map->remote_map.iod_oh; + input.mdkv_id = map->remote_map.mdkv_id; + input.attrkv_id = map->remote_map.attrkv_id; break; } case H5I_ATTR: @@ -9792,6 +9624,8 @@ H5VL_iod_evict(void *_obj, uint64_t c_version, hid_t apl_id, void **req) H5VL_iod_attr_t *attr = (H5VL_iod_attr_t *)obj; input.iod_id = attr->remote_attr.iod_id; input.iod_oh = attr->remote_attr.iod_oh; + input.mdkv_id = attr->remote_attr.mdkv_id; + input.attrkv_id = IOD_OBJ_INVALID; break; } case H5I_UNINIT: diff --git a/src/H5VLiod_analysis.c b/src/H5VLiod_analysis.c index 3487b6e..12078da 100644 --- a/src/H5VLiod_analysis.c +++ b/src/H5VLiod_analysis.c @@ -716,7 +716,7 @@ H5VL__iod_farm_work(iod_obj_map_t *obj_map, iod_handle_t *cohs, if(NULL == (split_data[i] = malloc(split_data_size))) HGOTO_ERROR_FF(FAIL, "can't allocate farm buffer"); - HG_Bulk_handle_create(split_data[i], split_data_size, + HG_Bulk_handle_create(1, &split_data[i], &split_data_size, HG_BULK_READWRITE, &bulk_handle); transfer_input.axe_id = farm_output[i].axe_id; @@ -947,6 +947,8 @@ done: if(type_id) H5Tclose(type_id); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (analysis_execute_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -1060,12 +1062,16 @@ H5VL_iod_server_analysis_farm_cb(AXE_engine_t UNUSED axe_engine, HG_Handler_start_output(op_data->hg_handle, &output->farm_out); done: + + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); + if(0 == split_num_elmts) { output = (H5VLiod_farm_data_t *)H5MM_xfree(output); op_data = (op_data_t *)H5MM_xfree(op_data); } - input = (analysis_farm_in_t *)H5MM_xfree(input); + input = (analysis_farm_in_t *)H5MM_xfree(input); } /* end H5VL_iod_server_analysis_farm_cb() */ /*------------------------------------------------------------------------- @@ -1105,17 +1111,19 @@ H5VL_iod_server_analysis_transfer_cb(AXE_engine_t axe_engine, #if H5_EFF_DEBUG fprintf(stderr, "(%d) Transferring split data back to master\n", my_rank_g); #endif - HG_Bulk_handle_create(farm_output->data, data_size, HG_BULK_READ_ONLY, - &bulk_block_handle); + /* Create bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_create(1, &farm_output->data, &data_size, + HG_BULK_READ_ONLY, &bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't create bulk handle"); - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_write_all(source, - input->bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't get data from function shipper"); + /* Push data to the client */ + if(HG_SUCCESS != HG_Bulk_transfer(HG_BULK_PUSH, source, input->bulk_handle, 0, + bulk_block_handle, 0, data_size, &bulk_request)) + HGOTO_ERROR_FF(FAIL, "Transfer data failed"); - /* wait for it to complete */ + /* Wait for bulk data read to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR_FF(FAIL, "can't get data from function shipper"); + HGOTO_ERROR_FF(FAIL, "can't wait for bulk data operation"); /* free the bds block handle */ if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) @@ -1127,9 +1135,10 @@ H5VL_iod_server_analysis_transfer_cb(AXE_engine_t axe_engine, done: HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (analysis_transfer_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); - } /* end H5VL_iod_server_analysis_transfer_cb() */ /*------------------------------------------------------------------------- diff --git a/src/H5VLiod_attr.c b/src/H5VLiod_attr.c index bd85740..58a4117 100644 --- a/src/H5VLiod_attr.c +++ b/src/H5VLiod_attr.c @@ -254,6 +254,9 @@ done: obj_create_hint = NULL; } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); + input = (attr_create_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -300,6 +303,8 @@ H5VL_iod_server_attr_open_cb(AXE_engine_t UNUSED axe_engine, iod_ret_t ret; herr_t ret_value = SUCCEED; + output.space_id = FAIL; + output.type_id = FAIL; #if H5_EFF_DEBUG fprintf(stderr, "Start attribute open %s at %s (OH %"PRIu64" ID %"PRIx64")\n", @@ -423,6 +428,12 @@ H5VL_iod_server_attr_open_cb(AXE_engine_t UNUSED axe_engine, HG_Handler_start_output(op_data->hg_handle, &output); done: + + if(FAIL != output.type_id) + H5Tclose(output.type_id); + if(FAIL != output.space_id) + H5Sclose(output.space_id); + if(ret_value < 0) { output.iod_oh.rd_oh.cookie = IOD_OH_UNDEFINED; output.iod_oh.wr_oh.cookie = IOD_OH_UNDEFINED; @@ -432,6 +443,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &output); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (attr_open_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -502,6 +515,17 @@ H5VL_iod_server_attr_read_cb(AXE_engine_t UNUSED axe_engine, if(NULL == (buf = malloc(size))) HGOTO_ERROR_FF(FAIL, "can't allocate read buffer"); + /* Create bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_create(1, &buf, &size, + HG_BULK_READWRITE, &bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't create bulk handle"); + +#if 0 + /* get mercury buffer where data is */ + if(HG_SUCCESS != HG_Bulk_handle_access(bulk_block_handle, 0, size, + HG_BULK_READ_ONLY, 1, &buf, &size, NULL)) + HGOTO_ERROR_FF(FAIL, "Could not access handle"); +#endif /* Get dataspace if it is not available */ if(H5I_UNINIT == space_id) { /* open the metadata scratch pad of the attribute */ @@ -580,15 +604,14 @@ H5VL_iod_server_attr_read_cb(AXE_engine_t UNUSED axe_engine, HGOTO_ERROR_FF(ret, "can't read from array object"); } - /* Create a new block handle to write the data */ - HG_Bulk_handle_create(buf, size, HG_BULK_READ_ONLY, &bulk_block_handle); + /* Push data to the client */ + if(HG_SUCCESS != HG_Bulk_transfer(HG_BULK_PUSH, dest, bulk_handle, 0, + bulk_block_handle, 0, size, &bulk_request)) + HGOTO_ERROR_FF(FAIL, "Transfer data failed"); - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_write_all(dest, bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't start Mercury Bulk Data write"); - /* wait for it to complete */ + /* Wait for bulk data read to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR_FF(FAIL, "Failed to wait on Mercury Bulk data write"); + HGOTO_ERROR_FF(FAIL, "can't wait for bulk data operation"); done: #if H5_EFF_DEBUG @@ -597,14 +620,19 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) HDONE_ERROR_FF(FAIL, "can't send result of write to client"); - if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) - HDONE_ERROR_FF(FAIL, "can't free bds block handle"); + if(buf) { + /* free block handle */ + if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't free bds block handle"); + buf = NULL; + } + + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (attr_io_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); - free(buf); - /* free allocated descriptors */ free(hslabs.start); free(hslabs.stride); @@ -684,21 +712,30 @@ H5VL_iod_server_attr_write_cb(AXE_engine_t UNUSED axe_engine, /* Read bulk data here and wait for the data to be here */ size = HG_Bulk_handle_get_size(bulk_handle); + if(NULL == (buf = malloc(size))) HGOTO_ERROR_FF(FAIL, "can't allocate read buffer"); - HG_Bulk_handle_create(buf, size, HG_BULK_READWRITE, &bulk_block_handle); + /* Create bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_create(1, &buf, &size, + HG_BULK_READWRITE, &bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't create bulk handle"); + + /* Pull data from the client */ + if(HG_SUCCESS != HG_Bulk_transfer(HG_BULK_PULL, source, bulk_handle, 0, + bulk_block_handle, 0, size, &bulk_request)) + HGOTO_ERROR_FF(FAIL, "Transfer data failed"); - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_read_all(source, bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't get data from function shipper"); - /* wait for it to complete */ + /* Wait for bulk data read to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR_FF(FAIL, "can't get data from function shipper"); + HGOTO_ERROR_FF(FAIL, "can't wait for bulk data operation"); - /* free the bds block handle */ - if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) - HGOTO_ERROR_FF(FAIL, "can't free bds block handle"); +#if 0 + /* get mercury buffer where data is */ + if(HG_SUCCESS != HG_Bulk_handle_access(bulk_block_handle, 0, size, + HG_BULK_READWRITE, 1, &buf, &size, NULL)) + HGOTO_ERROR_FF(FAIL, "Could not access handle"); +#endif /* Get dataspace if it is not available */ if(H5I_UNINIT == space_id) { @@ -781,6 +818,15 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) HDONE_ERROR_FF(FAIL, "can't send result of write to client"); + if(buf) { + /* free block handle */ + if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't free bds block handle"); + buf = NULL; + } + + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (attr_io_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -909,6 +955,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (attr_op_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -1050,6 +1098,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (attr_rename_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -1233,6 +1283,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (attr_op_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); } /* end H5VL_iod_server_attr_remove_cb() */ @@ -1284,6 +1336,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (attr_close_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); diff --git a/src/H5VLiod_client.c b/src/H5VLiod_client.c index 8df44c8..0f2d07e 100644 --- a/src/H5VLiod_client.c +++ b/src/H5VLiod_client.c @@ -696,11 +696,6 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) HGOTO_ERROR(H5E_INDEX, H5E_CANTUPDATE, FAIL, "unable to issue index post_update operation"); } #endif - - if(info->vl_segments) { - free(info->vl_segments); - info->vl_segments = NULL; - } if(info->vl_lengths) { free(info->vl_lengths); info->vl_lengths = NULL; @@ -798,7 +793,8 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) hid_t rcxt_id; H5RC_t *rc; H5P_genplist_t *plist = NULL; - hg_bulk_segment_t *segments = NULL; + void **addrs = NULL; + size_t *sizes = NULL; size_t num_segments = 0; hg_request_t hg_req; hg_status_t hg_status; @@ -808,16 +804,16 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) /* Create segments from vl lengths */ if(H5VL_iod_create_segments_recv((char *)info->buf_ptr, info->type_info, - (size_t)info->nelmts, &segments, &num_segments, + (size_t)info->nelmts, &addrs, &sizes, &num_segments, info->vl_lengths, info->vl_lengths_size, NULL, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't create segments for bulk data transfer"); - HDassert(segments); + HDassert(addrs); + HDassert(sizes); /* Register non-contiguous memory segments */ - if(HG_SUCCESS != HG_Bulk_handle_create_segments(segments, num_segments, - HG_BULK_READWRITE, - info->bulk_handle)) + if(HG_SUCCESS != HG_Bulk_handle_create(num_segments, addrs, sizes, + HG_BULK_READWRITE, info->bulk_handle)) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't create Bulk Data handle"); /* get the context ID */ @@ -862,12 +858,20 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) req->state = H5VL_IOD_COMPLETED; } - HG_Request_free(hg_req); - HG_Bulk_handle_free(*info->bulk_handle); + if(addrs) { + free(addrs); + addrs = NULL; + } + if(sizes) { + free(sizes); + sizes = NULL; + } - if(segments) { - free(segments); - segments = NULL; + HG_Request_free(hg_req); + if(HG_SUCCESS != HG_Bulk_handle_free(*info->bulk_handle)) { + HERROR(H5E_FUNC, H5E_CANTINIT, "failed to free attribute bulk handle\n"); + req->status = H5ES_STATUS_FAIL; + req->state = H5VL_IOD_COMPLETED; } } @@ -875,6 +879,7 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) HDfree(info->vl_lengths); info->vl_lengths = NULL; } + if(H5Sclose(info->file_space_id) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace"); if(H5Tclose(info->mem_type_id) < 0) @@ -1061,7 +1066,7 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't allocate VL recieve buffer"); /* Register memory with bulk_handle */ - if(HG_SUCCESS != HG_Bulk_handle_create(value_buf, output->val_size, + if(HG_SUCCESS != HG_Bulk_handle_create(1, &value_buf, &output->val_size, HG_BULK_READWRITE, info->value_handle)) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't create Bulk Data Handle"); @@ -1429,7 +1434,7 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) case HG_LINK_MOVE: case HG_LINK_REMOVE: case HG_OBJECT_SET_COMMENT: - case HG_OBJECT_COPY: + //case HG_OBJECT_COPY: { int *status = (int *)req->data; @@ -1751,9 +1756,9 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) break; } #endif /* H5_HAVE_INDEXING */ - case HG_LINK_ITERATE: - case HG_OBJECT_VISIT: - case HG_MAP_ITERATE: + //case HG_LINK_ITERATE: + //case HG_OBJECT_VISIT: + //case HG_MAP_ITERATE: default: req->status = H5ES_STATUS_FAIL; req->state = H5VL_IOD_COMPLETED; @@ -1809,10 +1814,6 @@ H5VL_iod_request_cancel(H5VL_iod_file_t *file, H5VL_iod_request_t *req) fprintf(stderr, "failed to free bulk handle\n"); } - if(info->vl_segments) { - HDfree(info->vl_segments); - info->vl_segments = NULL; - } if(info->vl_lengths) { HDfree(info->vl_lengths); info->vl_lengths = NULL; @@ -2114,7 +2115,7 @@ H5VL_iod_request_cancel(H5VL_iod_file_t *file, H5VL_iod_request_t *req) case HG_LINK_MOVE: case HG_LINK_REMOVE: case HG_OBJECT_SET_COMMENT: - case HG_OBJECT_COPY: + //case HG_OBJECT_COPY: { int *status = (int *)req->data; @@ -2197,9 +2198,9 @@ H5VL_iod_request_cancel(H5VL_iod_file_t *file, H5VL_iod_request_t *req) req->data = NULL; H5VL_iod_request_delete(file, req); break; - case HG_LINK_ITERATE: - case HG_OBJECT_VISIT: - case HG_MAP_ITERATE: + //case HG_LINK_ITERATE: + //case HG_OBJECT_VISIT: + //case HG_MAP_ITERATE: default: H5VL_iod_request_delete(file, req); HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "Request Type not supported"); @@ -2430,7 +2431,6 @@ H5VL_iod_pre_write(hid_t type_id, H5S_t *space, const void *buf, /*out*/uint64_t *_vlen_checksum, /*out*/hg_bulk_t *bulk_handle, /*out*/hg_bulk_t *vl_len_bulk_handle, - /*out*/hg_bulk_segment_t **_vl_segments, /*out*/char **_vl_lengths) { hsize_t buf_size = 0; @@ -2448,38 +2448,41 @@ H5VL_iod_pre_write(hid_t type_id, H5S_t *space, const void *buf, nelmts = (size_t)H5S_GET_SELECT_NPOINTS(space); if(type_info.vls) { - hg_bulk_segment_t *segments = NULL; size_t num_segments = 0; char *vl_lengths = NULL; + void **addrs = NULL; + size_t *sizes = NULL; size_t vl_lengths_size = 0; - HDassert(_vl_segments); HDassert(_vl_lengths); /* Create segments and vl lengths */ - if(H5VL_iod_create_segments_send((char *)buf, &type_info, nelmts, &segments, &num_segments, + if(H5VL_iod_create_segments_send((char *)buf, &type_info, nelmts, + &addrs, &sizes, &num_segments, &vl_lengths, &vl_lengths_size, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create segments for bulk data transfer"); - HDassert(segments); HDassert(vl_lengths); + HDassert(addrs); + HDassert(sizes); /* Register vl lengths */ - if(HG_SUCCESS != HG_Bulk_handle_create(vl_lengths, vl_lengths_size, + if(HG_SUCCESS != HG_Bulk_handle_create(1, &vl_lengths, &vl_lengths_size, HG_BULK_READ_ONLY, vl_len_bulk_handle)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Bulk Data Handle for vlen lengths"); /* Register non-contiguous memory segments */ - if(HG_SUCCESS != HG_Bulk_handle_create_segments(segments, num_segments, - HG_BULK_READ_ONLY, bulk_handle)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Bulk Data handle"); + if(HG_SUCCESS != HG_Bulk_handle_create(num_segments, addrs, sizes, + HG_BULK_READ_ONLY, bulk_handle)) + HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't create Bulk Data handle"); if(_checksum) - checksum = H5_checksum_crc64_segments(segments, num_segments); + checksum = H5_checksum_crc64_segments(addrs, sizes, num_segments); if(_vlen_checksum) *_vlen_checksum = H5_checksum_crc64(vl_lengths, vl_lengths_size); - *_vl_segments = segments; *_vl_lengths = vl_lengths; + free(addrs); addrs = NULL; + free(sizes); sizes = NULL; } else { H5T_t *dt = NULL; @@ -2500,7 +2503,7 @@ H5VL_iod_pre_write(hid_t type_id, H5S_t *space, const void *buf, /* If the memory selection is contiguous, create simple HG Bulk Handle */ if(H5S_select_is_contiguous(space)) { /* Register memory with bulk_handle */ - if(HG_SUCCESS != HG_Bulk_handle_create(buf, (size_t)buf_size, + if(HG_SUCCESS != HG_Bulk_handle_create(1, &buf, &buf_size, HG_BULK_READ_ONLY, bulk_handle)) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't create Bulk Data Handle"); } @@ -2511,7 +2514,6 @@ H5VL_iod_pre_write(hid_t type_id, H5S_t *space, const void *buf, size_t *len = NULL; /* array that contains the length of a contiguous block at each address */ size_t count = 0; /* number of offset/length entries in selection */ size_t i; - hg_bulk_segment_t *bulk_segments = NULL; uint8_t *start_offset = (uint8_t *) buf; /* generate the offsets/lengths pair arrays from the memory dataspace selection */ @@ -2519,21 +2521,16 @@ H5VL_iod_pre_write(hid_t type_id, H5S_t *space, const void *buf, HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't retrieve offets/lengths of memory space"); /* Register memory with segmented HG handle */ - bulk_segments = (hg_bulk_segment_t *)malloc(count * sizeof(hg_bulk_segment_t)); for (i = 0; i < count ; i++) { - bulk_segments[i].address = (void *)(start_offset + off[i]); - bulk_segments[i].size = len[i]; + off[i] = start_offset + off[i]; } /* create Bulk handle */ - if (HG_SUCCESS != HG_Bulk_handle_create_segments(bulk_segments, count, - HG_BULK_READ_ONLY, bulk_handle)) + if (HG_SUCCESS != HG_Bulk_handle_create(count, off, len, HG_BULK_READ_ONLY, bulk_handle)) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't create Bulk Data Handle"); /* cleanup */ if(count) { - free(bulk_segments); - bulk_segments = NULL; free(len); len = NULL; free(off); @@ -2588,7 +2585,7 @@ H5VL_iod_pre_read(hid_t type_id, H5S_t *space, const void *buf, hssize_t nelmts, /* If the memory selection is contiguous, create simple HG Bulk Handle */ if(H5S_select_is_contiguous(space)) { /* Register memory with bulk_handle */ - if(HG_SUCCESS != HG_Bulk_handle_create(buf, buf_size, + if(HG_SUCCESS != HG_Bulk_handle_create(1, &buf, &buf_size, HG_BULK_READWRITE, bulk_handle)) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't create Bulk Data Handle"); } @@ -2599,7 +2596,6 @@ H5VL_iod_pre_read(hid_t type_id, H5S_t *space, const void *buf, hssize_t nelmts, size_t *len = NULL; /* array that contains the length of a contiguous block at each address */ size_t count = 0; /* number of offset/length entries in selection */ size_t i; - hg_bulk_segment_t *bulk_segments = NULL; uint8_t *start_offset = (uint8_t *) buf; /* generate the offsets/lengths pair arrays from the memory dataspace selection */ @@ -2607,21 +2603,16 @@ H5VL_iod_pre_read(hid_t type_id, H5S_t *space, const void *buf, hssize_t nelmts, HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't retrieve offets/lengths of memory space"); /* Register memory with segmented HG handle */ - bulk_segments = (hg_bulk_segment_t *)malloc(count * sizeof(hg_bulk_segment_t)); for (i = 0; i < count ; i++) { - bulk_segments[i].address = (void *)(start_offset + off[i]); - bulk_segments[i].size = len[i]; + off[i] = start_offset + off[i]; } /* create Bulk handle */ - if (HG_SUCCESS != HG_Bulk_handle_create_segments(bulk_segments, count, - HG_BULK_READWRITE, bulk_handle)) + if (HG_SUCCESS != HG_Bulk_handle_create(count, off, len, HG_BULK_READWRITE, bulk_handle)) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't create Bulk Data Handle"); /* cleanup */ if(count) { - free(bulk_segments); - bulk_segments = NULL; free(len); len = NULL; free(off); diff --git a/src/H5VLiod_client.h b/src/H5VLiod_client.h index a5ae2f4..a75fd99 100644 --- a/src/H5VLiod_client.h +++ b/src/H5VLiod_client.h @@ -62,7 +62,7 @@ typedef enum H5RQ_type_t { HG_DTYPE_CLOSE, HG_LINK_CREATE, HG_LINK_MOVE, - HG_LINK_ITERATE, + //HG_LINK_ITERATE, HG_LINK_EXISTS, HG_LINK_GET_INFO, HG_LINK_GET_VAL, @@ -73,13 +73,13 @@ typedef enum H5RQ_type_t { HG_MAP_GET, HG_MAP_GET_COUNT, HG_MAP_EXISTS, - HG_MAP_ITERATE, + //HG_MAP_ITERATE, HG_MAP_DELETE, HG_MAP_CLOSE, HG_OBJECT_OPEN_BY_TOKEN, HG_OBJECT_OPEN, - HG_OBJECT_COPY, - HG_OBJECT_VISIT, + //HG_OBJECT_COPY, + //HG_OBJECT_VISIT, HG_OBJECT_EXISTS, HG_OBJECT_SET_COMMENT, HG_OBJECT_GET_COMMENT, @@ -95,10 +95,12 @@ typedef enum H5RQ_type_t { HG_TR_ABORT, HG_PREFETCH, HG_EVICT, - HG_VIEW_CREATE, +#ifdef H5_HAVE_INDEXING HG_DSET_SET_INDEX_INFO, HG_DSET_GET_INDEX_INFO, - HG_DSET_RM_INDEX_INFO + HG_DSET_RM_INDEX_INFO, +#endif + HG_VIEW_CREATE } H5RQ_type_t; /* the client IOD VOL request struct */ @@ -305,7 +307,6 @@ typedef struct H5VL_iod_write_info_t { void *status; hg_bulk_t *bulk_handle; hg_bulk_t *vl_len_bulk_handle; - hg_bulk_segment_t *vl_segments; char *vl_lengths; #ifdef H5_HAVE_INDEXING void *idx_handle; @@ -432,7 +433,6 @@ H5_DLL herr_t H5VL_iod_pre_write(hid_t type_id, H5S_t *space, const void *buf, /*out*/uint64_t *_vlen_checksum, /*out*/hg_bulk_t *bulk_handle, /*out*/hg_bulk_t *vl_len_bulk_handle, - /*out*/hg_bulk_segment_t **_vl_segments, /*out*/char **_vl_lengths); H5_DLL herr_t H5VL_iod_pre_read(hid_t type_id, struct H5S_t *space, const void *buf, hssize_t nelmts, /*out*/hg_bulk_t *bulk_handle); @@ -455,8 +455,8 @@ H5_DLL herr_t H5VL_iod_map_get_types(void *map, hid_t *key_type_id, hid_t *val_t H5_DLL herr_t H5VL_iod_map_get_count(void *map, hsize_t *count, hid_t rcxt_id, void **req); H5_DLL herr_t H5VL_iod_map_exists(void *map, hid_t key_mem_type_id, const void *key, hbool_t *exists, hid_t rcxt_id, void **req); -H5_DLL herr_t H5VL_iod_map_iterate(void *map, hid_t key_mem_type_id, hid_t value_mem_type_id, - H5M_iterate_func_t callback_func, void *context); +//H5_DLL herr_t H5VL_iod_map_iterate(void *map, hid_t key_mem_type_id, hid_t value_mem_type_id, +//H5M_iterate_func_t callback_func, void *context); H5_DLL herr_t H5VL_iod_map_delete(void *map, hid_t key_mem_type_id, const void *key, hid_t trans_id, void **req); H5_DLL herr_t H5VL_iod_map_close(void *map, void **req); diff --git a/src/H5VLiod_common.c b/src/H5VLiod_common.c index 9047613..63dc49f 100644 --- a/src/H5VLiod_common.c +++ b/src/H5VLiod_common.c @@ -74,12 +74,12 @@ static int H5VL_iod_cmpd_qsort_cb(const void *_memb1, const void *_memb2); static int H5VL_iod_get_type_info_helper(hid_t type_id, H5VL_iod_type_info_t *type_info, size_t offset, size_t *vls_nalloc); static int H5VL_iod_cs_send_helper(char *buf, H5VL_iod_type_info_t *type_info, - size_t nelem, hg_bulk_segment_t **segments, size_t *num_segments, + size_t nelem, void ***addrs, size_t **sizes, size_t *num_segments, size_t *segments_nalloc, char **vl_lengths, size_t *vl_lengths_nused, size_t *vl_lengths_nalloc, void ***free_list, size_t *free_list_len, size_t *free_list_nalloc); static int H5VL_iod_cs_recv_helper(char *buf, H5VL_iod_type_info_t *type_info, - size_t nelem, hg_bulk_segment_t **segments, size_t *num_segments, + size_t nelem, void ***addrs, size_t **sizes, size_t *num_segments, size_t *segments_nalloc, char *vl_lengths, size_t *vl_lengths_loc, size_t vl_lengths_nused, void ***free_list, size_t *free_list_len, size_t *free_list_nalloc); @@ -105,7 +105,6 @@ static int H5VL_iod_cs_recv_helper(char *buf, H5VL_iod_type_info_t *type_info, } /* end if */ \ } while(0) - /*------------------------------------------------------------------------- * Function: H5VL_iod_cmpd_qsort_cb * @@ -503,7 +502,7 @@ H5VL_iod_type_info_reset(H5VL_iod_type_info_t *type_info) */ static int H5VL_iod_cs_send_helper(char *buf, H5VL_iod_type_info_t *type_info, - size_t nelem, hg_bulk_segment_t **segments, size_t *num_segments, + size_t nelem, void ***addrs, size_t **sizes, size_t *num_segments, size_t *segments_nalloc, char **vl_lengths, size_t *vl_lengths_nused, size_t *vl_lengths_nalloc, void ***free_list, size_t *free_list_len, size_t *free_list_nalloc) @@ -535,8 +534,22 @@ H5VL_iod_cs_send_helper(char *buf, H5VL_iod_type_info_t *type_info, if(wrapped) wrapped = FALSE; else { - /* Add fixed-length segment to segments array */ - H5VL_IOD_ARR_ADD(hg_bulk_segment_t, *segments, *num_segments, *segments_nalloc, 256); + /* Add segment to segments array */ + if(*segments_nalloc == *num_segments) { + size_t tmp_nalloc; + + tmp_nalloc = (*num_segments) ? (*num_segments) * 2 : (256); + + if(NULL == (*addrs = (void **)realloc + (*addrs, tmp_nalloc * sizeof(void *)))) + ERROR("failed to reallocate array"); + + if(NULL == (*sizes = (size_t *)realloc + (*sizes, tmp_nalloc * sizeof(size_t)))) + ERROR("failed to reallocate array"); + + *segments_nalloc = tmp_nalloc; + } /* end if */ /* Check if we can wrap this segment */ if((j == (type_info->num_fl_spans - 1)) && wrappable @@ -548,8 +561,9 @@ H5VL_iod_cs_send_helper(char *buf, H5VL_iod_type_info_t *type_info, span_size = type_info->fl_spans[j].size; /* Add segment */ - (*segments)[*num_segments].address = (hg_ptr_t)(buf + (i * type_info->size) + type_info->fl_spans[j].offset); - (*segments)[*num_segments].size = span_size; + (*addrs)[*num_segments] = (void *)(buf + (i * type_info->size) + + type_info->fl_spans[j].offset); + (*sizes)[*num_segments] = span_size; (*num_segments)++; } /* end else */ } /* end if */ @@ -579,7 +593,10 @@ H5VL_iod_cs_send_helper(char *buf, H5VL_iod_type_info_t *type_info, } /* end if */ /* Recurse into vlen data */ - if(H5VL_iod_cs_send_helper((char *)vl.p, type_info->vls[j].base_type, vl.len, segments, num_segments, segments_nalloc, vl_lengths, vl_lengths_nused, vl_lengths_nalloc, free_list, free_list_len, free_list_nalloc) < 0) + if(H5VL_iod_cs_send_helper((char *)vl.p, type_info->vls[j].base_type, + vl.len, addrs, sizes, num_segments, segments_nalloc, + vl_lengths, vl_lengths_nused, vl_lengths_nalloc, + free_list, free_list_len, free_list_nalloc) < 0) ERROR("failed to build segments"); } /* end if */ } /* end if */ @@ -618,10 +635,26 @@ H5VL_iod_cs_send_helper(char *buf, H5VL_iod_type_info_t *type_info, * include null terminator in segment length so it is not * transmitted. */ if(vl_s_len > 1) { - H5VL_IOD_ARR_ADD(hg_bulk_segment_t, *segments, *num_segments, *segments_nalloc, 256); + /* Add segment to segments array */ + if(*segments_nalloc == *num_segments) { + size_t tmp_nalloc; + + tmp_nalloc = (*num_segments) ? (*num_segments) * 2 : (256); + + if(NULL == (*addrs = (void **)realloc + (*addrs, tmp_nalloc * sizeof(void *)))) + ERROR("failed to reallocate array"); - (*segments)[*num_segments].address = (hg_ptr_t)vl_s; - (*segments)[*num_segments].size = vl_s_len - 1; + if(NULL == (*sizes = (size_t *)realloc + (*sizes, tmp_nalloc * sizeof(size_t)))) + ERROR("failed to reallocate array"); + + *segments_nalloc = tmp_nalloc; + } /* end if */ + + /* Add segment */ + (*addrs)[*num_segments] = (void *)vl_s; + (*sizes)[*num_segments] = vl_s_len - 1; (*num_segments)++; } /* end if */ } /* end if */ @@ -629,10 +662,25 @@ H5VL_iod_cs_send_helper(char *buf, H5VL_iod_type_info_t *type_info, } /* end if */ else { /* No vlens, just add entire buffer to segments array */ - H5VL_IOD_ARR_ADD(hg_bulk_segment_t, *segments, *num_segments, *segments_nalloc, 256); + if(*segments_nalloc == *num_segments) { + size_t tmp_nalloc; + + tmp_nalloc = (*num_segments) ? (*num_segments) * 2 : (256); + + if(NULL == (*addrs = (void **)realloc + (*addrs, tmp_nalloc * sizeof(void *)))) + ERROR("failed to reallocate array"); - (*segments)[*num_segments].address = (hg_ptr_t)buf; - (*segments)[*num_segments].size = nelem * type_info->size; + if(NULL == (*sizes = (size_t *)realloc + (*sizes, tmp_nalloc * sizeof(size_t)))) + ERROR("failed to reallocate array"); + + *segments_nalloc = tmp_nalloc; + } /* end if */ + + /* Add segment */ + (*addrs)[*num_segments] = (void *)buf; + (*sizes)[*num_segments] = nelem * type_info->size; (*num_segments)++; } /* end else */ @@ -659,7 +707,7 @@ error: */ int H5VL_iod_create_segments_send(char *buf, H5VL_iod_type_info_t *type_info, - size_t nelem, hg_bulk_segment_t **segments, size_t *num_segments, + size_t nelem, void ***addrs, size_t **sizes, size_t *num_segments, char **vl_lengths, size_t *vl_lengths_size, void ***free_list, size_t *free_list_len) { @@ -671,8 +719,6 @@ H5VL_iod_create_segments_send(char *buf, H5VL_iod_type_info_t *type_info, assert(type_info); assert(type_info->vls); assert(nelem > 0); - assert(segments); - assert(!*segments); assert(num_segments); assert(*num_segments == 0); assert(vl_lengths); @@ -684,7 +730,9 @@ H5VL_iod_create_segments_send(char *buf, H5VL_iod_type_info_t *type_info, assert(!free_list_len || (*free_list_len == 0)); /* Call the real (recursive) function */ - if(H5VL_iod_cs_send_helper(buf, type_info, nelem, segments, num_segments, &segments_nalloc, vl_lengths, vl_lengths_size, &vl_lengths_nalloc, free_list, free_list_len, &free_list_nalloc) < 0) + if(H5VL_iod_cs_send_helper(buf, type_info, nelem, addrs, sizes, num_segments, &segments_nalloc, + vl_lengths, vl_lengths_size, &vl_lengths_nalloc, + free_list, free_list_len, &free_list_nalloc) < 0) ERROR("failed to build segments"); return(SUCCEED); @@ -711,7 +759,7 @@ error: */ static int H5VL_iod_cs_recv_helper(char *buf, H5VL_iod_type_info_t *type_info, - size_t nelem, hg_bulk_segment_t **segments, size_t *num_segments, + size_t nelem, void ***addrs, size_t **sizes, size_t *num_segments, size_t *segments_nalloc, char *vl_lengths, size_t *vl_lengths_loc, size_t vl_lengths_size, void ***free_list, size_t *free_list_len, size_t *free_list_nalloc) @@ -744,7 +792,21 @@ H5VL_iod_cs_recv_helper(char *buf, H5VL_iod_type_info_t *type_info, wrapped = FALSE; else { /* Add fixed-length segment to segments array */ - H5VL_IOD_ARR_ADD(hg_bulk_segment_t, *segments, *num_segments, *segments_nalloc, 256); + if(*segments_nalloc == *num_segments) { + size_t tmp_nalloc; + + tmp_nalloc = (*num_segments) ? (*num_segments) * 2 : (256); + + if(NULL == (*addrs = (void **)realloc + (*addrs, tmp_nalloc * sizeof(void *)))) + ERROR("failed to reallocate array"); + + if(NULL == (*sizes = (size_t *)realloc + (*sizes, tmp_nalloc * sizeof(size_t)))) + ERROR("failed to reallocate array"); + + *segments_nalloc = tmp_nalloc; + } /* end if */ /* Check if we can wrap this segment */ if((j == (type_info->num_fl_spans - 1)) && wrappable @@ -756,8 +818,9 @@ H5VL_iod_cs_recv_helper(char *buf, H5VL_iod_type_info_t *type_info, span_size = type_info->fl_spans[j].size; /* Add segment */ - (*segments)[*num_segments].address = (hg_ptr_t)(buf + (i * type_info->size) + type_info->fl_spans[j].offset); - (*segments)[*num_segments].size = span_size; + (*addrs)[*num_segments] = (void *)(buf + (i * type_info->size) + + type_info->fl_spans[j].offset); + (*sizes)[*num_segments] = span_size; (*num_segments)++; } /* end else */ } /* end if */ @@ -793,7 +856,11 @@ H5VL_iod_cs_recv_helper(char *buf, H5VL_iod_type_info_t *type_info, } /* end if */ /* Recurse into vlen data */ - if(H5VL_iod_cs_recv_helper(vl->p, type_info->vls[j].base_type, (size_t)vl_length, segments, num_segments, segments_nalloc, vl_lengths, vl_lengths_loc, vl_lengths_size, free_list, free_list_len, free_list_nalloc) < 0) + if(H5VL_iod_cs_recv_helper(vl->p, type_info->vls[j].base_type, + (size_t)vl_length, addrs, sizes, + num_segments, segments_nalloc, + vl_lengths, vl_lengths_loc, vl_lengths_size, + free_list, free_list_len, free_list_nalloc) < 0) ERROR("failed to build segments"); } /* end if */ } /* end if */ @@ -826,10 +893,26 @@ H5VL_iod_cs_recv_helper(char *buf, H5VL_iod_type_info_t *type_info, /* Add vl string to segments array, if length is greater * than 1 (including null terminator) */ if(vl_s_len > 1) { - H5VL_IOD_ARR_ADD(hg_bulk_segment_t, *segments, *num_segments, *segments_nalloc, 256); + /* Add segment to segments array */ + if(*segments_nalloc == *num_segments) { + size_t tmp_nalloc; + + tmp_nalloc = (*num_segments) ? (*num_segments) * 2 : (256); - (*segments)[*num_segments].address = (hg_ptr_t)*vl_s; - (*segments)[*num_segments].size = (size_t)vl_s_len - 1; + if(NULL == (*addrs = (void **)realloc + (*addrs, tmp_nalloc * sizeof(void *)))) + ERROR("failed to reallocate array"); + + if(NULL == (*sizes = (size_t *)realloc + (*sizes, tmp_nalloc * sizeof(size_t)))) + ERROR("failed to reallocate array"); + + *segments_nalloc = tmp_nalloc; + } /* end if */ + + /* Add segment */ + (*addrs)[*num_segments] = (void *)*vl_s; + (*sizes)[*num_segments] = vl_s_len - 1; (*num_segments)++; } /* end if */ @@ -840,10 +923,25 @@ H5VL_iod_cs_recv_helper(char *buf, H5VL_iod_type_info_t *type_info, } /* end if */ else { /* No vlens, just add entire buffer to segments array */ - H5VL_IOD_ARR_ADD(hg_bulk_segment_t, *segments, *num_segments, *segments_nalloc, 256); + if(*segments_nalloc == *num_segments) { + size_t tmp_nalloc; + + tmp_nalloc = (*num_segments) ? (*num_segments) * 2 : (256); - (*segments)[*num_segments].address = (hg_ptr_t)buf; - (*segments)[*num_segments].size = nelem * type_info->size; + if(NULL == (*addrs = (void **)realloc + (*addrs, tmp_nalloc * sizeof(void *)))) + ERROR("failed to reallocate array"); + + if(NULL == (*sizes = (size_t *)realloc + (*sizes, tmp_nalloc * sizeof(size_t)))) + ERROR("failed to reallocate array"); + + *segments_nalloc = tmp_nalloc; + } /* end if */ + + /* Add segment */ + (*addrs)[*num_segments] = (void *)buf; + (*sizes)[*num_segments] = nelem * type_info->size; (*num_segments)++; } /* end else */ @@ -871,7 +969,7 @@ error: */ int H5VL_iod_create_segments_recv(char *buf, H5VL_iod_type_info_t *type_info, - size_t nelem, hg_bulk_segment_t **segments, size_t *num_segments, + size_t nelem, void ***addrs, size_t **sizes, size_t *num_segments, char *vl_lengths, size_t vl_lengths_size, void ***free_list, size_t *free_list_len) { @@ -883,8 +981,6 @@ H5VL_iod_create_segments_recv(char *buf, H5VL_iod_type_info_t *type_info, assert(type_info); assert(type_info->vls); assert(nelem > 0); - assert(segments); - assert(!*segments); assert(num_segments); assert(*num_segments == 0); assert(vl_lengths); @@ -894,7 +990,9 @@ H5VL_iod_create_segments_recv(char *buf, H5VL_iod_type_info_t *type_info, assert(!free_list_len || (*free_list_len == 0)); /* Call the real (recursive) function */ - if(H5VL_iod_cs_recv_helper(buf, type_info, nelem, segments, num_segments, &segments_nalloc, vl_lengths, &vl_lengths_loc, vl_lengths_size, free_list, free_list_len, &free_list_nalloc) < 0) + if(H5VL_iod_cs_recv_helper(buf, type_info, nelem, addrs, sizes, num_segments, &segments_nalloc, + vl_lengths, &vl_lengths_loc, vl_lengths_size, + free_list, free_list_len, &free_list_nalloc) < 0) ERROR("failed to build segments"); return(SUCCEED); @@ -957,7 +1055,7 @@ H5_checksum_crc64(const void *buf, size_t buf_size) } uint64_t -H5_checksum_crc64_segments(hg_bulk_segment_t *segments, size_t count) +H5_checksum_crc64_segments(void **addrs, size_t *sizes, size_t count) { const char *hash_method = "crc64"; size_t hash_size; @@ -970,7 +1068,7 @@ H5_checksum_crc64_segments(hg_bulk_segment_t *segments, size_t count) /* Update checksum */ for (i = 0; i < count; i++) { - mchecksum_update(checksum, segments[i].address, segments[i].size); + mchecksum_update(checksum, addrs[i], sizes[i]); } /* Get size of checksum */ @@ -1017,4 +1115,169 @@ H5_checksum_crc64_fragments(void **buf, size_t *buf_size, size_t count) return ret_value; } + +void +EFF__mercury_register_callbacks(void) +{ + /* Register function and encoding/decoding functions */ + H5VL_EFF_INIT_ID = MERCURY_REGISTER("eff_init", eff_init_in_t, ret_t, + H5VL_iod_server_eff_init); + H5VL_EFF_FINALIZE_ID = MERCURY_REGISTER("eff_finalize", ret_t, ret_t, + H5VL_iod_server_eff_finalize); + + H5VL_ANALYSIS_EXECUTE_ID = MERCURY_REGISTER("analysis_execute", + analysis_execute_in_t, + analysis_execute_out_t, + H5VL_iod_server_analysis_execute); + + H5VL_FILE_CREATE_ID = MERCURY_REGISTER("file_create", file_create_in_t, file_create_out_t, + H5VL_iod_server_file_create); + H5VL_FILE_OPEN_ID = MERCURY_REGISTER("file_open", file_open_in_t, file_open_out_t, + H5VL_iod_server_file_open); + H5VL_FILE_CLOSE_ID = MERCURY_REGISTER("file_close", file_close_in_t, ret_t, + H5VL_iod_server_file_close); + + H5VL_ATTR_CREATE_ID = MERCURY_REGISTER("attr_create", attr_create_in_t, attr_create_out_t, + H5VL_iod_server_attr_create); + H5VL_ATTR_OPEN_ID = MERCURY_REGISTER("attr_open", attr_open_in_t, attr_open_out_t, + H5VL_iod_server_attr_open); + H5VL_ATTR_READ_ID = MERCURY_REGISTER("attr_read", attr_io_in_t, ret_t, + H5VL_iod_server_attr_read); + H5VL_ATTR_WRITE_ID = MERCURY_REGISTER("attr_write", attr_io_in_t, ret_t, + H5VL_iod_server_attr_write); + H5VL_ATTR_EXISTS_ID = MERCURY_REGISTER("attr_exists", attr_op_in_t, htri_t, + H5VL_iod_server_attr_exists); + //H5VL_ATTR_ITERATE_ID = MERCURY_REGISTER("attr_iterate", attr_op_in_t, ret_t); + H5VL_ATTR_RENAME_ID = MERCURY_REGISTER("attr_rename", attr_rename_in_t, ret_t, + H5VL_iod_server_attr_rename); + H5VL_ATTR_REMOVE_ID = MERCURY_REGISTER("attr_remove", attr_op_in_t, ret_t, + H5VL_iod_server_attr_remove); + H5VL_ATTR_CLOSE_ID = MERCURY_REGISTER("attr_close", attr_close_in_t, ret_t, + H5VL_iod_server_attr_close); + + H5VL_GROUP_CREATE_ID = MERCURY_REGISTER("group_create", group_create_in_t, group_create_out_t, + H5VL_iod_server_group_create); + H5VL_GROUP_OPEN_ID = MERCURY_REGISTER("group_open", group_open_in_t, group_open_out_t, + H5VL_iod_server_group_open); + H5VL_GROUP_CLOSE_ID = MERCURY_REGISTER("group_close", group_close_in_t, ret_t, + H5VL_iod_server_group_close); + + H5VL_MAP_CREATE_ID = MERCURY_REGISTER("map_create", map_create_in_t, map_create_out_t, + H5VL_iod_server_map_create); + H5VL_MAP_OPEN_ID = MERCURY_REGISTER("map_open", map_open_in_t, map_open_out_t, + H5VL_iod_server_map_open); + H5VL_MAP_SET_ID = MERCURY_REGISTER("map_set", map_set_in_t, ret_t, + H5VL_iod_server_map_set); + H5VL_MAP_GET_ID = MERCURY_REGISTER("map_get", map_get_in_t, map_get_out_t, + H5VL_iod_server_map_get); + H5VL_MAP_GET_COUNT_ID = MERCURY_REGISTER("map_get_count", map_get_count_in_t, int64_t, + H5VL_iod_server_map_get_count); + //H5VL_MAP_ITERATE_ID = MERCURY_REGISTER("map_iterate", map_op_in_t, ret_t); + H5VL_MAP_EXISTS_ID = MERCURY_REGISTER("map_exists", map_op_in_t, hbool_t, + H5VL_iod_server_map_exists); + H5VL_MAP_DELETE_ID = MERCURY_REGISTER("map_delete", map_op_in_t, ret_t, + H5VL_iod_server_map_delete); + H5VL_MAP_CLOSE_ID = MERCURY_REGISTER("map_close", map_close_in_t, ret_t, + H5VL_iod_server_map_close); + + H5VL_DSET_CREATE_ID = MERCURY_REGISTER("dset_create", dset_create_in_t, dset_create_out_t, + H5VL_iod_server_dset_create); + H5VL_DSET_OPEN_ID = MERCURY_REGISTER("dset_open", dset_open_in_t, dset_open_out_t, + H5VL_iod_server_dset_open); + H5VL_DSET_READ_ID = MERCURY_REGISTER("dset_read", dset_io_in_t, dset_read_out_t, + H5VL_iod_server_dset_read); + H5VL_DSET_GET_VL_SIZE_ID = MERCURY_REGISTER("dset_get_vl_size", dset_io_in_t, dset_read_out_t, + H5VL_iod_server_dset_get_vl_size); + H5VL_DSET_WRITE_ID = MERCURY_REGISTER("dset_write", dset_io_in_t, ret_t, + H5VL_iod_server_dset_write); + H5VL_DSET_SET_EXTENT_ID = MERCURY_REGISTER("dset_set_extent", + dset_set_extent_in_t, ret_t, + H5VL_iod_server_dset_set_extent); + H5VL_DSET_CLOSE_ID = MERCURY_REGISTER("dset_close", dset_close_in_t, ret_t, + H5VL_iod_server_dset_close); + + H5VL_DTYPE_COMMIT_ID = MERCURY_REGISTER("dtype_commit", dtype_commit_in_t, dtype_commit_out_t, + H5VL_iod_server_dtype_commit); + H5VL_DTYPE_OPEN_ID = MERCURY_REGISTER("dtype_open", dtype_open_in_t, dtype_open_out_t, + H5VL_iod_server_dtype_open); + H5VL_DTYPE_CLOSE_ID = MERCURY_REGISTER("dtype_close", dtype_close_in_t, ret_t, + H5VL_iod_server_dtype_close); + + H5VL_LINK_CREATE_ID = MERCURY_REGISTER("link_create", link_create_in_t, ret_t, + H5VL_iod_server_link_create); + H5VL_LINK_MOVE_ID = MERCURY_REGISTER("link_move", link_move_in_t, ret_t, + H5VL_iod_server_link_move); + H5VL_LINK_EXISTS_ID = MERCURY_REGISTER("link_exists", link_op_in_t, htri_t, + H5VL_iod_server_link_exists); + H5VL_LINK_GET_INFO_ID = MERCURY_REGISTER("link_get_info", link_op_in_t, linfo_t, + H5VL_iod_server_link_get_info); + H5VL_LINK_GET_VAL_ID = MERCURY_REGISTER("link_get_val", link_get_val_in_t, + link_get_val_out_t, H5VL_iod_server_link_get_val); + //H5VL_LINK_ITERATE_ID = MERCURY_REGISTER("link_iterate", link_op_in_t, ret_t); + H5VL_LINK_REMOVE_ID = MERCURY_REGISTER("link_remove", link_op_in_t, ret_t, + H5VL_iod_server_link_remove); + + H5VL_OBJECT_OPEN_BY_TOKEN_ID = MERCURY_REGISTER("object_open_by_token", + object_token_in_t, iod_handles_t, + H5VL_iod_server_object_open_by_token); + H5VL_OBJECT_OPEN_ID = MERCURY_REGISTER("object_open", object_op_in_t, object_open_out_t, + H5VL_iod_server_object_open); + //H5VL_OBJECT_COPY_ID = MERCURY_REGISTER("object_copy", object_copy_in_t, ret_t); + H5VL_OBJECT_EXISTS_ID = MERCURY_REGISTER("object_exists", object_op_in_t, htri_t, + H5VL_iod_server_object_exists); + //H5VL_OBJECT_VISIT_ID = MERCURY_REGISTER("object_visit", object_op_in_t, ret_t,); + H5VL_OBJECT_SET_COMMENT_ID = MERCURY_REGISTER("set_comment", object_set_comment_in_t, ret_t, + H5VL_iod_server_object_set_comment); + H5VL_OBJECT_GET_COMMENT_ID = MERCURY_REGISTER("get_comment", object_get_comment_in_t, + object_get_comment_out_t, + H5VL_iod_server_object_get_comment); + H5VL_OBJECT_GET_INFO_ID = MERCURY_REGISTER("object_get_info", object_op_in_t, oinfo_t, + H5VL_iod_server_object_get_info); + + H5VL_RC_ACQUIRE_ID = MERCURY_REGISTER("read_context_acquire", + rc_acquire_in_t, rc_acquire_out_t, + H5VL_iod_server_rcxt_acquire); + H5VL_RC_RELEASE_ID = MERCURY_REGISTER("read_context_release", rc_release_in_t, ret_t, + H5VL_iod_server_rcxt_release); + H5VL_RC_PERSIST_ID = MERCURY_REGISTER("read_context_persist", rc_persist_in_t, ret_t, + H5VL_iod_server_rcxt_persist); + H5VL_RC_SNAPSHOT_ID = MERCURY_REGISTER("read_context_snapshot", rc_snapshot_in_t, ret_t, + H5VL_iod_server_rcxt_snapshot); + + H5VL_TR_START_ID = MERCURY_REGISTER("transaction_start", tr_start_in_t, ret_t, + H5VL_iod_server_trans_start); + H5VL_TR_FINISH_ID = MERCURY_REGISTER("transaction_finish", tr_finish_in_t, ret_t, + H5VL_iod_server_trans_finish); + H5VL_TR_SET_DEPEND_ID = MERCURY_REGISTER("transaction_set_depend",tr_set_depend_in_t, ret_t, + H5VL_iod_server_trans_set_dependency); + H5VL_TR_SKIP_ID = MERCURY_REGISTER("transaction_skip", tr_skip_in_t, ret_t, + H5VL_iod_server_trans_skip); + H5VL_TR_ABORT_ID = MERCURY_REGISTER("transaction_abort",tr_abort_in_t, ret_t, + H5VL_iod_server_trans_abort); + + H5VL_PREFETCH_ID = MERCURY_REGISTER("prefetch", prefetch_in_t, hrpl_t, + H5VL_iod_server_prefetch); + H5VL_EVICT_ID = MERCURY_REGISTER("evict", evict_in_t, ret_t, + H5VL_iod_server_evict); + + H5VL_VIEW_CREATE_ID = MERCURY_REGISTER("view_create", view_create_in_t, view_create_out_t, + H5VL_iod_server_view_create); + +#ifdef H5_HAVE_INDEXING + H5VL_DSET_SET_INDEX_INFO_ID = MERCURY_REGISTER("dset_set_index_info", + dset_set_index_info_in_t, ret_t, + H5VL_iod_server_dset_set_index_info); + H5VL_DSET_GET_INDEX_INFO_ID = MERCURY_REGISTER("dset_get_index_info", + dset_get_index_info_in_t, + dset_get_index_info_out_t, + H5VL_iod_server_dset_get_index_info); + H5VL_DSET_RM_INDEX_INFO_ID = MERCURY_REGISTER("dset_rm_index_info", + dset_rm_index_info_in_t, ret_t, + H5VL_iod_server_dset_remove_index_info); +#endif + + H5VL_CANCEL_OP_ID = MERCURY_REGISTER("cancel_op", uint64_t, uint8_t, + H5VL_iod_server_cancel_op); +} + #endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_common.h b/src/H5VLiod_common.h index 647a8f4..a0c4897 100644 --- a/src/H5VLiod_common.h +++ b/src/H5VLiod_common.h @@ -32,6 +32,78 @@ #define IOD_COUNT_UNDEFINED ((uint64_t)(-1))//(pow(2.0,64.0) - 1) #define H5_EFF_DEBUG 1 +/* function shipper IDs for different routines */ +hg_id_t H5VL_EFF_INIT_ID; +hg_id_t H5VL_EFF_FINALIZE_ID; +hg_id_t H5VL_ANALYSIS_EXECUTE_ID; +hg_id_t H5VL_FILE_CREATE_ID; +hg_id_t H5VL_FILE_OPEN_ID; +hg_id_t H5VL_FILE_CLOSE_ID; +hg_id_t H5VL_ATTR_CREATE_ID; +hg_id_t H5VL_ATTR_OPEN_ID; +hg_id_t H5VL_ATTR_READ_ID; +hg_id_t H5VL_ATTR_WRITE_ID; +hg_id_t H5VL_ATTR_EXISTS_ID; +//hg_id_t H5VL_ATTR_ITERATE_ID; +hg_id_t H5VL_ATTR_RENAME_ID; +hg_id_t H5VL_ATTR_REMOVE_ID; +hg_id_t H5VL_ATTR_CLOSE_ID; +hg_id_t H5VL_GROUP_CREATE_ID; +hg_id_t H5VL_GROUP_OPEN_ID; +hg_id_t H5VL_GROUP_CLOSE_ID; +hg_id_t H5VL_MAP_CREATE_ID; +hg_id_t H5VL_MAP_OPEN_ID; +hg_id_t H5VL_MAP_SET_ID; +hg_id_t H5VL_MAP_GET_ID; +hg_id_t H5VL_MAP_GET_COUNT_ID; +hg_id_t H5VL_MAP_EXISTS_ID; +//hg_id_t H5VL_MAP_ITERATE_ID; +hg_id_t H5VL_MAP_DELETE_ID; +hg_id_t H5VL_MAP_CLOSE_ID; +hg_id_t H5VL_DSET_CREATE_ID; +hg_id_t H5VL_DSET_OPEN_ID; +hg_id_t H5VL_DSET_READ_ID; +hg_id_t H5VL_DSET_GET_VL_SIZE_ID; +hg_id_t H5VL_DSET_WRITE_ID; +hg_id_t H5VL_DSET_SET_EXTENT_ID; +hg_id_t H5VL_DSET_CLOSE_ID; +hg_id_t H5VL_DTYPE_COMMIT_ID; +hg_id_t H5VL_DTYPE_OPEN_ID; +hg_id_t H5VL_DTYPE_CLOSE_ID; +hg_id_t H5VL_LINK_CREATE_ID; +hg_id_t H5VL_LINK_MOVE_ID; +//hg_id_t H5VL_LINK_ITERATE_ID; +hg_id_t H5VL_LINK_EXISTS_ID; +hg_id_t H5VL_LINK_GET_INFO_ID; +hg_id_t H5VL_LINK_GET_VAL_ID; +hg_id_t H5VL_LINK_REMOVE_ID; +hg_id_t H5VL_OBJECT_OPEN_BY_TOKEN_ID; +hg_id_t H5VL_OBJECT_OPEN_ID; +//hg_id_t H5VL_OBJECT_COPY_ID; +//hg_id_t H5VL_OBJECT_VISIT_ID; +hg_id_t H5VL_OBJECT_EXISTS_ID; +hg_id_t H5VL_OBJECT_SET_COMMENT_ID; +hg_id_t H5VL_OBJECT_GET_COMMENT_ID; +hg_id_t H5VL_OBJECT_GET_INFO_ID; +hg_id_t H5VL_RC_ACQUIRE_ID; +hg_id_t H5VL_RC_RELEASE_ID; +hg_id_t H5VL_RC_PERSIST_ID; +hg_id_t H5VL_RC_SNAPSHOT_ID; +hg_id_t H5VL_TR_START_ID; +hg_id_t H5VL_TR_FINISH_ID; +hg_id_t H5VL_TR_SET_DEPEND_ID; +hg_id_t H5VL_TR_SKIP_ID; +hg_id_t H5VL_TR_ABORT_ID; +hg_id_t H5VL_PREFETCH_ID; +hg_id_t H5VL_EVICT_ID; +hg_id_t H5VL_CANCEL_OP_ID; +hg_id_t H5VL_VIEW_CREATE_ID; +#ifdef H5_HAVE_INDEXING +hg_id_t H5VL_DSET_SET_INDEX_INFO_ID; +hg_id_t H5VL_DSET_GET_INDEX_INFO_ID; +hg_id_t H5VL_DSET_RM_INDEX_INFO_ID; +#endif + /* Structure for a span of fixed-length data in a type */ typedef struct H5VL_iod_fl_span_t { size_t offset; /* Offset of start of span in type */ @@ -123,19 +195,91 @@ typedef binary_buf_t loc_info_t; H5_DLL int H5VL_iod_get_type_info(hid_t type_id, H5VL_iod_type_info_t *type_info); H5_DLL void H5VL_iod_type_info_reset(H5VL_iod_type_info_t *type_info); H5_DLL int H5VL_iod_create_segments_send(char *buf, H5VL_iod_type_info_t *type_info, - size_t nelem, hg_bulk_segment_t **segments, size_t *num_segments, + size_t nelem, void ***addrs, size_t **sizes, size_t *num_segments, char **vl_lengths, size_t *vl_lengths_nused, void ***free_list, size_t *free_list_len); H5_DLL int H5VL_iod_create_segments_recv(char *buf, H5VL_iod_type_info_t *type_info, - size_t nelem, hg_bulk_segment_t **segments, size_t *num_segments, + size_t nelem, void ***addrs, size_t **sizes, size_t *num_segments, char *vl_lengths, size_t vl_lengths_nused, void ***free_list, size_t *free_list_len); H5_DLL void H5VL_iod_free_list_free(void **free_list, size_t free_list_len); #ifdef H5_HAVE_EFF +H5_DLL void EFF__mercury_register_callbacks(void); + +#ifdef H5_HAVE_INDEXING +H5_DLL int H5VL_iod_server_dset_set_index_info(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dset_get_index_info(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dset_remove_index_info(hg_handle_t handle); +#endif + +H5_DLL int H5VL_iod_server_eff_init(hg_handle_t handle); +H5_DLL int H5VL_iod_server_eff_finalize(hg_handle_t handle); +H5_DLL int H5VL_iod_server_analysis_execute(hg_handle_t handle); +H5_DLL int H5VL_iod_server_file_create(hg_handle_t handle); +H5_DLL int H5VL_iod_server_file_open(hg_handle_t handle); +H5_DLL int H5VL_iod_server_file_close(hg_handle_t handle); +H5_DLL int H5VL_iod_server_attr_create(hg_handle_t handle); +H5_DLL int H5VL_iod_server_attr_open(hg_handle_t handle); +H5_DLL int H5VL_iod_server_attr_read(hg_handle_t handle); +H5_DLL int H5VL_iod_server_attr_write(hg_handle_t handle); +H5_DLL int H5VL_iod_server_attr_exists(hg_handle_t handle); +H5_DLL int H5VL_iod_server_attr_rename(hg_handle_t handle); +H5_DLL int H5VL_iod_server_attr_remove(hg_handle_t handle); +H5_DLL int H5VL_iod_server_attr_close(hg_handle_t handle); +H5_DLL int H5VL_iod_server_group_create(hg_handle_t handle); +H5_DLL int H5VL_iod_server_group_open(hg_handle_t handle); +H5_DLL int H5VL_iod_server_group_close(hg_handle_t handle); +H5_DLL int H5VL_iod_server_map_create(hg_handle_t handle); +H5_DLL int H5VL_iod_server_map_open(hg_handle_t handle); +H5_DLL int H5VL_iod_server_map_set(hg_handle_t handle); +H5_DLL int H5VL_iod_server_map_get(hg_handle_t handle); +H5_DLL int H5VL_iod_server_map_get_count(hg_handle_t handle); +H5_DLL int H5VL_iod_server_map_exists(hg_handle_t handle); +H5_DLL int H5VL_iod_server_map_delete(hg_handle_t handle); +H5_DLL int H5VL_iod_server_map_close(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dset_create(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dset_open(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dset_read(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dset_get_vl_size(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dset_write(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dset_set_extent(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dset_close(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dtype_commit(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dtype_open(hg_handle_t handle); +H5_DLL int H5VL_iod_server_dtype_close(hg_handle_t handle); +H5_DLL int H5VL_iod_server_link_create(hg_handle_t handle); +H5_DLL int H5VL_iod_server_link_move(hg_handle_t handle); +H5_DLL int H5VL_iod_server_link_exists(hg_handle_t handle); +H5_DLL int H5VL_iod_server_link_get_info(hg_handle_t handle); +H5_DLL int H5VL_iod_server_link_get_val(hg_handle_t handle); +H5_DLL int H5VL_iod_server_link_remove(hg_handle_t handle); +//H5_DLL int H5VL_iod_server_link_iterate(hg_handle_t handle); +H5_DLL int H5VL_iod_server_object_open_by_token(hg_handle_t handle); +H5_DLL int H5VL_iod_server_object_open(hg_handle_t handle); +//H5_DLL int H5VL_iod_server_object_copy(hg_handle_t handle); +//H5_DLL int H5VL_iod_server_object_visit(hg_handle_t handle); +H5_DLL int H5VL_iod_server_object_exists(hg_handle_t handle); +H5_DLL int H5VL_iod_server_object_set_comment(hg_handle_t handle); +H5_DLL int H5VL_iod_server_object_get_comment(hg_handle_t handle); +H5_DLL int H5VL_iod_server_object_get_info(hg_handle_t handle); +H5_DLL int H5VL_iod_server_rcxt_acquire(hg_handle_t handle); +H5_DLL int H5VL_iod_server_rcxt_release(hg_handle_t handle); +H5_DLL int H5VL_iod_server_rcxt_persist(hg_handle_t handle); +H5_DLL int H5VL_iod_server_rcxt_snapshot(hg_handle_t handle); +H5_DLL int H5VL_iod_server_trans_start(hg_handle_t handle); +H5_DLL int H5VL_iod_server_trans_finish(hg_handle_t handle); +H5_DLL int H5VL_iod_server_trans_set_dependency(hg_handle_t handle); +H5_DLL int H5VL_iod_server_trans_skip(hg_handle_t handle); +H5_DLL int H5VL_iod_server_trans_abort(hg_handle_t handle); +H5_DLL int H5VL_iod_server_prefetch(hg_handle_t handle); +H5_DLL int H5VL_iod_server_evict(hg_handle_t handle); +H5_DLL int H5VL_iod_server_view_create(hg_handle_t handle); +H5_DLL int H5VL_iod_server_cancel_op(hg_handle_t handle); + H5_DLL uint64_t H5_checksum_crc64(const void *buf, size_t buf_size); -H5_DLL uint64_t H5_checksum_crc64_segments(hg_bulk_segment_t *segments, size_t count); +H5_DLL uint64_t H5_checksum_crc64_segments(void **addrs, size_t *sizes, size_t count); H5_DLL uint64_t H5_checksum_crc64_fragments(void **buf, size_t *buf_size, size_t count); H5_DLL int hg_proc_ret_t(hg_proc_t proc, void *data); @@ -746,7 +890,9 @@ MERCURY_GEN_PROC(evict_in_t, //((hid_t)(apl_id)) ((int32_t)(obj_type)) ((iod_handles_t)(iod_oh)) - ((iod_obj_id_t)(iod_id))) + ((iod_obj_id_t)(iod_id)) + ((iod_obj_id_t)(mdkv_id)) + ((iod_obj_id_t)(attrkv_id))) MERCURY_GEN_PROC(view_create_in_t, ((axe_t)(axe_info)) diff --git a/src/H5VLiod_dset.c b/src/H5VLiod_dset.c index 2b6b781..2df1fb7 100644 --- a/src/H5VLiod_dset.c +++ b/src/H5VLiod_dset.c @@ -39,7 +39,8 @@ typedef struct { size_t buf_size; size_t nelmts; size_t cur_seg; - hg_bulk_segment_t *segments; + void **addrs; + size_t *sizes; iod_trans_id_t wtid; iod_trans_id_t rtid; } H5VL_iod_server_vl_write_t; @@ -48,7 +49,7 @@ static herr_t H5VL__iod_server_vl_data_write(iod_handle_t coh, iod_obj_id_t iod_id, iod_handles_t iod_oh, hid_t space_id, hid_t mem_type_id, hid_t dset_type_id, H5VL_iod_type_info_t type_info, size_t nelmts, - size_t num_segments, hg_bulk_segment_t *segments, + size_t num_segments, void **addrs, size_t *sizes, hid_t dxpl_id, iod_trans_id_t wtid, iod_trans_id_t rtid, na_addr_t source, hg_bulk_t bulk_handle, uint32_t cs_scope); @@ -383,6 +384,9 @@ done: } last_comp = (char *)H5MM_xfree(last_comp); + + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dset_create_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -426,6 +430,10 @@ H5VL_iod_server_dset_open_cb(AXE_engine_t UNUSED axe_engine, iod_ret_t ret; herr_t ret_value = SUCCEED; + output.space_id = FAIL; + output.type_id = FAIL; + output.dcpl_id = FAIL; + #if H5_EFF_DEBUG fprintf(stderr, "Start dataset open %s at (OH %"PRIu64" ID %"PRIx64")\n", name, loc_handle.rd_oh.cookie, loc_id); @@ -454,10 +462,10 @@ H5VL_iod_server_dset_open_cb(AXE_engine_t UNUSED axe_engine, HGOTO_ERROR_FF(FAIL, "Scratch Pad failed integrity check"); } - /* open the metadata scratch pad */ + /* open the metadata KV */ ret = iod_obj_open_read(coh, sp[0], rtid, NULL, &mdkv_oh, NULL); if(ret < 0) - HGOTO_ERROR_FF(ret, "can't open scratch pad"); + HGOTO_ERROR_FF(ret, "can't open metadata KV"); step ++; ret = H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_PLIST, H5VL_IOD_KEY_OBJ_CPL, @@ -475,7 +483,7 @@ H5VL_iod_server_dset_open_cb(AXE_engine_t UNUSED axe_engine, if(ret != SUCCEED) HGOTO_ERROR_FF(ret, "failed to retrieve dataspace"); - /* close the metadata scratch pad */ + /* close the metadata KV */ ret = iod_obj_close(mdkv_oh, NULL, NULL); if(ret < 0) HGOTO_ERROR_FF(ret, "can't close object"); @@ -494,6 +502,14 @@ H5VL_iod_server_dset_open_cb(AXE_engine_t UNUSED axe_engine, HG_Handler_start_output(op_data->hg_handle, &output); done: + + if(FAIL != output.type_id) + H5Tclose(output.type_id); + if(FAIL != output.space_id) + H5Sclose(output.space_id); + if(FAIL != output.dcpl_id) + H5Pclose(output.dcpl_id); + if(ret_value < 0) { fprintf(stderr, "DSET open FAILED\n"); output.iod_oh.rd_oh.cookie = IOD_OH_UNDEFINED; @@ -515,6 +531,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &output); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dset_open_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -593,6 +611,11 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t axe_engine, if(NULL == (buf = malloc(size))) HGOTO_ERROR_FF(FAIL, "can't allocate read buffer"); + /* Create bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_create(1, &buf, &size, + HG_BULK_READWRITE, &bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't create bulk handle"); + /* get the number of points selected */ nelmts = (size_t)H5Sget_select_npoints(space_id); @@ -658,15 +681,14 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t axe_engine, HGOTO_ERROR_FF(ret, "can't read from array object"); } - /* Create a new block handle to write the data */ - HG_Bulk_handle_create(buf, size, HG_BULK_READ_ONLY, &bulk_block_handle); + /* Push data to the client */ + if(HG_SUCCESS != HG_Bulk_transfer(HG_BULK_PUSH, dest, bulk_handle, 0, + bulk_block_handle, 0, size, &bulk_request)) + HGOTO_ERROR_FF(FAIL, "Transfer data failed"); - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_write_all(dest, bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't read from array object"); - /* wait for it to complete */ + /* Wait for bulk data read to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR_FF(FAIL, "can't read from array object"); + HGOTO_ERROR_FF(FAIL, "can't wait for bulk data operation"); /* free block handle */ if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) @@ -687,12 +709,14 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &output)) HDONE_ERROR_FF(FAIL, "can't send result of write to client"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dset_io_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); if(buf) { free(buf); - buf=NULL; + buf = NULL; } /* close the dataset if we opened it in this routine */ @@ -771,8 +795,7 @@ H5VL_iod_server_dset_get_vl_size_cb(AXE_engine_t UNUSED axe_engine, if(ret != SUCCEED) HGOTO_ERROR_FF(ret, "can't read from array object"); - /* MSC - create a bulk block handle. Mercury does not support - segmented handles yet, so we need a temporrary buffer. */ + /* MSC - use a temporrary buffer for now. */ { size_t *temp_buf = NULL; uint8_t *temp_ptr; @@ -780,8 +803,14 @@ H5VL_iod_server_dset_get_vl_size_cb(AXE_engine_t UNUSED axe_engine, unsigned u; H5VL_iod_type_info_t type_info; - if(NULL == (temp_buf = (size_t *)malloc(buf_size))) - HGOTO_ERROR_FF(FAIL, "can't allocate size buffer"); + /* allocate buffer to hold data */ + if(NULL == (temp_buf = malloc(buf_size))) + HGOTO_ERROR_FF(FAIL, "can't allocate read buffer"); + + /* Create bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_create(1, &temp_buf, &buf_size, + HG_BULK_READWRITE, &bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't create bulk handle"); buf_ptr = (uint8_t *)buf; temp_ptr = (uint8_t *)temp_buf; @@ -816,16 +845,14 @@ H5VL_iod_server_dset_get_vl_size_cb(AXE_engine_t UNUSED axe_engine, H5VL_iod_type_info_reset(&type_info); - /* Create a new block handle to write the data */ - HG_Bulk_handle_create(temp_buf, buf_size, HG_BULK_READ_ONLY, &bulk_block_handle); + /* Push data to the client */ + if(HG_SUCCESS != HG_Bulk_transfer(HG_BULK_PUSH, dest, bulk_handle, 0, + bulk_block_handle, 0, buf_size, &bulk_request)) + HGOTO_ERROR_FF(FAIL, "Transfer data failed"); - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_write_all(dest, bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't read from array object"); - - /* wait for it to complete */ + /* Wait for bulk data read to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR_FF(FAIL, "can't read from array object"); + HGOTO_ERROR_FF(FAIL, "can't wait for bulk data operation"); /* free block handle */ if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) @@ -852,6 +879,8 @@ done: fprintf(stderr, "Done with dset get vl size (%zu), sending response to client\n", buf_size); #endif + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dset_io_in_t *)H5MM_xfree(input); /* close the dataset if we opened it in this routine */ @@ -927,6 +956,10 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, input->dxpl_id = H5Pcopy(H5P_DATASET_XFER_DEFAULT); dxpl_id = input->dxpl_id; + /* get the scope for data integrity checks for raw data */ + if(H5Pget_rawdata_integrity_scope(dxpl_id, &raw_cs_scope) < 0) + HGOTO_ERROR_FF(FAIL, "can't get scope for data integrity checks"); + nelmts = (size_t)H5Sget_select_npoints(space_id); /* Get type info */ @@ -934,109 +967,75 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, HGOTO_ERROR_FF(FAIL, "failed to get datatype info"); if(type_info.vls) { - hg_bulk_segment_t *segments = NULL; + void **addrs = NULL; + size_t *sizes = NULL; size_t num_segments = 0; char *vl_lengths = NULL; size_t vl_lengths_size = 0; void **free_list = NULL; size_t free_list_len = 0; - hg_bulk_t vl_len_handle; + hg_bulk_t vl_len_handle = HG_BULK_NULL; /* Get size of vl_lengths array and allocate local buffer */ vl_lengths_size = HG_Bulk_handle_get_size(vl_len_bulk_handle); if(vl_lengths_size == 0) HGOTO_ERROR_FF(FAIL, "no vlen lengths sent"); + if(NULL == (vl_lengths = (char *)malloc(vl_lengths_size))) HGOTO_ERROR_FF(FAIL, "can't allocate vlen lengths buffer"); - /* Register local memory buffer */ - if(HG_SUCCESS != HG_Bulk_handle_create(vl_lengths, vl_lengths_size, - HG_BULK_READWRITE, &vl_len_handle)) + /* Create bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_create(1, &vl_lengths, &vl_lengths_size, + HG_BULK_READWRITE, &vl_len_handle)) HGOTO_ERROR_FF(FAIL, "create vlen bulk handle"); - /* Receive vl length data from client */ - if(HG_SUCCESS != HG_Bulk_read_all(source, vl_len_bulk_handle, - vl_len_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't read vlen lengths bulk data"); + /* Pull data from the client */ + if(HG_SUCCESS != HG_Bulk_transfer(HG_BULK_PULL, source, vl_len_bulk_handle, 0, + vl_len_handle, 0, vl_lengths_size, &bulk_request)) + HGOTO_ERROR_FF(FAIL, "Transfer data failed"); /* Wait for bulk data read to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) HGOTO_ERROR_FF(FAIL, "can't wait for vlen lengths bulk data operation"); - /* Free the bulk handle */ - if(HG_SUCCESS != HG_Bulk_handle_free(vl_len_handle)) - HGOTO_ERROR_FF(FAIL, "can't free vlen bulk handle"); +#if 0 + /* get mercury buffer where data is */ + if(HG_SUCCESS != HG_Bulk_handle_access(vl_len_handle, 0, vl_lengths_size, + HG_BULK_READWRITE, 1, + &vl_lengths, &vl_lengths_size, NULL)) + HGOTO_ERROR_FF(FAIL, "Could not access handle"); +#endif if(NULL == (buf = malloc(nelmts * type_info.size))) HGOTO_ERROR_FF(FAIL, "can't allocate data buffer"); /* Create segments from vl lengths */ - if(H5VL_iod_create_segments_recv((char *)buf, &type_info, nelmts, &segments, &num_segments, + if(H5VL_iod_create_segments_recv((char *)buf, &type_info, nelmts, &addrs, &sizes, &num_segments, vl_lengths, vl_lengths_size, &free_list, &free_list_len) < 0) HGOTO_ERROR_FF(FAIL, "can't create segments for bulk data transfer"); - assert(segments); + assert(addrs); + assert(sizes); -#if 1 ret = H5VL__iod_server_vl_data_write(coh, iod_id, iod_oh, space_id, src_id, dst_id, type_info, - nelmts, num_segments, segments, dxpl_id, wtid, rtid, + nelmts, num_segments, addrs, sizes, dxpl_id, wtid, rtid, source, bulk_handle, raw_cs_scope); if(ret != SUCCEED) HGOTO_ERROR_FF(ret, "can't write VL data to array object"); -#else - { - int i; - size_t j = 0; - uint64_t *buf_ptr = (uint64_t *)vl_lengths; - - fprintf(stderr, "Buffer size: %zu\n", nelmts * type_info.size); - /* Print VL length DATA */ - for(i = 0; i < vl_lengths_size/sizeof(size_t); i++) { - fprintf(stderr, "Element %d size %lu segment %lu, size %zu\n", i, vl_lengths[j], - segments[i].address, segments[i].size); - j+=8; - } /* end for */ - } - - /* Register non-contiguous memory segments */ - if(HG_SUCCESS != HG_Bulk_handle_create_segments(segments, num_segments, - HG_BULK_READWRITE, &vl_data_handle)) - HGOTO_ERROR_FF(FAIL, "can't create Bulk Data Handle"); - - /* Receive bulk data from client */ - if(HG_SUCCESS != HG_Bulk_read_all(source, bulk_handle, vl_data_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't read bulk data"); - - /* Wait for bulk data read to complete */ - if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR_FF(FAIL, "can't wait for bulk data operation"); - /* Free the bulk handle */ - if(HG_SUCCESS != HG_Bulk_handle_free(vl_data_handle)) - HGOTO_ERROR_FF(FAIL, "can't free bulk handle"); - - { - hvl_t *buf_ptr = (hvl_t *)buf; - int i, j; - - /* Print VL DATA */ - for(i = 0; i < 5; i++) { - int temp = (int)buf_ptr[i].len; - - fprintf(stderr, "Element %d size %zu: ", i, temp); - for(j = 0; j < temp; j++) - fprintf(stderr, "%d ",((unsigned int *)buf_ptr[i].p)[j]); - fprintf(stderr, "\n"); - } /* end for */ - } -#endif + if(HG_SUCCESS != HG_Bulk_handle_free(vl_len_handle)) + HGOTO_ERROR_FF(FAIL, "can't free vlen bulk handle"); /* Free segments */ - if(segments) { - free(segments); - segments = NULL; - num_segments = 0; + if(addrs) { + free(addrs); + addrs = NULL; + } /* end if */ + if(sizes) { + free(sizes); + sizes = NULL; } /* end if */ + num_segments = 0; if(free_list) { H5VL_iod_free_list_free(free_list, free_list_len); @@ -1050,6 +1049,11 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, vl_lengths = NULL; vl_lengths_size = 0; } + + if(buf) { + free(buf); + buf = NULL; + } } else { size_t elmt_size; @@ -1061,20 +1065,26 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, if(NULL == (buf = malloc(size))) HGOTO_ERROR_FF(FAIL, "can't allocate read buffer"); - /* create a Mercury block handle for transfer */ - HG_Bulk_handle_create(buf, size, HG_BULK_READWRITE, &bulk_block_handle); + /* Create bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_create(1, &buf, &size, + HG_BULK_READWRITE, &bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't create bulk handle"); - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_read_all(source, bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't get data from function shipper"); + /* Pull data from the client */ + if(HG_SUCCESS != HG_Bulk_transfer(HG_BULK_PULL, source, bulk_handle, 0, + bulk_block_handle, 0, size, &bulk_request)) + HGOTO_ERROR_FF(FAIL, "Transfer data failed"); - /* wait for it to complete */ + /* Wait for bulk data read to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR_FF(FAIL, "can't get data from function shipper"); + HGOTO_ERROR_FF(FAIL, "can't wait for bulk data operation"); - /* free the bds block handle */ - if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) - HGOTO_ERROR_FF(FAIL, "can't free bds block handle"); +#if 0 + /* get mercury buffer where data is */ + if(HG_SUCCESS != HG_Bulk_handle_access(bulk_block_handle, 0, size, + HG_BULK_READWRITE, 1, &buf, &size, NULL)) + HGOTO_ERROR_FF(FAIL, "Could not access handle"); +#endif /* MSC - check if client requested to corrupt data */ if(H5Pget_dxpl_inject_corruption(dxpl_id, &flag) < 0) @@ -1083,10 +1093,6 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, ((int *)buf)[0] = 10; } - /* get the scope for data integrity checks for raw data */ - if(H5Pget_rawdata_integrity_scope(dxpl_id, &raw_cs_scope) < 0) - HGOTO_ERROR_FF(FAIL, "can't get scope for data integrity checks"); - /* verify data if transfer flag is set */ if(raw_cs_scope & H5_CHECKSUM_TRANSFER) { data_cs = H5_checksum_crc64(buf, size); @@ -1117,20 +1123,14 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, if(H5Tconvert(src_id, dst_id, nelmts, buf, NULL, dxpl_id) < 0) HGOTO_ERROR_FF(FAIL, "data type conversion failed") -#if 0 - { - int *ptr = (int *)buf; - - fprintf(stderr, "DWRITE Received a buffer of size %zu with values: ", size); - for(u=0 ; u<size/sizeof(int) ; ++u) - fprintf(stderr, "%d ", ptr[u]); - fprintf(stderr, "\n"); - } -#endif - elmt_size = H5Tget_size(dst_id); ret = H5VL__iod_server_final_io(iod_oh.wr_oh, space_id, elmt_size, TRUE, buf, buf_size, cs, raw_cs_scope, wtid); + + /* free the block handle */ + if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't free bds block handle"); + if(ret != SUCCEED) HGOTO_ERROR_FF(ret, "can't write to array object"); } @@ -1149,14 +1149,12 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) HDONE_ERROR_FF(FAIL, "can't send result of write to client"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dset_io_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); - H5VL_iod_type_info_reset(&type_info); - if(buf) { - free(buf); - buf = NULL; - } + H5VL_iod_type_info_reset(&type_info); /* close the dataset if we opened it in this routine */ if(TRUE == opened_locally) { @@ -1261,6 +1259,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dset_set_extent_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -1318,6 +1318,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dset_close_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -1681,7 +1683,7 @@ static herr_t H5VL__iod_server_vl_data_write(iod_handle_t coh, iod_obj_id_t iod_id, iod_handles_t iod_oh, hid_t space_id, hid_t mem_type_id, hid_t UNUSED dset_type_id, H5VL_iod_type_info_t type_info, size_t nelmts, - size_t num_segments, hg_bulk_segment_t *segments, + size_t num_segments, void **addrs, size_t *sizes, hid_t UNUSED dxpl_id, iod_trans_id_t wtid, iod_trans_id_t rtid, na_addr_t source, hg_bulk_t bulk_handle, uint32_t cs_scope) { @@ -1697,29 +1699,33 @@ H5VL__iod_server_vl_data_write(iod_handle_t coh, iod_obj_id_t iod_id, iod_handle /* Print VL length DATA */ for(u = 0; u < num_segments; u++) { #if H5_EFF_DEBUG - fprintf(stderr, "Element %zu size %zu \n", u, segments[u].size); + fprintf(stderr, "Element %zu size %zu \n", u, sizes[u]); #endif - buf_size += segments[u].size; + buf_size += sizes[u]; } /* end for */ if(NULL == (buf = malloc(buf_size))) HGOTO_ERROR_FF(FAIL, "can't allocate data buffer"); - /* Register local memory buffer */ - if(HG_SUCCESS != HG_Bulk_handle_create(buf, buf_size, HG_BULK_READWRITE, &vl_data_handle)) - HGOTO_ERROR_FF(FAIL, "create vlen bulk handle"); + /* Create bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_create(1, &buf, &buf_size, + HG_BULK_READWRITE, &vl_data_handle)) + HGOTO_ERROR_FF(FAIL, "can't create bulk handle"); - /* Receive vl length data from client */ - if(HG_SUCCESS != HG_Bulk_read_all(source, bulk_handle, vl_data_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't read vlen lengths bulk data"); + /* Pull data from the client */ + if(HG_SUCCESS != HG_Bulk_transfer(HG_BULK_PULL, source, bulk_handle, 0, + vl_data_handle, 0, buf_size, &bulk_request)) + HGOTO_ERROR_FF(FAIL, "Transfer data failed"); /* Wait for bulk data read to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR_FF(FAIL, "can't wait for vlen lengths bulk data operation"); - - /* Free the bulk handle */ - if(HG_SUCCESS != HG_Bulk_handle_free(vl_data_handle)) - HGOTO_ERROR_FF(FAIL, "can't free vlen bulk handle"); + HGOTO_ERROR_FF(FAIL, "can't wait for bulk data operation"); +#if 0 + /* get mercury buffer where data is */ + if(HG_SUCCESS != HG_Bulk_handle_access(vl_data_handle, 0, buf_size, + HG_BULK_READWRITE, 1, &buf, &buf_size, NULL)) + HGOTO_ERROR_FF(FAIL, "Could not access handle"); +#endif /* set other parameters needed to do IO */ udata.coh = coh; @@ -1729,7 +1735,8 @@ H5VL__iod_server_vl_data_write(iod_handle_t coh, iod_obj_id_t iod_id, iod_handle udata.buf_size = buf_size; udata.wtid = wtid; udata.rtid = rtid; - udata.segments = segments; + udata.addrs = addrs; + udata.sizes = sizes; udata.cur_seg = 0; udata.space_id = space_id; udata.iod_id = iod_id; @@ -1738,11 +1745,10 @@ H5VL__iod_server_vl_data_write(iod_handle_t coh, iod_obj_id_t iod_id, iod_handle if(H5Diterate(&bogus, mem_type_id, space_id, H5VL__iod_server_vl_data_write_cb, &udata) < 0) HGOTO_ERROR_FF(FAIL, "failed to compute buffer size"); + /* Free the bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_free(vl_data_handle)) + HGOTO_ERROR_FF(FAIL, "can't free vlen bulk handle"); done: - if(buf) { - free(buf); - buf = NULL; - } return ret_value; }/* end H5VL__iod_server_vl_data_write */ @@ -1828,7 +1834,7 @@ H5VL__iod_server_vl_data_write_cb(void UNUSED *elem, hid_t type_id, unsigned ndi HGOTO_ERROR_FF(ret, "Failed to create BLOB object"); } - buf_size = udata->segments[udata->cur_seg].size; + buf_size = udata->sizes[udata->cur_seg]; /* MSC - type conversion ?? */ diff --git a/src/H5VLiod_dtype.c b/src/H5VLiod_dtype.c index 0273a01..66da6bd 100644 --- a/src/H5VLiod_dtype.c +++ b/src/H5VLiod_dtype.c @@ -297,11 +297,13 @@ done: obj_create_hint = NULL; } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dtype_commit_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); free(buf); - } /* end H5VL_iod_server_dtype_commit_cb() */ @@ -349,6 +351,9 @@ H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, iod_ret_t ret; herr_t ret_value = SUCCEED; + output.tcpl_id = FAIL; + output.type_id = FAIL; + #if H5_EFF_DEBUG fprintf(stderr, "Start datatype open %s at (OH %"PRIu64" ID %"PRIx64")\n", name, loc_handle.rd_oh.cookie, loc_id); @@ -464,6 +469,11 @@ H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, HG_Handler_start_output(op_data->hg_handle, &output); done: + if(FAIL != output.type_id) + H5Tclose(output.type_id); + if(FAIL != output.tcpl_id) + H5Pclose(output.tcpl_id); + if(ret_value < 0) { output.iod_oh.rd_oh.cookie = IOD_OH_UNDEFINED; output.iod_oh.wr_oh.cookie = IOD_OH_UNDEFINED; @@ -483,9 +493,10 @@ done: HG_Handler_start_output(op_data->hg_handle, &output); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dtype_open_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); - } /* end H5VL_iod_server_dtype_open_cb() */ @@ -537,6 +548,8 @@ H5VL_iod_server_dtype_close_cb(AXE_engine_t UNUSED axe_engine, done: HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dtype_close_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); diff --git a/src/H5VLiod_encdec.c b/src/H5VLiod_encdec.c index a637203..dac1cf2 100644 --- a/src/H5VLiod_encdec.c +++ b/src/H5VLiod_encdec.c @@ -808,7 +808,7 @@ int hg_proc_hid_t(hg_proc_t proc, void *data) op = hg_proc_get_op(proc); if (HG_ENCODE == op || HG_FREE == op) { - if(FAIL == id) + if(FAIL == id || H5P_DEFAULT == id) type = H5I_UNINIT; else type = H5Iget_type(id); diff --git a/src/H5VLiod_file.c b/src/H5VLiod_file.c index f30465e..5c6f2d7 100644 --- a/src/H5VLiod_file.c +++ b/src/H5VLiod_file.c @@ -279,6 +279,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret_value); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (file_create_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -334,6 +336,8 @@ H5VL_iod_server_file_open_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start file open %s %d %d\n", input->name, input->flags, input->fapl_id); #endif + output.fcpl_id = FAIL; + if(H5F_ACC_RDWR == mode) mode = IOD_CONT_RW; else if(H5F_ACC_RDONLY == mode) @@ -544,12 +548,15 @@ H5VL_iod_server_file_open_cb(AXE_engine_t UNUSED axe_engine, HG_Handler_start_output(op_data->hg_handle, &output); done: + if(FAIL != output.fcpl_id) + H5Pclose(output.fcpl_id); + if(ret_value < 0) { output.coh.cookie = IOD_OH_UNDEFINED; output.root_id = IOD_OBJ_INVALID; output.root_oh.rd_oh.cookie = IOD_OH_UNDEFINED; output.root_oh.wr_oh.cookie = IOD_OH_UNDEFINED; - output.fcpl_id = H5P_FILE_CREATE_DEFAULT; + output.fcpl_id = FAIL; output.kv_oid_index = 0; output.array_oid_index = 0; output.blob_oid_index = 0; @@ -557,6 +564,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &output); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (file_open_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -824,6 +833,8 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) HDONE_ERROR_FF(FAIL, "can't send result of file close to client"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (file_close_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); diff --git a/src/H5VLiod_group.c b/src/H5VLiod_group.c index aa027a6..1be384d 100644 --- a/src/H5VLiod_group.c +++ b/src/H5VLiod_group.c @@ -231,6 +231,9 @@ done: } last_comp = (char *)H5MM_xfree(last_comp); + + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (group_create_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -274,6 +277,8 @@ H5VL_iod_server_group_open_cb(AXE_engine_t UNUSED axe_engine, iod_ret_t ret; herr_t ret_value = SUCCEED; + output.gcpl_id = FAIL; + #if H5_EFF_DEBUG fprintf(stderr, "Start group open %s at (OH %"PRIu64" ID %"PRIx64")\n", name, loc_handle.rd_oh.cookie, loc_id); @@ -342,6 +347,9 @@ H5VL_iod_server_group_open_cb(AXE_engine_t UNUSED axe_engine, HG_Handler_start_output(op_data->hg_handle, &output); done: + if(FAIL != output.gcpl_id) + H5Pclose(output.gcpl_id); + if(ret_value < 0) { output.iod_oh.rd_oh.cookie = IOD_OH_UNDEFINED; output.iod_oh.wr_oh.cookie = IOD_OH_UNDEFINED; @@ -360,6 +368,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &output); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (group_open_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -414,6 +424,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (group_close_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); diff --git a/src/H5VLiod_index.c b/src/H5VLiod_index.c index caab1bc..0e2fde1 100644 --- a/src/H5VLiod_index.c +++ b/src/H5VLiod_index.c @@ -118,6 +118,8 @@ done: if(ret < 0) HDONE_ERROR_FF(ret, "can't close object"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dset_set_index_info_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -259,6 +261,8 @@ done: if(ret < 0) HDONE_ERROR_FF(ret, "can't close object"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dset_get_index_info_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -336,6 +340,8 @@ done: if(ret < 0) HDONE_ERROR_FF(ret, "can't close object"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (dset_rm_index_info_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); diff --git a/src/H5VLiod_link.c b/src/H5VLiod_link.c index c328452..d83007b 100644 --- a/src/H5VLiod_link.c +++ b/src/H5VLiod_link.c @@ -199,6 +199,9 @@ done: src_last_comp = (char *)H5MM_xfree(src_last_comp); dst_last_comp = (char *)H5MM_xfree(dst_last_comp); + + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (link_create_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -401,6 +404,9 @@ done: src_last_comp = (char *)H5MM_xfree(src_last_comp); dst_last_comp = (char *)H5MM_xfree(dst_last_comp); + + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (link_move_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -503,8 +509,11 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (link_op_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); } /* end H5VL_iod_server_link_exists_cb() */ @@ -602,8 +611,11 @@ done: iod_obj_close(cur_oh.wr_oh, NULL, NULL); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (link_op_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); if(iod_link.link_type == H5L_TYPE_SOFT) { @@ -704,8 +716,11 @@ done: iod_obj_close(cur_oh.wr_oh, NULL, NULL); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (link_get_val_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); + last_comp = (char *)H5MM_xfree(last_comp); if(output.value.val) @@ -903,6 +918,9 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret_value); last_comp = (char *)H5MM_xfree(last_comp); + + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (link_op_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); diff --git a/src/H5VLiod_map.c b/src/H5VLiod_map.c index 0e44e7e..61f004b 100644 --- a/src/H5VLiod_map.c +++ b/src/H5VLiod_map.c @@ -259,6 +259,9 @@ done: } last_comp = (char *)H5MM_xfree(last_comp); + + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (map_create_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -307,8 +310,9 @@ H5VL_iod_server_map_open_cb(AXE_engine_t UNUSED axe_engine, name, loc_handle.rd_oh.cookie, loc_id); #endif - output.keytype_id = -1; - output.valtype_id = -1; + output.keytype_id = FAIL; + output.valtype_id = FAIL; + output.mcpl_id = FAIL; /* Traverse Path and open map */ ret = H5VL_iod_server_open_path(coh, loc_id, loc_handle, name, rtid, @@ -375,6 +379,13 @@ H5VL_iod_server_map_open_cb(AXE_engine_t UNUSED axe_engine, HG_Handler_start_output(op_data->hg_handle, &output); done: + if(FAIL != output.keytype_id) + H5Tclose(output.keytype_id); + if(FAIL != output.valtype_id) + H5Tclose(output.valtype_id); + if(FAIL != output.mcpl_id) + H5Pclose(output.mcpl_id); + if(ret_value < 0) { output.iod_oh.rd_oh.cookie = IOD_OH_UNDEFINED; output.iod_oh.wr_oh.cookie = IOD_OH_UNDEFINED; @@ -395,6 +406,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &output); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (map_open_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -472,19 +485,26 @@ H5VL_iod_server_map_set_cb(AXE_engine_t UNUSED axe_engine, if(NULL == (val_buf = malloc(val_size))) HGOTO_ERROR_FF(FAIL, "can't allocate read buffer"); - /* create a Mercury block handle for transfer */ - HG_Bulk_handle_create(val_buf, val_size, HG_BULK_READWRITE, &bulk_block_handle); + /* Create bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_create(1, &val_buf, &val_size, + HG_BULK_READWRITE, &bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't create bulk handle"); - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_read_all(source, value_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't get data from function shipper"); - /* wait for it to complete */ + /* Pull data from the client */ + if(HG_SUCCESS != HG_Bulk_transfer(HG_BULK_PULL, source, value_handle, 0, + bulk_block_handle, 0, val_size, &bulk_request)) + HGOTO_ERROR_FF(FAIL, "Transfer data failed"); + + /* Wait for bulk data read to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR_FF(FAIL, "can't get data from function shipper"); + HGOTO_ERROR_FF(FAIL, "can't wait for bulk data operation"); - /* free the bds block handle */ - if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) - HGOTO_ERROR_FF(FAIL, "can't free bds block handle"); +#if 0 + /* get mercury buffer where data is */ + if(HG_SUCCESS != HG_Bulk_handle_access(bulk_block_handle, 0, val_size, + HG_BULK_READWRITE, 1, &val_buf, &val_size, NULL)) + HGOTO_ERROR_FF(FAIL, "Could not access handle"); +#endif /* get the scope for data integrity checks for raw data */ if(H5Pget_rawdata_integrity_scope(dxpl_id, &raw_cs_scope) < 0) @@ -578,11 +598,17 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) HDONE_ERROR_FF(FAIL, "can't send result of write to client"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (map_set_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); - if(val_buf) - free(val_buf); + if(val_buf) { + /* free block handle */ + if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't free bds block handle"); + val_buf = NULL; + } /* close the map if we opened it in this routine */ if(opened_locally) { @@ -694,11 +720,25 @@ H5VL_iod_server_map_get_cb(AXE_engine_t UNUSED axe_engine, if(val_is_vl) { output.ret = ret_value; output.val_size = src_size; +#if H5_EFF_DEBUG fprintf(stderr, "val size = %zu\n", src_size); +#endif if(client_val_buf_size) { if(NULL == (val_buf = malloc((size_t)src_size))) HGOTO_ERROR_FF(FAIL, "can't allocate buffer"); + /* Create bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_create(1, &val_buf, &src_size, + HG_BULK_READWRITE, &bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't create bulk handle"); + +#if 0 + /* get mercury buffer where data is */ + if(HG_SUCCESS != HG_Bulk_handle_access(bulk_block_handle, 0, src_size, + HG_BULK_READ_ONLY, 1, &val_buf, &src_size, NULL)) + HGOTO_ERROR_FF(FAIL, "Could not access handle"); +#endif + ret = iod_kv_get_value(iod_oh, rtid, key.buf, (iod_size_t)key.buf_size, val_buf, &src_size, kv_cs, NULL); if(ret < 0) @@ -722,19 +762,14 @@ H5VL_iod_server_map_get_cb(AXE_engine_t UNUSED axe_engine, } #endif - /* Create a new block handle to write the data */ - HG_Bulk_handle_create(val_buf, (size_t)src_size, HG_BULK_READ_ONLY, &bulk_block_handle); + /* Push data to the client */ + if(HG_SUCCESS != HG_Bulk_transfer(HG_BULK_PUSH, dest, value_handle, 0, + bulk_block_handle, 0, src_size, &bulk_request)) + HGOTO_ERROR_FF(FAIL, "Transfer data failed"); - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_write_all(dest, value_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't read from array object"); - /* wait for it to complete */ + /* Wait for bulk data read to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR_FF(FAIL, "can't read from array object"); - - /* free block handle */ - if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) - HGOTO_ERROR_FF(FAIL, "can't free bds block handle"); + HGOTO_ERROR_FF(FAIL, "can't wait for bulk data operation"); } } else { @@ -744,6 +779,18 @@ H5VL_iod_server_map_get_cb(AXE_engine_t UNUSED axe_engine, if(NULL == (val_buf = malloc((size_t)src_size))) HGOTO_ERROR_FF(FAIL, "can't allocate buffer"); + /* Create bulk handle */ + if(HG_SUCCESS != HG_Bulk_handle_create(1, &val_buf, &src_size, + HG_BULK_READWRITE, &bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't create bulk handle"); + +#if 0 + /* get mercury buffer where data is */ + if(HG_SUCCESS != HG_Bulk_handle_access(bulk_block_handle, 0, src_size, + HG_BULK_READ_ONLY, 1, &val_buf, &src_size, NULL)) + HGOTO_ERROR_FF(FAIL, "Could not access handle"); +#endif + ret = iod_kv_get_value(iod_oh, rtid, key.buf, (iod_size_t)key.buf_size, val_buf, &src_size, kv_cs, NULL); if(ret < 0) @@ -784,19 +831,14 @@ H5VL_iod_server_map_get_cb(AXE_engine_t UNUSED axe_engine, output.val_size = val_size; output.ret = ret_value; - /* Create a new block handle to write the data */ - HG_Bulk_handle_create(val_buf, val_size, HG_BULK_READ_ONLY, &bulk_block_handle); + /* Push data to the client */ + if(HG_SUCCESS != HG_Bulk_transfer(HG_BULK_PUSH, dest, value_handle, 0, + bulk_block_handle, 0, src_size, &bulk_request)) + HGOTO_ERROR_FF(FAIL, "Transfer data failed"); - /* Write bulk data here and wait for the data to be there */ - if(HG_SUCCESS != HG_Bulk_write_all(dest, value_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR_FF(FAIL, "can't read from array object"); - /* wait for it to complete */ + /* Wait for bulk data read to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR_FF(FAIL, "can't read from array object"); - - /* free block handle */ - if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) - HGOTO_ERROR_FF(FAIL, "can't free bds block handle"); + HGOTO_ERROR_FF(FAIL, "can't wait for bulk data operation"); } #if H5_EFF_DEBUG @@ -816,9 +858,15 @@ done: HDONE_ERROR_FF(FAIL, "can't send result of map get"); } - if(val_buf) - free(val_buf); + if(val_buf) { + /* free block handle */ + if(HG_SUCCESS != HG_Bulk_handle_free(bulk_block_handle)) + HGOTO_ERROR_FF(FAIL, "can't free bds block handle"); + val_buf = NULL; + } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (map_get_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -897,6 +945,8 @@ done: HDONE_ERROR_FF(FAIL, "can't send result of map get_count"); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (map_get_count_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -987,6 +1037,8 @@ done: HDONE_ERROR_FF(FAIL, "can't send result of map exists"); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (map_op_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -1071,6 +1123,8 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) HDONE_ERROR_FF(FAIL, "can't send result of map delete"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (map_op_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -1128,6 +1182,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (map_close_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); diff --git a/src/H5VLiod_obj.c b/src/H5VLiod_obj.c index abc7099..9c4c6be 100644 --- a/src/H5VLiod_obj.c +++ b/src/H5VLiod_obj.c @@ -78,6 +78,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &obj_oh); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (object_token_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -117,6 +119,10 @@ H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, iod_ret_t ret; herr_t ret_value = SUCCEED; + output.cpl_id = FAIL; + output.id1 = FAIL; + output.id2 = FAIL; + #if H5_EFF_DEBUG fprintf(stderr, "Start Object Open on %s (OH %"PRIu64" ID %"PRIx64")\n", input->loc_name, input->loc_oh.rd_oh.cookie, input->loc_id); @@ -298,6 +304,18 @@ H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, HG_Handler_start_output(op_data->hg_handle, &output); done: + + if(FAIL != output.cpl_id) + H5Pclose(output.cpl_id); + if(FAIL != output.id1) + H5Tclose(output.id1); + if(FAIL != output.id2) { + if(H5I_DATASET == output.obj_type) + H5Sclose(output.id2); + else if(H5I_MAP == output.obj_type) + H5Tclose(output.id2); + } + if(ret_value < 0) { output.iod_oh.rd_oh.cookie = IOD_OH_UNDEFINED; output.iod_oh.wr_oh.cookie = IOD_OH_UNDEFINED; @@ -308,11 +326,15 @@ done: HG_Handler_start_output(op_data->hg_handle, &output); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (object_op_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); } /* end H5VL_iod_server_object_open_cb() */ +/* MSC - NEED IOD & a lot more work*/ +#if 0 /*------------------------------------------------------------------------- * Function: H5VL_iod_server_object_copy_cb @@ -357,9 +379,6 @@ H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start object copy\n"); #endif - /* MSC - NEED IOD & a lot more work*/ -#if 0 - /* Traverse Path and open object */ if(H5VL_iod_server_open_path(coh, input->src_loc_id, input->src_loc_oh, input->src_loc_name, rtid, cs_scope, &obj_id, &obj_oh) < 0) @@ -508,8 +527,6 @@ H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, iod_obj_close(dst_oh, NULL, NULL); } -#endif - done: #if H5_EFF_DEBUG fprintf(stderr, "Done with object Copy, sending response to client\n"); @@ -519,10 +536,14 @@ done: if(new_name) free(new_name); + + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (object_copy_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); } /* end H5VL_iod_server_object_copy_cb() */ +#endif /*------------------------------------------------------------------------- @@ -587,6 +608,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (object_op_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -742,7 +765,9 @@ done: oinfo.num_attrs = 0; HG_Handler_start_output(op_data->hg_handle, &oinfo); } - + + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (object_op_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -863,6 +888,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (object_set_comment_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -1018,6 +1045,8 @@ done: iod_cs = NULL; } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (object_get_comment_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -1247,6 +1276,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &output); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (object_op_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); diff --git a/src/H5VLiod_server.c b/src/H5VLiod_server.c index 8c2bcba..d2c8b78 100644 --- a/src/H5VLiod_server.c +++ b/src/H5VLiod_server.c @@ -47,237 +47,44 @@ hg_id_t H5VL_EFF_CLOSE_CONTAINER; hg_id_t H5VL_EFF_ANALYSIS_FARM; hg_id_t H5VL_EFF_ANALYSIS_FARM_TRANSFER; -#define H5VL_RPC_CB(func_name, handle) \ - static hg_return_t \ - func_name ## _thread_cb(hg_handle_t handle) - -/* Assuming func_name_cb is defined, calling H5VL_AXE_TASK_CB(func_name, struct_name) - * will define func_name_thread and func_name_thread_cb that can be used - * to execute RPC callback from a thread - */ #define H5VL_AXE_TASK_CB(func_name, struct_name) \ - static HG_THREAD_RETURN_TYPE \ - func_name ## _thread \ - (void *arg) \ - { \ - hg_handle_t handle = (hg_handle_t) arg; \ - hg_thread_ret_t thread_ret = (hg_thread_ret_t) 0; \ - \ - func_name ## _thread_cb(handle); \ - \ - return thread_ret; \ - } \ - hg_return_t \ - func_name ## _cb(hg_handle_t handle) \ + int \ + func_name(hg_handle_t handle) \ { \ op_data_t *op_data = NULL; \ - attr_rename_in_t *input = NULL; \ - hg_return_t ret = HG_SUCCESS; \ - \ - FUNC_ENTER_NOAPI_NOINIT \ + struct_name *input = NULL; \ + int ret_value = HG_SUCCESS; \ \ if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) \ - HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, HG_FAIL, "can't allocate axe op_data struct"); \ + HGOTO_ERROR_FF(HG_FAIL, "can't allocate axe op_data struct"); \ \ if(NULL == (input = (struct_name *) H5MM_malloc(sizeof(struct_name)))) \ - HGOTO_ERROR2(H5E_ATTR, H5E_NOSPACE, HG_FAIL, "can't allocate input struct for decoding"); \ + HGOTO_ERROR_FF(HG_FAIL, "can't allocate input struct for decoding"); \ \ if(HG_FAIL == HG_Handler_get_input(handle, input)) \ - HGOTO_ERROR2(H5E_ATTR, H5E_CANTGET, HG_FAIL, "can't get input parameters"); \ + HGOTO_ERROR_FF(HG_FAIL, "can't get input parameters"); \ \ if(NULL == engine) \ - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, HG_FAIL, "AXE engine not started"); \ + HGOTO_ERROR_FF(HG_FAIL, "AXE engine not started"); \ \ if(input->axe_info.count && \ H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, \ input->axe_info.count) < 0) \ - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, HG_FAIL, "Unable to cleanup AXE tasks"); \ + HGOTO_ERROR_FF(HG_FAIL, "Unable to cleanup AXE tasks"); \ \ op_data->hg_handle = handle; \ op_data->input = (void *)input; \ \ if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, \ - input->axe_info.num_parents, input->axe_info.parent_axe_ids, \ - 0, NULL, func_name ## _thread, op_data, NULL)) \ - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); \ + input->axe_info.num_parents, \ + input->axe_info.parent_axe_ids, \ + 0, NULL, func_name ## _cb, op_data, NULL)) \ + HGOTO_ERROR_FF(HG_FAIL, "can't insert task into async engine"); \ \ done: \ - FUNC_LEAVE_NOAPI(ret_value) \ + return ret_value; \ } -void -EFF__mercury_register_callbacks(void) -{ - - H5VL_EFF_OPEN_CONTAINER = MERCURY_REGISTER("container_open", hg_const_string_t, iod_handle_t); - MERCURY_HANDLER_REGISTER("container_open", H5VL_iod_server_container_open, - hg_const_string_t, iod_handle_t); - - H5VL_EFF_CLOSE_CONTAINER = MERCURY_REGISTER("container_close", iod_handle_t, ret_t); - MERCURY_HANDLER_REGISTER("container_close", H5VL_iod_server_container_close, - iod_handle_t, ret_t); - - MERCURY_HANDLER_REGISTER("analysis_execute", H5VL_iod_server_analysis_execute, - analysis_execute_in_t, analysis_execute_out_t); - - H5VL_EFF_ANALYSIS_FARM = MERCURY_REGISTER("analysis_farm", analysis_farm_in_t, - analysis_farm_out_t); - MERCURY_HANDLER_REGISTER("analysis_farm", H5VL_iod_server_analysis_farm, - analysis_farm_in_t, analysis_farm_out_t); - - H5VL_EFF_ANALYSIS_FARM_TRANSFER = MERCURY_REGISTER("analysis_transfer", - analysis_transfer_in_t, analysis_transfer_out_t); - MERCURY_HANDLER_REGISTER("analysis_transfer", H5VL_iod_server_analysis_transfer, - analysis_transfer_in_t, analysis_transfer_out_t); - - /* Register function and encoding/decoding functions */ - MERCURY_HANDLER_REGISTER("eff_init", H5VL_iod_server_eff_init, - eff_init_in_t, ret_t); - MERCURY_HANDLER_REGISTER("eff_finalize", H5VL_iod_server_eff_finalize, - ret_t, ret_t); - - MERCURY_HANDLER_REGISTER("file_create", H5VL_iod_server_file_create, - file_create_in_t, file_create_out_t); - MERCURY_HANDLER_REGISTER("file_open", H5VL_iod_server_file_open, - file_open_in_t, file_open_out_t); - MERCURY_HANDLER_REGISTER("file_close", H5VL_iod_server_file_close, - file_close_in_t, ret_t); - - MERCURY_HANDLER_REGISTER("attr_create", H5VL_iod_server_attr_create, - attr_create_in_t, attr_create_out_t); - MERCURY_HANDLER_REGISTER("attr_open", H5VL_iod_server_attr_open, - attr_open_in_t, attr_open_out_t); - MERCURY_HANDLER_REGISTER("attr_read", H5VL_iod_server_attr_read, - attr_io_in_t, ret_t); - MERCURY_HANDLER_REGISTER("attr_write", H5VL_iod_server_attr_write, - attr_io_in_t, ret_t); - MERCURY_HANDLER_REGISTER("attr_exists", H5VL_iod_server_attr_exists, - attr_op_in_t, htri_t); - MERCURY_HANDLER_REGISTER("attr_rename", H5VL_iod_server_attr_rename, - attr_rename_in_t, ret_t); - MERCURY_HANDLER_REGISTER("attr_remove", H5VL_iod_server_attr_remove, - attr_op_in_t, ret_t); - MERCURY_HANDLER_REGISTER("attr_close", H5VL_iod_server_attr_close, - attr_close_in_t, ret_t); - - MERCURY_HANDLER_REGISTER("group_create", H5VL_iod_server_group_create, - group_create_in_t, group_create_out_t); - MERCURY_HANDLER_REGISTER("group_open", H5VL_iod_server_group_open, - group_open_in_t, group_open_out_t); - MERCURY_HANDLER_REGISTER("group_close", H5VL_iod_server_group_close, - group_close_in_t, ret_t); - - MERCURY_HANDLER_REGISTER("map_create", H5VL_iod_server_map_create, - map_create_in_t, map_create_out_t); - MERCURY_HANDLER_REGISTER("map_open", H5VL_iod_server_map_open, - map_open_in_t, map_open_out_t); - MERCURY_HANDLER_REGISTER("map_set", H5VL_iod_server_map_set, - map_set_in_t, ret_t); - MERCURY_HANDLER_REGISTER("map_get", H5VL_iod_server_map_get, - map_get_in_t, map_get_out_t); - MERCURY_HANDLER_REGISTER("map_get_count", H5VL_iod_server_map_get_count, - map_get_count_in_t, int64_t); - MERCURY_HANDLER_REGISTER("map_exists", H5VL_iod_server_map_exists, - map_op_in_t, hbool_t); - MERCURY_HANDLER_REGISTER("map_delete", H5VL_iod_server_map_delete, - map_op_in_t, ret_t); - MERCURY_HANDLER_REGISTER("map_close", H5VL_iod_server_map_close, - map_close_in_t, ret_t); - - MERCURY_HANDLER_REGISTER("dset_create", H5VL_iod_server_dset_create, - dset_create_in_t, dset_create_out_t); - MERCURY_HANDLER_REGISTER("dset_open", H5VL_iod_server_dset_open, - dset_open_in_t, dset_open_out_t); - MERCURY_HANDLER_REGISTER("dset_read", H5VL_iod_server_dset_read, - dset_io_in_t, dset_read_out_t); - MERCURY_HANDLER_REGISTER("dset_get_vl_size", H5VL_iod_server_dset_get_vl_size, - dset_io_in_t, dset_read_out_t); - MERCURY_HANDLER_REGISTER("dset_write", H5VL_iod_server_dset_write, - dset_io_in_t, ret_t); - MERCURY_HANDLER_REGISTER("dset_set_extent", H5VL_iod_server_dset_set_extent, - dset_set_extent_in_t, ret_t); - MERCURY_HANDLER_REGISTER("dset_close", H5VL_iod_server_dset_close, - dset_close_in_t, ret_t); - -#ifdef H5_HAVE_INDEXING - MERCURY_HANDLER_REGISTER("dset_set_index_info", H5VL_iod_server_dset_set_index_info, - dset_set_index_info_in_t, ret_t); - MERCURY_HANDLER_REGISTER("dset_get_index_info", H5VL_iod_server_dset_get_index_info, - dset_get_index_info_in_t, dset_get_index_info_out_t); - MERCURY_HANDLER_REGISTER("dset_rm_index_info", H5VL_iod_server_dset_remove_index_info, - dset_rm_index_info_in_t, ret_t); -#endif - - MERCURY_HANDLER_REGISTER("dtype_commit", H5VL_iod_server_dtype_commit, - dtype_commit_in_t, dtype_commit_out_t); - MERCURY_HANDLER_REGISTER("dtype_open", H5VL_iod_server_dtype_open, - dtype_open_in_t, dtype_open_out_t); - MERCURY_HANDLER_REGISTER("dtype_close", H5VL_iod_server_dtype_close, - dtype_close_in_t, ret_t); - - MERCURY_HANDLER_REGISTER("link_create", H5VL_iod_server_link_create, - link_create_in_t, ret_t); - MERCURY_HANDLER_REGISTER("link_move", H5VL_iod_server_link_move, - link_move_in_t, ret_t); - MERCURY_HANDLER_REGISTER("link_exists", H5VL_iod_server_link_exists, - link_op_in_t, htri_t); - MERCURY_HANDLER_REGISTER("link_get_info", H5VL_iod_server_link_get_info, - link_op_in_t, linfo_t); - MERCURY_HANDLER_REGISTER("link_get_val", H5VL_iod_server_link_get_val, - link_get_val_in_t, link_get_val_out_t); - MERCURY_HANDLER_REGISTER("link_iterate", H5VL_iod_server_link_iterate, - link_op_in_t, ret_t); - MERCURY_HANDLER_REGISTER("link_remove", H5VL_iod_server_link_remove, - link_op_in_t, ret_t); - - MERCURY_HANDLER_REGISTER("object_open_by_token", H5VL_iod_server_object_open_by_token, - object_token_in_t, iod_handles_t); - MERCURY_HANDLER_REGISTER("object_open", H5VL_iod_server_object_open, - object_op_in_t, object_open_out_t); - MERCURY_HANDLER_REGISTER("object_copy", H5VL_iod_server_object_copy, - object_copy_in_t, ret_t); - MERCURY_HANDLER_REGISTER("object_exists", H5VL_iod_server_object_exists, - object_op_in_t, htri_t); - MERCURY_HANDLER_REGISTER("object_visit", H5VL_iod_server_object_visit, - object_op_in_t, ret_t); - MERCURY_HANDLER_REGISTER("set_comment", H5VL_iod_server_object_set_comment, - object_set_comment_in_t, ret_t); - MERCURY_HANDLER_REGISTER("get_comment", H5VL_iod_server_object_get_comment, - object_get_comment_in_t, object_get_comment_out_t); - MERCURY_HANDLER_REGISTER("object_get_info", H5VL_iod_server_object_get_info, - object_op_in_t, oinfo_t); - - MERCURY_HANDLER_REGISTER("read_context_acquire", H5VL_iod_server_rcxt_acquire, - rc_acquire_in_t, rc_acquire_out_t); - MERCURY_HANDLER_REGISTER("read_context_release", H5VL_iod_server_rcxt_release, - rc_release_in_t, ret_t); - MERCURY_HANDLER_REGISTER("read_context_persist", H5VL_iod_server_rcxt_persist, - rc_persist_in_t, ret_t); - MERCURY_HANDLER_REGISTER("read_context_snapshot", H5VL_iod_server_rcxt_snapshot, - rc_snapshot_in_t, ret_t); - - MERCURY_HANDLER_REGISTER("transaction_start", H5VL_iod_server_trans_start, - tr_start_in_t, ret_t); - MERCURY_HANDLER_REGISTER("transaction_finish", H5VL_iod_server_trans_finish, - tr_finish_in_t, ret_t); - MERCURY_HANDLER_REGISTER("transaction_set_depend", H5VL_iod_server_trans_set_dependency, - tr_set_depend_in_t, ret_t); - MERCURY_HANDLER_REGISTER("transaction_skip", H5VL_iod_server_trans_skip, - tr_skip_in_t, ret_t); - MERCURY_HANDLER_REGISTER("transaction_abort", H5VL_iod_server_trans_abort, - tr_abort_in_t, ret_t); - - MERCURY_HANDLER_REGISTER("prefetch", H5VL_iod_server_prefetch, - prefetch_in_t, hrpl_t); - MERCURY_HANDLER_REGISTER("evict", H5VL_iod_server_evict, - evict_in_t, ret_t); - - MERCURY_HANDLER_REGISTER("view_create", H5VL_iod_server_view_create, - view_create_in_t, view_create_out_t); - - MERCURY_HANDLER_REGISTER("cancel_op", H5VL_iod_server_cancel_op, uint64_t, uint8_t); -} - herr_t EFF_start_server(MPI_Comm comm, MPI_Info UNUSED info) { @@ -332,8 +139,6 @@ EFF_start_server(MPI_Comm comm, MPI_Info UNUSED info) if(HG_SUCCESS != HG_Init(network_class)) return FAIL; - if(HG_SUCCESS != HG_Handler_init(network_class)) - return FAIL; /* Look up addr id */ /* We do the lookup here but this may not be optimal */ @@ -372,6 +177,17 @@ EFF_start_server(MPI_Comm comm, MPI_Info UNUSED info) EFF__mercury_register_callbacks(); + /* register server specific callbacks */ + H5VL_EFF_OPEN_CONTAINER = MERCURY_REGISTER("container_open", hg_const_string_t, iod_handle_t, + H5VL_iod_server_container_open); + H5VL_EFF_CLOSE_CONTAINER = MERCURY_REGISTER("container_close", iod_handle_t, ret_t, + H5VL_iod_server_container_close); + H5VL_EFF_ANALYSIS_FARM = MERCURY_REGISTER("analysis_farm", analysis_farm_in_t, + analysis_farm_out_t, H5VL_iod_server_analysis_farm); + H5VL_EFF_ANALYSIS_FARM_TRANSFER = MERCURY_REGISTER("analysis_transfer", analysis_transfer_in_t, + analysis_transfer_out_t, + H5VL_iod_server_analysis_transfer); + /* Initialize engine attribute */ if(AXEengine_attr_init(&engine_attr) != AXE_SUCCEED) return FAIL; @@ -418,8 +234,6 @@ EFF_start_server(MPI_Comm comm, MPI_Info UNUSED info) } free(server_addr_g); - if(HG_SUCCESS != HG_Handler_finalize()) - return FAIL; if(HG_SUCCESS != HG_Finalize()) return FAIL; if(NA_SUCCESS != NA_Finalize(network_class)) @@ -531,58 +345,67 @@ done: return ret_value; } /* end H5VL_iod_server_eff_finalize() */ - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_analysis_execute - * - * Purpose: Function shipper registered call for Executing Analysis. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_analysis_execute(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - analysis_execute_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (analysis_execute_in_t *)H5MM_malloc(sizeof(analysis_execute_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - //if(AXE_SUCCEED != AXEgenerate_task_id(engine, &axe_id)) - //HGOTO_ERROR_FF(FAIL, "Unable to generate ID for AXE task"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, - H5VL_iod_server_analysis_execute_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_analysis_execute() */ +H5VL_AXE_TASK_CB(H5VL_iod_server_analysis_execute, analysis_execute_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_file_create, file_create_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_file_open, file_open_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_attr_create, attr_create_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_attr_open, attr_open_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_attr_read, attr_io_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_attr_write, attr_io_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_attr_exists, attr_op_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_attr_rename, attr_rename_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_attr_remove, attr_op_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_attr_close, attr_close_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_group_create, group_create_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_group_open, group_open_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_group_close, group_close_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_dset_create, dset_create_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_dset_open, dset_open_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_dset_read, dset_io_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_dset_get_vl_size, dset_io_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_dset_write, dset_io_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_dset_set_extent, dset_set_extent_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_dset_close, dset_close_in_t) +#ifdef H5_HAVE_INDEXING +H5VL_AXE_TASK_CB(H5VL_iod_server_dset_set_index_info, dset_set_index_info_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_dset_get_index_info, dset_get_index_info_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_dset_remove_index_info, dset_rm_index_info_in_t) +#endif +H5VL_AXE_TASK_CB(H5VL_iod_server_dtype_commit, dtype_commit_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_dtype_open, dtype_open_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_dtype_close, dtype_close_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_link_create, link_create_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_link_move, link_move_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_link_exists, link_op_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_link_get_info, link_op_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_link_get_val, link_get_val_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_link_remove, link_op_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_object_open_by_token, object_token_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_object_open, object_op_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_object_exists, object_op_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_object_set_comment, object_set_comment_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_object_get_comment, object_get_comment_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_object_get_info, object_op_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_map_create, map_create_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_map_open, map_open_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_map_set, map_set_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_map_get, map_get_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_map_get_count, map_get_count_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_map_exists, map_op_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_map_delete, map_op_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_map_close, map_close_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_rcxt_acquire, rc_acquire_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_rcxt_release, rc_release_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_rcxt_persist, rc_persist_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_rcxt_snapshot, rc_snapshot_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_trans_start, tr_start_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_trans_finish, tr_finish_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_trans_set_dependency, tr_set_depend_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_trans_skip, tr_skip_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_trans_abort, tr_abort_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_prefetch, prefetch_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_evict, evict_in_t) +H5VL_AXE_TASK_CB(H5VL_iod_server_view_create, view_create_in_t) /*------------------------------------------------------------------------- @@ -776,106 +599,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5VL_iod_server_file_create - * - * Purpose: Function shipper registered call for File Create. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_file_create(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - file_create_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (file_create_in_t *)H5MM_malloc(sizeof(file_create_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, - H5VL_iod_server_file_create_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_file_create() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_file_open - * - * Purpose: Function shipper registered call for File Open. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_file_open(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - file_open_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (file_open_in_t *) H5MM_malloc(sizeof(file_open_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, - H5VL_iod_server_file_open_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_file_open() */ - - -/*------------------------------------------------------------------------- * Function: H5VL_iod_server_file_close * * Purpose: Function shipper registered call for File Close. @@ -925,3017 +648,4 @@ done: return ret_value; } /* end H5VL_iod_server_file_close() */ - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_create - * - * Purpose: Function shipper registered call for Attr Create. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_attr_create(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - attr_create_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (attr_create_in_t *) - H5MM_malloc(sizeof(attr_create_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_attr_create_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_attr_create() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_open - * - * Purpose: Function shipper registered call for Attr Open. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_attr_open(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - attr_open_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (attr_open_in_t *) - H5MM_malloc(sizeof(attr_open_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_attr_open_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_attr_open() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_read - * - * Purpose: Function shipper registered call for Attr Read. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_attr_read(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - attr_io_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (attr_io_in_t *) - H5MM_malloc(sizeof(attr_io_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_attr_read_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_attr_read() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_write - * - * Purpose: Function shipper registered call for Attr Write. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_attr_write(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - attr_io_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (attr_io_in_t *) - H5MM_malloc(sizeof(attr_io_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_attr_write_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_attr_write() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_exists - * - * Purpose: Function shipper registered call for Attr Exists. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_attr_exists(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - attr_op_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (attr_op_in_t *) - H5MM_malloc(sizeof(attr_op_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_attr_exists_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_attr_exists() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_rename - * - * Purpose: Function shipper registered call for Attr Rename. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_attr_rename(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - attr_rename_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (attr_rename_in_t *) - H5MM_malloc(sizeof(attr_rename_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_attr_rename_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_attr_rename() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_remove - * - * Purpose: Function shipper registered call for Attr Remove. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_attr_remove(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - attr_op_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (attr_op_in_t *) - H5MM_malloc(sizeof(attr_op_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_attr_remove_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_attr_remove() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_attr_close - * - * Purpose: Function shipper registered call for Attr Close. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_attr_close(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - attr_close_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (attr_close_in_t *) - H5MM_malloc(sizeof(attr_close_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_attr_close_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_attr_close() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_group_create - * - * Purpose: Function shipper registered call for Group Create. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_group_create(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - group_create_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (group_create_in_t *)H5MM_malloc(sizeof(group_create_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_group_create_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_group_create() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_group_open - * - * Purpose: Function shipper registered call for Group Open. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_group_open(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - group_open_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (group_open_in_t *)H5MM_malloc(sizeof(group_open_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_group_open_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_group_open() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_group_close - * - * Purpose: Function shipper registered call for Group Close. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_group_close(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - group_close_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (group_close_in_t *)H5MM_malloc(sizeof(group_close_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_group_close_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); -done: - return ret_value; -} /* end H5VL_iod_server_group_close() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_create - * - * Purpose: Function shipper registered call for Dset Create. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dset_create(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dset_create_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dset_create_in_t *) - H5MM_malloc(sizeof(dset_create_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dset_create_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dset_create() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_open - * - * Purpose: Function shipper registered call for Dset Open. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dset_open(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dset_open_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dset_open_in_t *) - H5MM_malloc(sizeof(dset_open_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dset_open_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dset_open() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_read - * - * Purpose: Function shipper registered call for Dset Read. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dset_read(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dset_io_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dset_io_in_t *) - H5MM_malloc(sizeof(dset_io_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dset_read_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dset_read() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_get_vl_size - * - * Purpose: Function shipper registered call for dset get VL buffer size. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dset_get_vl_size(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dset_io_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dset_io_in_t *) - H5MM_malloc(sizeof(dset_io_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dset_get_vl_size_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dset_get_vl_size() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_write - * - * Purpose: Function shipper registered call for Dset Write. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dset_write(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dset_io_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dset_io_in_t *) - H5MM_malloc(sizeof(dset_io_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dset_write_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dset_write() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_set_extent - * - * Purpose: Function shipper registered call for Dset Set_Extent. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dset_set_extent(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dset_set_extent_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dset_set_extent_in_t *) - H5MM_malloc(sizeof(dset_set_extent_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dset_set_extent_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dset_set_extent() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_close - * - * Purpose: Function shipper registered call for Dset Close. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * January, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dset_close(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dset_close_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dset_close_in_t *) - H5MM_malloc(sizeof(dset_close_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dset_close_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dset_close() */ - -#ifdef H5_HAVE_INDEXING - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_set_index_info - * - * Purpose: Function shipper registered call for Dset Set_Index_Info. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * March, 2014 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dset_set_index_info(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dset_set_index_info_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dset_set_index_info_in_t *) - H5MM_malloc(sizeof(dset_set_index_info_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dset_set_index_info_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dset_set_index_info() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_get_index_info - * - * Purpose: Function shipper registered call for Dset Get_Index_Info. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * March, 2014 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dset_get_index_info(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dset_get_index_info_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dset_get_index_info_in_t *) - H5MM_malloc(sizeof(dset_get_index_info_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dset_get_index_info_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dset_get_index_info() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dset_remove_index_info - * - * Purpose: Function shipper registered call for Dset Remove_Index_Info. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * March, 2014 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dset_remove_index_info(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dset_rm_index_info_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dset_rm_index_info_in_t *) - H5MM_malloc(sizeof(dset_rm_index_info_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dset_remove_index_info_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dset_remove_index_info() */ -#endif - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dtype_commit - * - * Purpose: Function shipper registered call for Dtype Commit. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dtype_commit(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dtype_commit_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dtype_commit_in_t *) - H5MM_malloc(sizeof(dtype_commit_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dtype_commit_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dtype_commit() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dtype_open - * - * Purpose: Function shipper registered call for Dtype Open. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dtype_open(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dtype_open_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dtype_open_in_t *) - H5MM_malloc(sizeof(dtype_open_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dtype_open_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dtype_open() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_dtype_close - * - * Purpose: Function shipper registered call for Dtype Close. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * April, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_dtype_close(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - dtype_close_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (dtype_close_in_t *) - H5MM_malloc(sizeof(dtype_close_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_dtype_close_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_dtype_close() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_link_create - * - * Purpose: Function shipper registered call for Link Creation. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_link_create(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - link_create_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (link_create_in_t *) - H5MM_malloc(sizeof(link_create_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_link_create_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_link_create() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_link_move - * - * Purpose: Function shipper registered call for Link Move. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_link_move(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - link_move_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (link_move_in_t *) - H5MM_malloc(sizeof(link_move_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_link_move_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_link_move() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_link_iterate - * - * Purpose: Function shipper registered call for Link Iteration. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_link_iterate(hg_handle_t UNUSED handle) -{ - //op_data_t *op_data = NULL; - int ret_value = HG_SUCCESS; - -#if 0 - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (link_iterate_in_t *) - H5MM_malloc(sizeof(link_iterate_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; -#endif - - return ret_value; -} /* end H5VL_iod_server_link_iterate() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_link_exists - * - * Purpose: Function shipper registered call for Link Existance. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_link_exists(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - link_op_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (link_op_in_t *) - H5MM_malloc(sizeof(link_op_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_link_exists_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_link_exists() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_link_get_info - * - * Purpose: Function shipper registered call for Link get_info. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_link_get_info(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - link_op_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (link_op_in_t *) - H5MM_malloc(sizeof(link_op_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_link_get_info_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_link_get_info() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_link_get_val - * - * Purpose: Function shipper registered call for Link get_val. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_link_get_val(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - link_get_val_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (link_get_val_in_t *) - H5MM_malloc(sizeof(link_get_val_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_link_get_val_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_link_get_val() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_link_remove - * - * Purpose: Function shipper registered call for Link Removal. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_link_remove(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - link_op_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (link_op_in_t *) - H5MM_malloc(sizeof(link_op_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_link_remove_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_link_remove() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_open_by_token - * - * Purpose: Function shipper registered call for Object Open by token. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_object_open_by_token(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - object_token_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (object_token_in_t *) - H5MM_malloc(sizeof(object_token_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_object_open_by_token_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_object_open_by_token() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_open - * - * Purpose: Function shipper registered call for Object Open. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_object_open(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - object_op_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (object_op_in_t *) - H5MM_malloc(sizeof(object_op_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_object_open_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_object_open() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_copy - * - * Purpose: Function shipper registered call for Object Copy. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_object_copy(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - object_copy_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (object_copy_in_t *) - H5MM_malloc(sizeof(object_copy_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_object_copy_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_object_copy() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_visit - * - * Purpose: Function shipper registered call for Object Visit. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_object_visit(hg_handle_t UNUSED handle) -{ - //op_data_t *op_data = NULL; - int ret_value = HG_SUCCESS; - - return ret_value; -} /* end H5VL_iod_server_object_visit() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_exists - * - * Purpose: Function shipper registered call for Object Existance. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_object_exists(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - object_op_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (object_op_in_t *) - H5MM_malloc(sizeof(object_op_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_object_exists_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_object_exists() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_set_comment - * - * Purpose: Function shipper registered call for Set Comment. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_object_set_comment(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - object_set_comment_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (object_set_comment_in_t *) - H5MM_malloc(sizeof(object_set_comment_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_object_set_comment_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_object_set_comment() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_get_comment - * - * Purpose: Function shipper registered call for Get Comment. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_object_get_comment(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - object_get_comment_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (object_get_comment_in_t *) - H5MM_malloc(sizeof(object_get_comment_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_object_get_comment_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_object_get_comment() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_object_get_info - * - * Purpose: Function shipper registered call for Object get_info. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * May, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_object_get_info(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - object_op_in_t *input = NULL; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (object_op_in_t *) - H5MM_malloc(sizeof(object_op_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate input struct for decoding"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_object_get_info_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_object_get_info() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_map_create - * - * Purpose: Function shipper registered call for Map Create. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * July, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_map_create(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - map_create_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (map_create_in_t *)H5MM_malloc(sizeof(map_create_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_map_create_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_map_create() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_map_open - * - * Purpose: Function shipper registered call for Map Open. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * July, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_map_open(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - map_open_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (map_open_in_t *)H5MM_malloc(sizeof(map_open_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_map_open_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_map_open() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_map_set - * - * Purpose: Function shipper registered call for Map Set. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * July, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_map_set(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - map_set_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (map_set_in_t *)H5MM_malloc(sizeof(map_set_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_map_set_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_map_set() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_map_get - * - * Purpose: Function shipper registered call for Map Get. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * July, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_map_get(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - map_get_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (map_get_in_t *)H5MM_malloc(sizeof(map_get_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_map_get_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_map_get() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_map_get_count - * - * Purpose: Function shipper registered call for Map Get_Count. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * July, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_map_get_count(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - map_get_count_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (map_get_count_in_t *)H5MM_malloc(sizeof(map_get_count_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_map_get_count_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_map_get_count() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_map_exists - * - * Purpose: Function shipper registered call for Map Exists. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * July, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_map_exists(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - map_op_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (map_op_in_t *)H5MM_malloc(sizeof(map_op_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_map_exists_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_map_exists() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_map_delete - * - * Purpose: Function shipper registered call for Map Delete. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * July, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_map_delete(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - map_op_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (map_op_in_t *)H5MM_malloc(sizeof(map_op_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_map_delete_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_map_delete() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_map_close - * - * Purpose: Function shipper registered call for Map Close. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * July, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_map_close(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - map_close_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (map_close_in_t *)H5MM_malloc(sizeof(map_close_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_map_close_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_map_close() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_rcxt_acquire - * - * Purpose: Function shipper registered call for Read Context Acquire. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * September, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_rcxt_acquire(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - rc_acquire_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (rc_acquire_in_t *)H5MM_malloc(sizeof(rc_acquire_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_rcxt_acquire_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_rcxt_acquire() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_rcxt_release - * - * Purpose: Function shipper registered call for read context release. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * September, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_rcxt_release(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - rc_release_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (rc_release_in_t *)H5MM_malloc(sizeof(rc_release_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_rcxt_release_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_rcxt_release() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_rcxt_persist - * - * Purpose: Function shipper registered call for read context persist. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * September, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_rcxt_persist(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - rc_persist_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (rc_persist_in_t *)H5MM_malloc(sizeof(rc_persist_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_rcxt_persist_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_rcxt_persist() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_rcxt_snapshot - * - * Purpose: Function shipper registered call for read context snapshot. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * September, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_rcxt_snapshot(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - rc_snapshot_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (rc_snapshot_in_t *)H5MM_malloc(sizeof(rc_snapshot_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_rcxt_snapshot_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_rcxt_snapshot() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_trans_start - * - * Purpose: Function shipper registered call for transaction start. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * September, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_trans_start(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - tr_start_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (tr_start_in_t *)H5MM_malloc(sizeof(tr_start_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_trans_start_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_trans_start() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_trans_finish - * - * Purpose: Function shipper registered call for transaction finish. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * September, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_trans_finish(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - tr_finish_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (tr_finish_in_t *)H5MM_malloc(sizeof(tr_finish_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_trans_finish_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_trans_finish() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_trans_set_dependency - * - * Purpose: Function shipper registered call for transaction set_dependency. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * September, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_trans_set_dependency(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - tr_set_depend_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (tr_set_depend_in_t *)H5MM_malloc(sizeof(tr_set_depend_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_trans_set_dependency_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_trans_set_dependency() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_trans_skip - * - * Purpose: Function shipper registered call for transaction skip. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * September, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_trans_skip(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - tr_skip_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (tr_skip_in_t *)H5MM_malloc(sizeof(tr_skip_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_trans_skip_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_trans_skip() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_trans_abort - * - * Purpose: Function shipper registered call for transaction abort. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * September, 2013 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_trans_abort(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - tr_abort_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (tr_abort_in_t *)H5MM_malloc(sizeof(tr_abort_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_trans_abort_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_trans_abort() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_prefetch - * - * Purpose: Function shipper registered call for object prefetch. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * February, 2014 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_prefetch(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - prefetch_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (prefetch_in_t *)H5MM_malloc(sizeof(prefetch_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_prefetch_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_prefetch() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_evict - * - * Purpose: Function shipper registered call for object evict. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * February, 2014 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_evict(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - evict_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (evict_in_t *)H5MM_malloc(sizeof(evict_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_evict_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_evict() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_server_view_create - * - * Purpose: Function shipper registered call for object view_create. - * Inserts the real worker routine into the Async Engine. - * - * Return: Success: HG_SUCCESS - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * February, 2014 - * - *------------------------------------------------------------------------- - */ -int -H5VL_iod_server_view_create(hg_handle_t handle) -{ - op_data_t *op_data = NULL; - view_create_in_t *input; - int ret_value = HG_SUCCESS; - - if(NULL == (op_data = (op_data_t *)H5MM_malloc(sizeof(op_data_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(NULL == (input = (view_create_in_t *)H5MM_malloc(sizeof(view_create_in_t)))) - HGOTO_ERROR_FF(FAIL, "can't allocate axe op_data struct"); - - if(HG_FAIL == HG_Handler_get_input(handle, input)) - HGOTO_ERROR_FF(FAIL, "can't get input parameters"); - - if(NULL == engine) - HGOTO_ERROR_FF(FAIL, "AXE engine not started"); - - if(input->axe_info.count && - H5VL__iod_server_finish_axe_tasks(engine, input->axe_info.start_range, - input->axe_info.count) < 0) - HGOTO_ERROR_FF(FAIL, "Unable to cleanup AXE tasks"); - - op_data->hg_handle = handle; - op_data->input = (void *)input; - - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, - input->axe_info.num_parents, input->axe_info.parent_axe_ids, - 0, NULL, H5VL_iod_server_view_create_cb, op_data, NULL)) - HGOTO_ERROR_FF(FAIL, "can't insert task into async engine"); - -done: - return ret_value; -} /* end H5VL_iod_server_view_create() */ - #endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_server.h b/src/H5VLiod_server.h index 383f999..f427bac 100644 --- a/src/H5VLiod_server.h +++ b/src/H5VLiod_server.h @@ -110,83 +110,11 @@ extern hg_id_t H5VL_EFF_ANALYSIS_FARM_TRANSFER; typedef herr_t (*H5VL_operator_t)(iod_handle_t coh, iod_obj_id_t obj_id, iod_trans_id_t rtid, H5I_type_t obj_type, uint32_t cs_scope, void *operator_data); -H5_DLL void EFF__mercury_register_callbacks(void); - -H5_DLL int H5VL_iod_server_analysis_execute(hg_handle_t handle); H5_DLL int H5VL_iod_server_analysis_farm(hg_handle_t handle); H5_DLL int H5VL_iod_server_analysis_transfer(hg_handle_t handle); H5_DLL int H5VL_iod_server_container_open(hg_handle_t handle); H5_DLL int H5VL_iod_server_container_close(hg_handle_t handle); -#ifdef H5_HAVE_INDEXING -H5_DLL int H5VL_iod_server_dset_set_index_info(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dset_get_index_info(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dset_remove_index_info(hg_handle_t handle); -#endif - -H5_DLL int H5VL_iod_server_eff_init(hg_handle_t handle); -H5_DLL int H5VL_iod_server_eff_finalize(hg_handle_t handle); -H5_DLL int H5VL_iod_server_file_create(hg_handle_t handle); -H5_DLL int H5VL_iod_server_file_open(hg_handle_t handle); -H5_DLL int H5VL_iod_server_file_close(hg_handle_t handle); -H5_DLL int H5VL_iod_server_attr_create(hg_handle_t handle); -H5_DLL int H5VL_iod_server_attr_open(hg_handle_t handle); -H5_DLL int H5VL_iod_server_attr_read(hg_handle_t handle); -H5_DLL int H5VL_iod_server_attr_write(hg_handle_t handle); -H5_DLL int H5VL_iod_server_attr_exists(hg_handle_t handle); -H5_DLL int H5VL_iod_server_attr_rename(hg_handle_t handle); -H5_DLL int H5VL_iod_server_attr_remove(hg_handle_t handle); -H5_DLL int H5VL_iod_server_attr_close(hg_handle_t handle); -H5_DLL int H5VL_iod_server_group_create(hg_handle_t handle); -H5_DLL int H5VL_iod_server_group_open(hg_handle_t handle); -H5_DLL int H5VL_iod_server_group_close(hg_handle_t handle); -H5_DLL int H5VL_iod_server_map_create(hg_handle_t handle); -H5_DLL int H5VL_iod_server_map_open(hg_handle_t handle); -H5_DLL int H5VL_iod_server_map_set(hg_handle_t handle); -H5_DLL int H5VL_iod_server_map_get(hg_handle_t handle); -H5_DLL int H5VL_iod_server_map_get_count(hg_handle_t handle); -H5_DLL int H5VL_iod_server_map_exists(hg_handle_t handle); -H5_DLL int H5VL_iod_server_map_delete(hg_handle_t handle); -H5_DLL int H5VL_iod_server_map_close(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dset_create(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dset_open(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dset_read(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dset_get_vl_size(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dset_write(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dset_set_extent(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dset_close(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dtype_commit(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dtype_open(hg_handle_t handle); -H5_DLL int H5VL_iod_server_dtype_close(hg_handle_t handle); -H5_DLL int H5VL_iod_server_cancel_op(hg_handle_t handle); -H5_DLL int H5VL_iod_server_link_create(hg_handle_t handle); -H5_DLL int H5VL_iod_server_link_move(hg_handle_t handle); -H5_DLL int H5VL_iod_server_link_exists(hg_handle_t handle); -H5_DLL int H5VL_iod_server_link_get_info(hg_handle_t handle); -H5_DLL int H5VL_iod_server_link_get_val(hg_handle_t handle); -H5_DLL int H5VL_iod_server_link_remove(hg_handle_t handle); -H5_DLL int H5VL_iod_server_link_iterate(hg_handle_t handle); -H5_DLL int H5VL_iod_server_object_open_by_token(hg_handle_t handle); -H5_DLL int H5VL_iod_server_object_open(hg_handle_t handle); -H5_DLL int H5VL_iod_server_object_copy(hg_handle_t handle); -H5_DLL int H5VL_iod_server_object_visit(hg_handle_t handle); -H5_DLL int H5VL_iod_server_object_exists(hg_handle_t handle); -H5_DLL int H5VL_iod_server_object_set_comment(hg_handle_t handle); -H5_DLL int H5VL_iod_server_object_get_comment(hg_handle_t handle); -H5_DLL int H5VL_iod_server_object_get_info(hg_handle_t handle); -H5_DLL int H5VL_iod_server_rcxt_acquire(hg_handle_t handle); -H5_DLL int H5VL_iod_server_rcxt_release(hg_handle_t handle); -H5_DLL int H5VL_iod_server_rcxt_persist(hg_handle_t handle); -H5_DLL int H5VL_iod_server_rcxt_snapshot(hg_handle_t handle); -H5_DLL int H5VL_iod_server_trans_start(hg_handle_t handle); -H5_DLL int H5VL_iod_server_trans_finish(hg_handle_t handle); -H5_DLL int H5VL_iod_server_trans_set_dependency(hg_handle_t handle); -H5_DLL int H5VL_iod_server_trans_skip(hg_handle_t handle); -H5_DLL int H5VL_iod_server_trans_abort(hg_handle_t handle); -H5_DLL int H5VL_iod_server_prefetch(hg_handle_t handle); -H5_DLL int H5VL_iod_server_evict(hg_handle_t handle); -H5_DLL int H5VL_iod_server_view_create(hg_handle_t handle); - H5_DLL void H5VL_iod_server_analysis_execute_cb(AXE_engine_t axe_engine, size_t num_n_parents, AXE_task_t n_parents[], size_t num_s_parents, AXE_task_t s_parents[], diff --git a/src/H5VLiod_trans.c b/src/H5VLiod_trans.c index 145f95c..083d753 100644 --- a/src/H5VLiod_trans.c +++ b/src/H5VLiod_trans.c @@ -180,6 +180,8 @@ done: HG_Handler_start_output(op_data->hg_handle, &output); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (rc_acquire_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -223,6 +225,8 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) fprintf(stderr, "Failed to Release Read context\n"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (rc_release_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -331,6 +335,8 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) fprintf(stderr, "Failed to Persist Read context\n"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (rc_persist_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -376,6 +382,8 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) fprintf(stderr, "Failed to Snapshot Read context\n"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (rc_snapshot_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -433,6 +441,8 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) fprintf(stderr, "Failed to Start Transaction\n"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (tr_start_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -546,6 +556,8 @@ done: iod_obj_close(oidkv_oh, NULL, NULL); } + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (tr_finish_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -595,6 +607,8 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) fprintf(stderr, "Failed to Set_Dependency between Transactions\n"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (tr_set_depend_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -645,6 +659,8 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) fprintf(stderr, "Failed to Skip Transaction\n"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (tr_skip_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -695,6 +711,8 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) fprintf(stderr, "Failed to Abort Transaction\n"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (tr_abort_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -752,6 +770,8 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &replica_id)) fprintf(stderr, "Failed to Prefetch Object\n"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (prefetch_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -779,13 +799,16 @@ H5VL_iod_server_evict_cb(AXE_engine_t UNUSED axe_engine, { op_data_t *op_data = (op_data_t *)_op_data; evict_in_t *input = (evict_in_t *)op_data->input; - //iod_handle_t coh = input->coh; /* the container handle */ + iod_handle_t coh = input->coh; /* the container handle */ iod_trans_id_t tid = input->rcxt_num; iod_handles_t iod_oh = input->iod_oh; /* object handle */ iod_obj_id_t iod_id = input->iod_id; /* OID */ + iod_obj_id_t mdkv_id = input->mdkv_id; /* OID */ + iod_obj_id_t attrkv_id = input->attrkv_id; /* OID */ //H5I_type_t obj_type = input->obj_type; //hid_t apl_id = input->apl_id; iod_trans_id_t replica_id = input->replica_id; + iod_handle_t mdkv_oh, attrkv_oh; iod_ret_t ret; herr_t ret_value = SUCCEED; @@ -797,6 +820,41 @@ H5VL_iod_server_evict_cb(AXE_engine_t UNUSED axe_engine, else { fprintf(stderr, "Evict Object (OID %"PRIx64" OH %"PRIu64") at Version %"PRIu64"\n", iod_id, iod_oh.rd_oh.cookie, tid); + + /* open the metadata KV */ + ret = iod_obj_open_read(coh, mdkv_id, tid, NULL, &mdkv_oh, NULL); + if(ret < 0) + HGOTO_ERROR_FF(ret, "can't open metadata KV"); + + ret = iod_obj_purge(mdkv_oh, tid, NULL, NULL); + if(ret < 0) { + iod_obj_close(mdkv_oh, NULL, NULL); + HGOTO_ERROR_FF(ret, "can't evict object"); + } + + /* close the metadata KV */ + ret = iod_obj_close(mdkv_oh, NULL, NULL); + if(ret < 0) + HGOTO_ERROR_FF(ret, "can't close object"); + + if(IOD_OBJ_INVALID != attrkv_id) { + /* open the attribute KV */ + ret = iod_obj_open_read(coh, attrkv_id, tid, NULL, &attrkv_oh, NULL); + if(ret < 0) + HGOTO_ERROR_FF(ret, "can't open metadata KV"); + + ret = iod_obj_purge(attrkv_oh, tid, NULL, NULL); + if(ret < 0) { + iod_obj_close(attrkv_oh, NULL, NULL); + HGOTO_ERROR_FF(ret, "can't evict object"); + } + + /* close the attribute KV */ + ret = iod_obj_close(attrkv_oh, NULL, NULL); + if(ret < 0) + HGOTO_ERROR_FF(ret, "can't close object"); + } + ret = iod_obj_purge(iod_oh.rd_oh, tid, NULL, NULL); } @@ -811,6 +869,8 @@ done: if(HG_SUCCESS != HG_Handler_start_output(op_data->hg_handle, &ret_value)) fprintf(stderr, "Failed to Evict Object\n"); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (evict_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); diff --git a/src/H5VLiod_view.c b/src/H5VLiod_view.c index e77a792..b1832ab 100644 --- a/src/H5VLiod_view.c +++ b/src/H5VLiod_view.c @@ -198,6 +198,8 @@ done: if(output.attr_info.tokens) free(output.attr_info.tokens); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (view_create_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -516,6 +518,8 @@ done: if(ret_value < 0) HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (view_create_in_t *)H5MM_xfree(input); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -594,6 +598,8 @@ done: if(ret_value < 0) HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (view_create_in_t *)H5MM_xfree(input); output = (view_create_out_t *)H5MM_xfree(output); op_data = (op_data_t *)H5MM_xfree(op_data); @@ -650,6 +656,8 @@ done: if(ret_value < 0) HG_Handler_start_output(op_data->hg_handle, &ret_value); + HG_Handler_free_input(op_data->hg_handle, input); + HG_Handler_free(op_data->hg_handle); input = (object_op_in_t *)H5MM_xfree(input); //op_data = (op_data_t *)H5MM_xfree(op_data); |