From a4e20801e98248b480dadb182a964ccc1dc8b371 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Fri, 27 Jun 2014 17:48:07 -0500 Subject: [svn-r25373] make some changes to index program. --- testff/h5ff_client_index.c | 41 +++++++++++------------------------------ 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/testff/h5ff_client_index.c b/testff/h5ff_client_index.c index 3fe4fcf..3a9b4f1 100644 --- a/testff/h5ff_client_index.c +++ b/testff/h5ff_client_index.c @@ -175,25 +175,9 @@ write_incr(hid_t file_id, const char *dataset_name, hsize_t count[2] = {ntuples, ncomponents}; int rank = (ncomponents == 1) ? 1 : 2; herr_t ret; - hid_t rcxt_id; uint64_t version = req_version; int n; - if(0 == my_rank) { - rcxt_id = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL); - } - MPI_Bcast(&version, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD); - if (0 != my_rank) { - rcxt_id = H5RCcreate(file_id, version); - } - assert(req_version == version); - - dataset_id = H5Dopen_ff(file_id, dataset_name, H5P_DEFAULT, rcxt_id, estack_id); - assert(dataset_id); - - file_space_id = H5Screate_simple(rank, dims, NULL); - assert(file_space_id); - /* do incremental updates */ for (n = 0; n < my_size; n++) { if (my_rank == n) { @@ -203,6 +187,12 @@ write_incr(hid_t file_id, const char *dataset_name, rid = H5RCacquire(file_id, &version, H5P_DEFAULT, estack_id); assert((uint64_t )(req_version + (uint64_t) n) == version); + dataset_id = H5Dopen_ff(file_id, dataset_name, H5P_DEFAULT, rcxt_id, estack_id); + assert(dataset_id); + + file_space_id = H5Dget_space(dataset_id); + assert(file_space_id); + /* create transaction object */ tid = H5TRcreate(file_id, rid, (uint64_t) (req_version + 1 + (uint64_t) n)); assert(tid); @@ -231,23 +221,14 @@ write_incr(hid_t file_id, const char *dataset_name, ret = H5RCrelease(rid, H5_EVENT_STACK_NULL); assert(0 == ret); ret = H5RCclose(rid); + + /* Close the first dataset. */ + H5Sclose(file_space_id); + ret = H5Dclose_ff(dataset_id, estack_id); + assert(0 == ret); } MPI_Barrier(MPI_COMM_WORLD); } - - /* Close the first dataset. */ - H5Sclose(file_space_id); - ret = H5Dclose_ff(dataset_id, estack_id); - assert(0 == ret); - - /* release container version 0. */ - if (my_rank == 0) { - ret = H5RCrelease(rcxt_id, estack_id); - assert(0 == ret); - } - - ret = H5RCclose(rcxt_id); - assert(0 == ret); } static void -- cgit v0.12