From 0f9e1cd95bcc22374e1e444267cb72b1cc8ee299 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Fri, 23 Aug 2013 14:24:52 -0500 Subject: [svn-r24065] - refactor code for client FF plugin to help usage of global linked list for AXE tasks. - Add a global linked list to hold all AXE tasks created (across multiple containers) - Add additional payload to all operations forwarded to the server to include a start and count of AXE IDs to finish. ( Finishing the AXE tasks is not done yet ) --- src/H5VLiod.c | 3571 +++++++++++--------------------------------------- src/H5VLiod_client.c | 11 +- src/H5VLiod_client.h | 19 +- src/H5VLiod_common.h | 193 +-- src/H5VLiod_dset.c | 2 +- src/H5VLiod_encdec.c | 26 + src/H5VLiod_server.c | 188 +-- 7 files changed, 1004 insertions(+), 3006 deletions(-) diff --git a/src/H5VLiod.c b/src/H5VLiod.c index 526d322..80b51cd 100644 --- a/src/H5VLiod.c +++ b/src/H5VLiod.c @@ -91,6 +91,13 @@ static hg_id_t H5VL_OBJECT_GET_COMMENT_ID; static hg_id_t H5VL_OBJECT_GET_INFO_ID; static hg_id_t H5VL_CANCEL_OP_ID; +static na_addr_t PEER; +static na_class_t *network_class = NULL; + +static uint64_t g_axe_id; +static uint64_t axe_bound; +static H5VL_iod_axe_list_t axe_list; + /* Prototypes */ static void *H5VL_iod_fapl_copy(const void *_old_fa); static herr_t H5VL_iod_fapl_free(void *_fa); @@ -175,12 +182,6 @@ H5FL_DEFINE(H5VL_iod_map_t); H5FL_DEFINE(H5VL_iod_dset_t); H5FL_DEFINE(H5VL_iod_dtype_t); -static na_addr_t PEER; -static na_class_t *network_class = NULL; - -static uint64_t axe_id; -static uint64_t axe_bound; - static H5VL_class_t H5VL_iod_g = { IOD, "iod", /* name */ @@ -303,6 +304,164 @@ H5VL_iod_init(void) FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_init() */ +herr_t +H5VL__iod_request_remove_from_axe_list(H5VL_iod_request_t *request) +{ + H5VL_iod_request_t *prev; + H5VL_iod_request_t *next; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(request); + + prev = request->global_prev; + next = request->global_next; + + if (prev) { + if (next) { + prev->global_next = next; + next->global_prev = prev; + } + else { + prev->global_next = NULL; + axe_list.tail = prev; + } + } + else { + if (next) { + next->global_prev = NULL; + axe_list.head = next; + } + else { + axe_list.head = NULL; + axe_list.tail = NULL; + } + } + + request->global_prev = NULL; + request->global_next = NULL; + //request = (H5VL_iod_request_t *)H5MM_xfree(request); + + FUNC_LEAVE_NOAPI(SUCCEED) +} + +herr_t +H5VL__iod_request_add_to_axe_list(H5VL_iod_request_t *request) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(request); + + if (axe_list.tail) { + axe_list.tail->global_next = request; + request->global_prev = axe_list.tail; + axe_list.tail = request; + } + else { + axe_list.head = request; + axe_list.tail = request; + request->global_prev = NULL; + } + + request->global_next = NULL; + request->rc ++; + + /* process axe_list */ + while(axe_list.head && 1 == axe_list.head->rc && + axe_list.head->axe_id == axe_list.last_released_task+1) { + + axe_list.last_released_task = axe_list.head->axe_id; + + /* remove head from axe list */ + H5VL__iod_request_remove_from_axe_list(axe_list.head); + } + + FUNC_LEAVE_NOAPI(SUCCEED) +} + +herr_t +H5VL__iod_create_and_forward(hg_id_t op_id, H5RQ_type_t op_type, + H5VL_iod_object_t *request_obj, htri_t track, + void *input, void *output, void *data, void **req) +{ + hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ + hg_request_t *hg_req = NULL; + H5VL_iod_request_t _request; /* Local request, for sync. operations */ + H5VL_iod_request_t *request = NULL; + hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ + axe_t *axe_info = (axe_t *) input; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* get a function shipper request */ + if(do_async) { + if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate a HG request"); + } /* end if */ + else + hg_req = &_hg_req; + + /* Get async request for operation */ + if(do_async) { + if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); + } /* end if */ + else + request = &_request; + + /* Set up request */ + HDmemset(request, 0, sizeof(*request)); + request->type = op_type; + request->data = data; + request->req = hg_req; + request->rc = 1; + request->obj = request_obj; + request->axe_id = axe_info->axe_id; + request->next = request->prev = NULL; + request->global_next = request->global_prev = NULL; + + /* add request to container's linked list */ + H5VL_iod_request_add(request_obj->file, request); + + axe_info->start_range = axe_list.last_released_task; + /* add request to global axe's linked list */ + H5VL__iod_request_add_to_axe_list(request); + axe_info->count = axe_list.last_released_task - axe_info->start_range; + + /* forward the call to the ION */ + if(HG_Forward(PEER, op_id, input, output, hg_req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship file create"); + + /* Store/wait on request */ + if(do_async) { + /* Sanity check */ + HDassert(request != &_request); + + *req = request; + + /* Track request */ + if(track) + request_obj->request = request; + } /* end if */ + else { + if(track) + request_obj->request = NULL; + + /* Synchronously wait on the request */ + if(H5VL_iod_request_wait(request_obj->file, request) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on HG request"); + + H5VL__iod_request_remove_from_axe_list(request); + + /* Sanity check */ + HDassert(request == &_request); + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} + /*------------------------------------------------------------------------- * Function: EFF_init @@ -334,9 +493,13 @@ EFF_init(MPI_Comm comm, MPI_Info UNUSED info) operation. Each process owns a portion of the ID space and uses that space incrementally. */ axe_seed = (pow(2.0,64.0) - 1) / num_procs; - axe_id = axe_seed * my_rank + 1; + g_axe_id = axe_seed * my_rank + 1; axe_bound = axe_seed * (my_rank + 1); + axe_list.last_released_task = g_axe_id - 1; + axe_list.head = NULL; + axe_list.tail = NULL; + /* This is a temporary solution for connecting to the server using mercury */ if ((config = fopen("port.cfg", "r")) != NULL) { @@ -909,12 +1072,7 @@ H5VL_iod_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl H5VL_iod_fapl_t *fa = NULL; H5P_genplist_t *plist; /* Property list pointer */ H5VL_iod_file_t *file = NULL; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; file_create_in_t input; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -951,25 +1109,14 @@ H5VL_iod_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl input.flags = flags; input.fcpl_id = fcpl_id; input.fapl_id = fapl_id; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; #if H5VL_IOD_DEBUG printf("File Create %s IOD ROOT ID %llu, axe id %llu\n", - name, input.root_id, input.axe_id); + name, input.root_id, input.axe_info.axe_id); #endif - /* forward the call to the ION */ - if(HG_Forward(PEER, H5VL_FILE_CREATE_ID, &input, &file->remote_file, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship file create"); - /* create the file object that is passed to the API layer */ file->file_name = HDstrdup(name); file->flags = flags; @@ -989,46 +1136,10 @@ H5VL_iod_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl file->common.obj_name[1] = '\0'; file->common.file = file; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_FILE_CREATE; - request->data = file; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)file; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - file->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't wait on HG request"); - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - file->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_FILE_CREATE_ID, HG_FILE_CREATE, + (H5VL_iod_object_t *)file, 1, + &input, &file->remote_file, file, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship file create"); ret_value = (void *)file; @@ -1085,24 +1196,12 @@ H5VL_iod_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_i input.name = name; input.flags = flags; input.fapl_id = fapl_id; - input.axe_id = axe_id ++; - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG - printf("File Open %s axe id %llu\n", name, input.axe_id); + printf("File Open %s axe id %llu\n", name, input.axe_info.axe_id); #endif - /* forward the call to the server */ - if(HG_Forward(PEER, H5VL_FILE_OPEN_ID, &input, &file->remote_file, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship file create"); - /* create the file object that is passed to the API layer */ MPI_Comm_rank(fa->comm, &file->my_rank); MPI_Comm_size(fa->comm, &file->num_procs); @@ -1122,46 +1221,10 @@ H5VL_iod_file_open(const char *name, unsigned flags, hid_t fapl_id, hid_t dxpl_i file->common.obj_name[1] = '\0'; file->common.file = file; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_FILE_OPEN; - request->data = file; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)file; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - file->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't wait on HG request"); - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - file->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_FILE_OPEN_ID, HG_FILE_OPEN, + (H5VL_iod_object_t *)file, 1, + &input, &file->remote_file, file, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship file open"); ret_value = (void *)file; @@ -1189,13 +1252,8 @@ H5VL_iod_file_flush(void *_obj, H5VL_loc_params_t loc_params, H5F_scope_t scope, { H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; H5VL_iod_file_t *file = obj->file; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; int *status; file_flush_in_t input; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1203,59 +1261,15 @@ H5VL_iod_file_flush(void *_obj, H5VL_loc_params_t loc_params, H5F_scope_t scope, /* set the input structure for the HG encode routine */ input.coh = file->remote_file.coh; input.scope = scope; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; /* allocate an integer to receive the return value if the file close succeeded or not */ status = (int *)malloc(sizeof(int)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the ION */ - if(HG_Forward(PEER, H5VL_FILE_FLUSH_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "failed to ship file close"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_FILE_FLUSH; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)file; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - file->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_FILE_FLUSH_ID, HG_FILE_FLUSH, + (H5VL_iod_object_t *)file, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship file flush"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1280,10 +1294,6 @@ H5VL_iod_file_get(void *_obj, H5VL_file_get_t get_type, hid_t dxpl_id, void **re { H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; H5VL_iod_file_t *file = obj->file; - hg_request_t *hg_req; - int *status; - H5VL_iod_request_t *request; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1484,19 +1494,14 @@ H5VL_iod_file_close(void *_file, hid_t dxpl_id, void **req) { H5VL_iod_file_t *file = (H5VL_iod_file_t *)_file; file_close_in_t input; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; int *status; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* If this call is not asynchronous, complete and remove all requests that are associated with this object from the List */ - if(!do_async) { + if(NULL == req) { if(H5VL_iod_request_wait_all(file) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on all object requests"); } @@ -1504,67 +1509,23 @@ H5VL_iod_file_close(void *_file, hid_t dxpl_id, void **req) /* allocate an integer to receive the return value if the file close succeeded or not */ status = (int *)malloc(sizeof(int)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - input.coh = file->remote_file.coh; input.root_oh = file->remote_file.root_oh; input.root_id = file->remote_file.root_id; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG - printf("File Close Root ID %llu axe id %llu\n", input.root_id, input.axe_id); + printf("File Close Root ID %llu axe id %llu\n", input.root_id, input.axe_info.axe_id); #endif - /* forward the call to the ION */ - if(HG_Forward(PEER, H5VL_FILE_CLOSE_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "failed to ship file close"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; + if(H5VL__iod_create_and_forward(H5VL_FILE_CLOSE_ID, HG_FILE_CLOSE, + (H5VL_iod_object_t *)file, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship file close"); - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_FILE_CLOSE; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)file; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - file->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_iod_file_close() */ +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_file_close() */ /*------------------------------------------------------------------------- @@ -1593,11 +1554,6 @@ H5VL_iod_group_create(void *_obj, H5VL_loc_params_t loc_params, const char *name iod_handle_t iod_oh; uint64_t parent_axe_id; char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -1642,25 +1598,13 @@ H5VL_iod_group_create(void *_obj, H5VL_loc_params_t loc_params, const char *name input.gcpl_id = gcpl_id; input.gapl_id = gapl_id; input.lcpl_id = lcpl_id; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Group Create %s, IOD ID %llu, axe id %llu, parent %llu\n", - new_name, input.grp_id, input.axe_id, input.parent_axe_id); + new_name, input.grp_id, input.axe_info.axe_id, input.parent_axe_id); #endif - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_GROUP_CREATE_ID, &input, &grp->remote_group, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship group create"); - /* setup the local group struct */ /* store the entire path of the group locally */ { @@ -1684,51 +1628,16 @@ H5VL_iod_group_create(void *_obj, H5VL_loc_params_t loc_params, const char *name grp->common.file = obj->file; grp->common.file->nopen_objs ++; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_GROUP_CREATE; - request->data = grp; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)grp; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - grp->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "can't wait on HG request") - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - grp->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_GROUP_CREATE_ID, HG_GROUP_CREATE, + (H5VL_iod_object_t *)grp, 1, + &input, &grp->remote_group, grp, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship group create"); ret_value = (void *)grp; done: - if(new_name) free(new_name); + if(new_name) + free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_group_create() */ @@ -1757,11 +1666,6 @@ H5VL_iod_group_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, iod_handle_t iod_oh; uint64_t parent_axe_id; char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ group_open_in_t input; void *ret_value = NULL; @@ -1787,25 +1691,13 @@ H5VL_iod_group_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, input.parent_axe_id = parent_axe_id; input.name = new_name; input.gapl_id = gapl_id; - input.axe_id = axe_id ++; - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Group Open %s LOC ID %llu, axe id %llu, parent %llu\n", - new_name, input.loc_id, input.axe_id, input.parent_axe_id); + new_name, input.loc_id, input.axe_info.axe_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_GROUP_OPEN_ID, &input, &grp->remote_group, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship group open"); - /* setup the local group struct */ /* store the entire path of the group locally */ { @@ -1827,51 +1719,16 @@ H5VL_iod_group_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, grp->common.file = obj->file; grp->common.file->nopen_objs ++; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_GROUP_OPEN; - request->data = grp; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)grp; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - grp->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "can't wait on HG request") - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - grp->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_GROUP_OPEN_ID, HG_GROUP_OPEN, + (H5VL_iod_object_t *)grp, 1, + &input, &grp->remote_group, grp, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship group open"); ret_value = (void *)grp; done: - if(new_name) free(new_name); + if(new_name) + free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_group_open() */ @@ -1942,18 +1799,13 @@ H5VL_iod_group_close(void *_grp, hid_t dxpl_id, void **req) H5VL_iod_group_t *grp = (H5VL_iod_group_t *)_grp; group_close_in_t input; int *status; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* If this call is not asynchronous, complete and remove all requests that are associated with this object from the List */ - if(!do_async) { + if(NULL == req) { if(H5VL_iod_request_wait_some(grp->common.file, grp) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on all object requests"); } @@ -1961,14 +1813,6 @@ H5VL_iod_group_close(void *_grp, hid_t dxpl_id, void **req) /* allocate an integer to receive the return value if the group close succeeded or not */ status = (int *)malloc(sizeof(int)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - /* set the parent axe id */ if(grp->common.request) input.parent_axe_id = grp->common.request->axe_id; @@ -1978,53 +1822,17 @@ H5VL_iod_group_close(void *_grp, hid_t dxpl_id, void **req) input.iod_oh = grp->remote_group.iod_oh; input.iod_id = grp->remote_group.iod_id; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Group Close IOD ID %llu, axe id %llu\n", - input.iod_id, input.axe_id); + input.iod_id, input.axe_info.axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_GROUP_CLOSE_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "failed to ship group close"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_GROUP_CLOSE; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)grp; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(grp->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - grp->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(grp->common.file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_GROUP_CLOSE_ID, HG_GROUP_CLOSE, + (H5VL_iod_object_t *)grp, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship group close"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2056,12 +1864,7 @@ H5VL_iod_dataset_create(void *_obj, H5VL_loc_params_t loc_params, const char *na iod_handle_t iod_oh; uint64_t parent_axe_id; char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; hid_t type_id, space_id, lcpl_id; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -2111,25 +1914,13 @@ H5VL_iod_dataset_create(void *_obj, H5VL_loc_params_t loc_params, const char *na input.lcpl_id = lcpl_id; input.type_id = type_id; input.space_id = space_id; - input.axe_id = axe_id ++; - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Dataset Create %s IOD ID %llu, axe id %llu, parent %llu\n", - new_name, input.dset_id, input.axe_id, input.parent_axe_id); + new_name, input.dset_id, input.axe_info.axe_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_DSET_CREATE_ID, &input, &dset->remote_dset, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship dataset create"); - /* setup the local dataset struct */ /* store the entire path of the dataset locally */ { @@ -2158,51 +1949,15 @@ H5VL_iod_dataset_create(void *_obj, H5VL_loc_params_t loc_params, const char *na dset->common.file = obj->file; dset->common.file->nopen_objs ++; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_DSET_CREATE; - request->data = dset; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)dset; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - dset->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't wait on HG request"); - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - dset->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_DSET_CREATE_ID, HG_DSET_CREATE, (H5VL_iod_object_t *)dset, 1, + &input, &dset->remote_dset, dset, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship dataset create"); ret_value = (void *)dset; done: - if(new_name) free(new_name); + if(new_name) + free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_dataset_create() */ @@ -2263,25 +2018,13 @@ H5VL_iod_dataset_open(void *_obj, H5VL_loc_params_t loc_params, const char *name input.parent_axe_id = parent_axe_id; input.name = new_name; input.dapl_id = dapl_id; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Dataset Open %s LOC ID %llu, axe id %llu, parent %llu\n", - new_name, input.loc_id, input.axe_id, input.parent_axe_id); + new_name, input.loc_id, input.axe_info.axe_id, input.parent_axe_id); #endif - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_DSET_OPEN_ID, &input, &dset->remote_dset, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship dataset open"); - /* setup the local dataset struct */ /* store the entire path of the dataset locally */ { @@ -2295,11 +2038,6 @@ H5VL_iod_dataset_open(void *_obj, H5VL_loc_params_t loc_params, const char *name dset->common.obj_name[obj_name_len+name_len] = '\0'; } -#if H5VL_IOD_DEBUG - printf("Dataset Open %s LOC ID %llu, axe id %llu, parent %llu\n", - dset->common.obj_name, input.loc_id, input.axe_id, input.parent_axe_id); -#endif - if((dset->dapl_id = H5Pcopy(dapl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy dapl"); @@ -2308,51 +2046,15 @@ H5VL_iod_dataset_open(void *_obj, H5VL_loc_params_t loc_params, const char *name dset->common.file = obj->file; dset->common.file->nopen_objs ++; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_DSET_OPEN; - request->data = dset; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)dset; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - dset->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't wait on HG request"); - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - dset->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_DSET_OPEN_ID, HG_DSET_OPEN, (H5VL_iod_object_t *)dset, 1, + &input, &dset->remote_dset, dset, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship dataset open"); ret_value = (void *)dset; done: - if(new_name) free(new_name); + if(new_name) + free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_dataset_open() */ @@ -2378,11 +2080,7 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, dset_io_in_t input; dset_get_vl_size_in_t input_vl; H5P_genplist_t *plist; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; hg_bulk_t *bulk_handle = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; H5VL_iod_read_status_t *status = NULL; const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; @@ -2392,7 +2090,6 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, H5VL_iod_io_info_t *info = NULL; hbool_t is_vl_data = FALSE; uint64_t parent_axe_id; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -2460,14 +2157,6 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, bulk_handle, &is_vl_data) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't generate read parameters"); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - if(!is_vl_data) { /* Fill input structure for reading data */ input.coh = dset->common.file->remote_file.coh; @@ -2479,7 +2168,7 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, input.space_id = file_space_id; input.dset_type_id = dset->remote_dset.type_id; input.mem_type_id = mem_type_id; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; input.parent_axe_id = parent_axe_id; } else { @@ -2490,7 +2179,7 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, input_vl.dxpl_id = dxpl_id; input_vl.space_id = file_space_id; input_vl.mem_type_id = mem_type_id; - input_vl.axe_id = axe_id ++; + input_vl.axe_info.axe_id = g_axe_id ++; input_vl.parent_axe_id = parent_axe_id; } @@ -2501,22 +2190,12 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, #if H5VL_IOD_DEBUG if(!is_vl_data) printf("Dataset Read, axe id %llu, parent %llu\n", - input.axe_id, input.parent_axe_id); + input.axe_info.axe_id, input.parent_axe_id); else printf("Dataset GET size, axe id %llu, parent %llu\n", - input_vl.axe_id, input_vl.parent_axe_id); + input_vl.axe_info.axe_id, input_vl.parent_axe_id); #endif - /* forward the call to the IONs */ - if(!is_vl_data) { - if(HG_Forward(PEER, H5VL_DSET_READ_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship dataset read"); - } - else { - if(HG_Forward(PEER, H5VL_DSET_GET_VL_SIZE_ID, &input_vl, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship dataset get VL size"); - } - /* setup info struct for I/O request. This is to manage the I/O operation once the wait is called. */ if(NULL == (info = (H5VL_iod_io_info_t *)H5MM_calloc(sizeof(H5VL_iod_io_info_t)))) @@ -2549,55 +2228,24 @@ H5VL_iod_dataset_read(void *_dset, hid_t mem_type_id, hid_t mem_space_id, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy datatype"); if(NULL == (info->dxpl_id = H5P_copy_plist((H5P_genplist_t *)plist, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy dxpl"); - info->axe_id = axe_id++; + info->axe_id = g_axe_id ++; info->peer = PEER; info->read_id = H5VL_DSET_READ_ID; } - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - + /* forward the call to the IONs */ if(!is_vl_data) { - request->type = HG_DSET_READ; + if(H5VL__iod_create_and_forward(H5VL_DSET_READ_ID, HG_DSET_READ, (H5VL_iod_object_t *)dset, 0, + &input, status, info, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship dataset read"); } else { - request->type = HG_DSET_GET_VL_SIZE; + if(H5VL__iod_create_and_forward(H5VL_DSET_GET_VL_SIZE_ID, HG_DSET_GET_VL_SIZE, + (H5VL_iod_object_t *)dset, 0, + &input_vl, status, info, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship dataset get VL size"); } - request->data = info; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)dset; - request->status = 0; - request->state = 0; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(dset->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - } /* end if */ - else { - /* Sanity check */ - HDassert(request == &_request); - - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(dset->common.file, request) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't wait on HG request"); - } /* end else */ - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_dataset_read() */ @@ -2623,11 +2271,7 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, H5VL_iod_dset_t *dset = (H5VL_iod_dset_t *)_dset; dset_io_in_t input; H5P_genplist_t *plist; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; hg_bulk_t *bulk_handle = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; char fake_char; @@ -2639,7 +2283,6 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, uint64_t parent_axe_id; uint32_t internal_cs; /* internal checksum calculated in this function */ size_t *vl_string_len = NULL; /* array that will contain lengths of strings if the datatype is a VL string type */ - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -2722,27 +2365,15 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, input.space_id = file_space_id; input.dset_type_id = dset->remote_dset.type_id; input.mem_type_id = mem_type_id; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; status = (int *)malloc(sizeof(int)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - #if H5VL_IOD_DEBUG printf("Dataset Write, axe id %llu, parent %llu\n", - input.axe_id, input.parent_axe_id); + input.axe_info.axe_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_DSET_WRITE_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship dataset write"); - /* setup info struct for I/O request This is to manage the I/O operation once the wait is called. */ if(NULL == (info = (H5VL_iod_io_info_t *)H5MM_calloc(sizeof(H5VL_iod_io_info_t)))) @@ -2752,40 +2383,10 @@ H5VL_iod_dataset_write(void *_dset, hid_t mem_type_id, hid_t mem_space_id, info->bulk_handle = bulk_handle; info->vl_string_len = vl_string_len; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_DSET_WRITE; - request->data = info; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)dset; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(dset->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - } /* end if */ - else { - /* Sanity check */ - HDassert(request == &_request); - - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(dset->common.file, request) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't wait on HG request"); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_DSET_WRITE_ID, HG_DSET_WRITE, + (H5VL_iod_object_t *)dset, 0, + &input, status, info, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship dataset write"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2812,11 +2413,6 @@ H5VL_iod_dataset_set_extent(void *_dset, const hsize_t size[], hid_t dxpl_id, vo dset_set_extent_in_t input; iod_obj_id_t iod_id; iod_handle_t iod_oh; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ int *status = NULL; uint64_t parent_axe_id; size_t num_parents; @@ -2852,14 +2448,14 @@ H5VL_iod_dataset_set_extent(void *_dset, const hsize_t size[], hid_t dxpl_id, vo input.dims.size = size; input.parent_axe_ids.count = num_parents; input.parent_axe_ids.ids = axe_parents; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG { size_t i; printf("Dataset Set Extent, axe id %llu, %d parents: ", - input.axe_id, num_parents); + input.axe_info.axe_id, num_parents); for(i=0 ; itype = HG_DSET_SET_EXTENT; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)dset; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(dset->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - dset->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(dset->common.file, request) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_DSET_SET_EXTENT_ID, HG_DSET_SET_EXTENT, + (H5VL_iod_object_t *)dset, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship dataset set_extent"); /* modify the local dataspace of the dataset */ { @@ -2924,7 +2476,7 @@ H5VL_iod_dataset_set_extent(void *_dset, const hsize_t size[], hid_t dxpl_id, vo hsize_t curr_dims[H5O_LAYOUT_NDIMS];/* Current dimension sizes */ if(NULL == (space = (H5S_t *)H5I_object_verify(dset->remote_dset.space_id, - H5I_DATASPACE))) + H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space"); /* Check if we are shrinking or expanding any of the dimensions */ @@ -3046,13 +2598,8 @@ H5VL_iod_dataset_close(void *_dset, hid_t dxpl_id, void **req) H5VL_iod_dset_t *dset = (H5VL_iod_dset_t *)_dset; dset_close_in_t input; int *status; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; size_t num_parents; uint64_t *axe_parents = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -3068,7 +2615,7 @@ H5VL_iod_dataset_close(void *_dset, hid_t dxpl_id, void **req) /* If this call is not asynchronous, complete and remove all requests that are associated with this object from the List */ - if(!do_async) { + if(NULL == req) { if(H5VL_iod_request_wait_some(dset->common.file, dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't wait on all object requests"); } @@ -3083,75 +2630,30 @@ H5VL_iod_dataset_close(void *_dset, hid_t dxpl_id, void **req) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get AXE parents"); } - status = (int *)malloc(sizeof(int)); - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - input.iod_oh = dset->remote_dset.iod_oh; input.iod_id = dset->remote_dset.iod_id; input.parent_axe_ids.count = num_parents; input.parent_axe_ids.ids = axe_parents; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG { size_t i; printf("Dataset Close %s, axe id %llu, %d parents: ", - dset->common.obj_name, input.axe_id, num_parents); + dset->common.obj_name, input.axe_info.axe_id, num_parents); for(i=0 ; itype = HG_DSET_CLOSE; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)dset; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(dset->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - dset->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(dset->common.file, request) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't wait on HG request"); + status = (int *)malloc(sizeof(int)); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_DSET_CLOSE_ID, HG_DSET_CLOSE, + (H5VL_iod_object_t *)dset, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship dataset close"); done: axe_parents = (uint64_t *)H5MM_xfree(axe_parents); @@ -3184,12 +2686,7 @@ H5VL_iod_datatype_commit(void *_obj, H5VL_loc_params_t loc_params, const char *n iod_obj_id_t iod_id; iod_handle_t iod_oh; char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; uint64_t parent_axe_id; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -3226,25 +2723,13 @@ H5VL_iod_datatype_commit(void *_obj, H5VL_loc_params_t loc_params, const char *n input.tapl_id = tapl_id; input.lcpl_id = lcpl_id; input.type_id = type_id; - input.axe_id = axe_id ++; - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Datatype Commit %s IOD ID %llu, axe id %llu, parent %llu\n", - new_name, input.dtype_id, input.axe_id, input.parent_axe_id); + new_name, input.dtype_id, input.axe_info.axe_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_DTYPE_COMMIT_ID, &input, &dtype->remote_dtype, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship dataset create"); - /* setup the local datatype struct */ /* store the entire path of the datatype locally */ { @@ -3271,46 +2756,10 @@ H5VL_iod_datatype_commit(void *_obj, H5VL_loc_params_t loc_params, const char *n dtype->common.file = obj->file; dtype->common.file->nopen_objs ++; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_DTYPE_COMMIT; - request->data = dtype; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)dtype; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - dtype->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't wait on HG request"); - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - dtype->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_DTYPE_COMMIT_ID, HG_DTYPE_COMMIT, + (H5VL_iod_object_t *)dtype, 1, + &input, &dtype->remote_dtype, dtype, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship datatype commit"); ret_value = (void *)dtype; done: @@ -3342,12 +2791,7 @@ H5VL_iod_datatype_open(void *_obj, H5VL_loc_params_t loc_params, const char *nam iod_obj_id_t iod_id; iod_handle_t iod_oh; char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; uint64_t parent_axe_id; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -3374,25 +2818,13 @@ H5VL_iod_datatype_open(void *_obj, H5VL_loc_params_t loc_params, const char *nam input.parent_axe_id = parent_axe_id; input.name = new_name; input.tapl_id = tapl_id; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Datatype Open %s LOC ID %llu, axe id %llu, parent %llu\n", - new_name, input.loc_id, input.axe_id, input.parent_axe_id); + new_name, input.loc_id, input.axe_info.axe_id, input.parent_axe_id); #endif - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_DTYPE_OPEN_ID, &input, &dtype->remote_dtype, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship datatype open"); - /* setup the local datatype struct */ /* store the entire path of the datatype locally */ { @@ -3414,46 +2846,10 @@ H5VL_iod_datatype_open(void *_obj, H5VL_loc_params_t loc_params, const char *nam dtype->common.file = obj->file; dtype->common.file->nopen_objs ++; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_DTYPE_OPEN; - request->data = dtype; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)dtype; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - dtype->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't wait on HG request"); - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - dtype->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_DTYPE_OPEN_ID, HG_DTYPE_OPEN, + (H5VL_iod_object_t *)dtype, 1, + &input, &dtype->remote_dtype, dtype, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship datatype open"); ret_value = (void *)dtype; @@ -3552,18 +2948,13 @@ H5VL_iod_datatype_close(void *obj, hid_t dxpl_id, void **req) H5VL_iod_dtype_t *dtype = (H5VL_iod_dtype_t *)obj; dtype_close_in_t input; int *status; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* If this call is not asynchronous, complete and remove all requests that are associated with this object from the List */ - if(!do_async) { + if(NULL == req) { if(H5VL_iod_request_wait_some(dtype->common.file, dtype) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on all object requests"); } @@ -3575,65 +2966,21 @@ H5VL_iod_datatype_close(void *obj, hid_t dxpl_id, void **req) input.parent_axe_id = 0; } - status = (int *)malloc(sizeof(int)); - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - input.iod_oh = dtype->remote_dtype.iod_oh; input.iod_id = dtype->remote_dtype.iod_id; - input.axe_id = axe_id ++; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_DTYPE_CLOSE_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "failed to ship dtype close"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_DTYPE_CLOSE; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)dtype; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(dtype->common.file, request); + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Datatype Close %s, axe id %llu, parent %d\n", - dtype->common.obj_name, input.axe_id, input.parent_axe_id); + dtype->common.obj_name, input.axe_info.axe_id, input.parent_axe_id); #endif - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; + status = (int *)malloc(sizeof(int)); - /* Track request */ - dtype->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(dtype->common.file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_DTYPE_CLOSE_ID, HG_DTYPE_CLOSE, + (H5VL_iod_object_t *)dtype, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship datatype open"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -3665,13 +3012,8 @@ H5VL_iod_attribute_create(void *_obj, H5VL_loc_params_t loc_params, const char * iod_handle_t iod_oh; char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ const char *path; /* path on where the traversal starts relative to the location object specified */ - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; hid_t type_id, space_id; uint64_t parent_axe_id; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -3718,22 +3060,9 @@ H5VL_iod_attribute_create(void *_obj, H5VL_loc_params_t loc_params, const char * input.acpl_id = acpl_id; input.type_id = type_id; input.space_id = space_id; - input.axe_id = axe_id ++; - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_ATTR_CREATE_ID, &input, &attr->remote_attr, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship attribute create"); + input.axe_info.axe_id = g_axe_id ++; /* setup the local attribute struct */ - /* store the entire path of the attribute locally */ if(loc_params.type == H5VL_OBJECT_BY_SELF) { path = NULL; @@ -3758,7 +3087,7 @@ H5VL_iod_attribute_create(void *_obj, H5VL_loc_params_t loc_params, const char * #if H5VL_IOD_DEBUG printf("Attribute Create %s IOD ID %llu, axe id %llu, parent %llu\n", - attr_name, input.attr_id, input.axe_id, input.parent_axe_id); + attr_name, input.attr_id, input.axe_info.axe_id, input.parent_axe_id); #endif /* copy property lists, dtype, and dspace*/ @@ -3774,51 +3103,16 @@ H5VL_iod_attribute_create(void *_obj, H5VL_loc_params_t loc_params, const char * attr->common.file = obj->file; attr->common.file->nopen_objs ++; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_ATTR_CREATE; - request->data = attr; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)attr; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - attr->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't wait on HG request"); - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - attr->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_ATTR_CREATE_ID, HG_ATTR_CREATE, + (H5VL_iod_object_t *)attr, 1, + &input, &attr->remote_attr, attr, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship attribute create"); ret_value = (void *)attr; done: - if(new_name) free(new_name); + if(new_name) + free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_attribute_create() */ @@ -3847,12 +3141,7 @@ H5VL_iod_attribute_open(void *_obj, H5VL_loc_params_t loc_params, const char *at const char *path; /* path on where the traversal starts relative to the location object specified */ iod_obj_id_t iod_id; iod_handle_t iod_oh; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; uint64_t parent_axe_id; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -3880,25 +3169,13 @@ H5VL_iod_attribute_open(void *_obj, H5VL_loc_params_t loc_params, const char *at input.parent_axe_id = parent_axe_id; input.path = new_name; input.attr_name = attr_name; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Attribute Open %s LOC ID %llu, axe id %llu, parent %llu\n", - attr_name, input.loc_id, input.axe_id, input.parent_axe_id); + attr_name, input.loc_id, input.axe_info.axe_id, input.parent_axe_id); #endif - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_ATTR_OPEN_ID, &input, &attr->remote_attr, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship attribute open"); - /* setup the local attribute struct */ /* store the entire path of the attribute locally */ @@ -3928,51 +3205,16 @@ H5VL_iod_attribute_open(void *_obj, H5VL_loc_params_t loc_params, const char *at attr->common.file = obj->file; attr->common.file->nopen_objs ++; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_ATTR_OPEN; - request->data = attr; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)attr; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - attr->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't wait on HG request"); - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - attr->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_ATTR_OPEN_ID, HG_ATTR_OPEN, + (H5VL_iod_object_t *)attr, 1, + &input, &attr->remote_attr, attr, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship attribute open"); ret_value = (void *)attr; done: - if(new_name) free(new_name); + if(new_name) + free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_attribute_open() */ @@ -3996,15 +3238,10 @@ H5VL_iod_attribute_read(void *_attr, hid_t type_id, void *buf, hid_t dxpl_id, vo H5VL_iod_attr_t *attr = (H5VL_iod_attr_t *)_attr; attr_io_in_t input; H5P_genplist_t *plist; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; hg_bulk_t *bulk_handle = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; H5VL_iod_read_status_t *status = NULL; size_t size; H5VL_iod_io_info_t *info; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -4041,23 +3278,11 @@ H5VL_iod_attribute_read(void *_attr, hid_t type_id, void *buf, hid_t dxpl_id, vo input.iod_id = attr->remote_attr.iod_id; input.bulk_handle = *bulk_handle; input.type_id = type_id; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; /* allocate structure to receive status of read operation (contains return value and checksum */ status = (H5VL_iod_read_status_t *)malloc(sizeof(H5VL_iod_read_status_t)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_ATTR_READ_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship attribute read"); - /* setup info struct for I/O request. This is to manage the I/O operation once the wait is called. */ if(NULL == (info = (H5VL_iod_io_info_t *)H5MM_malloc(sizeof(H5VL_iod_io_info_t)))) @@ -4065,42 +3290,10 @@ H5VL_iod_attribute_read(void *_attr, hid_t type_id, void *buf, hid_t dxpl_id, vo info->status = status; info->bulk_handle = bulk_handle; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_ATTR_READ; - request->data = info; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)attr; - request->status = 0; - request->state = 0; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(attr->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - } /* end if */ - else { - /* Sanity check */ - HDassert(request == &_request); - - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(attr->common.file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_ATTR_READ_ID, HG_ATTR_READ, + (H5VL_iod_object_t *)attr, 0, + &input, status, info, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship attribute read"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -4126,16 +3319,11 @@ H5VL_iod_attribute_write(void *_attr, hid_t type_id, const void *buf, hid_t dxpl H5VL_iod_attr_t *attr = (H5VL_iod_attr_t *)_attr; attr_io_in_t input; H5P_genplist_t *plist; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; hg_bulk_t *bulk_handle = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; int *status = NULL; size_t size; H5VL_iod_io_info_t *info; uint32_t cs; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -4177,7 +3365,7 @@ H5VL_iod_attribute_write(void *_attr, hid_t type_id, const void *buf, hid_t dxpl input.iod_id = attr->remote_attr.iod_id; input.bulk_handle = *bulk_handle; input.type_id = type_id; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; status = (int *)malloc(sizeof(int)); @@ -4185,18 +3373,6 @@ H5VL_iod_attribute_write(void *_attr, hid_t type_id, const void *buf, hid_t dxpl if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_BADATOM, FAIL, "can't find object for ID") - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_ATTR_WRITE_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship attribute write"); - /* setup info struct for I/O request This is to manage the I/O operation once the wait is called. */ if(NULL == (info = (H5VL_iod_io_info_t *)H5MM_malloc(sizeof(H5VL_iod_io_info_t)))) @@ -4204,40 +3380,10 @@ H5VL_iod_attribute_write(void *_attr, hid_t type_id, const void *buf, hid_t dxpl info->status = status; info->bulk_handle = bulk_handle; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_ATTR_WRITE; - request->data = info; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)attr; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(attr->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - } /* end if */ - else { - /* Sanity check */ - HDassert(request == &_request); - - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(attr->common.file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_ATTR_WRITE_ID, HG_ATTR_WRITE, + (H5VL_iod_object_t *)attr, 0, + &input, status, info, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship attribute write"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -4266,11 +3412,6 @@ H5VL_iod_attribute_remove(void *_obj, H5VL_loc_params_t loc_params, const char * iod_obj_id_t iod_id; iod_handle_t iod_oh; char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ int *status = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -4288,61 +3429,18 @@ H5VL_iod_attribute_remove(void *_obj, H5VL_loc_params_t loc_params, const char * input.loc_oh = iod_oh; input.path = new_name; input.attr_name = attr_name; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; status = (int *)malloc(sizeof(int)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_ATTR_REMOVE_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship attribute remove"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_ATTR_REMOVE; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - obj->request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_ATTR_REMOVE_ID, HG_ATTR_REMOVE, + (H5VL_iod_object_t *)obj, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship attribute remove"); done: - if(new_name) free(new_name); + if(new_name) + free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_attribute_remove() */ @@ -4482,57 +3580,15 @@ H5VL_iod_attribute_get(void *_obj, H5VL_attr_get_t get_type, hid_t dxpl_id, input.loc_oh = iod_oh; input.path = new_name; input.attr_name = attr_name; - input.axe_id = axe_id ++; - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; + input.axe_info.axe_id = g_axe_id ++; - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_ATTR_EXISTS_ID, &input, ret, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship attribute exists"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *) - H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_ATTR_EXISTS; - request->data = ret; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - *req = request; - /* Track request */ - obj->request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_ATTR_EXISTS_ID, HG_ATTR_EXISTS, + (H5VL_iod_object_t *)obj, 1, + &input, ret, ret, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship attribute exists"); - if(new_name) free(new_name); + if(new_name) + free(new_name); break; } /* H5Aget_info */ @@ -4613,7 +3669,7 @@ H5VL_iod_attribute_close(void *_attr, hid_t dxpl_id, void **req) /* If this call is not asynchronous, complete and remove all requests that are associated with this object from the List */ - if(!do_async) { + if(NULL == req) { if(H5VL_iod_request_wait_some(attr->common.file, attr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on all object requests"); } @@ -4630,72 +3686,28 @@ H5VL_iod_attribute_close(void *_attr, hid_t dxpl_id, void **req) status = (int *)malloc(sizeof(int)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - input.iod_oh = attr->remote_attr.iod_oh; input.iod_id = attr->remote_attr.iod_id; input.parent_axe_ids.count = num_parents; input.parent_axe_ids.ids = axe_parents; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG { size_t i; printf("Attribute Close, axe id %llu, %d parents: ", - input.axe_id, num_parents); + input.axe_info.axe_id, num_parents); for(i=0 ; itype = HG_ATTR_CLOSE; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)attr; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(attr->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - attr->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(attr->common.file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_ATTR_CLOSE_ID, HG_ATTR_CLOSE, + (H5VL_iod_object_t *)attr, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship attribute close"); done: axe_parents = (uint64_t *)H5MM_xfree(axe_parents); @@ -4724,11 +3736,6 @@ H5VL_iod_link_create(H5VL_link_create_type_t create_type, void *_obj, H5VL_loc_p H5VL_iod_object_t *cur_obj = NULL; link_create_in_t input; int *status; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ H5P_genplist_t *plist; /* Property list pointer */ char *loc_name = NULL, *new_name = NULL; char *link_value = NULL; /* Value of soft link */ @@ -4785,12 +3792,14 @@ H5VL_iod_link_create(H5VL_link_create_type_t create_type, void *_obj, H5VL_loc_p input.lapl_id = lapl_id; input.loc_name = loc_name; input.target_name = new_name; - input.axe_id = axe_id ++; - input.link_value = strdup("\0"); + input.axe_info.axe_id = g_axe_id ++; + link_value = strdup("\0"); + input.link_value = link_value; + #if H5VL_IOD_DEBUG printf("Hard Link Create axe %llu: %s ID %llu axe %llu to %s ID %llu axe %llu\n", - input.axe_id, loc_name, input.loc_id, input.parent_axe_id, + input.axe_info.axe_id, loc_name, input.loc_id, input.parent_axe_id, new_name, input.target_loc_id, input.target_parent_axe_id); #endif @@ -4836,7 +3845,7 @@ H5VL_iod_link_create(H5VL_link_create_type_t create_type, void *_obj, H5VL_loc_p input.create_type = H5VL_LINK_CREATE_SOFT; input.coh = obj->file->remote_file.coh; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; input.lcpl_id = lcpl_id; input.lapl_id = lapl_id; input.loc_name = loc_name; @@ -4845,7 +3854,7 @@ H5VL_iod_link_create(H5VL_link_create_type_t create_type, void *_obj, H5VL_loc_p #if H5VL_IOD_DEBUG printf("Soft Link Create axe %llu: %s ID %llu axe %llu to %s ID %llu axe %llu\n", - input.axe_id, loc_name, input.loc_id, input.parent_axe_id, + input.axe_info.axe_id, loc_name, input.loc_id, input.parent_axe_id, new_name, input.target_loc_id, input.target_parent_axe_id); #endif @@ -4871,60 +3880,17 @@ H5VL_iod_link_create(H5VL_link_create_type_t create_type, void *_obj, H5VL_loc_p status = (herr_t *)malloc(sizeof(herr_t)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_LINK_CREATE_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship link create"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc - (sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_LINK_CREATE; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)cur_obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - cur_obj->request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_LINK_CREATE_ID, HG_LINK_CREATE, cur_obj, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship link move"); done: - if(loc_name) free(loc_name); - if(new_name) free(new_name); - if(input.link_value) HDfree(input.link_value); + if(loc_name) + HDfree(loc_name); + if(new_name) + HDfree(new_name); + if(link_value) + HDfree(link_value); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_link_create() */ @@ -4958,13 +3924,8 @@ H5VL_iod_link_move(void *_src_obj, H5VL_loc_params_t loc_params1, H5VL_iod_object_t *cur_obj; link_move_in_t input; int *status; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ char *src_name = NULL, *dst_name = NULL; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -5003,7 +3964,7 @@ H5VL_iod_link_move(void *_src_obj, H5VL_loc_params_t loc_params1, /* set the input structure for the HG encode routine */ input.coh = src_obj->file->remote_file.coh; input.copy_flag = copy_flag; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; input.lcpl_id = lcpl_id; input.lapl_id = lapl_id; input.src_loc_name = src_name; @@ -5012,65 +3973,19 @@ H5VL_iod_link_move(void *_src_obj, H5VL_loc_params_t loc_params1, #if H5VL_IOD_DEBUG if(copy_flag) printf("Link Copy axe %llu: %s ID %llu axe %llu to %s ID %llu axe %llu\n", - input.axe_id, src_name, input.src_loc_id, input.src_parent_axe_id, + input.axe_info.axe_id, src_name, input.src_loc_id, input.src_parent_axe_id, dst_name, input.dst_loc_id, input.dst_parent_axe_id); else printf("Link Move axe %llu: %s ID %llu axe %llu to %s ID %llu axe %llu\n", - input.axe_id, src_name, input.src_loc_id, input.src_parent_axe_id, + input.axe_info.axe_id, src_name, input.src_loc_id, input.src_parent_axe_id, dst_name, input.dst_loc_id, input.dst_parent_axe_id); #endif status = (herr_t *)malloc(sizeof(herr_t)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_LINK_MOVE_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship link move"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc - (sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_LINK_MOVE; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)cur_obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(dst_obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - cur_obj->request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(dst_obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_LINK_MOVE_ID, HG_LINK_MOVE, cur_obj, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship link move"); done: if(src_name) free(src_name); @@ -5127,12 +4042,6 @@ H5VL_iod_link_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_ hid_t dxpl_id, void **req, va_list arguments) { H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; - int *status; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ char *new_name = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -5153,61 +4062,21 @@ H5VL_iod_link_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_ /* set the input structure for the HG encode routine */ input.coh = obj->file->remote_file.coh; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; input.path = new_name; - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - #if H5VL_IOD_DEBUG printf("Link Exists axe %llu: %s ID %llu axe %llu\n", - input.axe_id, new_name, input.loc_id, input.parent_axe_id); + input.axe_info.axe_id, new_name, input.loc_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_LINK_EXISTS_ID, &input, ret, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship link exists"); + if(H5VL__iod_create_and_forward(H5VL_LINK_EXISTS_ID, HG_LINK_EXISTS, obj, 0, + &input, ret, ret, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship link exists"); - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *) - H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_LINK_EXISTS; - request->data = ret; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - *req = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(new_name) + free(new_name); - if(new_name) free(new_name); break; } /* H5Lget_info/H5Lget_info_by_idx */ @@ -5224,61 +4093,20 @@ H5VL_iod_link_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_ /* set the input structure for the HG encode routine */ input.coh = obj->file->remote_file.coh; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; input.path = new_name; - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - #if H5VL_IOD_DEBUG printf("Link get info axe %llu: %s ID %llu axe %llu\n", - input.axe_id, new_name, input.loc_id, input.parent_axe_id); + input.axe_info.axe_id, new_name, input.loc_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_LINK_GET_INFO_ID, &input, linfo, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship link get info"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *) - H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_LINK_GET_INFO; - request->data = linfo; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - *req = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_LINK_GET_INFO_ID, HG_LINK_GET_INFO, obj, 0, + &input, linfo, linfo, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship link get_info"); - if(new_name) free(new_name); + if(new_name) + free(new_name); break; } /* H5Lget_val/H5Lget_val_by_idx */ @@ -5297,7 +4125,7 @@ H5VL_iod_link_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_ /* set the input structure for the HG encode routine */ input.coh = obj->file->remote_file.coh; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; input.path = new_name; input.length = size; @@ -5309,58 +4137,17 @@ H5VL_iod_link_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_link_get_t get_ result->value.val_size = input.length; result->value.val = buf; - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - #if H5VL_IOD_DEBUG printf("Link get val axe %llu: %s ID %llu axe %llu\n", - input.axe_id, new_name, input.loc_id, input.parent_axe_id); + input.axe_info.axe_id, new_name, input.loc_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_LINK_GET_VAL_ID, &input, result, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship link get val"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *) - H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_LINK_GET_VAL; - request->data = result; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - *req = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_LINK_GET_VAL_ID, HG_LINK_GET_VAL, obj, 0, + &input, result, result, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship link get_val"); - if(new_name) free(new_name); + if(new_name) + free(new_name); break; } /* H5Lget_name_by_idx */ @@ -5398,11 +4185,6 @@ H5VL_iod_link_remove(void *_obj, H5VL_loc_params_t loc_params, hid_t dxpl_id, vo H5VL_iod_object_t *cur_obj; link_op_in_t input; int *status; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ char *new_name = NULL; herr_t ret_value = SUCCEED; @@ -5417,66 +4199,22 @@ H5VL_iod_link_remove(void *_obj, H5VL_loc_params_t loc_params, hid_t dxpl_id, vo /* set the input structure for the HG encode routine */ input.coh = obj->file->remote_file.coh; input.path = new_name; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Link Remove axe %llu: %s ID %llu axe %llu\n", - input.axe_id, new_name, input.loc_id, input.parent_axe_id); + input.axe_info.axe_id, new_name, input.loc_id, input.parent_axe_id); #endif status = (int *)malloc(sizeof(int)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_LINK_REMOVE_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship link remove"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_LINK_REMOVE; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)cur_obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - cur_obj->request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_LINK_REMOVE_ID, HG_LINK_REMOVE, cur_obj, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship link remove"); done: - if(new_name) free(new_name); + if(new_name) + free(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_link_remove() */ @@ -5499,33 +4237,12 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, H5I_type_t *opened_type, hid_t dxpl_id, void **req) { H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; /* location object to open the group */ - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ char *new_name = NULL; void *ret_value; FUNC_ENTER_NOAPI_NOINIT if(H5VL_OBJECT_BY_ADDR == loc_params.type) { - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - switch(loc_params.loc_data.loc_by_addr.obj_type) { case H5O_TYPE_DATASET: { @@ -5548,11 +4265,7 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, input.parent_axe_id = 0; input.name = "."; input.dapl_id = H5P_DATASET_ACCESS_DEFAULT; - input.axe_id = axe_id ++; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_DSET_OPEN_ID, &input, &dset->remote_dset, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship dataset open"); + input.axe_info.axe_id = g_axe_id ++; dset->dapl_id = H5P_DATASET_ACCESS_DEFAULT; @@ -5562,38 +4275,10 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, dset->common.file->nopen_objs ++; dset->common.obj_name = NULL; - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_DSET_OPEN; - request->data = dset; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)dset; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - dset->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't wait on HG request"); - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - dset->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_DSET_OPEN_ID, HG_DSET_OPEN, + (H5VL_iod_object_t *)dset, 1, + &input, &dset->remote_dset, dset, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship dataset create"); *opened_type = H5I_DATASET; ret_value = (void *)dset; @@ -5620,41 +4305,20 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, input.parent_axe_id = 0; input.name = "."; input.tapl_id = H5P_DATATYPE_ACCESS_DEFAULT; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; dtype->tapl_id = H5P_DATATYPE_ACCESS_DEFAULT; - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_DTYPE_OPEN_ID, &input, &dtype->remote_dtype, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship datatype open"); - /* set common object parameters */ dtype->common.obj_type = H5I_DATATYPE; dtype->common.file = obj->file; dtype->common.file->nopen_objs ++; dtype->common.obj_name = NULL; - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_DTYPE_OPEN; - request->data = dtype; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)dtype; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* MSC - DATATYPE OPEN has to SYNCHRONOUS for now */ - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't wait on HG request"); - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - dtype->common.request = NULL; + if(H5VL__iod_create_and_forward(H5VL_DTYPE_OPEN_ID, HG_DTYPE_OPEN, + (H5VL_iod_object_t *)dtype, 1, + &input, &dtype->remote_dtype, dtype, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship datatype open"); *opened_type = H5I_DATATYPE; ret_value = (void *)dtype; @@ -5680,52 +4344,20 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, input.parent_axe_id = 0; input.name = "."; input.gapl_id = H5P_GROUP_ACCESS_DEFAULT; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; grp->gapl_id = H5P_GROUP_ACCESS_DEFAULT; - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_GROUP_OPEN_ID, &input, &grp->remote_group, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship group open"); - /* set common object parameters */ grp->common.obj_type = H5I_GROUP; grp->common.file = obj->file; grp->common.file->nopen_objs ++; grp->common.obj_name = NULL; - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_GROUP_OPEN; - request->data = grp; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)grp; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - grp->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "can't wait on HG request") - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - grp->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_GROUP_OPEN_ID, HG_GROUP_OPEN, + (H5VL_iod_object_t *)grp, 1, + &input, &grp->remote_group, grp, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship group open"); *opened_type = H5I_GROUP; ret_value = (void *)grp; @@ -5753,52 +4385,20 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, input.parent_axe_id = 0; input.name = "."; input.mapl_id = H5P_GROUP_ACCESS_DEFAULT; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; map->mapl_id = H5P_GROUP_ACCESS_DEFAULT; - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_MAP_OPEN_ID, &input, &map->remote_map, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship map open"); - /* set common object parameters */ map->common.obj_type = H5I_MAP; map->common.file = obj->file; map->common.file->nopen_objs ++; map->common.obj_name = NULL; - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_MAP_OPEN; - request->data = map; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)map; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - map->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "can't wait on HG request") - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - map->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_MAP_OPEN_ID, HG_MAP_OPEN, + (H5VL_iod_object_t *)map, 1, + &input, &map->remote_map, map, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship map open"); *opened_type = H5I_MAP; ret_value = (void *)map; @@ -5813,9 +4413,6 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, object_op_in_t input; H5VL_iod_remote_object_t remote_obj; /* generic remote object structure */ - hg_req = &_hg_req; - request = &_request; - /* Retrieve the parent AXE id by traversing the path where the object should be opened. */ if(H5VL_iod_get_parent_info(obj, loc_params, ".", &input.loc_id, &input.loc_oh, @@ -5824,28 +4421,12 @@ H5VL_iod_object_open(void *_obj, H5VL_loc_params_t loc_params, /* set the input structure for the HG encode routine */ input.coh = obj->file->remote_file.coh; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; input.loc_name = new_name; - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_OBJECT_OPEN_ID, &input, &remote_obj, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship link remove"); - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_OBJECT_OPEN; - request->data = &remote_obj; - request->req = hg_req; - request->obj = obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't wait on HG request"); + if(H5VL__iod_create_and_forward(H5VL_OBJECT_OPEN_ID, HG_OBJECT_OPEN, + obj, 1, &input, &remote_obj, &remote_obj, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship object open"); *opened_type = remote_obj.obj_type; @@ -6064,11 +4645,6 @@ H5VL_iod_object_copy(void *_src_obj, H5VL_loc_params_t loc_params1, const char * H5VL_iod_object_t *cur_obj; object_copy_in_t input; int *status; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ char *new_src_name = NULL, *new_dst_name = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -6090,7 +4666,7 @@ H5VL_iod_object_copy(void *_src_obj, H5VL_loc_params_t loc_params1, const char * /* set the input structure for the HG encode routine */ input.coh = src_obj->file->remote_file.coh; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; input.lcpl_id = lcpl_id; input.ocpypl_id = ocpypl_id; input.src_loc_name = new_src_name; @@ -6098,61 +4674,16 @@ H5VL_iod_object_copy(void *_src_obj, H5VL_loc_params_t loc_params1, const char * #if H5VL_IOD_DEBUG printf("Object Copy axe %llu: %s ID %llu axe %llu to %s ID %llu axe %llu\n", - input.axe_id, new_src_name, input.src_loc_id, input.src_parent_axe_id, + input.axe_info.axe_id, new_src_name, input.src_loc_id, input.src_parent_axe_id, new_dst_name, input.dst_loc_id, input.dst_parent_axe_id); #endif status = (herr_t *)malloc(sizeof(herr_t)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_OBJECT_COPY_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship object copy"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc - (sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_OBJECT_COPY; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)cur_obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(dst_obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - cur_obj->request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(dst_obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_OBJECT_COPY_ID, HG_OBJECT_COPY, + (H5VL_iod_object_t *)cur_obj, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship object copy"); done: if(new_src_name) free(new_src_name); @@ -6209,11 +4740,6 @@ H5VL_iod_object_misc(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_misc_ hid_t dxpl_id, void **req, va_list arguments) { H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ int *status = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -6239,64 +4765,22 @@ H5VL_iod_object_misc(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_misc_ input.path = loc_name; input.old_attr_name = old_name; input.new_attr_name = new_name; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Attribute Rename %s to %s LOC ID %llu, axe id %llu, parent %llu\n", - old_name, new_name, input.loc_id, input.axe_id, input.parent_axe_id); + old_name, new_name, input.loc_id, input.axe_info.axe_id, input.parent_axe_id); #endif status = (herr_t *)malloc(sizeof(herr_t)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_ATTR_RENAME_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship attribute rename"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *) - H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_ATTR_RENAME; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - *req = request; - /* Track request */ - obj->request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_ATTR_RENAME_ID, HG_ATTR_RENAME, + (H5VL_iod_object_t *)obj, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship attribute rename"); - if(loc_name) free(loc_name); + if(loc_name) + free(loc_name); break; } /* H5Oset_comment */ @@ -6316,61 +4800,21 @@ H5VL_iod_object_misc(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_misc_ input.coh = obj->file->remote_file.coh; input.path = loc_name; input.comment = comment; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; status = (herr_t *)malloc(sizeof(herr_t)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_OBJECT_SET_COMMENT_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship set comment"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *) - H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_OBJECT_SET_COMMENT; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - *req = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_OBJECT_SET_COMMENT_ID, HG_OBJECT_SET_COMMENT, + (H5VL_iod_object_t *)obj, 0, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship object set_comment"); /* store the comment locally if the object is open */ if(loc_params.type == H5VL_OBJECT_BY_SELF) obj->comment = HDstrdup(comment); - if(loc_name) free(loc_name); + if(loc_name) + free(loc_name); break; } /* H5Oincr_refcount / H5Odecr_refcount */ @@ -6419,11 +4863,6 @@ H5VL_iod_object_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_get_t { H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; int *status; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ char *new_name = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -6444,61 +4883,21 @@ H5VL_iod_object_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_get_t /* set the input structure for the HG encode routine */ input.coh = obj->file->remote_file.coh; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; input.loc_name = new_name; - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - #if H5VL_IOD_DEBUG printf("Object Exists axe %llu: %s ID %llu axe %llu\n", - input.axe_id, new_name, input.loc_id, input.parent_axe_id); + input.axe_info.axe_id, new_name, input.loc_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_OBJECT_EXISTS_ID, &input, ret, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship object exists"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *) - H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_OBJECT_EXISTS; - request->data = ret; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - *req = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_OBJECT_EXISTS_ID, HG_OBJECT_EXISTS, + (H5VL_iod_object_t *)obj, 0, + &input, ret, ret, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship object exists"); - if(new_name) free(new_name); + if(new_name) + free(new_name); break; } /* H5Oget_comment / H5Oget_comment_by_name */ @@ -6536,7 +4935,7 @@ H5VL_iod_object_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_get_t /* set the input structure for the HG encode routine */ input.coh = obj->file->remote_file.coh; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; input.path = new_name; if(comment) input.length = size; @@ -6552,58 +4951,18 @@ H5VL_iod_object_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_get_t result->name.value_size = ret; result->name.value = comment; - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - #if H5VL_IOD_DEBUG printf("Object Get Comment axe %llu: %s ID %llu axe %llu\n", - input.axe_id, new_name, input.loc_id, input.parent_axe_id); + input.axe_info.axe_id, new_name, input.loc_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_OBJECT_GET_COMMENT_ID, &input, result, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship object exists"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *) - H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_OBJECT_GET_COMMENT; - request->data = result; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - *req = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_OBJECT_GET_COMMENT_ID, HG_OBJECT_GET_COMMENT, + (H5VL_iod_object_t *)obj, 0, + &input, result, result, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship object get_comment"); - if(new_name) free(new_name); + if(new_name) + free(new_name); break; } /* H5Oget_info / H5Oget_info_by_name / H5Oget_info_by_idx */ @@ -6620,61 +4979,21 @@ H5VL_iod_object_get(void *_obj, H5VL_loc_params_t loc_params, H5VL_object_get_t /* set the input structure for the HG encode routine */ input.coh = obj->file->remote_file.coh; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; input.loc_name = new_name; - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - #if H5VL_IOD_DEBUG printf("Object get_info axe %llu: %s ID %llu axe %llu\n", - input.axe_id, new_name, input.loc_id, input.parent_axe_id); + input.axe_info.axe_id, new_name, input.loc_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_OBJECT_GET_INFO_ID, &input, oinfo, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship object exists"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *) - H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_OBJECT_GET_INFO; - request->data = oinfo; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)obj; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - *req = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't wait on HG request"); - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_OBJECT_GET_INFO_ID, HG_OBJECT_GET_INFO, + (H5VL_iod_object_t *)obj, 0, + &input, oinfo, oinfo, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship object get_info"); - if(new_name) free(new_name); + if(new_name) + free(new_name); break; } /* H5Rget_region */ @@ -6708,322 +5027,107 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_object_get() */ - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_cancel - * - * Purpose: Cancel an asynchronous operation - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: Mohamad Chaarawi - * April 2013 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5VL_iod_cancel(void **req, H5_status_t *status) +void * +H5VL_iod_map_create(void *_obj, H5VL_loc_params_t loc_params, const char *name, + hid_t keytype, hid_t valtype, hid_t lcpl_id, hid_t mcpl_id, + hid_t mapl_id, uint64_t trans, void **req) { - H5VL_iod_request_t *request = *((H5VL_iod_request_t **)req); - hg_status_t hg_status; - int ret; - H5VL_iod_state_t state; - hg_request_t hg_req; /* Local function shipper request, for sync. operations */ - herr_t ret_value = SUCCEED; /* Return value */ + H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; /* location object to create the group */ + H5VL_iod_map_t *map = NULL; /* the map object that is created and passed to the user */ + map_create_in_t input; + iod_obj_id_t iod_id; + iod_handle_t iod_oh; + uint64_t parent_axe_id; + char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ + void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT - /* request has completed already, can not cancel */ - if(request->state == H5VL_IOD_COMPLETED) { - if(H5VL_iod_request_wait(request->obj->file, request) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to wait for request"); - *status = request->status; - request->req = H5MM_xfree(request->req); - request = (H5VL_iod_request_t *)H5MM_xfree(request); - } + /* Retrieve the parent AXE id by traversing the path where the + map should be created. */ + if(H5VL_iod_get_parent_info(obj, loc_params, name, &iod_id, &iod_oh, + &parent_axe_id, &new_name, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "Failed to resolve current working group"); - /* forward the cancel call to the IONs */ - if(HG_Forward(PEER, H5VL_CANCEL_OP_ID, &request->axe_id, &state, &hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship attribute write"); + /* allocate the map object that is returned to the user */ + if(NULL == (map = H5FL_CALLOC(H5VL_iod_map_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate object struct"); - /* Wait on the cancel request to return */ - ret = HG_Wait(hg_req, HG_MAX_IDLE_TIME, &hg_status); - /* If the actual wait Fails, then the status of the cancel - operation is unknown */ - if(HG_FAIL == ret) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to wait on cancel request") - else { - if(hg_status) { - /* If the operation to be canceled has already completed, - mark it so and complete it locally */ - if(state == H5VL_IOD_COMPLETED) { - if(H5VL_IOD_PENDING == request->state) { - if(H5VL_iod_request_wait(request->obj->file, request) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to wait for request"); - } + map->remote_map.iod_oh.cookie = IOD_OH_UNDEFINED; + map->remote_map.iod_id = IOD_ID_UNDEFINED; + map->remote_map.mcpl_id = -1; - *status = request->status; - request->req = H5MM_xfree(request->req); - request = (H5VL_iod_request_t *)H5MM_xfree(request); - } + /* Generate an IOD ID for the group to be created */ + H5VL_iod_gen_obj_id(obj->file->my_rank, obj->file->num_procs, + obj->file->remote_file.kv_oid_index, + IOD_OBJ_KV, &input.map_id); + map->remote_map.iod_id = input.map_id; - /* if the status returned is cancelled, then cancel it - locally too */ - else if (state == H5VL_IOD_CANCELLED) { - request->status = H5AO_CANCELLED; - request->state = H5VL_IOD_CANCELLED; - if(H5VL_iod_request_cancel(request->obj->file, request) < 0) - fprintf(stderr, "Operation Failed!\n"); + /* increment the index of KV objects created on the container */ + obj->file->remote_file.kv_oid_index ++; - *status = request->status; - request->req = H5MM_xfree(request->req); - request = (H5VL_iod_request_t *)H5MM_xfree(request); - } - } - else - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Cancel Operation taking too long. Aborting"); + /* set the input structure for the HG encode routine */ + input.coh = obj->file->remote_file.coh; + input.loc_id = iod_id; + input.loc_oh = iod_oh; + input.parent_axe_id = parent_axe_id; + input.name = new_name; + input.keytype_id = keytype; + input.valtype_id = valtype; + input.mcpl_id = mcpl_id; + input.mapl_id = mapl_id; + input.lcpl_id = lcpl_id; + input.axe_info.axe_id = g_axe_id ++; + +#if H5VL_IOD_DEBUG + printf("Map Create %s, IOD ID %llu, axe id %llu, parent %llu\n", + new_name, input.map_id, input.axe_info.axe_id, input.parent_axe_id); +#endif + + /* setup the local map struct */ + /* store the entire path of the map locally */ + { + size_t obj_name_len = HDstrlen(obj->obj_name); + size_t name_len = HDstrlen(name); + + if (NULL == (map->common.obj_name = (char *)HDmalloc(obj_name_len + name_len + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); + HDmemcpy(map->common.obj_name, obj->obj_name, obj_name_len); + HDmemcpy(map->common.obj_name+obj_name_len, name, name_len); + map->common.obj_name[obj_name_len+name_len] = '\0'; } + /* copy property lists */ + if((map->remote_map.mcpl_id = H5Pcopy(mcpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy mcpl"); + if((map->mapl_id = H5Pcopy(mapl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy mapl"); + if((map->remote_map.keytype_id = H5Tcopy(keytype)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy dtype"); + if((map->remote_map.valtype_id = H5Tcopy(valtype)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy dtype"); + + /* set common object parameters */ + map->common.obj_type = H5I_MAP; + map->common.file = obj->file; + map->common.file->nopen_objs ++; + + if(H5VL__iod_create_and_forward(H5VL_MAP_CREATE_ID, HG_MAP_CREATE, + (H5VL_iod_object_t *)map, 1, + &input, &map->remote_map, map, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship map create"); + + ret_value = (void *)map; + done: + if(new_name) + free(new_name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_iod_cancel() */ +} /* end H5VL_iod_map_create() */ - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_test - * - * Purpose: Test for an asynchronous operation's completion - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: Quincey Koziol - * Wednesday, March 20, 2013 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5VL_iod_test(void **req, H5_status_t *status) -{ - H5VL_iod_request_t *request = *((H5VL_iod_request_t **)req); - hg_status_t hg_status; - int ret; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - ret = HG_Wait(*((hg_request_t *)request->req), 0, &hg_status); - if(HG_FAIL == ret) { - fprintf(stderr, "failed to wait on request\n"); - request->status = H5AO_FAILED; - request->state = H5VL_IOD_COMPLETED; - H5VL_iod_request_delete(request->obj->file, request); - } - else { - if(hg_status) { - request->status = H5AO_SUCCEEDED; - request->state = H5VL_IOD_COMPLETED; - if(H5VL_iod_request_complete(request->obj->file, request) < 0) - fprintf(stderr, "Operation Failed!\n"); - *status = request->status; - request->req = H5MM_xfree(request->req); - request = (H5VL_iod_request_t *)H5MM_xfree(request); - } - else - *status = request->status; - } - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5VL_iod_test() */ - - -/*------------------------------------------------------------------------- - * Function: H5VL_iod_wait - * - * Purpose: Wait for an asynchronous operation to complete - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: Quincey Koziol - * Wednesday, March 20, 2013 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5VL_iod_wait(void **req, H5_status_t *status) -{ - H5VL_iod_request_t *request = *((H5VL_iod_request_t **)req); - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT - - if(H5VL_IOD_PENDING == request->state) { - if(H5VL_iod_request_wait(request->obj->file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to wait for request") - } - - *status = request->status; - request->req = H5MM_xfree(request->req); - request = (H5VL_iod_request_t *)H5MM_xfree(request); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_iod_wait() */ - -void * -H5VL_iod_map_create(void *_obj, H5VL_loc_params_t loc_params, const char *name, - hid_t keytype, hid_t valtype, hid_t lcpl_id, hid_t mcpl_id, - hid_t mapl_id, uint64_t trans, void **req) -{ - H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; /* location object to create the group */ - H5VL_iod_map_t *map = NULL; /* the map object that is created and passed to the user */ - map_create_in_t input; - iod_obj_id_t iod_id; - iod_handle_t iod_oh; - uint64_t parent_axe_id; - char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ - void *ret_value = NULL; - - FUNC_ENTER_NOAPI_NOINIT - - /* Retrieve the parent AXE id by traversing the path where the - map should be created. */ - if(H5VL_iod_get_parent_info(obj, loc_params, name, &iod_id, &iod_oh, - &parent_axe_id, &new_name, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "Failed to resolve current working group"); - - /* allocate the map object that is returned to the user */ - if(NULL == (map = H5FL_CALLOC(H5VL_iod_map_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate object struct"); - - map->remote_map.iod_oh.cookie = IOD_OH_UNDEFINED; - map->remote_map.iod_id = IOD_ID_UNDEFINED; - map->remote_map.mcpl_id = -1; - - /* Generate an IOD ID for the group to be created */ - H5VL_iod_gen_obj_id(obj->file->my_rank, obj->file->num_procs, - obj->file->remote_file.kv_oid_index, - IOD_OBJ_KV, &input.map_id); - map->remote_map.iod_id = input.map_id; - - /* increment the index of KV objects created on the container */ - obj->file->remote_file.kv_oid_index ++; - - /* set the input structure for the HG encode routine */ - input.coh = obj->file->remote_file.coh; - input.loc_id = iod_id; - input.loc_oh = iod_oh; - input.parent_axe_id = parent_axe_id; - input.name = new_name; - input.keytype_id = keytype; - input.valtype_id = valtype; - input.mcpl_id = mcpl_id; - input.mapl_id = mapl_id; - input.lcpl_id = lcpl_id; - input.axe_id = axe_id ++; - -#if H5VL_IOD_DEBUG - printf("Map Create %s, IOD ID %llu, axe id %llu, parent %llu\n", - new_name, input.map_id, input.axe_id, input.parent_axe_id); -#endif - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_MAP_CREATE_ID, &input, &map->remote_map, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship map create"); - - /* setup the local map struct */ - /* store the entire path of the map locally */ - { - size_t obj_name_len = HDstrlen(obj->obj_name); - size_t name_len = HDstrlen(name); - - if (NULL == (map->common.obj_name = (char *)HDmalloc(obj_name_len + name_len + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate"); - HDmemcpy(map->common.obj_name, obj->obj_name, obj_name_len); - HDmemcpy(map->common.obj_name+obj_name_len, name, name_len); - map->common.obj_name[obj_name_len+name_len] = '\0'; - } - - /* copy property lists */ - if((map->remote_map.mcpl_id = H5Pcopy(mcpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy mcpl"); - if((map->mapl_id = H5Pcopy(mapl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy mapl"); - if((map->remote_map.keytype_id = H5Tcopy(keytype)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy dtype"); - if((map->remote_map.valtype_id = H5Tcopy(valtype)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy dtype"); - - /* set common object parameters */ - map->common.obj_type = H5I_MAP; - map->common.file = obj->file; - map->common.file->nopen_objs ++; - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_MAP_CREATE; - request->data = map; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)map; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - map->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "can't wait on HG request") - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - map->common.request = NULL; - } /* end else */ - - ret_value = (void *)map; - -done: - if(new_name) free(new_name); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_iod_map_create() */ - -void * -H5VL_iod_map_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, hid_t mapl_id, - uint64_t trans, void **req) +void * +H5VL_iod_map_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, hid_t mapl_id, + uint64_t trans, void **req) { H5VL_iod_object_t *obj = (H5VL_iod_object_t *)_obj; /* location object to create the group */ H5VL_iod_map_t *map = NULL; /* the map object that is created and passed to the user */ @@ -7032,11 +5136,6 @@ H5VL_iod_map_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, hi iod_handle_t iod_oh; uint64_t parent_axe_id; char *new_name = NULL; /* resolved path to where we need to start traversal at the server */ - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -7063,25 +5162,13 @@ H5VL_iod_map_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, hi input.parent_axe_id = parent_axe_id; input.name = new_name; input.mapl_id = mapl_id; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("Map Open %s LOC ID %llu, axe id %llu, parent %llu, name len %zu\n", - new_name, input.loc_id, input.axe_id, input.parent_axe_id, strlen(input.name)); + new_name, input.loc_id, input.axe_info.axe_id, input.parent_axe_id, strlen(input.name)); #endif - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_MAP_OPEN_ID, &input, &map->remote_map, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to ship map create"); - /* setup the local map struct */ /* store the entire path of the map locally */ { @@ -7104,46 +5191,9 @@ H5VL_iod_map_open(void *_obj, H5VL_loc_params_t loc_params, const char *name, hi map->common.file = obj->file; map->common.file->nopen_objs ++; - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_MAP_OPEN; - request->data = map; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)map; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(obj->file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - map->common.request = request; - } /* end if */ - else { - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(obj->file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "can't wait on HG request") - - /* Sanity check */ - HDassert(request == &_request); - - /* Request has completed already */ - map->common.request = NULL; - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_MAP_OPEN_ID, HG_MAP_OPEN, (H5VL_iod_object_t *)map, 1, + &input, &map->remote_map, map, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "failed to create and ship map open"); ret_value = (void *)map; @@ -7161,11 +5211,6 @@ H5VL_iod_map_set(void *_map, hid_t key_mem_type_id, const void *key, map_set_in_t input; size_t key_size, val_size; int *status = NULL; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -7214,64 +5259,18 @@ H5VL_iod_map_set(void *_map, hid_t key_mem_type_id, const void *key, input.val_memtype_id = val_mem_type_id; input.val.buf_size = val_size; input.val.buf = value; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; status = (int *)malloc(sizeof(int)); - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - - printf("kmap %d kmem %d. vmap %d kmap %d dxpl %d\n", - input.key_maptype_id,input.key_memtype_id,input.val_maptype_id,input.val_memtype_id, dxpl_id); - #if H5VL_IOD_DEBUG printf("MAP set, axe id %llu, parent %llu\n", - input.axe_id, input.parent_axe_id); + input.axe_info.axe_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_MAP_SET_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship map set"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_MAP_SET; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)map; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(map->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - } /* end if */ - else { - /* Sanity check */ - HDassert(request == &_request); - - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(map->common.file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't wait on HG request"); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_MAP_SET_ID, HG_MAP_SET, (H5VL_iod_object_t *)map, 0, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship map set"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7286,11 +5285,6 @@ H5VL_iod_map_get(void *_map, hid_t key_mem_type_id, const void *key, map_get_in_t input; map_get_out_t *output; size_t key_size, val_size; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -7337,19 +5331,11 @@ H5VL_iod_map_get(void *_map, hid_t key_mem_type_id, const void *key, input.key.buf_size = key_size; input.key.buf = key; input.val_memtype_id = val_mem_type_id; - input.axe_id = axe_id ++; - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("MAP Get, axe id %llu, parent %llu\n", - input.axe_id, input.parent_axe_id); + input.axe_info.axe_id, input.parent_axe_id); #endif if(NULL == (output = (map_get_out_t *)H5MM_calloc(sizeof(map_get_out_t)))) @@ -7358,46 +5344,10 @@ H5VL_iod_map_get(void *_map, hid_t key_mem_type_id, const void *key, output->val.val = value; output->val.val_size = val_size; - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_MAP_GET_ID, &input, output, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship dataset read"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_MAP_GET; - request->data = output; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)map; - request->status = 0; - request->state = 0; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(map->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); + if(H5VL__iod_create_and_forward(H5VL_MAP_GET_ID, HG_MAP_GET, (H5VL_iod_object_t *)map, 0, + &input, output, output, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship map get"); - *req = request; - } /* end if */ - else { - /* Sanity check */ - HDassert(request == &_request); - - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(map->common.file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't wait on HG request"); - } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_map_get() */ @@ -7435,11 +5385,6 @@ H5VL_iod_map_get_count(void *_map, hsize_t *count, uint64_t trans, void **req) { H5VL_iod_map_t *map = (H5VL_iod_map_t *)_map; map_get_count_in_t input; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -7455,61 +5400,17 @@ H5VL_iod_map_get_count(void *_map, hsize_t *count, uint64_t trans, void **req) input.coh = map->common.file->remote_file.coh; input.iod_oh = map->remote_map.iod_oh; input.iod_id = map->remote_map.iod_id; - input.axe_id = axe_id ++; - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("MAP Get count, axe id %llu, parent %llu\n", - input.axe_id, input.parent_axe_id); + input.axe_info.axe_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_MAP_GET_COUNT_ID, &input, count, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship dataset read"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_MAP_GET_COUNT; - request->data = count; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)map; - request->status = 0; - request->state = 0; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(map->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - } /* end if */ - else { - /* Sanity check */ - HDassert(request == &_request); - - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(map->common.file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't wait on HG request"); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_MAP_GET_COUNT_ID, HG_MAP_GET_COUNT, + (H5VL_iod_object_t *)map, 0, + &input, count, count, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship map get_count"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7522,11 +5423,6 @@ H5VL_iod_map_exists(void *_map, hid_t key_mem_type_id, const void *key, H5VL_iod_map_t *map = (H5VL_iod_map_t *)_map; map_op_in_t input; size_t key_size; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -7555,61 +5451,16 @@ H5VL_iod_map_exists(void *_map, hid_t key_mem_type_id, const void *key, input.key_memtype_id = key_mem_type_id; input.key.buf_size = key_size; input.key.buf = key; - input.axe_id = axe_id ++; - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("MAP EXISTS, axe id %llu, parent %llu\n", - input.axe_id, input.parent_axe_id); + input.axe_info.axe_id, input.parent_axe_id); #endif - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_MAP_EXISTS_ID, &input, exists, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship dataset read"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_MAP_EXISTS; - request->data = exists; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)map; - request->status = 0; - request->state = 0; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(map->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - } /* end if */ - else { - /* Sanity check */ - HDassert(request == &_request); - - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(map->common.file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't wait on HG request"); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_MAP_EXISTS_ID, HG_MAP_EXISTS, (H5VL_iod_object_t *)map, 0, + &input, exists, exists, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship map exists"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7637,11 +5488,6 @@ H5VL_iod_map_delete(void *_map, hid_t key_mem_type_id, const void *key, map_op_in_t input; size_t key_size; int *status = NULL; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -7670,66 +5516,18 @@ H5VL_iod_map_delete(void *_map, hid_t key_mem_type_id, const void *key, input.key_memtype_id = key_mem_type_id; input.key.buf_size = key_size; input.key.buf = key; - input.axe_id = axe_id ++; - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; + input.axe_info.axe_id = g_axe_id ++; #if H5VL_IOD_DEBUG printf("MAP DELETE, axe id %llu, parent %llu\n", - input.axe_id, input.parent_axe_id); + input.axe_info.axe_id, input.parent_axe_id); #endif status = (int *)malloc(sizeof(int)); - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_MAP_DELETE_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship dataset read"); - - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; - - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_MAP_DELETE; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)map; - request->status = 0; - request->state = 0; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(map->common.file, request); - - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); - - *req = request; - - /* Track request */ - map->common.request = request; - } /* end if */ - else { - /* Sanity check */ - HDassert(request == &_request); - - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(map->common.file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't wait on HG request"); - } /* end else */ + if(H5VL__iod_create_and_forward(H5VL_MAP_DELETE_ID, HG_MAP_DELETE, (H5VL_iod_object_t *)map, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship map delete"); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7742,18 +5540,13 @@ herr_t H5VL_iod_map_close(void *_map, void **req) int *status; size_t num_parents; uint64_t *axe_parents = NULL; - hg_request_t _hg_req; /* Local function shipper request, for sync. operations */ - hg_request_t *hg_req = NULL; - H5VL_iod_request_t _request; /* Local request, for sync. operations */ - H5VL_iod_request_t *request = NULL; - hbool_t do_async = (req == NULL) ? FALSE : TRUE; /* Whether we're performing async. I/O */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT /* If this call is not asynchronous, complete and remove all requests that are associated with this object from the List */ - if(!do_async) { + if(NULL == req) { if(H5VL_iod_request_wait_some(map->common.file, map) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't wait on all object requests"); } @@ -7768,73 +5561,187 @@ herr_t H5VL_iod_map_close(void *_map, void **req) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get AXE parents"); } - status = (int *)malloc(sizeof(int)); - - /* get a function shipper request */ - if(do_async) { - if(NULL == (hg_req = (hg_request_t *)H5MM_malloc(sizeof(hg_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate a HG request"); - } /* end if */ - else - hg_req = &_hg_req; - input.iod_oh = map->remote_map.iod_oh; input.iod_id = map->remote_map.iod_id; input.parent_axe_ids.count = num_parents; input.parent_axe_ids.ids = axe_parents; - input.axe_id = axe_id ++; + input.axe_info.axe_id = g_axe_id ++; - /* forward the call to the IONs */ - if(HG_Forward(PEER, H5VL_MAP_CLOSE_ID, &input, status, hg_req) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "failed to ship map close"); + status = (int *)malloc(sizeof(int)); - /* Get async request for operation */ - if(do_async) { - if(NULL == (request = (H5VL_iod_request_t *)H5MM_malloc(sizeof(H5VL_iod_request_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate IOD VOL request struct"); - } /* end if */ - else - request = &_request; + if(H5VL__iod_create_and_forward(H5VL_MAP_CLOSE_ID, HG_MAP_CLOSE, (H5VL_iod_object_t *)map, 1, + &input, status, status, req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to create and ship map close"); - /* Set up request */ - HDmemset(request, 0, sizeof(*request)); - request->type = HG_MAP_CLOSE; - request->data = status; - request->req = hg_req; - request->obj = (H5VL_iod_object_t *)map; - request->axe_id = input.axe_id; - request->next = request->prev = NULL; - /* add request to container's linked list */ - H5VL_iod_request_add(map->common.file, request); +done: + axe_parents = (uint64_t *)H5MM_xfree(axe_parents); + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_map_close() */ -#if H5VL_IOD_DEBUG - printf("MAP Close IOD ID %llu, axe id %llu\n", - input.iod_id, input.axe_id); -#endif + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_cancel + * + * Purpose: Cancel an asynchronous operation + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Mohamad Chaarawi + * April 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5VL_iod_cancel(void **req, H5_status_t *status) +{ + H5VL_iod_request_t *request = *((H5VL_iod_request_t **)req); + hg_status_t hg_status; + int ret; + H5VL_iod_state_t state; + hg_request_t hg_req; /* Local function shipper request, for sync. operations */ + herr_t ret_value = SUCCEED; /* Return value */ - /* Store/wait on request */ - if(do_async) { - /* Sanity check */ - HDassert(request != &_request); + FUNC_ENTER_NOAPI_NOINIT - *req = request; + /* request has completed already, can not cancel */ + if(request->state == H5VL_IOD_COMPLETED) { + if(H5VL_iod_request_wait(request->obj->file, request) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to wait for request"); + *status = request->status; + request->req = H5MM_xfree(request->req); + request = (H5VL_iod_request_t *)H5MM_xfree(request); + } - /* Track request */ - map->common.request = request; - } /* end if */ + /* forward the cancel call to the IONs */ + if(HG_Forward(PEER, H5VL_CANCEL_OP_ID, &request->axe_id, &state, &hg_req) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to ship attribute write"); + + /* Wait on the cancel request to return */ + ret = HG_Wait(hg_req, HG_MAX_IDLE_TIME, &hg_status); + /* If the actual wait Fails, then the status of the cancel + operation is unknown */ + if(HG_FAIL == ret) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "failed to wait on cancel request") else { + if(hg_status) { + /* If the operation to be canceled has already completed, + mark it so and complete it locally */ + if(state == H5VL_IOD_COMPLETED) { + if(H5VL_IOD_PENDING == request->state) { + if(H5VL_iod_request_wait(request->obj->file, request) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to wait for request"); + } - /* Synchronously wait on the request */ - if(H5VL_iod_request_wait(map->common.file, request) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't wait on HG request"); + *status = request->status; + request->req = H5MM_xfree(request->req); + request = (H5VL_iod_request_t *)H5MM_xfree(request); + } - /* Sanity check */ - HDassert(request == &_request); - } /* end else */ + /* if the status returned is cancelled, then cancel it + locally too */ + else if (state == H5VL_IOD_CANCELLED) { + request->status = H5AO_CANCELLED; + request->state = H5VL_IOD_CANCELLED; + if(H5VL_iod_request_cancel(request->obj->file, request) < 0) + fprintf(stderr, "Operation Failed!\n"); + + *status = request->status; + request->req = H5MM_xfree(request->req); + request = (H5VL_iod_request_t *)H5MM_xfree(request); + } + } + else + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Cancel Operation taking too long. Aborting"); + } done: - axe_parents = (uint64_t *)H5MM_xfree(axe_parents); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5VL_iod_map_close() */ +} /* end H5VL_iod_cancel() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_test + * + * Purpose: Test for an asynchronous operation's completion + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * Wednesday, March 20, 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5VL_iod_test(void **req, H5_status_t *status) +{ + H5VL_iod_request_t *request = *((H5VL_iod_request_t **)req); + hg_status_t hg_status; + int ret; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + ret = HG_Wait(*((hg_request_t *)request->req), 0, &hg_status); + if(HG_FAIL == ret) { + fprintf(stderr, "failed to wait on request\n"); + request->status = H5AO_FAILED; + request->state = H5VL_IOD_COMPLETED; + H5VL_iod_request_delete(request->obj->file, request); + } + else { + if(hg_status) { + request->status = H5AO_SUCCEEDED; + request->state = H5VL_IOD_COMPLETED; + if(H5VL_iod_request_complete(request->obj->file, request) < 0) + fprintf(stderr, "Operation Failed!\n"); + *status = request->status; + request->req = H5MM_xfree(request->req); + request = (H5VL_iod_request_t *)H5MM_xfree(request); + } + else + *status = request->status; + } + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5VL_iod_test() */ + + +/*------------------------------------------------------------------------- + * Function: H5VL_iod_wait + * + * Purpose: Wait for an asynchronous operation to complete + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * Wednesday, March 20, 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5VL_iod_wait(void **req, H5_status_t *status) +{ + H5VL_iod_request_t *request = *((H5VL_iod_request_t **)req); + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + if(H5VL_IOD_PENDING == request->state) { + if(H5VL_iod_request_wait(request->obj->file, request) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to wait for request") + } + + H5VL__iod_request_remove_from_axe_list(request); + + *status = request->status; + request->rc --; + request->req = H5MM_xfree(request->req); + request = (H5VL_iod_request_t *)H5MM_xfree(request); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5VL_iod_wait() */ #endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_client.c b/src/H5VLiod_client.c index 4c7a3d4..2ecfe24 100644 --- a/src/H5VLiod_client.c +++ b/src/H5VLiod_client.c @@ -275,6 +275,7 @@ H5VL_iod_request_wait_all(H5VL_iod_file_t *file) fprintf(stderr, "Wait timeout reached\n"); cur_req->status = H5AO_FAILED; cur_req->state = H5VL_IOD_COMPLETED; + //H5VL_iod_request_remove_from_axe_list(cur_req); H5VL_iod_request_delete(file, cur_req); goto done; } @@ -284,6 +285,7 @@ H5VL_iod_request_wait_all(H5VL_iod_file_t *file) } } + //H5VL_iod_request_remove_from_axe_list(cur_req); if(H5VL_iod_request_complete(file, cur_req) < 0) fprintf(stderr, "Operation Failed!\n"); @@ -330,6 +332,7 @@ H5VL_iod_request_wait_some(H5VL_iod_file_t *file, const void *object) fprintf(stderr, "failed to wait on request\n"); cur_req->status = H5AO_FAILED; cur_req->state = H5VL_IOD_COMPLETED; + //H5VL_iod_request_remove_from_axe_list(cur_req); H5VL_iod_request_delete(file, cur_req); } else { @@ -337,6 +340,7 @@ H5VL_iod_request_wait_some(H5VL_iod_file_t *file, const void *object) fprintf(stderr, "Wait timeout reached\n"); cur_req->status = H5AO_FAILED; cur_req->state = H5VL_IOD_COMPLETED; + //H5VL_iod_request_remove_from_axe_list(cur_req); H5VL_iod_request_delete(file, cur_req); } else { @@ -344,6 +348,7 @@ H5VL_iod_request_wait_some(H5VL_iod_file_t *file, const void *object) cur_req->state = H5VL_IOD_COMPLETED; if(H5VL_iod_request_complete(file, cur_req) < 0) fprintf(stderr, "Operation Failed!\n"); + //H5VL_iod_request_remove_from_axe_list(cur_req); } } } @@ -552,7 +557,7 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) input.space_id = info->file_space_id; input.mem_type_id = info->mem_type_id; input.dset_type_id = dset->remote_dset.type_id; - input.axe_id = info->axe_id; + input.axe_info.axe_id = info->axe_id; input.parent_axe_id = 0; /* forward call to IONs */ @@ -1424,6 +1429,7 @@ H5VL_iod_get_axe_parents(H5VL_iod_object_t *obj, /*IN/OUT*/ size_t *count, if(cur_req->status == H5AO_PENDING){ if(NULL != parents) { parents[size] = cur_req->axe_id; + cur_req->rc ++; } size ++; } @@ -1457,7 +1463,7 @@ herr_t H5VL_iod_get_parent_info(H5VL_iod_object_t *obj, H5VL_loc_params_t loc_params, const char *name, /*OUT*/iod_obj_id_t *iod_id, /*OUT*/iod_handle_t *iod_oh, /*OUT*/uint64_t *axe_id, - /*OUT*/char **new_name, /*OUT*/const H5VL_iod_object_t **last_obj) + /*OUT*/char **new_name, /*OUT*/H5VL_iod_object_t **last_obj) { iod_obj_id_t cur_id; iod_handle_t cur_oh; @@ -1573,6 +1579,7 @@ H5VL_iod_get_parent_info(H5VL_iod_object_t *obj, H5VL_loc_params_t loc_params, if(cur_obj->request && cur_obj->request->status == H5AO_PENDING) { *axe_id = cur_obj->request->axe_id; + cur_obj->request->rc ++; } else { *axe_id = 0; diff --git a/src/H5VLiod_client.h b/src/H5VLiod_client.h index 98c31bc..61d27fc 100644 --- a/src/H5VLiod_client.h +++ b/src/H5VLiod_client.h @@ -81,6 +81,13 @@ typedef enum H5RQ_type_t { HG_OBJECT_GET_INFO } H5RQ_type_t; +/* global AXE list struct */ +typedef struct H5VL_iod_axe_list_t { + struct H5VL_iod_request_t *head; + struct H5VL_iod_request_t *tail; + uint64_t last_released_task; +} H5VL_iod_axe_list_t; + /* the client IOD VOL request struct */ typedef struct H5VL_iod_request_t { H5RQ_type_t type; @@ -92,6 +99,9 @@ typedef struct H5VL_iod_request_t { uint64_t axe_id; struct H5VL_iod_request_t *prev; struct H5VL_iod_request_t *next; + struct H5VL_iod_request_t *global_prev; + struct H5VL_iod_request_t *global_next; + unsigned rc; } H5VL_iod_request_t; /* struct that contains the information about the IOD container */ @@ -253,10 +263,17 @@ H5_DLL herr_t H5VL_iod_request_wait_all(H5VL_iod_file_t *file); H5_DLL herr_t H5VL_iod_request_wait_some(H5VL_iod_file_t *file, const void *object); H5_DLL herr_t H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req); H5_DLL herr_t H5VL_iod_request_cancel(H5VL_iod_file_t *file, H5VL_iod_request_t *req); + +H5_DLL herr_t H5VL__iod_request_remove_from_axe_list(H5VL_iod_request_t *request); +H5_DLL herr_t H5VL__iod_request_add_to_axe_list(H5VL_iod_request_t *request); +H5_DLL herr_t H5VL__iod_create_and_forward(hg_id_t op_id, H5RQ_type_t op_type, + H5VL_iod_object_t *request_obj, htri_t track, + void *input, void *output, void *data, void **req); + H5_DLL herr_t H5VL_iod_get_parent_info(H5VL_iod_object_t *obj, H5VL_loc_params_t loc_params, const char *name, iod_obj_id_t *iod_id, iod_handle_t *iod_oh, uint64_t *axe_id, char **new_name, - const H5VL_iod_object_t **last_obj); + H5VL_iod_object_t **last_obj); H5_DLL herr_t H5VL_iod_get_axe_parents(H5VL_iod_object_t *obj, size_t *count, uint64_t *parents); H5_DLL herr_t H5VL_iod_gen_obj_id(int myrank, int nranks, uint64_t cur_index, iod_obj_type_t type, uint64_t *id); diff --git a/src/H5VLiod_common.h b/src/H5VLiod_common.h index e6e2e9a..8402f3a 100644 --- a/src/H5VLiod_common.h +++ b/src/H5VLiod_common.h @@ -70,7 +70,14 @@ typedef struct value_t { void *val; } value_t; +typedef struct axe_t { + uint64_t axe_id; + uint64_t start_range; + uint64_t count; +} axe_t; + H5_DLL int hg_proc_ret_t(hg_proc_t proc, void *data); +H5_DLL int hg_proc_axe_t(hg_proc_t proc, void *data); H5_DLL int hg_proc_size_t(hg_proc_t proc, void *data); H5_DLL int hg_proc_hid_t(hg_proc_t proc, void *data); H5_DLL int hg_proc_htri_t(hg_proc_t proc, void *data); @@ -87,172 +94,206 @@ H5_DLL int hg_proc_oinfo_t(hg_proc_t proc, void *data); MERCURY_GEN_PROC(eff_init_in_t, ((uint32_t)(proc_num))) -MERCURY_GEN_PROC(file_create_in_t, ((hg_string_t)(name)) ((uint32_t)(flags)) +MERCURY_GEN_PROC(file_create_in_t, ((axe_t)(axe_info)) + ((hg_string_t)(name)) ((uint32_t)(flags)) ((iod_obj_id_t)(root_id)) - ((hid_t)(fapl_id)) ((hid_t)(fcpl_id)) ((uint64_t)(axe_id))) + ((hid_t)(fapl_id)) ((hid_t)(fcpl_id))) MERCURY_GEN_PROC(file_create_out_t, ((iod_handle_t)(coh)) ((iod_handle_t)(root_oh)) ((uint64_t)(kv_oid_index)) ((uint64_t)(array_oid_index)) ((uint64_t)(blob_oid_index))) -MERCURY_GEN_PROC(file_open_in_t, ((hg_string_t)(name)) ((uint32_t)(flags)) - ((hid_t)(fapl_id)) ((uint64_t)(axe_id))) +MERCURY_GEN_PROC(file_open_in_t, ((axe_t)(axe_info)) + ((hg_string_t)(name)) ((uint32_t)(flags)) + ((hid_t)(fapl_id))) MERCURY_GEN_PROC(file_open_out_t, ((iod_handle_t)(coh)) ((iod_handle_t)(root_oh)) ((uint64_t)(kv_oid_index)) ((uint64_t)(array_oid_index)) ((uint64_t)(blob_oid_index)) ((iod_obj_id_t)(root_id)) ((hid_t)(fcpl_id))) -MERCURY_GEN_PROC(file_flush_in_t, ((iod_handle_t)(coh)) ((int32_t)(scope)) - ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(file_close_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(root_oh)) - ((iod_obj_id_t)(root_id)) ((uint64_t)(axe_id))) +MERCURY_GEN_PROC(file_flush_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((int32_t)(scope))) +MERCURY_GEN_PROC(file_close_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(root_oh)) + ((iod_obj_id_t)(root_id))) -MERCURY_GEN_PROC(attr_create_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(attr_create_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((iod_obj_id_t)(attr_id)) ((uint64_t)(parent_axe_id)) ((hg_string_t)(path)) ((hg_string_t)(attr_name)) ((hid_t)(acpl_id)) - ((hid_t)(type_id)) ((hid_t)(space_id)) ((uint64_t)(axe_id))) + ((hid_t)(type_id)) ((hid_t)(space_id))) MERCURY_GEN_PROC(attr_create_out_t, ((iod_handle_t)(iod_oh))) -MERCURY_GEN_PROC(attr_open_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(attr_open_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) ((hg_string_t)(path)) - ((hg_string_t)(attr_name)) ((uint64_t)(axe_id))) + ((hg_string_t)(attr_name))) MERCURY_GEN_PROC(attr_open_out_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(acpl_id)) ((hid_t)(type_id)) ((hid_t)(space_id))) -MERCURY_GEN_PROC(attr_op_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(attr_op_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) - ((hg_string_t)(path)) ((hg_string_t)(attr_name)) ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(attr_rename_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) + ((hg_string_t)(path)) ((hg_string_t)(attr_name))) +MERCURY_GEN_PROC(attr_rename_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) ((hg_string_t)(path)) ((hg_string_t)(old_attr_name)) - ((hg_string_t)(new_attr_name)) ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(attr_io_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) + ((hg_string_t)(new_attr_name))) +MERCURY_GEN_PROC(attr_io_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((uint64_t)(parent_axe_id)) - ((hid_t)(type_id)) ((hg_bulk_t)(bulk_handle)) ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(attr_close_in_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) - ((axe_ids_t)(parent_axe_ids)) ((uint64_t)(axe_id))) + ((hid_t)(type_id)) ((hg_bulk_t)(bulk_handle))) +MERCURY_GEN_PROC(attr_close_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) + ((axe_ids_t)(parent_axe_ids))) -MERCURY_GEN_PROC(group_create_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(group_create_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((iod_obj_id_t)(grp_id)) ((uint64_t)(parent_axe_id)) ((hg_string_t)(name)) ((hid_t)(gapl_id)) - ((hid_t)(gcpl_id)) ((hid_t)(lcpl_id)) ((uint64_t)(axe_id))) + ((hid_t)(gcpl_id)) ((hid_t)(lcpl_id))) MERCURY_GEN_PROC(group_create_out_t, ((iod_handle_t)(iod_oh))) -MERCURY_GEN_PROC(group_open_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(group_open_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) ((hg_string_t)(name)) - ((hid_t)(gapl_id)) ((uint64_t)(axe_id))) + ((hid_t)(gapl_id))) MERCURY_GEN_PROC(group_open_out_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(gcpl_id))) -MERCURY_GEN_PROC(group_close_in_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) - ((uint64_t)(parent_axe_id)) ((uint64_t)(axe_id))) +MERCURY_GEN_PROC(group_close_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) + ((uint64_t)(parent_axe_id))) -MERCURY_GEN_PROC(map_create_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(map_create_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((iod_obj_id_t)(map_id)) ((uint64_t)(parent_axe_id)) ((hg_string_t)(name)) ((hid_t)(keytype_id)) ((hid_t)(valtype_id)) ((hid_t)(mapl_id)) ((hid_t)(mcpl_id)) - ((hid_t)(lcpl_id))((uint64_t)(axe_id))) + ((hid_t)(lcpl_id))) MERCURY_GEN_PROC(map_create_out_t, ((iod_handle_t)(iod_oh))) -MERCURY_GEN_PROC(map_open_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(map_open_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) - ((hg_string_t)(name)) ((hid_t)(mapl_id)) ((uint64_t)(axe_id))) + ((hg_string_t)(name)) ((hid_t)(mapl_id))) MERCURY_GEN_PROC(map_open_out_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(keytype_id)) ((hid_t)(valtype_id)) ((hid_t)(mcpl_id))) -MERCURY_GEN_PROC(map_set_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) +MERCURY_GEN_PROC(map_set_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((uint64_t)(parent_axe_id)) ((hid_t)(key_maptype_id)) ((hid_t)(key_memtype_id)) ((binary_buf_t)(key)) ((hid_t)(val_maptype_id)) ((hid_t)(val_memtype_id)) ((binary_buf_t)(val)) - ((hid_t)(dxpl_id)) ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(map_get_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) + ((hid_t)(dxpl_id))) +MERCURY_GEN_PROC(map_get_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((uint64_t)(parent_axe_id)) ((hid_t)(key_maptype_id)) ((hid_t)(key_memtype_id)) ((binary_buf_t)(key)) ((hid_t)(val_maptype_id)) ((hid_t)(val_memtype_id)) - ((hid_t)(dxpl_id)) ((uint64_t)(axe_id))) + ((hid_t)(dxpl_id))) MERCURY_GEN_PROC(map_get_out_t, ((int32_t)(ret)) ((value_t)(val))) -MERCURY_GEN_PROC(map_get_count_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) - ((iod_obj_id_t)(iod_id)) ((uint64_t)(parent_axe_id)) - ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(map_op_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) +MERCURY_GEN_PROC(map_get_count_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) + ((iod_obj_id_t)(iod_id)) ((uint64_t)(parent_axe_id))) +MERCURY_GEN_PROC(map_op_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((uint64_t)(parent_axe_id)) - ((hid_t)(key_maptype_id)) ((hid_t)(key_memtype_id)) ((binary_buf_t)(key)) - ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(map_close_in_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) - ((axe_ids_t)(parent_axe_ids)) ((uint64_t)(axe_id))) + ((hid_t)(key_maptype_id)) ((hid_t)(key_memtype_id)) ((binary_buf_t)(key))) +MERCURY_GEN_PROC(map_close_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) + ((axe_ids_t)(parent_axe_ids))) -MERCURY_GEN_PROC(dset_create_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(dset_create_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((iod_obj_id_t)(dset_id)) ((uint64_t)(parent_axe_id)) ((hg_string_t)(name)) ((hid_t)(dapl_id)) ((hid_t)(dcpl_id)) ((hid_t)(lcpl_id)) - ((hid_t)(type_id)) ((hid_t)(space_id)) ((uint64_t)(axe_id))) + ((hid_t)(type_id)) ((hid_t)(space_id))) MERCURY_GEN_PROC(dset_create_out_t, ((iod_handle_t)(iod_oh))) -MERCURY_GEN_PROC(dset_open_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(dset_open_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) - ((hg_string_t)(name)) ((hid_t)(dapl_id)) ((uint64_t)(axe_id))) + ((hg_string_t)(name)) ((hid_t)(dapl_id))) MERCURY_GEN_PROC(dset_open_out_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(dcpl_id)) ((hid_t)(type_id)) ((hid_t)(space_id))) -MERCURY_GEN_PROC(dset_set_extent_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) +MERCURY_GEN_PROC(dset_set_extent_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((axe_ids_t)(parent_axe_ids)) - ((dims_t)(dims)) ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(dset_io_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) + ((dims_t)(dims))) +MERCURY_GEN_PROC(dset_io_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((uint64_t)(parent_axe_id)) ((hid_t)(dset_type_id)) ((hid_t)(mem_type_id)) ((hid_t)(space_id)) ((hid_t)(dxpl_id)) ((uint32_t)(checksum)) - ((hg_bulk_t)(bulk_handle)) ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(dset_get_vl_size_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) + ((hg_bulk_t)(bulk_handle))) +MERCURY_GEN_PROC(dset_get_vl_size_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((uint64_t)(parent_axe_id)) ((hid_t)(mem_type_id)) - ((hid_t)(space_id)) ((hid_t)(dxpl_id)) ((uint64_t)(axe_id))) + ((hid_t)(space_id)) ((hid_t)(dxpl_id))) MERCURY_GEN_PROC(dset_read_out_t, ((int32_t)(ret)) ((uint32_t)(cs)) ((size_t)(buf_size))) -MERCURY_GEN_PROC(dset_close_in_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) - ((axe_ids_t)(parent_axe_ids)) ((uint64_t)(axe_id))) +MERCURY_GEN_PROC(dset_close_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) + ((axe_ids_t)(parent_axe_ids))) -MERCURY_GEN_PROC(dtype_commit_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(dtype_commit_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((iod_obj_id_t)(dtype_id)) ((uint64_t)(parent_axe_id)) ((hg_string_t)(name)) ((hid_t)(tapl_id)) ((hid_t)(tcpl_id)) ((hid_t)(lcpl_id)) - ((hid_t)(type_id)) ((uint64_t)(axe_id))) + ((hid_t)(type_id))) MERCURY_GEN_PROC(dtype_commit_out_t, ((iod_handle_t)(iod_oh))) -MERCURY_GEN_PROC(dtype_open_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(dtype_open_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) - ((hg_string_t)(name)) ((hid_t)(tapl_id)) ((uint64_t)(axe_id))) + ((hg_string_t)(name)) ((hid_t)(tapl_id))) MERCURY_GEN_PROC(dtype_open_out_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(tcpl_id)) ((hid_t)(type_id))) -MERCURY_GEN_PROC(dtype_close_in_t, ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) - ((uint64_t)(parent_axe_id)) ((uint64_t)(axe_id))) +MERCURY_GEN_PROC(dtype_close_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) + ((uint64_t)(parent_axe_id))) -MERCURY_GEN_PROC(link_create_in_t, ((int8_t)(create_type)) ((iod_handle_t)(coh)) +MERCURY_GEN_PROC(link_create_in_t, ((axe_t)(axe_info)) + ((int8_t)(create_type)) ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) ((hg_string_t)(loc_name)) ((iod_handle_t)(target_loc_oh)) ((iod_obj_id_t)(target_loc_id)) ((uint64_t)(target_parent_axe_id)) ((hg_string_t)(target_name)) ((hg_string_t)(link_value)) - ((hid_t)(lapl_id)) ((hid_t)(lcpl_id)) ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(link_move_in_t, ((hbool_t)(copy_flag)) ((iod_handle_t)(coh)) + ((hid_t)(lapl_id)) ((hid_t)(lcpl_id))) +MERCURY_GEN_PROC(link_move_in_t, ((axe_t)(axe_info)) + ((hbool_t)(copy_flag)) ((iod_handle_t)(coh)) ((iod_handle_t)(src_loc_oh)) ((iod_obj_id_t)(src_loc_id)) ((uint64_t)(src_parent_axe_id)) ((hg_string_t)(src_loc_name)) ((iod_handle_t)(dst_loc_oh)) ((iod_obj_id_t)(dst_loc_id)) ((uint64_t)(dst_parent_axe_id)) ((hg_string_t)(dst_loc_name)) - ((hid_t)(lapl_id)) ((hid_t)(lcpl_id)) ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(link_op_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) + ((hid_t)(lapl_id)) ((hid_t)(lcpl_id))) +MERCURY_GEN_PROC(link_op_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) - ((hg_string_t)(path)) ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(link_get_val_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) + ((hg_string_t)(path))) +MERCURY_GEN_PROC(link_get_val_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) - ((hg_string_t)(path)) ((uint64_t)(length)) ((uint64_t)(axe_id))) + ((hg_string_t)(path)) ((uint64_t)(length))) MERCURY_GEN_PROC(link_get_val_out_t, ((int32_t)(ret)) ((value_t)(value))) -MERCURY_GEN_PROC(object_op_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) +MERCURY_GEN_PROC(object_op_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) - ((hg_string_t)(loc_name)) ((uint64_t)(axe_id))) + ((hg_string_t)(loc_name))) MERCURY_GEN_PROC(object_open_out_t, ((int32_t)(obj_type)) ((iod_handle_t)(iod_oh)) ((iod_obj_id_t)(iod_id)) ((hid_t)(cpl_id)) ((hid_t)(type_id)) ((hid_t)(space_id))) -MERCURY_GEN_PROC(object_copy_in_t, ((iod_handle_t)(coh)) +MERCURY_GEN_PROC(object_copy_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(src_loc_oh)) ((iod_obj_id_t)(src_loc_id)) ((uint64_t)(src_parent_axe_id)) ((hg_string_t)(src_loc_name)) ((iod_handle_t)(dst_loc_oh)) ((iod_obj_id_t)(dst_loc_id)) ((uint64_t)(dst_parent_axe_id)) ((hg_string_t)(dst_loc_name)) - ((hid_t)(ocpypl_id)) ((hid_t)(lcpl_id)) ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(object_set_comment_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) + ((hid_t)(ocpypl_id)) ((hid_t)(lcpl_id))) +MERCURY_GEN_PROC(object_set_comment_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) - ((hg_string_t)(path)) ((hg_string_t)(comment)) ((uint64_t)(axe_id))) -MERCURY_GEN_PROC(object_get_comment_in_t, ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) + ((hg_string_t)(path)) ((hg_string_t)(comment))) +MERCURY_GEN_PROC(object_get_comment_in_t, ((axe_t)(axe_info)) + ((iod_handle_t)(coh)) ((iod_handle_t)(loc_oh)) ((iod_obj_id_t)(loc_id)) ((uint64_t)(parent_axe_id)) - ((hg_string_t)(path)) ((uint64_t)(length)) ((uint64_t)(axe_id))) + ((hg_string_t)(path)) ((uint64_t)(length))) MERCURY_GEN_PROC(object_get_comment_out_t, ((int32_t)(ret)) ((name_t)(name))) #endif /* H5_HAVE_EFF */ diff --git a/src/H5VLiod_dset.c b/src/H5VLiod_dset.c index 81843ec..fcb6455 100644 --- a/src/H5VLiod_dset.c +++ b/src/H5VLiod_dset.c @@ -870,7 +870,7 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, FUNC_ENTER_NOAPI_NOINIT #if H5VL_IOD_DEBUG - fprintf(stderr, "Dataset Write with AXE ID %llu\n",input->axe_id); + fprintf(stderr, "Dataset Write with AXE ID\n"); #endif /* open the dataset if we don't have the handle yet */ diff --git a/src/H5VLiod_encdec.c b/src/H5VLiod_encdec.c index baf61e4..8fbdf54 100644 --- a/src/H5VLiod_encdec.c +++ b/src/H5VLiod_encdec.c @@ -55,6 +55,32 @@ int hg_proc_ret_t(hg_proc_t proc, void *data) return ret; } +int hg_proc_axe_t(hg_proc_t proc, void *data) +{ + int ret = HG_SUCCESS; + axe_t *struct_data = (axe_t *) data; + + ret = hg_proc_uint64_t(proc, &struct_data->axe_id); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } + ret = hg_proc_uint64_t(proc, &struct_data->start_range); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } + ret = hg_proc_uint64_t(proc, &struct_data->count); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } + + return ret; +} /* Define hg_proc_htri_t */ int hg_proc_htri_t(hg_proc_t proc, void *data) { diff --git a/src/H5VLiod_server.c b/src/H5VLiod_server.c index ca4be57..8f38ecb 100644 --- a/src/H5VLiod_server.c +++ b/src/H5VLiod_server.c @@ -172,7 +172,7 @@ H5VLiod_start_handler(MPI_Comm comm, MPI_Info UNUSED info) if(AXEcreate_engine(&engine, &engine_attr) != AXE_SUCCEED) return FAIL; - /* Loop tp receive requests from clients */ + /* Loop to receive requests from clients */ while(1) { HG_Handler_process(0, HG_STATUS_IGNORE); if(shutdown) @@ -358,7 +358,7 @@ H5VL_iod_server_file_create(hg_handle_t handle) op_data->hg_handle = handle; op_data->input = (void *)input; - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + 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(H5E_FILE, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); @@ -405,7 +405,7 @@ H5VL_iod_server_file_open(hg_handle_t handle) op_data->hg_handle = handle; op_data->input = (void *)input; - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + 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(H5E_FILE, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); @@ -452,7 +452,7 @@ H5VL_iod_server_file_flush(hg_handle_t handle) op_data->hg_handle = handle; op_data->input = (void *)input; - if (AXE_SUCCEED != AXEcreate_barrier_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_barrier_task(engine, input->axe_info.axe_id, H5VL_iod_server_file_flush_cb, op_data, NULL)) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); @@ -500,7 +500,7 @@ H5VL_iod_server_file_close(hg_handle_t handle) op_data->hg_handle = handle; op_data->input = (void *)input; - if (AXE_SUCCEED != AXEcreate_barrier_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_barrier_task(engine, input->axe_info.axe_id, H5VL_iod_server_file_close_cb, op_data, NULL)) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); @@ -549,13 +549,13 @@ H5VL_iod_server_attr_create(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_attr_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_attr_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -605,13 +605,13 @@ H5VL_iod_server_attr_open(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_attr_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_attr_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -661,13 +661,13 @@ H5VL_iod_server_attr_read(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_attr_read_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_attr_read_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -717,13 +717,13 @@ H5VL_iod_server_attr_write(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_attr_write_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_attr_write_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -773,13 +773,13 @@ H5VL_iod_server_attr_exists(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_attr_exists_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_attr_exists_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -829,13 +829,13 @@ H5VL_iod_server_attr_rename(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_attr_rename_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_attr_rename_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -885,13 +885,13 @@ H5VL_iod_server_attr_remove(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_attr_remove_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_attr_remove_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -941,14 +941,14 @@ H5VL_iod_server_attr_close(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_ids.count) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, input->parent_axe_ids.count, input->parent_axe_ids.ids, 0, NULL, H5VL_iod_server_attr_close_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_attr_close_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -997,13 +997,13 @@ H5VL_iod_server_group_create(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_group_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_group_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1052,13 +1052,13 @@ H5VL_iod_server_group_open(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_group_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_group_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1107,13 +1107,13 @@ H5VL_iod_server_group_close(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_group_close_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_group_close_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1163,13 +1163,13 @@ H5VL_iod_server_dset_create(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_dset_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_dset_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1219,13 +1219,13 @@ H5VL_iod_server_dset_open(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_dset_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_dset_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1275,13 +1275,13 @@ H5VL_iod_server_dset_read(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_dset_read_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_dset_read_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1331,13 +1331,13 @@ H5VL_iod_server_dset_get_vl_size(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_dset_get_vl_size_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_dset_get_vl_size_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1387,13 +1387,13 @@ H5VL_iod_server_dset_write(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_dset_write_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_dset_write_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1443,14 +1443,14 @@ H5VL_iod_server_dset_set_extent(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_ids.count) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, input->parent_axe_ids.count, input->parent_axe_ids.ids, 0, NULL, H5VL_iod_server_dset_set_extent_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_dset_set_extent_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1512,14 +1512,14 @@ H5VL_iod_server_dset_close(hg_handle_t handle) i, input->parent_axe_ids.ids[i], status); } #endif - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, input->parent_axe_ids.count, input->parent_axe_ids.ids, 0, NULL, H5VL_iod_server_dset_close_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_dset_close_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1569,13 +1569,13 @@ H5VL_iod_server_dtype_commit(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_dtype_commit_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_dtype_commit_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1625,13 +1625,13 @@ H5VL_iod_server_dtype_open(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_dtype_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_dtype_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1681,13 +1681,13 @@ H5VL_iod_server_dtype_close(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_dtype_close_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_dtype_close_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1739,25 +1739,25 @@ H5VL_iod_server_link_create(hg_handle_t handle) if(input->parent_axe_id && input->target_parent_axe_id) { AXE_task_t tasks[2] = {input->parent_axe_id, input->target_parent_axe_id}; - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 2, tasks, 0, NULL, H5VL_iod_server_link_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else if(input->parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_link_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else if(input->target_parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->target_parent_axe_id, 0, NULL, H5VL_iod_server_link_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_link_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1809,25 +1809,25 @@ H5VL_iod_server_link_move(hg_handle_t handle) if(input->src_parent_axe_id && input->dst_parent_axe_id) { AXE_task_t tasks[2] = {input->src_parent_axe_id, input->dst_parent_axe_id}; - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 2, tasks, 0, NULL, H5VL_iod_server_link_move_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else if(input->src_parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->src_parent_axe_id, 0, NULL, H5VL_iod_server_link_move_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else if(input->dst_parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->dst_parent_axe_id, 0, NULL, H5VL_iod_server_link_move_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_link_move_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1922,13 +1922,13 @@ H5VL_iod_server_link_exists(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_link_exists_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_link_exists_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -1978,13 +1978,13 @@ H5VL_iod_server_link_get_info(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_link_get_info_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_link_get_info_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2034,13 +2034,13 @@ H5VL_iod_server_link_get_val(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_link_get_val_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_link_get_val_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2090,13 +2090,13 @@ H5VL_iod_server_link_remove(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_link_remove_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_link_remove_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2146,13 +2146,13 @@ H5VL_iod_server_object_open(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_object_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_object_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2204,25 +2204,25 @@ H5VL_iod_server_object_copy(hg_handle_t handle) if(input->src_parent_axe_id && input->dst_parent_axe_id) { AXE_task_t tasks[2] = {input->src_parent_axe_id, input->dst_parent_axe_id}; - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 2, tasks, 0, NULL, H5VL_iod_server_object_copy_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else if(input->src_parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->src_parent_axe_id, 0, NULL, H5VL_iod_server_object_copy_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else if(input->dst_parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->dst_parent_axe_id, 0, NULL, H5VL_iod_server_object_copy_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_object_copy_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2299,13 +2299,13 @@ H5VL_iod_server_object_exists(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_object_exists_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_object_exists_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2355,13 +2355,13 @@ H5VL_iod_server_object_set_comment(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_object_set_comment_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_object_set_comment_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2411,13 +2411,13 @@ H5VL_iod_server_object_get_comment(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_object_get_comment_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_object_get_comment_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2466,14 +2466,14 @@ H5VL_iod_server_object_get_info(hg_handle_t handle) op_data->hg_handle = handle; op_data->input = (void *)input; - if(input->parent_axe_id){ - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if(input->parent_axe_id) { + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_object_get_info_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_object_get_info_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2522,13 +2522,13 @@ H5VL_iod_server_map_create(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_map_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_map_create_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2577,13 +2577,13 @@ H5VL_iod_server_map_open(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_map_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_map_open_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2632,13 +2632,13 @@ H5VL_iod_server_map_set(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_map_set_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_map_set_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2687,13 +2687,13 @@ H5VL_iod_server_map_get(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_map_get_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_map_get_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2742,13 +2742,13 @@ H5VL_iod_server_map_get_count(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_map_get_count_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_map_get_count_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2797,13 +2797,13 @@ H5VL_iod_server_map_exists(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_map_exists_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_map_exists_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2852,13 +2852,13 @@ H5VL_iod_server_map_delete(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_id) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 1, &input->parent_axe_id, 0, NULL, H5VL_iod_server_map_delete_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_map_delete_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } @@ -2907,14 +2907,14 @@ H5VL_iod_server_map_close(hg_handle_t handle) op_data->input = (void *)input; if(input->parent_axe_ids.count) { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, input->parent_axe_ids.count, input->parent_axe_ids.ids, 0, NULL, H5VL_iod_server_map_close_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } else { - if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_id, 0, NULL, 0, NULL, + if (AXE_SUCCEED != AXEcreate_task(engine, input->axe_info.axe_id, 0, NULL, 0, NULL, H5VL_iod_server_map_close_cb, op_data, NULL)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, HG_FAIL, "can't insert task into async engine"); } -- cgit v0.12