From 202e92d6bc3dd4e785dfca00c930adaf6d78cfa8 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Thu, 17 Oct 2013 16:13:27 -0500 Subject: [svn-r24321] - Update FF branch to work with latest Mercury implementation. - some minor fixes. --- examples/h5ff_client_dset.c | 4 + src/H5VLiod.c | 11 +++ src/H5VLiod_attr.c | 8 ++ src/H5VLiod_client.c | 173 ++++++++++++++++++++++++++++++++++++++++---- src/H5VLiod_dset.c | 11 ++- src/H5VLiod_dtype.c | 8 ++ src/H5VLiod_encdec.c | 8 +- src/H5VLiod_file.c | 8 ++ src/H5VLiod_group.c | 8 ++ src/H5VLiod_map.c | 10 ++- src/H5VLiod_obj.c | 22 ++++-- 11 files changed, 249 insertions(+), 22 deletions(-) diff --git a/examples/h5ff_client_dset.c b/examples/h5ff_client_dset.c index 5ae072c..3463ad8 100644 --- a/examples/h5ff_client_dset.c +++ b/examples/h5ff_client_dset.c @@ -494,6 +494,10 @@ int main(int argc, char **argv) { free(rdata2); free(rdata3); + free(dset_token1); + free(dset_token2); + free(dset_token3); + EFF_finalize(); MPI_Finalize(); diff --git a/src/H5VLiod.c b/src/H5VLiod.c index e05cd3d..5315ac7 100644 --- a/src/H5VLiod.c +++ b/src/H5VLiod.c @@ -696,8 +696,14 @@ EFF_init(MPI_Comm comm, MPI_Info UNUSED info) /* forward the init call to the ION and wait for its completion */ if(HG_Forward(PEER, H5VL_EFF_INIT_ID, &num_procs, &ret_value, &hg_req) < 0) return FAIL; + + /* Wait for it to compete */ HG_Wait(hg_req, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE); + /* Free Mercury request */ + if(HG_Request_free(hg_req) != HG_SUCCESS) + return FAIL; + return ret_value; } /* end EFF_init() */ @@ -743,8 +749,13 @@ EFF_finalize(void) /* forward the finalize call to the ION and wait for it to complete */ if(HG_Forward(PEER, H5VL_EFF_FINALIZE_ID, &ret_value, &ret_value, &hg_req) < 0) return FAIL; + HG_Wait(hg_req, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE); + /* Free Mercury request */ + if(HG_Request_free(hg_req) != HG_SUCCESS) + return FAIL; + /* Free addr id */ if (HG_SUCCESS != NA_Addr_free(network_class, PEER)) return FAIL; diff --git a/src/H5VLiod_attr.c b/src/H5VLiod_attr.c index 68641da..76ba293 100644 --- a/src/H5VLiod_attr.c +++ b/src/H5VLiod_attr.c @@ -73,6 +73,10 @@ H5VL_iod_server_attr_create_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start attribute Create %s on object path %s\n", attr_name, loc_name); #endif + /* MSC - Remove when we have IOD */ + attr_oh.rd_oh.cookie=0; + attr_oh.wr_oh.cookie=0; + /* Open the object where the attribute needs to be created. */ if(H5VL_iod_server_open_path(coh, loc_id, loc_handle, loc_name, rtid, &obj_id, &obj_oh) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); @@ -312,6 +316,10 @@ H5VL_iod_server_attr_open_cb(AXE_engine_t UNUSED axe_engine, /* close the attribute KV holder */ iod_obj_close(attr_kv_oh, NULL, NULL); + /* MSC - Remove when we have IOD */ + attr_oh.rd_oh.cookie=0; + attr_oh.wr_oh.cookie=0; + /* open the attribute */ if (iod_obj_open_read(coh, attr_id, NULL /*hints*/, &attr_oh.rd_oh, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); diff --git a/src/H5VLiod_client.c b/src/H5VLiod_client.c index ec60e04..fb7fd46 100644 --- a/src/H5VLiod_client.c +++ b/src/H5VLiod_client.c @@ -428,7 +428,7 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) switch(req->type) { case HG_FILE_CREATE: if(IOD_OH_UNDEFINED == req->obj->file->remote_file.coh.cookie) { - fprintf(stderr, "failed to create/open file\n"); + fprintf(stderr, "failed to create file\n"); req->status = H5ES_STATUS_FAIL; req->state = H5VL_IOD_COMPLETED; } @@ -437,7 +437,7 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) break; case HG_FILE_OPEN: if(IOD_OH_UNDEFINED == req->obj->file->remote_file.coh.cookie) { - fprintf(stderr, "failed to create/open file\n"); + fprintf(stderr, "failed to open file\n"); req->status = H5ES_STATUS_FAIL; req->state = H5VL_IOD_COMPLETED; } @@ -462,17 +462,20 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) rc->c_version = file->remote_file.c_version; rc->file = file; } + + /* increment ref count on ID generated by Mercury encoding callback */ + if(H5I_inc_ref(req->obj->file->remote_file.fcpl_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); } H5VL_iod_request_delete(file, req); break; case HG_ATTR_CREATE: - case HG_ATTR_OPEN: { H5VL_iod_attr_t *attr = (H5VL_iod_attr_t *)req->obj; if(IOD_OH_UNDEFINED == attr->remote_attr.iod_oh.rd_oh.cookie) { - fprintf(stderr, "failed to create/open Attribute\n"); + fprintf(stderr, "failed to create Attribute\n"); req->status = H5ES_STATUS_FAIL; req->state = H5VL_IOD_COMPLETED; } @@ -480,58 +483,157 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) H5VL_iod_request_delete(file, req); break; } + case HG_ATTR_OPEN: + { + H5VL_iod_attr_t *attr = (H5VL_iod_attr_t *)req->obj; + + if(IOD_OH_UNDEFINED == attr->remote_attr.iod_oh.rd_oh.cookie) { + fprintf(stderr, "failed to open Attribute\n"); + req->status = H5ES_STATUS_FAIL; + req->state = H5VL_IOD_COMPLETED; + } + else { + /* increment ref count on IDs generated by Mercury encoding callback */ + if(H5I_inc_ref(attr->remote_attr.acpl_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + if(H5I_inc_ref(attr->remote_attr.type_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + if(H5I_inc_ref(attr->remote_attr.space_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + } + H5VL_iod_request_delete(file, req); + break; + } case HG_GROUP_CREATE: + { + H5VL_iod_group_t *group = (H5VL_iod_group_t *)req->obj; + + if(IOD_OH_UNDEFINED == group->remote_group.iod_oh.rd_oh.cookie) { + fprintf(stderr, "failed to create Group\n"); + req->status = H5ES_STATUS_FAIL; + req->state = H5VL_IOD_COMPLETED; + } + + H5VL_iod_request_delete(file, req); + break; + } case HG_GROUP_OPEN: { H5VL_iod_group_t *group = (H5VL_iod_group_t *)req->obj; if(IOD_OH_UNDEFINED == group->remote_group.iod_oh.rd_oh.cookie) { - fprintf(stderr, "failed to create/open Group\n"); + fprintf(stderr, "failed to open Group\n"); req->status = H5ES_STATUS_FAIL; req->state = H5VL_IOD_COMPLETED; } + else { + /* increment ref count on IDs generated by Mercury encoding callback */ + if(H5I_inc_ref(group->remote_group.gcpl_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + } H5VL_iod_request_delete(file, req); break; } case HG_MAP_CREATE: + { + H5VL_iod_map_t *map = (H5VL_iod_map_t *)req->obj; + + if(IOD_OH_UNDEFINED == map->remote_map.iod_oh.rd_oh.cookie) { + fprintf(stderr, "failed to create Map\n"); + req->status = H5ES_STATUS_FAIL; + req->state = H5VL_IOD_COMPLETED; + } + + H5VL_iod_request_delete(file, req); + break; + } case HG_MAP_OPEN: { H5VL_iod_map_t *map = (H5VL_iod_map_t *)req->obj; if(IOD_OH_UNDEFINED == map->remote_map.iod_oh.rd_oh.cookie) { - fprintf(stderr, "failed to create/open Map\n"); + fprintf(stderr, "failed to open Map\n"); req->status = H5ES_STATUS_FAIL; req->state = H5VL_IOD_COMPLETED; } + else { + /* increment ref count on IDs generated by Mercury encoding callback */ + if(H5I_inc_ref(map->remote_map.mcpl_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + if(H5I_inc_ref(map->remote_map.keytype_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + if(H5I_inc_ref(map->remote_map.valtype_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + } H5VL_iod_request_delete(file, req); break; } case HG_DSET_CREATE: + { + H5VL_iod_dset_t *dset = (H5VL_iod_dset_t *)req->obj; + + if(IOD_OH_UNDEFINED == dset->remote_dset.iod_oh.rd_oh.cookie) { + fprintf(stderr, "failed to create Dataset\n"); + req->status = H5ES_STATUS_FAIL; + req->state = H5VL_IOD_COMPLETED; + } + + H5VL_iod_request_delete(file, req); + break; + } case HG_DSET_OPEN: { H5VL_iod_dset_t *dset = (H5VL_iod_dset_t *)req->obj; if(IOD_OH_UNDEFINED == dset->remote_dset.iod_oh.rd_oh.cookie) { - fprintf(stderr, "failed to create/open Dataset\n"); + fprintf(stderr, "failed to open Dataset\n"); req->status = H5ES_STATUS_FAIL; req->state = H5VL_IOD_COMPLETED; } + else { + /* increment ref count on IDs generated by Mercury encoding callback */ + if(H5I_inc_ref(dset->remote_dset.dcpl_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + if(H5I_inc_ref(dset->remote_dset.type_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + if(H5I_inc_ref(dset->remote_dset.space_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + } H5VL_iod_request_delete(file, req); break; } case HG_DTYPE_COMMIT: + { + H5VL_iod_dtype_t *dtype = (H5VL_iod_dtype_t *)req->obj; + + if(IOD_OH_UNDEFINED == dtype->remote_dtype.iod_oh.rd_oh.cookie) { + fprintf(stderr, "failed to commit Datatype\n"); + req->status = H5ES_STATUS_FAIL; + req->state = H5VL_IOD_COMPLETED; + } + + H5VL_iod_request_delete(file, req); + break; + } case HG_DTYPE_OPEN: { H5VL_iod_dtype_t *dtype = (H5VL_iod_dtype_t *)req->obj; if(IOD_OH_UNDEFINED == dtype->remote_dtype.iod_oh.rd_oh.cookie) { - fprintf(stderr, "failed to create/open Attribute\n"); + fprintf(stderr, "failed to open Datatype\n"); req->status = H5ES_STATUS_FAIL; req->state = H5VL_IOD_COMPLETED; } + else { + /* increment ref count on IDs generated by Mercury encoding callback */ + if(H5I_inc_ref(dtype->remote_dtype.tcpl_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + if(H5I_inc_ref(dtype->remote_dtype.type_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + } H5VL_iod_request_delete(file, req); break; @@ -881,6 +983,7 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) input.val_size = output->val_size; input.val_handle = *info->value_handle; input.rcxt_num = rc->c_version; + input.cs_scope = map->common.file->md_integrity_scope; vl_read_info.output = output; vl_read_info.value_handle = info->value_handle; @@ -907,6 +1010,7 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) } /* free stuff associated with request */ + info->value_handle = (hg_bulk_t *)H5MM_xfree(info->value_handle); HDfree(value_buf); if(H5Tclose(info->val_mem_type_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "unable to release datatype"); @@ -1273,10 +1377,15 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) req->state = H5VL_IOD_COMPLETED; } + /* Free Mercury request */ + if(HG_Request_free(*((hg_request_t *)req->req)) != HG_SUCCESS) + HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "Can't Free Mercury Request"); + free(result); req->data = NULL; H5VL_iod_request_delete(file, req); - break; + HGOTO_DONE(ret_value); + //break; } case HG_OBJECT_OPEN_BY_TOKEN: { @@ -1293,9 +1402,32 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) break; } case HG_OBJECT_OPEN: - req->data = NULL; - H5VL_iod_request_delete(file, req); - break; + { + H5VL_iod_remote_object_t *obj = (H5VL_iod_remote_object_t *)req->data; + + if(IOD_OH_UNDEFINED == obj->iod_oh.rd_oh.cookie) { + fprintf(stderr, "failed to open Object\n"); + req->status = H5ES_STATUS_FAIL; + req->state = H5VL_IOD_COMPLETED; + } + else { + /* increment ref count on IDs generated by Mercury encoding callback */ + if(H5I_inc_ref(obj->cpl_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + if(FAIL != obj->type_id) { + if(H5I_inc_ref(obj->type_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + } + if(FAIL != obj->space_id) { + if(H5I_inc_ref(obj->space_id, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count"); + } + } + + req->data = NULL; + H5VL_iod_request_delete(file, req); + break; + } case HG_OBJECT_GET_COMMENT: { object_get_comment_out_t *result = (object_get_comment_out_t *)req->data; @@ -1306,9 +1438,14 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) req->state = H5VL_IOD_COMPLETED; } + /* Free Mercury request */ + if(HG_Request_free(*((hg_request_t *)req->req)) != HG_SUCCESS) + HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "Can't Free Mercury Request"); + free(result); H5VL_iod_request_delete(file, req); - break; + HGOTO_DONE(ret_value); + //break; } case HG_RC_ACQUIRE: { @@ -1373,6 +1510,11 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) H5VL_iod_request_delete(file, req); HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "Request Type not supported"); } + + /* Free Mercury request */ + if(HG_Request_free(*((hg_request_t *)req->req)) != HG_SUCCESS) + HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "Can't Free Mercury Request"); + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_request_complete */ @@ -1733,6 +1875,11 @@ H5VL_iod_request_cancel(H5VL_iod_file_t *file, H5VL_iod_request_t *req) H5VL_iod_request_delete(file, req); HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "Request Type not supported"); } + + /* Free Mercury request */ + if(HG_Request_free(*((hg_request_t *)req->req)) != HG_SUCCESS) + HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "Can't Free Mercury Request"); + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_iod_request_cancel */ diff --git a/src/H5VLiod_dset.c b/src/H5VLiod_dset.c index 543da38..f4679ed 100644 --- a/src/H5VLiod_dset.c +++ b/src/H5VLiod_dset.c @@ -106,6 +106,10 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, FUNC_ENTER_NOAPI_NOINIT + /* MSC - Remove when we have IOD */ + dset_oh.rd_oh.cookie=0; + dset_oh.wr_oh.cookie=0; + /* the traversal will retrieve the location where the dataset needs to be created. The traversal will fail if an intermediate group does not exist. */ @@ -313,9 +317,13 @@ H5VL_iod_server_dset_open_cb(AXE_engine_t UNUSED axe_engine, if(H5VL_iod_server_open_path(coh, loc_id, loc_handle, name, rtid, &dset_id, &dset_oh) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); + /* MSC - Remove when we have IOD */ + dset_oh.rd_oh.cookie=0; + dset_oh.wr_oh.cookie=0; + /* open a write handle on the ID. */ if (iod_obj_open_write(coh, dset_id, NULL, &dset_oh.wr_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current dset"); /* get scratch pad of the dataset */ if(iod_obj_get_scratch(dset_oh.rd_oh, rtid, &sp, &sp_cs, NULL) < 0) @@ -414,6 +422,7 @@ H5VL_iod_server_dset_open_cb(AXE_engine_t UNUSED axe_engine, done: if(ret_value < 0) { + fprintf(stderr, "DSET open FAILED\n"); output.iod_oh.rd_oh.cookie = IOD_OH_UNDEFINED; output.iod_oh.wr_oh.cookie = IOD_OH_UNDEFINED; output.iod_id = IOD_ID_UNDEFINED; diff --git a/src/H5VLiod_dtype.c b/src/H5VLiod_dtype.c index 6cbeb84..2943947 100644 --- a/src/H5VLiod_dtype.c +++ b/src/H5VLiod_dtype.c @@ -75,6 +75,10 @@ H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start datatype Commit %s\n", name); #endif + /* MSC - Remove when we have IOD */ + dtype_oh.rd_oh.cookie=0; + dtype_oh.wr_oh.cookie=0; + /* the traversal will retrieve the location where the datatype needs to be created. The traversal will fail if an intermediate group does not exist. */ @@ -299,6 +303,10 @@ H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, if(H5VL_iod_server_open_path(coh, loc_id, loc_handle, name, rtid, &dtype_id, &dtype_oh) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); + /* MSC - Remove when we have IOD */ + dtype_oh.rd_oh.cookie=0; + dtype_oh.wr_oh.cookie=0; + /* open a write handle on the ID. */ if (iod_obj_open_write(coh, dtype_id, NULL, &dtype_oh.wr_oh, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current datatype"); diff --git a/src/H5VLiod_encdec.c b/src/H5VLiod_encdec.c index 0b9f709..8db5328 100644 --- a/src/H5VLiod_encdec.c +++ b/src/H5VLiod_encdec.c @@ -719,7 +719,7 @@ int hg_proc_hid_t(hg_proc_t proc, void *data) op = hg_proc_get_op(proc); if (HG_ENCODE == op || HG_FREE == op) { - if(0 == id) + if(FAIL == id) type = H5I_UNINIT; else type = H5Iget_type(id); @@ -757,6 +757,12 @@ int hg_proc_hid_t(hg_proc_t proc, void *data) } break; case H5I_UNINIT: + ret = hg_proc_int32_t(proc, (hid_t *)data); + if (ret != HG_SUCCESS) { + HG_ERROR_DEFAULT("Proc error"); + ret = HG_FAIL; + return ret; + } break; default: HG_ERROR_DEFAULT("Unsupported hid_t - Proc error"); diff --git a/src/H5VLiod_file.c b/src/H5VLiod_file.c index 85421ec..5647c8a 100644 --- a/src/H5VLiod_file.c +++ b/src/H5VLiod_file.c @@ -66,6 +66,10 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start file create %s\n", input->name); #endif + /* MSC - Remove when we have IOD */ + root_oh.rd_oh.cookie=0; + root_oh.wr_oh.cookie=0; + /* convert HDF5 flags to IOD flags */ mode = (input->flags&H5F_ACC_RDWR) ? IOD_CONT_RW : IOD_CONT_RO; if (input->flags&H5F_ACC_CREAT) @@ -249,6 +253,10 @@ H5VL_iod_server_file_open_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start file open %s %d %d\n", input->name, input->flags, input->fapl_id); #endif + /* MSC - Remove when we have IOD */ + root_oh.rd_oh.cookie=0; + root_oh.wr_oh.cookie=0; + if(H5Pget_metadata_integrity_scope(input->fapl_id, &cs_scope) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); diff --git a/src/H5VLiod_group.c b/src/H5VLiod_group.c index 9ffa2bf..953d49d 100644 --- a/src/H5VLiod_group.c +++ b/src/H5VLiod_group.c @@ -71,6 +71,10 @@ H5VL_iod_server_group_create_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start group create %s\n", name); #endif + /* MSC - Remove when we have IOD */ + grp_oh.rd_oh.cookie=0; + grp_oh.wr_oh.cookie=0; + /* the traversal will retrieve the location where the group needs to be created. The traversal will fail if an intermediate group does not exist. */ @@ -234,6 +238,10 @@ H5VL_iod_server_group_open_cb(AXE_engine_t UNUSED axe_engine, if(H5VL_iod_server_open_path(coh, loc_id, loc_handle, name, rtid, &grp_id, &grp_oh) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); + /* MSC - Remove when we have IOD */ + grp_oh.rd_oh.cookie=0; + grp_oh.wr_oh.cookie=0; + /* open a write handle on the ID. */ if (iod_obj_open_write(coh, grp_id, NULL, &grp_oh.wr_oh, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); diff --git a/src/H5VLiod_map.c b/src/H5VLiod_map.c index 5c207d9..a474473 100644 --- a/src/H5VLiod_map.c +++ b/src/H5VLiod_map.c @@ -78,6 +78,10 @@ H5VL_iod_server_map_create_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start map create %s\n", name); #endif + /* MSC - Remove when we have IOD */ + map_oh.rd_oh.cookie=0; + map_oh.wr_oh.cookie=0; + /* the traversal will retrieve the location where the map needs to be created. The traversal will fail if an intermediate group does not exist. */ @@ -174,7 +178,7 @@ H5VL_iod_server_map_create_cb(AXE_engine_t UNUSED axe_engine, output.iod_oh.wr_oh.cookie = map_oh.wr_oh.cookie; HG_Handler_start_output(op_data->hg_handle, &output); - done: +done: /* return an UNDEFINED oh to the client if the operation failed */ if(ret_value < 0) { fprintf(stderr, "Failed Map Create\n"); @@ -239,6 +243,10 @@ H5VL_iod_server_map_open_cb(AXE_engine_t UNUSED axe_engine, if(H5VL_iod_server_open_path(coh, loc_id, loc_handle, name, rtid, &map_id, &map_oh) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); + /* MSC - Remove when we have IOD */ + map_oh.rd_oh.cookie=0; + map_oh.wr_oh.cookie=0; + /* open a write handle on the ID. */ if (iod_obj_open_write(coh, map_id, NULL, &map_oh.wr_oh, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current map"); diff --git a/src/H5VLiod_obj.c b/src/H5VLiod_obj.c index 22ea781..d34cfd0 100644 --- a/src/H5VLiod_obj.c +++ b/src/H5VLiod_obj.c @@ -59,6 +59,10 @@ H5VL_iod_server_object_open_by_token_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start Object Open by token = %llu\n", obj_id); #endif + /* MSC - Remove when we have IOD */ + obj_oh.rd_oh.cookie=0; + obj_oh.wr_oh.cookie=0; + if (iod_obj_open_read(coh, obj_id, NULL /*hints*/, &obj_oh.rd_oh, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); if (iod_obj_open_write(coh, obj_id, NULL /*hints*/, &obj_oh.wr_oh, NULL) < 0) @@ -122,6 +126,10 @@ H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start Object Open\n"); #endif + /* MSC - Remove when we have IOD */ + obj_oh.rd_oh.cookie=0; + obj_oh.wr_oh.cookie=0; + /* Traverse Path and open object */ if(H5VL_iod_server_open_path(coh, input->loc_id, input->loc_oh, input->loc_name, rtid, &obj_id, &obj_oh) < 0) @@ -243,8 +251,8 @@ H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, switch(output.obj_type){ case H5I_GROUP: output.cpl_id = H5P_GROUP_CREATE_DEFAULT; - output.type_id = 0; - output.space_id = 0; + output.type_id = FAIL; + output.space_id = FAIL; break; case H5I_DATASET: output.cpl_id = H5P_DATASET_CREATE_DEFAULT; @@ -254,7 +262,7 @@ H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, case H5I_DATATYPE: output.cpl_id = H5P_DATATYPE_CREATE_DEFAULT; output.type_id = obj_oh.cookie; - output.space_id = 0; + output.space_id = FAIL; break; default: HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "not a valid object (dataset, group, or datatype)") @@ -263,8 +271,8 @@ H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, /* Fake something */ output.obj_type = H5I_GROUP; output.cpl_id = H5P_GROUP_CREATE_DEFAULT; - output.type_id = 0; - output.space_id = 0; + output.type_id = FAIL; + output.space_id = FAIL; #endif output.iod_id = obj_id; @@ -284,7 +292,9 @@ done: output.iod_oh.rd_oh.cookie = IOD_OH_UNDEFINED; output.iod_oh.wr_oh.cookie = IOD_OH_UNDEFINED; output.iod_id = IOD_ID_UNDEFINED; - output.cpl_id = H5P_GROUP_CREATE_DEFAULT; + output.cpl_id = FAIL; + output.type_id = FAIL; + output.space_id = FAIL; HG_Handler_start_output(op_data->hg_handle, &output); } -- cgit v0.12