diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2016-12-12 22:41:39 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2016-12-12 22:41:39 (GMT) |
commit | 3889eeb5c86376fa677d48c8156584435f5cea66 (patch) | |
tree | 4e4d4b5850b8d3f6a4a409f3d64ec512f70b5ec3 /examples/h5dsm_dset_wpartial.c | |
parent | bbcb31845f506a167337c432c062a01936fe7118 (diff) | |
download | hdf5-3889eeb5c86376fa677d48c8156584435f5cea66.zip hdf5-3889eeb5c86376fa677d48c8156584435f5cea66.tar.gz hdf5-3889eeb5c86376fa677d48c8156584435f5cea66.tar.bz2 |
Add transaction number printing for write examples, optional transaction
number arguments for read examples. Rework and fix bug in
h5dsm_dset_wpartial.c. Not tested.
Diffstat (limited to 'examples/h5dsm_dset_wpartial.c')
-rw-r--r-- | examples/h5dsm_dset_wpartial.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/examples/h5dsm_dset_wpartial.c b/examples/h5dsm_dset_wpartial.c index 7932df9..8d08d60 100644 --- a/examples/h5dsm_dset_wpartial.c +++ b/examples/h5dsm_dset_wpartial.c @@ -75,8 +75,7 @@ int main(int argc, char *argv[]) { printf("\n"); } - if(rank == 0) - MPI_Barrier(MPI_COMM_WORLD); + printf("Transaction number = %llu\n", (long long unsigned)(trans_num + 1)); /* Set up dataspaces */ if((file_space = H5Screate_simple(2, dims, NULL)) < 0) @@ -96,23 +95,17 @@ int main(int argc, char *argv[]) { if(H5Sselect_hyperslab(mem_space, H5S_SELECT_SET, start, NULL, count, NULL) < 0) ERROR; - if(rank == 1) { - MPI_Barrier(MPI_COMM_WORLD); - if(H5TRclose(trans) < 0) - ERROR; - if((trans = H5TRcreate(file, trans_num + 2)) < 0) - ERROR; - } - /* Write data */ if(H5Dwrite_ff(dset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf, trans) < 0) ERROR; - if(H5TRcommit(trans) < 0) - ERROR; + MPI_Barrier(MPI_COMM_WORLD); if(rank == 0) - MPI_Barrier(MPI_COMM_WORLD); + if(H5TRcommit(trans) < 0) + ERROR; + + MPI_Barrier(MPI_COMM_WORLD); /* Close */ if(H5Dclose_ff(dset, -1) < 0) |