From 6622117e5377c4ada89f392c527b8c83d9049ce0 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Wed, 6 Nov 2013 19:26:31 -0500 Subject: [svn-r24410] more IOD integration. --- examples/Makefile.am | 26 ++-- examples/Makefile.in | 26 ++-- examples/h5ff_client_multiple_cont.c | 251 ++++++++++++++++------------------- src/H5VLiod.c | 2 +- src/H5VLiod_client.c | 2 +- src/H5VLiod_dset.c | 234 +++++++++++++++++--------------- src/H5VLiod_dtype.c | 81 +++++------ src/H5VLiod_file.c | 11 +- src/H5VLiod_group.c | 9 +- src/H5VLiod_obj.c | 152 ++++++++++----------- src/H5VLiod_server.c | 5 +- src/H5VLiod_util.c | 21 +-- 12 files changed, 417 insertions(+), 403 deletions(-) diff --git a/examples/Makefile.am b/examples/Makefile.am index 06ea2ea..6313495 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -40,23 +40,23 @@ endif # Don't tell automake about them, because if it knew they were programs, # it would try to compile them instead of using the h5cc script. # Use the boilerplate in config/examples.am instead. -EXAMPLE_PROG = h5_write h5_read h5_extend_write h5_chunk_read h5_compound \ - h5_crtgrpd h5_subset h5_cmprss h5_rdwt h5_crtgrpar h5_extend \ - h5_crtatt h5_crtgrp h5_crtdat \ - h5_group h5_select h5_attribute h5_mount h5_reference h5_drivers \ - h5_ref2reg h5_extlink h5_elink_unix2win h5_shared_mesg \ - h5_external_log_native_vol +EXAMPLE_PROG = #h5_write h5_read h5_extend_write h5_chunk_read h5_compound \ + #h5_crtgrpd h5_subset h5_cmprss h5_rdwt h5_crtgrpar h5_extend \ + #h5_crtatt h5_crtgrp h5_crtdat \ + #h5_group h5_select h5_attribute h5_mount h5_reference h5_drivers \ + #h5_ref2reg h5_extlink h5_elink_unix2win h5_shared_mesg \ + #h5_external_log_native_vol TEST_SCRIPT=testh5cc.sh # Install files # List all file that should be installed in examples directory -INSTALL_FILES = h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c \ - h5_crtgrpd.c h5_subset.c h5_cmprss.c h5_rdwt.c h5_crtgrpar.c \ - h5_extend.c h5_crtatt.c h5_crtgrp.c h5_crtdat.c \ - h5_compound.c h5_group.c h5_select.c h5_attribute.c h5_mount.c \ - h5_reference.c h5_drivers.c h5_extlink.c h5_elink_unix2win.c \ - h5_ref2reg.c h5_shared_mesg.c ph5example.c \ - h5_external_log_native_vol.c +INSTALL_FILES = #h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c \ + #h5_crtgrpd.c h5_subset.c h5_cmprss.c h5_rdwt.c h5_crtgrpar.c \ + #h5_extend.c h5_crtatt.c h5_crtgrp.c h5_crtdat.c \ + #h5_compound.c h5_group.c h5_select.c h5_attribute.c h5_mount.c \ + #h5_reference.c h5_drivers.c h5_extlink.c h5_elink_unix2win.c \ + #h5_ref2reg.c h5_shared_mesg.c ph5example.c \ + #h5_external_log_native_vol.c INSTALL_SCRIPT_FILES = run-c-ex.sh run_ff_tests.sh diff --git a/examples/Makefile.in b/examples/Makefile.in index 5287862..71e9eb1 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -414,24 +414,24 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog $(EXTLINK_DIRS) *.h5 # Don't tell automake about them, because if it knew they were programs, # it would try to compile them instead of using the h5cc script. # Use the boilerplate in config/examples.am instead. -EXAMPLE_PROG = h5_write h5_read h5_extend_write h5_chunk_read h5_compound \ - h5_crtgrpd h5_subset h5_cmprss h5_rdwt h5_crtgrpar h5_extend \ - h5_crtatt h5_crtgrp h5_crtdat \ - h5_group h5_select h5_attribute h5_mount h5_reference h5_drivers \ - h5_ref2reg h5_extlink h5_elink_unix2win h5_shared_mesg \ - h5_external_log_native_vol +EXAMPLE_PROG = #h5_write h5_read h5_extend_write h5_chunk_read h5_compound \ + #h5_crtgrpd h5_subset h5_cmprss h5_rdwt h5_crtgrpar h5_extend \ + #h5_crtatt h5_crtgrp h5_crtdat \ + #h5_group h5_select h5_attribute h5_mount h5_reference h5_drivers \ + #h5_ref2reg h5_extlink h5_elink_unix2win h5_shared_mesg \ + #h5_external_log_native_vol TEST_SCRIPT = testh5cc.sh # Install files # List all file that should be installed in examples directory -INSTALL_FILES = h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c \ - h5_crtgrpd.c h5_subset.c h5_cmprss.c h5_rdwt.c h5_crtgrpar.c \ - h5_extend.c h5_crtatt.c h5_crtgrp.c h5_crtdat.c \ - h5_compound.c h5_group.c h5_select.c h5_attribute.c h5_mount.c \ - h5_reference.c h5_drivers.c h5_extlink.c h5_elink_unix2win.c \ - h5_ref2reg.c h5_shared_mesg.c ph5example.c \ - h5_external_log_native_vol.c +INSTALL_FILES = #h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c \ + #h5_crtgrpd.c h5_subset.c h5_cmprss.c h5_rdwt.c h5_crtgrpar.c \ + #h5_extend.c h5_crtatt.c h5_crtgrp.c h5_crtdat.c \ + #h5_compound.c h5_group.c h5_select.c h5_attribute.c h5_mount.c \ + #h5_reference.c h5_drivers.c h5_extlink.c h5_elink_unix2win.c \ + #h5_ref2reg.c h5_shared_mesg.c ph5example.c \ + #h5_external_log_native_vol.c INSTALL_SCRIPT_FILES = run-c-ex.sh run_ff_tests.sh INSTALL_TOP_SCRIPT_FILES = run-all-ex.sh diff --git a/examples/h5ff_client_multiple_cont.c b/examples/h5ff_client_multiple_cont.c index a5c0ecb..5f85742 100644 --- a/examples/h5ff_client_multiple_cont.c +++ b/examples/h5ff_client_multiple_cont.c @@ -15,17 +15,16 @@ int main(int argc, char **argv) { const char file_name1[]="/eff_file_1"; const char file_name2[]="/eff_file_2"; hid_t fid1, fid2; - hid_t gid1, gid2, gid3, gid4; - hid_t sid; + hid_t gid1, gid2; hid_t did1, did2; hid_t dtid1, dtid2; - + hid_t sid; hid_t tid1, tid2, rid1, rid2, rid3, rid4; hid_t fapl_id, trspl_id; hid_t e_stack; - void *gid_token1, *gid_token2, *gid_token3, *gid_token4; - size_t token_size1, token_size2, token_size3, token_size4; + void *token1, *token2, *token3, *token4, *token5, *token6; + size_t token_size1, token_size2, token_size3, token_size4, token_size5, token_size6; uint64_t version; uint64_t trans_num; @@ -36,7 +35,7 @@ int main(int argc, char **argv) { hsize_t dims[1]; int my_rank, my_size; int provided; - MPI_Request mpi_req, mpi_reqs[8]; + MPI_Request mpi_req, mpi_reqs[12]; H5ES_status_t status; size_t num_events = 0; @@ -80,6 +79,16 @@ int main(int argc, char **argv) { wdata2[i]=i; } + /* create a 32 bit integer LE datatype. This is a local operation + that does not touch the file */ + dtid1 = H5Tcopy(H5T_NATIVE_INT); + dtid2 = H5Tcopy(H5T_NATIVE_INT); + + /* create a dataspace. This is a local Bookeeping operation that + does not touch the file */ + dims [0] = 60; + sid = H5Screate_simple(1, dims, NULL); + /* create an event Queue for managing asynchronous requests. Event Queues will releive the use from managing and completing @@ -128,17 +137,28 @@ int main(int argc, char **argv) { /* create groups */ gid1 = H5Gcreate_ff(fid1, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid1, e_stack); - gid2 = H5Gcreate_ff(fid1, "G1/G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid1, e_stack); - //gid2 = H5Gcreate_ff(gid1, "G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid1, e_stack); - - gid3 = H5Gcreate_ff(fid2, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid2, e_stack); - gid4 = H5Gcreate_ff(gid3, "G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid2, e_stack); + gid2 = H5Gcreate_ff(fid2, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid2, e_stack); + + /* Commit datatypes to the files */ + H5Tcommit_ff(fid1, "int", dtid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, + tid1, e_stack); + H5Tcommit_ff(fid2, "int", dtid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, + tid2, e_stack); + + /* create Datasets */ + did1 = H5Dcreate_ff(gid1, "D1", dtid1, sid, + H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, tid1, e_stack); + did2 = H5Dcreate_ff(gid2, "D1", dtid2, sid, + H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, tid2, e_stack); + + /* Raw data write on D1. */ + H5Dwrite_ff(did1, dtid1, sid, sid, H5P_DEFAULT, wdata1, tid1, e_stack); + H5Dwrite_ff(did2, dtid2, sid, sid, H5P_DEFAULT, wdata2, tid2, e_stack); } /* Tell other procs that transaction 1 is started */ MPI_Ibcast(&trans_num, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD, &mpi_req); - /* Do the local-to-global, global-to-local, so all delegates can write the gids created in transaction 1 */ @@ -148,36 +168,57 @@ int main(int argc, char **argv) { assert(0 == ret); ret = H5Oget_token(gid2, NULL, &token_size2); assert(0 == ret); - ret = H5Oget_token(gid3, NULL, &token_size3); + ret = H5Oget_token(dtid1, NULL, &token_size3); + assert(0 == ret); + ret = H5Oget_token(dtid2, NULL, &token_size4); + assert(0 == ret); + ret = H5Oget_token(did1, NULL, &token_size5); assert(0 == ret); - ret = H5Oget_token(gid4, NULL, &token_size4); + ret = H5Oget_token(did2, NULL, &token_size6); assert(0 == ret); /* allocate buffers for each token */ - gid_token1 = malloc(token_size1); - gid_token2 = malloc(token_size2); - gid_token3 = malloc(token_size3); - gid_token4 = malloc(token_size4); + token1 = malloc(token_size1); + token2 = malloc(token_size2); + token3 = malloc(token_size3); + token4 = malloc(token_size4); + token5 = malloc(token_size5); + token6 = malloc(token_size6); /* get the token buffer */ - ret = H5Oget_token(gid1, gid_token1, &token_size1); + ret = H5Oget_token(gid1, token1, &token_size1); assert(0 == ret); - ret = H5Oget_token(gid2, gid_token2, &token_size2); + ret = H5Oget_token(gid2, token2, &token_size2); assert(0 == ret); - ret = H5Oget_token(gid3, gid_token3, &token_size3); + ret = H5Oget_token(dtid1, token3, &token_size3); assert(0 == ret); - ret = H5Oget_token(gid4, gid_token4, &token_size4); + ret = H5Oget_token(dtid2, token4, &token_size4); assert(0 == ret); + ret = H5Oget_token(did1, token5, &token_size5); + assert(0 == ret); + ret = H5Oget_token(did2, token6, &token_size6); + assert(0 == ret); + + /* make sure the create operations have completed before + telling the delegates to open them */ + H5ESget_count(e_stack, &num_events); + H5ESwait_all(e_stack, &status); + H5ESclear(e_stack); + printf("%d events in event stack. Completion status = %d\n", num_events, status); /* bcast the token sizes and the tokens */ MPI_Ibcast(&token_size1, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[0]); MPI_Ibcast(&token_size2, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[1]); MPI_Ibcast(&token_size3, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[2]); MPI_Ibcast(&token_size4, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[3]); - MPI_Ibcast(gid_token1, token_size1, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[4]); - MPI_Ibcast(gid_token2, token_size2, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[5]); - MPI_Ibcast(gid_token3, token_size3, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[6]); - MPI_Ibcast(gid_token3, token_size3, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[7]); + MPI_Ibcast(&token_size5, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[4]); + MPI_Ibcast(&token_size6, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[5]); + MPI_Ibcast(token1, token_size1, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[6]); + MPI_Ibcast(token2, token_size2, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[7]); + MPI_Ibcast(token3, token_size3, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[8]); + MPI_Ibcast(token4, token_size4, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[9]); + MPI_Ibcast(token5, token_size5, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[10]); + MPI_Ibcast(token6, token_size6, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[11]); } /* Leader can continue writing to transaction 1, @@ -193,25 +234,38 @@ int main(int argc, char **argv) { MPI_Ibcast(&token_size2, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[1]); MPI_Ibcast(&token_size3, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[2]); MPI_Ibcast(&token_size4, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[3]); - MPI_Waitall(4, mpi_reqs, MPI_STATUS_IGNORE); + MPI_Ibcast(&token_size5, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[4]); + MPI_Ibcast(&token_size6, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[5]); + MPI_Waitall(6, mpi_reqs, MPI_STATUS_IGNORE); /* allocate buffers for each token */ - gid_token1 = malloc(token_size1); - gid_token2 = malloc(token_size2); - gid_token3 = malloc(token_size3); - gid_token4 = malloc(token_size4); + token1 = malloc(token_size1); + token2 = malloc(token_size2); + token3 = malloc(token_size3); + token4 = malloc(token_size4); + token5 = malloc(token_size5); + token6 = malloc(token_size6); /* recieve the tokens */ - MPI_Ibcast(gid_token1, token_size1, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[0]); - MPI_Ibcast(gid_token2, token_size2, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[1]); - MPI_Ibcast(gid_token3, token_size3, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[2]); - MPI_Ibcast(gid_token4, token_size4, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[3]); - MPI_Waitall(4, mpi_reqs, MPI_STATUS_IGNORE); - - gid1 = H5Oopen_by_token(gid_token1, rid1, e_stack); - gid2 = H5Oopen_by_token(gid_token2, rid1, e_stack); - gid3 = H5Oopen_by_token(gid_token3, rid2, e_stack); - gid4 = H5Oopen_by_token(gid_token4, rid2, e_stack); + MPI_Ibcast(token1, token_size1, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[0]); + MPI_Ibcast(token2, token_size2, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[1]); + MPI_Ibcast(token3, token_size3, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[2]); + MPI_Ibcast(token4, token_size4, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[3]); + MPI_Ibcast(token5, token_size5, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[4]); + MPI_Ibcast(token6, token_size6, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[5]); + MPI_Waitall(6, mpi_reqs, MPI_STATUS_IGNORE); + + gid1 = H5Oopen_by_token(token1, rid1, e_stack); + gid2 = H5Oopen_by_token(token2, rid2, e_stack); + dtid1 = H5Oopen_by_token(token3, rid1, e_stack); + dtid2 = H5Oopen_by_token(token4, rid2, e_stack); + did1 = H5Oopen_by_token(token5, rid1, e_stack); + did2 = H5Oopen_by_token(token6, rid2, e_stack); + + ret = H5Dread_ff(did1, dtid1, sid, sid, H5P_DEFAULT, rdata1, rid1, e_stack); + assert(ret == 0); + ret = H5Dread_ff(did2, dtid2, sid, sid, H5P_DEFAULT, rdata2, rid2, e_stack); + assert(ret == 0); } /* none leader procs have to complete operations before notifying the leader */ @@ -220,6 +274,16 @@ int main(int argc, char **argv) { H5ESwait_all(e_stack, &status); H5ESclear(e_stack); printf("%d events in event stack. Completion status = %d\n", num_events, status); + + fprintf(stderr, "Read Data from container 1: "); + for(i=0;i 0); - rid4 = H5RCcreate(fid2, version); - assert(rid4 > 0); - } - - /* read data from datasets with read version 1. */ - ret = H5Dread_ff(did1, dtid1, sid, sid, H5P_DEFAULT, rdata1, rid3, e_stack); - assert(ret == 0); - ret = H5Dread_ff(did2, dtid2, sid, sid, H5P_DEFAULT, rdata2, rid4, e_stack); - assert(ret == 0); - fprintf(stderr, "\n*****************************************************************************************************************\n"); fprintf(stderr, "Close Objects\n"); fprintf(stderr, "*****************************************************************************************************************\n"); - /* closing did1 acts as a barrier task at the server for all - operations dependeing on the dataset. This is asynchronous. */ assert(H5Dclose_ff(did1, e_stack) == 0); assert(H5Dclose_ff(did2, e_stack) == 0); assert(H5Tclose_ff(dtid1, e_stack) == 0); assert(H5Tclose_ff(dtid2, e_stack) == 0); -#endif - assert(H5Gclose_ff(gid1, e_stack) == 0); assert(H5Gclose_ff(gid2, e_stack) == 0); - assert(H5Gclose_ff(gid3, e_stack) == 0); - assert(H5Gclose_ff(gid4, e_stack) == 0); ret = H5RCclose(rid1); assert(0 == ret); ret = H5RCclose(rid2); assert(0 == ret); - MPI_Barrier(MPI_COMM_WORLD); - assert(H5Fclose_ff(fid1, e_stack) == 0); assert(H5Fclose_ff(fid2, e_stack) == 0); @@ -381,8 +350,16 @@ int main(int argc, char **argv) { printf("%d events in event stack. Completion status = %d\n", num_events, status); H5ESclose(e_stack); + H5Sclose(sid); H5Pclose(fapl_id); + free(token1); + free(token2); + free(token3); + free(token4); + free(token5); + free(token6); + free(wdata1); free(rdata1); free(wdata2); @@ -396,7 +373,7 @@ int main(int argc, char **argv) { and shutsdown the FS server (when all clients send the terminate request) and client */ EFF_finalize(); - MPI_Finalize(); + return 0; } diff --git a/src/H5VLiod.c b/src/H5VLiod.c index 9f5d493..bd9dedc 100644 --- a/src/H5VLiod.c +++ b/src/H5VLiod.c @@ -3507,7 +3507,7 @@ H5VL_iod_datatype_commit(void *_obj, H5VL_loc_params_t UNUSED loc_params, const HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "failed to copy dtype"); /* set common object parameters */ - dtype->common.obj_type = H5I_DATASET; + dtype->common.obj_type = H5I_DATATYPE; dtype->common.file = obj->file; dtype->common.file->nopen_objs ++; diff --git a/src/H5VLiod_client.c b/src/H5VLiod_client.c index f7bb5da..79ccd05 100644 --- a/src/H5VLiod_client.c +++ b/src/H5VLiod_client.c @@ -1310,7 +1310,7 @@ H5VL_iod_request_complete(H5VL_iod_file_t *file, H5VL_iod_request_t *req) H5VL_iod_dtype_t *dtype = (H5VL_iod_dtype_t *)req->obj; if(SUCCEED != *status) { - fprintf(stderr, "DATATYPE delete failed at the server\n"); + fprintf(stderr, "datatype close failed at the server\n"); req->status = H5ES_STATUS_FAIL; req->state = H5VL_IOD_COMPLETED; } diff --git a/src/H5VLiod_dset.c b/src/H5VLiod_dset.c index 069bcf8..b145049 100644 --- a/src/H5VLiod_dset.c +++ b/src/H5VLiod_dset.c @@ -95,40 +95,48 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, hid_t dcpl_id; iod_array_struct_t array; /* IOD array struct describing the dataset's dimensions */ scratch_pad sp; + iod_ret_t ret; iod_size_t array_dims[H5S_MAX_RANK], current_dims[H5S_MAX_RANK]; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start dataset create %s at %"PRIu64"\n", name, loc_handle.wr_oh); +#endif + /* the traversal will retrieve the location where the dataset needs to be created. The traversal will fail if an intermediate group does not exist. */ if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, rtid, FALSE, &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + fprintf(stderr, "Creating Dataset ID %"PRIx64" ", dset_id); + fprintf(stderr, "at (OH %"PRIu64" ID %"PRIx64")\n", cur_oh.wr_oh, cur_id); /* Set the IOD array creation parameters */ array.cell_size = H5Tget_size(input->type_id); array.num_dims = H5Sget_simple_extent_ndims(space_id); if(H5Sget_simple_extent_dims(space_id, current_dims, array_dims) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get dimentions' sizes"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "can't get dimentions' sizes"); if(H5S_UNLIMITED == array_dims[0]) { array_dims[0] = current_dims[0]; - array.firstdim_max = H5S_UNLIMITED; + array.firstdim_max = IOD_DIMLEN_UNLIMITED; } else { array.firstdim_max = array_dims[0]; } - + array.current_dims = current_dims; array.chunk_dims = NULL; /* MSC - NEED TO FIX THAT */ #if 0 if(layout.type == H5D_CHUNKED) { if(NULL == (array.chunk_dims = malloc (sizeof(iod_size_t) * layout.u.chunk.ndims))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate chunk dimention size array"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate chunk dimention size array"); array.chunk_dims; } #endif @@ -139,21 +147,24 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, #endif /* create the dataset */ - if(iod_obj_create(coh, wtid, NULL, IOD_OBJ_ARRAY, NULL, &array, &dset_id, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Array object"); + ret = iod_obj_create(coh, wtid, NULL, IOD_OBJ_ARRAY, NULL, &array, &dset_id, NULL); + if(ret != 0) { + fprintf(stderr, "ret: %d error: %s\n", ret, strerror(-ret)); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Array object"); + } if (iod_obj_open_read(coh, dset_id, NULL, &dset_oh.rd_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Dataset"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Dataset for Read"); 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 Dataset"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Dataset for Write"); /* create the attribute KV object for the dataset */ if(iod_obj_create(coh, wtid, NULL, IOD_OBJ_KV, NULL, NULL, &attrkv_id, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't create attribute KV object"); /* create the metadata KV object for the dataset */ if(iod_obj_create(coh, wtid, NULL, IOD_OBJ_KV, NULL, NULL, &mdkv_id, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); /* set values for the scratch pad object */ sp[0] = mdkv_id; @@ -167,16 +178,16 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, sp_cs = H5_checksum_crc64(&sp, sizeof(sp)); if (iod_obj_set_scratch(dset_oh.wr_oh, wtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); } else { if (iod_obj_set_scratch(dset_oh.wr_oh, wtid, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); } /* Open Metadata KV object for write */ if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); if(H5P_DEFAULT == input->dcpl_id) input->dcpl_id = H5Pcopy(H5P_DATASET_CREATE_DEFAULT); @@ -185,17 +196,17 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, /* insert plist metadata */ if(H5VL_iod_insert_plist(mdkv_oh, wtid, dcpl_id, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert link count metadata */ if(H5VL_iod_insert_link_count(mdkv_oh, wtid, (uint64_t)1, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert object type metadata */ if(H5VL_iod_insert_object_type(mdkv_oh, wtid, H5I_DATASET, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* MSC - need to check size of datatype if it fits in entry otherwise create a BLOB*/ @@ -203,21 +214,21 @@ H5VL_iod_server_dset_create_cb(AXE_engine_t UNUSED axe_engine, /* insert datatype metadata */ if(H5VL_iod_insert_datatype(mdkv_oh, wtid, input->type_id, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert dataspace metadata */ if(H5VL_iod_insert_dataspace(mdkv_oh, wtid, space_id, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close the Metadata KV object */ if(iod_obj_close(mdkv_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); /* add link in parent group to current object */ if(H5VL_iod_insert_new_link(cur_oh.wr_oh, wtid, last_comp, H5L_TYPE_HARD, &dset_id, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close parent group if it is not the location we started the traversal into */ @@ -297,41 +308,41 @@ H5VL_iod_server_dset_open_cb(AXE_engine_t UNUSED axe_engine, /* Traverse Path and open dset */ 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"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); /* 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 dset"); + HGOTO_ERROR2(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) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); } /* open the metadata scratch pad */ if (iod_obj_open_read(coh, sp[0], NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_PLIST, H5VL_IOD_KEY_OBJ_CPL, NULL, NULL, &output.dcpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dcpl"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dcpl"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_DATATYPE, H5VL_IOD_KEY_OBJ_DATATYPE, NULL, NULL, &output.type_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve datatype"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_DATASPACE, H5VL_IOD_KEY_OBJ_DATASPACE, NULL, NULL, &output.space_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dataspace"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dataspace"); /* close the metadata scratch pad */ if(iod_obj_close(mdkv_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); output.iod_id = dset_id; output.mdkv_id = sp[0]; @@ -413,24 +424,28 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, /* open the dataset if we don't have the handle yet */ if(iod_oh.rd_oh.cookie == IOD_OH_UNDEFINED) { if (iod_obj_open_read(coh, iod_id, NULL /*hints*/, &iod_oh.rd_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); opened_locally = TRUE; } +#if H5VL_IOD_DEBUG + fprintf(stderr, "Start dataset Read on OH %"PRIu64" OID %"PRIx64"\n", iod_oh.rd_oh, iod_id); +#endif + if(H5P_DEFAULT == input->dxpl_id) input->dxpl_id = H5Pcopy(H5P_DATASET_XFER_DEFAULT); dxpl_id = input->dxpl_id; /* get the scope for data integrity checks for raw data */ if(H5Pget_rawdata_integrity_scope(dxpl_id, &raw_cs_scope) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + HGOTO_ERROR2(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); /* retrieve size of bulk data asked for to be read */ size = HG_Bulk_handle_get_size(bulk_handle); /* allocate buffer to hold data */ if(NULL == (buf = malloc(size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); /* get the number of points selected */ nelmts = (size_t)H5Sget_select_npoints(space_id); @@ -460,7 +475,7 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, /* do data conversion */ if(H5Tconvert(src_id, dst_id, nelmts, buf, NULL, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed"); + HGOTO_ERROR2(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed"); if(raw_cs_scope) { /* calculate a checksum for the data to be sent */ @@ -473,7 +488,7 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, #endif /* MSC - check if client requested to corrupt data */ if(H5Pget_dxpl_inject_corruption(dxpl_id, &flag) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); if(flag) { fprintf(stderr, "Injecting a bad data value to cause corruption \n"); ((char *)buf)[0] = 54; @@ -484,7 +499,7 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, /* If the data is of variable length, special access is required */ if(H5VL__iod_server_vl_data_io(coh, iod_oh.rd_oh, space_id, dst_id, src_id, FALSE, buf, buf_size, dxpl_id, rtid) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); if(!(raw_cs_scope & H5_CHECKSUM_NONE)) { /* calculate a checksum for the data to be sent */ @@ -497,14 +512,14 @@ H5VL_iod_server_dset_read_cb(AXE_engine_t UNUSED axe_engine, /* Write bulk data here and wait for the data to be there */ if(HG_SUCCESS != HG_Bulk_write_all(dest, bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); /* wait for it to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); /* free block handle */ if(HG_SUCCESS != HG_Bulk_block_handle_free(bulk_block_handle)) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't free bds block handle"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "can't free bds block handle"); done: output.ret = ret_value; @@ -584,7 +599,7 @@ H5VL_iod_server_dset_get_vl_size_cb(AXE_engine_t UNUSED axe_engine, /* open the dataset if we don't have the handle yet */ if(iod_oh.rd_oh.cookie == IOD_OH_UNDEFINED) { if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh.rd_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); opened_locally = TRUE; } @@ -594,7 +609,7 @@ H5VL_iod_server_dset_get_vl_size_cb(AXE_engine_t UNUSED axe_engine, /* allocate buffer to hold blob IDs */ if(NULL == (buf = malloc(nelmts * sizeof(iod_obj_id_t) + sizeof(iod_size_t)))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); /* buffer always contains the length of each sequence, so initialize it to the size required to store those lengths */ @@ -603,12 +618,12 @@ H5VL_iod_server_dset_get_vl_size_cb(AXE_engine_t UNUSED axe_engine, /* get the number of decriptors required, i.e. the numbers of iod I/O operations needed */ if(H5VL_iod_get_file_desc(space_id, &num_descriptors, NULL) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to generate IOD file descriptor from dataspace selection"); + HGOTO_ERROR2(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to generate IOD file descriptor from dataspace selection"); /* allocate the IOD hyperslab descriptors needed */ if(NULL == (hslabs = (iod_hyperslab_t *)malloc (sizeof(iod_hyperslab_t) * (size_t)num_descriptors))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate iod array descriptors"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate iod array descriptors"); for(n=0 ; ndxpl_id) input->dxpl_id = H5Pcopy(H5P_DATASET_XFER_DEFAULT); dxpl_id = input->dxpl_id; @@ -814,38 +829,39 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, /* allocate buffer to hold data */ if(NULL == (buf = malloc(size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate read buffer"); /* create a Mercury block handle for transfer */ HG_Bulk_block_handle_create(buf, size, HG_BULK_READWRITE, &bulk_block_handle); /* Write bulk data here and wait for the data to be there */ if(HG_SUCCESS != HG_Bulk_read_all(source, bulk_handle, bulk_block_handle, &bulk_request)) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); + HGOTO_ERROR2(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); /* wait for it to complete */ if(HG_SUCCESS != HG_Bulk_wait(bulk_request, HG_MAX_IDLE_TIME, HG_STATUS_IGNORE)) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); + HGOTO_ERROR2(H5E_SYM, H5E_WRITEERROR, FAIL, "can't get data from function shipper"); /* free the bds block handle */ if(HG_SUCCESS != HG_Bulk_block_handle_free(bulk_block_handle)) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "can't free bds block handle"); + HGOTO_ERROR2(H5E_SYM, H5E_WRITEERROR, FAIL, "can't free bds block handle"); /* MSC - check if client requested to corrupt data */ if(H5Pget_dxpl_inject_corruption(dxpl_id, &flag) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "can't read property list"); if(flag) { ((int *)buf)[0] = 10; } /* get the scope for data integrity checks for raw data */ if(H5Pget_rawdata_integrity_scope(dxpl_id, &raw_cs_scope) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); + HGOTO_ERROR2(H5E_PLIST, H5E_CANTGET, FAIL, "can't get scope for data integrity checks"); /* verify data if transfer flag is set */ if(raw_cs_scope & H5_CHECKSUM_TRANSFER) { data_cs = H5_checksum_crc64(buf, size); if(cs != data_cs) { - fprintf(stderr, "Errrr.. Network transfer Data corruption. expecting %"PRIu64", got %"PRIu64"\n", + fprintf(stderr, + "Errrr.. Network transfer Data corruption. expecting %"PRIu64", got %"PRIu64"\n", cs, data_cs); ret_value = FAIL; goto done; @@ -874,11 +890,11 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, if(!is_vl_data) { /* convert data if needed */ if(H5Tconvert(src_id, dst_id, nelmts, buf, NULL, dxpl_id) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") + HGOTO_ERROR2(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed") if(H5VL__iod_server_final_io(coh, iod_oh.wr_oh, space_id, dst_id, TRUE, buf, buf_size, cs, raw_cs_scope, wtid) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + HGOTO_ERROR2(H5E_SYM, H5E_WRITEERROR, FAIL, "can't write to array object"); #if H5VL_IOD_DEBUG { @@ -895,7 +911,7 @@ H5VL_iod_server_dset_write_cb(AXE_engine_t UNUSED axe_engine, /* If the data is of variable length, special access is required */ if(H5VL__iod_server_vl_data_io(coh, iod_oh.wr_oh, space_id, src_id, dst_id, TRUE, buf, buf_size, dxpl_id, wtid) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); } done: @@ -962,13 +978,13 @@ H5VL_iod_server_dset_set_extent_cb(AXE_engine_t UNUSED axe_engine, /* open the dataset if we don't have the handle yet */ if(iod_oh.wr_oh.cookie == IOD_OH_UNDEFINED) { if (iod_obj_open_write(coh, iod_id, NULL /*hints*/, &iod_oh.wr_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); opened_locally = TRUE; } /* extend along the first dimension only */ if(iod_array_extend(iod_oh.wr_oh, wtid, (iod_size_t)input->dims.size[0], NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't extend dataset"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't extend dataset"); /* modify the dataspace of the dataset */ { @@ -978,29 +994,29 @@ H5VL_iod_server_dset_set_extent_cb(AXE_engine_t UNUSED axe_engine, /* open the metadata scratch pad */ if (iod_obj_open_write(coh, mdkv_id, NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); /* get the stored dataset dataspace */ if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_DATASPACE, H5VL_IOD_KEY_OBJ_DATASPACE, NULL, NULL, &space_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dataspace"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dataspace"); /* Check if we are shrinking or expanding any of the dimensions */ if((rank = H5Sget_simple_extent_ndims(space_id)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions"); + HGOTO_ERROR2(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions"); /* Modify the size of the data space */ if(H5Sset_extent_simple(space_id, rank, input->dims.size, NULL) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space"); + HGOTO_ERROR2(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space"); /* insert dataspace metadata */ if(H5VL_iod_insert_dataspace(mdkv_oh, wtid, space_id, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close the metadata scratch pad */ if(iod_obj_close(mdkv_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); } done: @@ -1016,7 +1032,7 @@ done: /* close the dataset if we opened it in this routine */ if(opened_locally) { if(iod_obj_close(iod_oh.wr_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Array object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Array object"); } FUNC_LEAVE_NOAPI_VOID @@ -1055,9 +1071,9 @@ H5VL_iod_server_dset_close_cb(AXE_engine_t UNUSED axe_engine, #endif if(iod_obj_close(iod_oh.rd_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); if(iod_obj_close(iod_oh.wr_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); done: #if H5VL_IOD_DEBUG @@ -1104,6 +1120,7 @@ H5VL__iod_server_final_io(iod_handle_t coh, iod_handle_t iod_oh, hid_t space_id, iod_array_io_t *io_array = NULL; /* arary for list I/O */ uint8_t *buf_ptr = NULL; size_t elmt_size; + iod_ret_t ret; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -1112,17 +1129,17 @@ H5VL__iod_server_final_io(iod_handle_t coh, iod_handle_t iod_oh, hid_t space_id, /* get the rank of the dataspace */ if((ndims = H5Sget_simple_extent_ndims(space_id)) < 0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get dataspace dimesnsion"); + HGOTO_ERROR2(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get dataspace dimesnsion"); /* get the number of decriptors required, i.e. the numbers of iod I/O operations needed */ if(H5VL_iod_get_file_desc(space_id, &num_descriptors, NULL) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to generate IOD file descriptor from dataspace selection"); + HGOTO_ERROR2(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to generate IOD file descriptor from dataspace selection"); /* allocate the IOD hyperslab descriptors needed */ if(NULL == (hslabs = (iod_hyperslab_t *)malloc (sizeof(iod_hyperslab_t) * (size_t)num_descriptors))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate iod array descriptors"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate iod array descriptors"); for(n=0 ; niod_oh, tid, NULL, mem_desc, &file_desc, &read_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); { void *buffers[2]; @@ -1422,7 +1444,7 @@ H5VL__iod_server_vl_data_io_cb(void UNUSED *elem, hid_t type_id, unsigned ndims, } if(entry_cs != read_cs) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "Data Corruption detected when reading"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "Data Corruption detected when reading"); free(mem_desc); @@ -1434,11 +1456,11 @@ H5VL__iod_server_vl_data_io_cb(void UNUSED *elem, hid_t type_id, unsigned ndims, if(0 == blob_id) { if(iod_obj_create(coh, tid, NULL/*hints*/, IOD_OBJ_BLOB, NULL, NULL, &blob_id, NULL /*event*/) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Failed to create BLOB object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Failed to create BLOB object"); } /* Open blob object */ if (iod_obj_open_write(coh, blob_id, NULL, &blob_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Datatype"); seq_len = *((size_t *)(udata->buf_ptr)); udata->buf_ptr += sizeof(size_t); @@ -1481,14 +1503,14 @@ H5VL__iod_server_vl_data_io_cb(void UNUSED *elem, hid_t type_id, unsigned ndims, /* write the VL data to the blob */ if(iod_blob_write(blob_oh, tid, NULL, mem_desc, blob_desc, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); free(mem_desc); free(blob_desc); /* close BLOB */ if(iod_obj_close(blob_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); /* update the array element with the blob_id and sequence length */ mem_desc = (iod_mem_desc_t *)malloc(sizeof(iod_mem_desc_t) + sizeof(iod_mem_frag_t) * 2); @@ -1514,7 +1536,7 @@ H5VL__iod_server_vl_data_io_cb(void UNUSED *elem, hid_t type_id, unsigned ndims, /* write the blob ID & size to the array element */ if(iod_array_write(udata->iod_oh, tid, NULL, mem_desc, &file_desc, &entry_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "can't read from array object"); free(mem_desc); @@ -1529,7 +1551,7 @@ H5VL__iod_server_vl_data_io_cb(void UNUSED *elem, hid_t type_id, unsigned ndims, /* Open blob object */ if (iod_obj_open_write(coh, blob_id, NULL, &blob_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Datatype"); /* create memory descriptor for reading */ mem_desc = (iod_mem_desc_t *)malloc(sizeof(iod_mem_desc_t) + sizeof(iod_mem_frag_t)); @@ -1546,13 +1568,13 @@ H5VL__iod_server_vl_data_io_cb(void UNUSED *elem, hid_t type_id, unsigned ndims, /* read the VL data from the blob */ if(iod_blob_read(blob_oh, tid, NULL, mem_desc, blob_desc, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); udata->buf_ptr += old_seq_len * udata->mem_type_size; /* close BLOB */ if(iod_obj_close(blob_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); free(mem_desc); free(blob_desc); diff --git a/src/H5VLiod_dtype.c b/src/H5VLiod_dtype.c index 86d1e8e..1153230 100644 --- a/src/H5VLiod_dtype.c +++ b/src/H5VLiod_dtype.c @@ -72,7 +72,7 @@ H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, FUNC_ENTER_NOAPI_NOINIT #if H5VL_IOD_DEBUG - fprintf(stderr, "Start datatype Commit %s\n", name); + fprintf(stderr, "Start datatype commit %s at %"PRIu64"\n", name, loc_handle.wr_oh); #endif /* the traversal will retrieve the location where the datatype needs @@ -80,24 +80,27 @@ H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, does not exist. */ if(H5VL_iod_server_traverse(coh, loc_id, loc_handle, name, rtid, FALSE, &last_comp, &cur_id, &cur_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + + fprintf(stderr, "Creating Datatype ID %"PRIx64" ", dtype_id); + fprintf(stderr, "at (OH %"PRIu64" ID %"PRIx64")\n", cur_oh.wr_oh, cur_id); /* create the datatype */ if(iod_obj_create(coh, wtid, NULL, IOD_OBJ_BLOB, NULL, NULL, &dtype_id, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create Datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't create BLOB"); if (iod_obj_open_read(coh, dtype_id, NULL, &dtype_oh.rd_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open Datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open BLOB"); 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 Datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open BLOB"); /* create the metadata KV object for the datatype */ if(iod_obj_create(coh, wtid, NULL, IOD_OBJ_KV, NULL, NULL, &mdkv_id, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); /* create the attribute KV object for the datatype */ if(iod_obj_create(coh, wtid, NULL, IOD_OBJ_KV, NULL, NULL, &attr_id, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create metadata KV object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't create attribute KV object"); /* set values for the scratch pad object */ sp[0] = mdkv_id; @@ -111,25 +114,25 @@ H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, sp_cs = H5_checksum_crc64(&sp, sizeof(sp)); if (iod_obj_set_scratch(dtype_oh.wr_oh, wtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); } else { if (iod_obj_set_scratch(dtype_oh.wr_oh, wtid, &sp, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); } /* Store Metadata in scratch pad */ if (iod_obj_open_write(coh, mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open metadata KV object"); /* determine the buffer size needed to store the encoded type of the datatype */ if(H5Tencode(input->type_id, NULL, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype type"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype type"); if(NULL == (buf = malloc (buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate type buffer"); /* encode datatype of the datatype */ if(H5Tencode(input->type_id, buf, &buf_size) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype type"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTENCODE, FAIL, "failed to encode datatype type"); /* create memory descriptor for writing */ mem_desc = (iod_mem_desc_t *)malloc(sizeof(iod_mem_desc_t) + sizeof(iod_mem_frag_t)); @@ -153,12 +156,12 @@ H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, /* write the serialized type value to the BLOB object */ if(iod_blob_write(dtype_oh.wr_oh, wtid, NULL, mem_desc, file_desc, &dt_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); } else { /* write the serialized type value to the BLOB object */ if(iod_blob_write(dtype_oh.wr_oh, wtid, NULL, mem_desc, file_desc, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); } free(mem_desc); @@ -170,15 +173,15 @@ H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, /* insert plist metadata */ if(H5VL_iod_insert_plist(mdkv_oh, wtid, tcpl_id, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert link count metadata */ if(H5VL_iod_insert_link_count(mdkv_oh, wtid, (uint64_t)1, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* insert object type metadata */ if(H5VL_iod_insert_object_type(mdkv_oh, wtid, H5I_DATATYPE, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* store the datatype size */ { @@ -192,19 +195,19 @@ H5VL_iod_server_dtype_commit_cb(AXE_engine_t UNUSED axe_engine, kv.value = &buf_size; if (iod_kv_set(mdkv_oh, wtid, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); free(key); } /* close the Metadata KV object */ if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); /* add link in parent group to current object */ if(H5VL_iod_insert_new_link(cur_oh.wr_oh, wtid, last_comp, H5L_TYPE_HARD, &dtype_id, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close parent group and its scratch pad if it is not the location we started the traversal into */ @@ -289,29 +292,29 @@ H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, /* Traverse Path and open dtype */ 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"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); /* 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"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current datatype"); /* get scratch pad of the datatype */ if(iod_obj_get_scratch(dtype_oh.rd_oh, rtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); } /* open the metadata scratch pad */ if (iod_obj_open_read(coh, sp[0], NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_PLIST, H5VL_IOD_KEY_OBJ_CPL, NULL, NULL, &output.tcpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve tcpl"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve tcpl"); val_size = sizeof(iod_size_t); key_size = strlen(H5VL_IOD_KEY_DTYPE_SIZE); @@ -319,14 +322,14 @@ H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, /* retrieve blob size metadata from scratch pad */ if(iod_kv_get_value(mdkv_oh, rtid, H5VL_IOD_KEY_DTYPE_SIZE, key_size, &buf_size, &val_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "datatype size lookup failed"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "datatype size lookup failed"); if(NULL == (buf = malloc(buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate BLOB read buffer"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate BLOB read buffer"); /* close the metadata scratch pad */ if(iod_obj_close(mdkv_oh, NULL, NULL)) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); /* create memory descriptor for writing */ mem_desc = (iod_mem_desc_t *)malloc(sizeof(iod_mem_desc_t) + sizeof(iod_mem_frag_t)); @@ -343,7 +346,7 @@ H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, /* read the serialized type value from the BLOB object */ if(iod_blob_read(dtype_oh.rd_oh, rtid, NULL, mem_desc, file_desc, &iod_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); if(iod_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* calculate a checksum for the datatype */ @@ -351,7 +354,7 @@ H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, /* Verifty checksum against one given by IOD */ if(iod_cs != dt_cs) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "Data Corruption detected when reading datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "Data Corruption detected when reading datatype"); } free(mem_desc); @@ -359,7 +362,7 @@ H5VL_iod_server_dtype_open_cb(AXE_engine_t UNUSED axe_engine, /* decode the datatype */ if((output.type_id = H5Tdecode(buf)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to decode datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unable to decode datatype"); free(buf); @@ -421,16 +424,20 @@ H5VL_iod_server_dtype_close_cb(AXE_engine_t UNUSED axe_engine, fprintf(stderr, "Start datatype Close\n"); #endif + if(IOD_OH_UNDEFINED == iod_oh.wr_oh.cookie || + IOD_OH_UNDEFINED == iod_oh.rd_oh.cookie) { + HGOTO_ERROR2(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close object with invalid handle"); + } + if((iod_obj_close(iod_oh.rd_oh, NULL, NULL)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Read OH"); if((iod_obj_close(iod_oh.wr_oh, NULL, NULL)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close Write OH"); -done: #if H5VL_IOD_DEBUG fprintf(stderr, "Done with dtype close, sending response to client\n"); #endif - +done: HG_Handler_start_output(op_data->hg_handle, &ret_value); input = (dtype_close_in_t *)H5MM_xfree(input); diff --git a/src/H5VLiod_file.c b/src/H5VLiod_file.c index 9ebbb16..fa73703 100644 --- a/src/H5VLiod_file.c +++ b/src/H5VLiod_file.c @@ -132,11 +132,11 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine, HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set scratch pad"); } - fprintf(stderr, "Set scratch M: %"PRIu64" A: %"PRIu64"\n", sp[0], sp[1]); + fprintf(stderr, "Set scratch M: %"PRIx64" A: %"PRIx64"\n", sp[0], sp[1]); /* Store Metadata in scratch pad */ if (iod_obj_open_write(coh, input->mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't create scratch pad"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open metadata KV"); /* store metadata */ if(H5P_DEFAULT == input->fcpl_id) @@ -411,6 +411,9 @@ H5VL_iod_server_file_close_cb(AXE_engine_t UNUSED axe_engine, if(iod_obj_get_scratch(root_oh.rd_oh, rtid, &sp, &sp_cs, NULL) < 0) HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for root object"); + fprintf(stderr, "root OH %"PRIu64" MDKV ID %"PRIx64"\n", + root_oh.rd_oh.cookie, sp[0]); + if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) @@ -418,8 +421,8 @@ H5VL_iod_server_file_close_cb(AXE_engine_t UNUSED axe_engine, } /* open the metadata scratch pad */ - if (iod_obj_open_write(coh, sp[0], NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + if (iod_obj_open_write(coh, sp[0], NULL, &mdkv_oh, NULL) < 0) + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open metadata KV"); /* insert current indexes in the metadata KV object */ kv.value = &input->max_kv_index; diff --git a/src/H5VLiod_group.c b/src/H5VLiod_group.c index 6c72e77..1ca18a6 100644 --- a/src/H5VLiod_group.c +++ b/src/H5VLiod_group.c @@ -78,7 +78,8 @@ H5VL_iod_server_group_create_cb(AXE_engine_t UNUSED axe_engine, &last_comp, &cur_id, &cur_oh) < 0) HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); - fprintf(stderr, "Creating at OH %"PRIu64" ID %"PRIx64"\n", cur_oh.wr_oh, cur_id); + fprintf(stderr, "Creating Group ID %"PRIx64") ", grp_id); + fprintf(stderr, "at (OH %"PRIu64" ID %"PRIx64")\n", cur_oh.wr_oh, cur_id); /* create the group */ if(iod_obj_create(coh, wtid, NULL, IOD_OBJ_KV, NULL, NULL, &grp_id, NULL) < 0) @@ -152,10 +153,12 @@ H5VL_iod_server_group_create_cb(AXE_engine_t UNUSED axe_engine, /* close parent group if it is not the location we started the traversal into */ if(loc_handle.rd_oh.cookie != cur_oh.rd_oh.cookie) { - iod_obj_close(cur_oh.rd_oh, NULL, NULL); + if(iod_obj_close(cur_oh.rd_oh, NULL, NULL) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close current object handle"); } if(loc_handle.wr_oh.cookie != cur_oh.wr_oh.cookie) { - iod_obj_close(cur_oh.wr_oh, NULL, NULL); + if(iod_obj_close(cur_oh.wr_oh, NULL, NULL) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close current object handle"); } #if H5VL_IOD_DEBUG diff --git a/src/H5VLiod_obj.c b/src/H5VLiod_obj.c index 05d4e20..274242b 100644 --- a/src/H5VLiod_obj.c +++ b/src/H5VLiod_obj.c @@ -56,13 +56,13 @@ H5VL_iod_server_object_open_by_token_cb(AXE_engine_t UNUSED axe_engine, FUNC_ENTER_NOAPI_NOINIT #if H5VL_IOD_DEBUG - fprintf(stderr, "Start Object Open by token = %"PRIu64"\n", obj_id); + fprintf(stderr, "Start Object Open by token = %"PRIx64"\n", obj_id); #endif 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"); + HGOTO_ERROR2(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) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't open current group"); #if H5VL_IOD_DEBUG fprintf(stderr, "Done with object open by token, sending response to client\n"); @@ -125,66 +125,66 @@ H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, /* 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) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); if(obj_id != input->loc_id) { /* get scratch pad of the object */ if(iod_obj_get_scratch(obj_oh.rd_oh, rtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); } /* open the metadata KV */ if (iod_obj_open_read(coh, sp[0], NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); } else { /* open the metadata KV */ if (iod_obj_open_read(coh, input->loc_mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); } if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_OBJECT_TYPE, H5VL_IOD_KEY_OBJ_TYPE, NULL, NULL, &output.obj_type) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); switch(output.obj_type) { case H5I_MAP: if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_PLIST, H5VL_IOD_KEY_OBJ_CPL, NULL, NULL, &output.cpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve mcpl"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve mcpl"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_DATATYPE, H5VL_IOD_KEY_MAP_KEY_TYPE, NULL, NULL, &output.id1) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_DATATYPE, H5VL_IOD_KEY_MAP_VALUE_TYPE, NULL, NULL, &output.id2) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); break; case H5I_GROUP: if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_PLIST, H5VL_IOD_KEY_OBJ_CPL, NULL, NULL, &output.cpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dcpl"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dcpl"); break; case H5I_DATASET: if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_PLIST, H5VL_IOD_KEY_OBJ_CPL, NULL, NULL, &output.cpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dcpl"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dcpl"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_DATATYPE, H5VL_IOD_KEY_OBJ_DATATYPE, NULL, NULL, &output.id1) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve datatype"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_DATASPACE, H5VL_IOD_KEY_OBJ_DATASPACE, NULL, NULL, &output.id2) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dataspace"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dataspace"); break; case H5I_DATATYPE: { @@ -201,10 +201,10 @@ H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, /* retrieve blob size metadata from scratch pad */ if(iod_kv_get_value(mdkv_oh, rtid, H5VL_IOD_KEY_DTYPE_SIZE, key_size, &buf_size, &val_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "datatype size lookup failed"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "datatype size lookup failed"); if(NULL == (buf = malloc(buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate BLOB read buffer"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate BLOB read buffer"); /* create memory descriptor for reading */ mem_desc.nfrag = 1; @@ -218,28 +218,28 @@ H5VL_iod_server_object_open_cb(AXE_engine_t UNUSED axe_engine, /* read the serialized type value from the BLOB object */ if(iod_blob_read(obj_oh.rd_oh, rtid, NULL, &mem_desc, &file_desc, &iod_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); /* calculate a checksum for the datatype */ dt_cs = H5_checksum_crc64(buf, buf_size); /* Verifty checksum against one given by IOD */ if(iod_cs != dt_cs) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "Data Corruption detected when reading datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "Data Corruption detected when reading datatype"); /* decode the datatype */ if((output.id1 = H5Tdecode(buf)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to decode datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unable to decode datatype"); free(buf); } default: - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Invalid object type"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Invalid object type"); } /* close the metadata scratch pad */ if(iod_obj_close(mdkv_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); output.iod_id = obj_id; output.mdkv_id = sp[0]; @@ -272,7 +272,7 @@ done: case H5I_DATATYPE: break; default: - HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "not a valid object (dataset, group, or datatype)") + HGOTO_ERROR2(H5E_ARGS, H5E_CANTINIT, FAIL, "not a valid object (dataset, group, or datatype)") } input = (object_op_in_t *)H5MM_xfree(input); @@ -333,32 +333,32 @@ H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, /* Traverse Path and open object */ if(H5VL_iod_server_open_path(coh, input->src_loc_id, input->src_loc_oh, input->src_loc_name, rtid, &obj_id, &obj_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); /* the traversal will retrieve the location where the objects needs to be copied to. The traversal will fail if an intermediate group does not exist. */ if(H5VL_iod_server_traverse(coh, input->dst_loc_id, input->dst_loc_oh, input->dst_loc_name, FALSE, rtid, &new_name, &dst_id, &dst_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't traverse path"); /* get scratch pad of the object */ if(iod_obj_get_scratch(obj_oh, rtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); } /* open the metadata scratch pad */ if (iod_obj_open_write(coh, sp[0], NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_OBJECT_TYPE, H5VL_IOD_KEY_OBJ_TYPE, NULL, NULL, &obj_type) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); switch(obj_type) { case H5I_MAP: @@ -366,20 +366,20 @@ H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, case H5I_GROUP: if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_PLIST, H5VL_IOD_KEY_OBJ_CPL, NULL, NULL, &output.cpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dcpl"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dcpl"); break; case H5I_DATASET: if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_PLIST, H5VL_IOD_KEY_OBJ_CPL, NULL, NULL, &output.cpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dcpl"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dcpl"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_DATATYPE, H5VL_IOD_KEY_OBJ_DATATYPE, NULL, NULL, &output.type_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve datatype"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_DATASPACE, H5VL_IOD_KEY_OBJ_DATASPACE, NULL, NULL, &output.space_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dataspace"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve dataspace"); break; case H5I_DATATYPE: { @@ -392,10 +392,10 @@ H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, /* retrieve blob size metadata from scratch pad */ if(iod_kv_get_value(mdkv_oh, rtid, H5VL_IOD_KEY_DTYPE_SIZE, &buf_size, sizeof(iod_size_t), NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "datatype size lookup failed"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "datatype size lookup failed"); if(NULL == (buf = malloc(buf_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate BLOB read buffer"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate BLOB read buffer"); /* create memory descriptor for reading */ mem_desc.nfrag = 1; @@ -409,7 +409,7 @@ H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, /* read the serialized type value from the BLOB object */ if(iod_blob_read(obj_oh, rtid, NULL, &mem_desc, &file_desc, &iod_cs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unable to write BLOB object"); /* MSC - NEED IOD */ /* calculate a checksum for the datatype */ @@ -417,16 +417,16 @@ H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, /* Verifty checksum against one given by IOD */ if(iod_cs != dt_cs) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, FAIL, "Data Corruption detected when reading datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_READERROR, FAIL, "Data Corruption detected when reading datatype"); /* decode the datatype */ if((output.type_id = H5Tdecode(buf)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to decode datatype"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "unable to decode datatype"); free(buf); } default: - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Invalid object type"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Invalid object type"); } /* create new object as a copy of the source object */ @@ -434,16 +434,16 @@ H5VL_iod_server_object_copy_cb(AXE_engine_t UNUSED axe_engine, /* close the metadata scratch pad */ if(iod_obj_close(mdkv_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); /* close the object handle */ if(input->src_loc_oh.cookie != obj_oh.cookie && iod_obj_close(obj_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); /* Insert object in the destination path */ if(H5VL_iod_insert_new_link(dst_oh, wtid, new_name, H5L_TYPE_HARD, &obj_id, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't insert KV value"); /* close dst group if it is not the location we started the traversal into */ @@ -512,7 +512,7 @@ H5VL_iod_server_object_exists_cb(AXE_engine_t UNUSED axe_engine, /* close the object */ if(loc_oh.rd_oh.cookie != obj_oh.rd_oh.cookie && iod_obj_close(obj_oh.rd_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); /* set return to TRUE */ ret = TRUE; @@ -574,38 +574,38 @@ H5VL_iod_server_object_get_info_cb(AXE_engine_t UNUSED axe_engine, /* Traverse Path and open object */ if(H5VL_iod_server_open_path(coh, loc_id, loc_oh, loc_name, rtid, &obj_id, &obj_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "object does not exist"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "object does not exist"); oinfo.addr = obj_id; if(obj_id != loc_id) { /* get scratch pad of the object */ if(iod_obj_get_scratch(obj_oh.rd_oh, rtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); } /* open the metadata KV */ if (iod_obj_open_read(coh, sp[0], NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); } else { /* open the metadata KV */ if (iod_obj_open_read(coh, input->loc_mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); } /* open the attribute scratch pad */ if (iod_obj_open_read(coh, sp[1], NULL /*hints*/, &attrkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_OBJECT_TYPE, H5VL_IOD_KEY_OBJ_TYPE, NULL, NULL, &obj_type) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); switch(obj_type) { case H5I_GROUP: @@ -621,28 +621,28 @@ H5VL_iod_server_object_get_info_cb(AXE_engine_t UNUSED axe_engine, oinfo.type = H5O_TYPE_MAP; break; default: - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unsupported object type for H5Oget_info"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "unsupported object type for H5Oget_info"); } if(H5VL_iod_get_metadata(mdkv_oh, rtid, H5VL_IOD_LINK_COUNT, H5VL_IOD_KEY_OBJ_LINK_COUNT, NULL, NULL, &oinfo.rc) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve link count"); if(iod_kv_get_num(attrkv_oh, rtid, &num_attrs, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve attribute count"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTGET, FAIL, "failed to retrieve attribute count"); oinfo.num_attrs = num_attrs; /* close the metadata KV */ if(iod_obj_close(mdkv_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); /* close the attribute KV */ if(iod_obj_close(attrkv_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); if(loc_oh.rd_oh.cookie != obj_oh.rd_oh.cookie && iod_obj_close(obj_oh.rd_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); #if H5VL_IOD_DEBUG fprintf(stderr, "Done with Object get_info, sending response to client\n"); @@ -706,27 +706,27 @@ H5VL_iod_server_object_set_comment_cb(AXE_engine_t UNUSED axe_engine, /* Traverse Path and open object */ if(H5VL_iod_server_open_path(coh, loc_id, loc_oh, loc_name, rtid, &obj_id, &obj_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); if(loc_id != obj_id) { /* get scratch pad of the object */ if(iod_obj_get_scratch(obj_oh.rd_oh, rtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); } /* open the metadata scratch pad */ if (iod_obj_open_write(coh, sp[0], NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); } else { /* open the metadata KV */ if (iod_obj_open_write(coh, input->loc_mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); } { @@ -739,18 +739,18 @@ H5VL_iod_server_object_set_comment_cb(AXE_engine_t UNUSED axe_engine, kv.value = &comment; if (iod_kv_set(mdkv_oh, wtid, NULL, &kv, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't set KV pair in parent"); free(key); } /* close metadata KV and object */ if(iod_obj_close(mdkv_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); if(loc_oh.rd_oh.cookie != obj_oh.rd_oh.cookie && iod_obj_close(obj_oh.rd_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); done: @@ -810,27 +810,27 @@ H5VL_iod_server_object_get_comment_cb(AXE_engine_t UNUSED axe_engine, /* Traverse Path and open object */ if(H5VL_iod_server_open_path(coh, loc_id, loc_oh, loc_name, rtid, &obj_id, &obj_oh) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't open object"); if(loc_id != obj_id) { /* get scratch pad of the object */ if(iod_obj_get_scratch(obj_oh.rd_oh, rtid, &sp, &sp_cs, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for object"); if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) { /* verify scratch pad integrity */ if(H5VL_iod_verify_scratch_pad(sp, sp_cs) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "Scratch Pad failed integrity check"); } /* open the metadata KV */ if (iod_obj_open_read(coh, sp[0], NULL /*hints*/, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); } else { /* open the metadata KV */ if (iod_obj_open_read(coh, input->loc_mdkv_id, NULL, &mdkv_oh, NULL) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); + HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open scratch pad"); } comment.value_size = (ssize_t *)malloc(sizeof(ssize_t)); @@ -841,18 +841,18 @@ H5VL_iod_server_object_get_comment_cb(AXE_engine_t UNUSED axe_engine, if(iod_kv_get_value(obj_oh.rd_oh, rtid, H5VL_IOD_KEY_OBJ_COMMENT, key_size, NULL, &val_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed"); if(NULL == (value = malloc ((size_t)val_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer"); if(iod_kv_get_value(obj_oh.rd_oh, rtid, H5VL_IOD_KEY_OBJ_COMMENT, key_size, value, &val_size, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "lookup failed"); if(length) { if(NULL == (comment.value = (char *)malloc (length))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer"); + HGOTO_ERROR2(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate value buffer"); memcpy(comment.value, value, length); } @@ -860,11 +860,11 @@ H5VL_iod_server_object_get_comment_cb(AXE_engine_t UNUSED axe_engine, /* close metadata KV and object */ if(iod_obj_close(mdkv_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); if(loc_oh.rd_oh.cookie != obj_oh.rd_oh.cookie && iod_obj_close(obj_oh.rd_oh, NULL, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close object"); *comment.value_size = val_size; diff --git a/src/H5VLiod_server.c b/src/H5VLiod_server.c index 688bc2b..09f3b7d 100644 --- a/src/H5VLiod_server.c +++ b/src/H5VLiod_server.c @@ -399,12 +399,13 @@ H5VL_iod_server_eff_finalize(hg_handle_t handle) /* increment the number of terminate requests received so far */ terminate_requests ++; + if(iod_finalize(NULL) < 0 ) + HGOTO_ERROR2(H5E_FILE, H5E_CANTDEC, HG_FAIL, "can't finalize IOD"); + /* if all the peers that connected at the beginning have sent the terminate request, then finalize IOD and indicate that it is time to shutdown the server */ if(terminate_requests == num_peers) { - if(iod_finalize(NULL) < 0 ) - HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, HG_FAIL, "can't finalize IOD"); shutdown = TRUE; } diff --git a/src/H5VLiod_util.c b/src/H5VLiod_util.c index 06900b1..3522426 100644 --- a/src/H5VLiod_util.c +++ b/src/H5VLiod_util.c @@ -136,9 +136,10 @@ H5VL_iod_server_traverse(iod_handle_t coh, iod_obj_id_t loc_id, iod_handles_t lo cur_id = value.u.iod_id; /* Close previous read handle unless it is the original one */ - if(loc_handle.rd_oh.cookie != prev_oh.cookie && - iod_obj_close(prev_oh, NULL, NULL) < 0) - HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close current object handle"); + if(loc_handle.rd_oh.cookie != prev_oh.cookie) { + if(iod_obj_close(prev_oh, NULL, NULL) < 0) + HGOTO_ERROR2(H5E_SYM, H5E_CANTINIT, FAIL, "can't close current object handle"); + } /* open the current group */ if (iod_obj_open_read(coh, cur_id, NULL, &cur_oh.rd_oh, NULL) < 0) @@ -328,8 +329,8 @@ H5VL_iod_get_file_desc(hid_t space_id, hssize_t *count, iod_hyperslab_t *hslabs) /* populate the hyperslab */ for(i=0 ; i