diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2016-10-27 20:37:25 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2016-10-27 20:37:25 (GMT) |
commit | 0a8d7fc0eb0edfcc2b9f68e5ec963daff6b236eb (patch) | |
tree | be21a01f7fe5d2bfc11486103c61a72a8830de37 /src/H5VLdaosm.c | |
parent | 7d3eb922bb7c47264d430af714246f29fdb3ea64 (diff) | |
download | hdf5-0a8d7fc0eb0edfcc2b9f68e5ec963daff6b236eb.zip hdf5-0a8d7fc0eb0edfcc2b9f68e5ec963daff6b236eb.tar.gz hdf5-0a8d7fc0eb0edfcc2b9f68e5ec963daff6b236eb.tar.bz2 |
Add daos error code reporting.
Diffstat (limited to 'src/H5VLdaosm.c')
-rw-r--r-- | src/H5VLdaosm.c | 127 |
1 files changed, 65 insertions, 62 deletions
diff --git a/src/H5VLdaosm.c b/src/H5VLdaosm.c index 0afd7f8..586b630 100644 --- a/src/H5VLdaosm.c +++ b/src/H5VLdaosm.c @@ -490,6 +490,7 @@ H5VL_daosm_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fa daos_iov_t glob; uint64_t gh_sizes[2]; char *gh_buf = NULL; + int ret; void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -528,61 +529,61 @@ H5VL_daosm_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fa daos_obj_id_t oid = {0, 0, 0}; /* Connect to the pool */ - if(0 != daos_pool_connect(fa->pool_uuid, NULL/*fa->pool_grp DSMINC*/, NULL /*pool_svc*/, DAOS_PC_RW, &file->poh, NULL /*&file->pool_info*/, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't connect to pool") + if(0 != (ret = daos_pool_connect(fa->pool_uuid, NULL/*fa->pool_grp DSMINC*/, NULL /*pool_svc*/, DAOS_PC_RW, &file->poh, NULL /*&file->pool_info*/, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't connect to pool: %d", ret) /* Create the container for the file */ - if(0 != daos_cont_create(file->poh, file->uuid, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, NULL, "can't create container") + if(0 != (ret = daos_cont_create(file->poh, file->uuid, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, NULL, "can't create container: %d", ret) /* Open the container */ - if(0 != daos_cont_open(file->poh, file->uuid, DAOS_COO_RW, &file->coh, NULL /*&file->co_info*/, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open container") + if(0 != (ret = daos_cont_open(file->poh, file->uuid, DAOS_COO_RW, &file->coh, NULL /*&file->co_info*/, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open container: %d", ret) /* Query the epoch */ - if(0 != daos_epoch_query(file->coh, &epoch_state, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't hold epoch") + if(0 != (ret = daos_epoch_query(file->coh, &epoch_state, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't hold epoch: %d", ret) epoch = epoch_state.es_lhe; /* Create global metadata object */ daos_obj_id_generate(&oid, DAOS_OC_REPLICA_RW); - if(0 != daos_obj_declare(file->coh, oid, 0, NULL /*oa*/, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, NULL, "can't create global metadata object") + if(0 != (ret = daos_obj_declare(file->coh, oid, 0, NULL /*oa*/, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, NULL, "can't create global metadata object: %d", ret) /* Open global metadata object */ - if(0 != daos_obj_open(file->glob_md_oh, oid, 0, DAOS_OO_EXCL, &file->glob_md_oh, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open global metadata object") + if(0 != (ret = daos_obj_open(file->glob_md_oh, oid, 0, DAOS_OO_EXCL, &file->glob_md_oh, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open global metadata object: %d", ret) /* Create root group */ HDmemset(&oid, 0, sizeof(oid)); oid.lo = 1; daos_obj_id_generate(&oid, DAOS_OC_TINY_RW); - if(0 != daos_obj_declare(file->coh, oid, epoch, NULL /*oa*/, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't create root group") + if(0 != (ret = daos_obj_declare(file->coh, oid, epoch, NULL /*oa*/, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't create root group: %d", ret) /* Open root group */ - if(0 != daos_obj_open(file->root_oh, oid, epoch, DAOS_OO_RW, &file->root_oh, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't open root group") + if(0 != (ret = daos_obj_open(file->root_oh, oid, epoch, DAOS_OO_RW, &file->root_oh, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't open root group: %d", ret) /* Write root group OID to global metadata object DSMINC */ /* Flush the epoch */ - if(0 != daos_epoch_flush(file->coh, epoch, NULL /*state*/, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, NULL, "can't flush epoch") + if(0 != (ret = daos_epoch_flush(file->coh, epoch, NULL /*state*/, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, NULL, "can't flush epoch: %d", ret) if(file->num_procs > 1) { /* Calculate sizes of global pool and container handles */ glob.iov_buf = NULL; glob.iov_buf_len = 0; glob.iov_len = 0; - if(0 != daos_pool_local2global(file->poh, &glob)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global pool handle size") + if(0 != (ret = daos_pool_local2global(file->poh, &glob))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global pool handle size: %d", ret) gh_sizes[0] = (uint64_t)glob.iov_buf_len; glob.iov_buf = NULL; glob.iov_buf_len = 0; glob.iov_len = 0; - if(0 != daos_cont_local2global(file->coh, &glob)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global container handle size") + if(0 != (ret = daos_cont_local2global(file->coh, &glob))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global container handle size: %d", ret) gh_sizes[1] = (uint64_t)glob.iov_buf_len; /* Retrieve global pool and container handles */ @@ -591,14 +592,14 @@ H5VL_daosm_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fa glob.iov_buf = gh_buf; glob.iov_buf_len = gh_sizes[0]; glob.iov_len = 0; - if(0 != daos_pool_local2global(file->poh, &glob)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global pool handle") + if(0 != (ret = daos_pool_local2global(file->poh, &glob))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global pool handle: %d", ret) HDassert(glob.iov_len == glob.iov_buf_len); glob.iov_buf = gh_buf + gh_sizes[0]; glob.iov_buf_len = gh_sizes[1]; glob.iov_len = 0; - if(0 != daos_cont_local2global(file->coh, &glob)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global container handle") + if(0 != (ret = daos_cont_local2global(file->coh, &glob))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global container handle: %d", ret) HDassert(glob.iov_len == glob.iov_buf_len); /* MPI_Bcast gh_sizes */ @@ -611,8 +612,8 @@ H5VL_daosm_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fa } /* end if */ /* Commit epoch DSMINC */ - if(0 != daos_epoch_commit(file->coh, epoch, NULL /*state*/, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, NULL, "can't commit epoch") + if(0 != (ret = daos_epoch_commit(file->coh, epoch, NULL /*state*/, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, NULL, "can't commit epoch: %d", ret) epoch++; } /* end if */ else { @@ -632,13 +633,13 @@ H5VL_daosm_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fa glob.iov_buf = gh_buf; glob.iov_buf_len = gh_sizes[0]; glob.iov_len = gh_sizes[0]; - if(0 != daos_pool_global2local(glob, &file->poh)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't get local pool handle") + if(0 != (ret = daos_pool_global2local(glob, &file->poh))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't get local pool handle: %d", ret) glob.iov_buf = gh_buf + gh_sizes[0]; glob.iov_buf_len = gh_sizes[1]; glob.iov_len = gh_sizes[1]; - if(0 != daos_cont_global2local(file->poh, glob, &file->coh)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't get local container handle") + if(0 != (ret = daos_cont_global2local(file->poh, glob, &file->coh))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't get local container handle: %d", ret) /* Leave global md object and root group handles empty for now */ @@ -699,6 +700,7 @@ H5VL_daosm_file_open(const char *name, unsigned flags, hid_t fapl_id, daos_iov_t glob; uint64_t gh_sizes[2]; char *gh_buf = NULL; + int ret; void *ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -728,44 +730,44 @@ H5VL_daosm_file_open(const char *name, unsigned flags, hid_t fapl_id, daos_obj_id_t oid = {0, 0, 0}; /* Connect to the pool */ - if(0 != daos_pool_connect(fa->pool_uuid, NULL/*fa->pool_grp DSMINC*/, NULL /*pool_svc*/, DAOS_PC_RW, &file->poh, NULL /*&file->pool_info*/, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't connect to pool") + if(0 != (ret = daos_pool_connect(fa->pool_uuid, NULL/*fa->pool_grp DSMINC*/, NULL /*pool_svc*/, DAOS_PC_RW, &file->poh, NULL /*&file->pool_info*/, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't connect to pool: %d", ret) /* Open the container */ - if(0 != daos_cont_open(file->poh, file->uuid, DAOS_COO_RW, &file->coh, NULL /*&file->co_info*/, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open container") + if(0 != (ret = daos_cont_open(file->poh, file->uuid, DAOS_COO_RW, &file->coh, NULL /*&file->co_info*/, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open container: %d", ret) /* Query the epoch */ - if(0 != daos_epoch_query(file->coh, &epoch_state, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't hold epoch") + if(0 != (ret = daos_epoch_query(file->coh, &epoch_state, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't hold epoch: %d", ret) epoch = epoch_state.es_lhe; /* Open global metadata object */ daos_obj_id_generate(&oid, DAOS_OC_REPLICA_RW); - if(0 != daos_obj_open(file->glob_md_oh, oid, 0, DAOS_OO_EXCL, &file->glob_md_oh, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open global metadata object") + if(0 != (ret = daos_obj_open(file->glob_md_oh, oid, 0, DAOS_OO_EXCL, &file->glob_md_oh, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "can't open global metadata object: %d", ret) /* Open root group */ /* Read root group OID from global metadata object DSMINC */ HDmemset(&oid, 0, sizeof(oid)); oid.lo = 1; daos_obj_id_generate(&oid, DAOS_OC_TINY_RW); - if(0 != daos_obj_open(file->root_oh, oid, epoch, DAOS_OO_RW, &file->root_oh, NULL /*event*/)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't open root group") + if(0 != (ret = daos_obj_open(file->root_oh, oid, epoch, DAOS_OO_RW, &file->root_oh, NULL /*event*/))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't open root group: %d", ret) if(file->num_procs > 1) { /* Calculate sizes of global pool and container handles */ glob.iov_buf = NULL; glob.iov_buf_len = 0; glob.iov_len = 0; - if(0 != daos_pool_local2global(file->poh, &glob)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global pool handle size") + if(0 != (ret = daos_pool_local2global(file->poh, &glob))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global pool handle size: %d", ret) gh_sizes[0] = (uint64_t)glob.iov_buf_len; glob.iov_buf = NULL; glob.iov_buf_len = 0; glob.iov_len = 0; - if(0 != daos_cont_local2global(file->coh, &glob)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global container handle size") + if(0 != (ret = daos_cont_local2global(file->coh, &glob))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global container handle size: %d", ret) gh_sizes[1] = (uint64_t)glob.iov_buf_len; /* Retrieve global pool and container handles */ @@ -774,14 +776,14 @@ H5VL_daosm_file_open(const char *name, unsigned flags, hid_t fapl_id, glob.iov_buf = gh_buf; glob.iov_buf_len = gh_sizes[0]; glob.iov_len = 0; - if(0 != daos_pool_local2global(file->poh, &glob)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global pool handle") + if(0 != (ret = daos_pool_local2global(file->poh, &glob))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global pool handle: %d", ret) HDassert(glob.iov_len == glob.iov_buf_len); glob.iov_buf = gh_buf + gh_sizes[0]; glob.iov_buf_len = gh_sizes[1]; glob.iov_len = 0; - if(0 != daos_cont_local2global(file->coh, &glob)) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global container handle") + if(0 != (ret = daos_cont_local2global(file->coh, &glob))) + HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't get global container handle: %d", ret) HDassert(glob.iov_len == glob.iov_buf_len); /* MPI_Bcast gh_sizes */ @@ -810,13 +812,13 @@ H5VL_daosm_file_open(const char *name, unsigned flags, hid_t fapl_id, glob.iov_buf = gh_buf; glob.iov_buf_len = gh_sizes[0]; glob.iov_len = gh_sizes[0]; - if(0 != daos_pool_global2local(glob, &file->poh)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't get local pool handle") + if(0 != (ret = daos_pool_global2local(glob, &file->poh))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't get local pool handle: %d", ret) glob.iov_buf = gh_buf + gh_sizes[0]; glob.iov_buf_len = gh_sizes[1]; glob.iov_len = gh_sizes[1]; - if(0 != daos_cont_global2local(file->poh, glob, &file->coh)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't get local container handle") + if(0 != (ret = daos_cont_global2local(file->poh, glob, &file->coh))) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, NULL, "can't get local container handle: %d", ret) /* Leave global md object and root group handles empty for now */ @@ -869,6 +871,7 @@ H5VL_daosm_file_close(void *_file, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UN { H5VL_daosm_file_t *file = (H5VL_daosm_file_t *)_file; daos_handle_t hdl_inval = DAOS_HDL_INVAL; + int ret; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -886,17 +889,17 @@ H5VL_daosm_file_close(void *_file, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UN if(file->fcpl_id != FAIL && H5I_dec_ref(file->fcpl_id) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "failed to close plist"); if(!HDmemcmp(&file->glob_md_oh, &hdl_inval, sizeof(hdl_inval))) - if(0 != daos_obj_close(file->glob_md_oh, NULL /*event*/)) - HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close global metadata object") + if(0 != (ret = daos_obj_close(file->glob_md_oh, NULL /*event*/))) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close global metadata object: %d", ret) if(!HDmemcmp(&file->root_oh, &hdl_inval, sizeof(hdl_inval))) - if(0 != daos_obj_close(file->root_oh, NULL /*event*/)) - HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close root group") + if(0 != (ret = daos_obj_close(file->root_oh, NULL /*event*/))) + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close root group: %d", ret) if(!HDmemcmp(&file->coh, &hdl_inval, sizeof(hdl_inval))) - if(0 != daos_cont_close(file->coh, NULL /*event*/)) - HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close container") + if(0 != (ret = daos_cont_close(file->coh, NULL /*event*/))) + HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close container: %d", ret) if(!HDmemcmp(&file->poh, &hdl_inval, sizeof(hdl_inval))) - if(0 != daos_pool_disconnect(file->poh, NULL /*event*/)) - HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't disconnect from pool") + if(0 != (ret = daos_pool_disconnect(file->poh, NULL /*event*/))) + HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't disconnect from pool: %d", ret) file = H5FL_FREE(H5VL_daosm_file_t, file); FUNC_LEAVE_NOAPI(ret_value) |