diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2017-02-10 18:43:44 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2017-02-10 18:43:44 (GMT) |
commit | 17259643fec10d53a46311b60e4010a425acee45 (patch) | |
tree | a59a16e932c8bc8d7f46a24a2f5a502ad548e8c0 /examples/h5dsm_file_open.c | |
parent | 1c06cb8e57b4c96b16c05dea6c6e75c44f84f388 (diff) | |
download | hdf5-17259643fec10d53a46311b60e4010a425acee45.zip hdf5-17259643fec10d53a46311b60e4010a425acee45.tar.gz hdf5-17259643fec10d53a46311b60e4010a425acee45.tar.bz2 |
Implement attribute read/write. Added examples for this. Added
optional snapshot parameter to h5dsm_file_open.c. Other minor
fixes/cleanup.
Diffstat (limited to 'examples/h5dsm_file_open.c')
-rw-r--r-- | examples/h5dsm_file_open.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/examples/h5dsm_file_open.c b/examples/h5dsm_file_open.c index b3846d0..3a1d399 100644 --- a/examples/h5dsm_file_open.c +++ b/examples/h5dsm_file_open.c @@ -4,12 +4,13 @@ int main(int argc, char *argv[]) { uuid_t pool_uuid; char *pool_grp = NULL; hid_t file = -1, fapl = -1; + H5VL_daosm_snap_id_t snap_id; (void)MPI_Init(&argc, &argv); (void)daos_init(); - if(argc != 3) - PRINTF_ERROR("argc != 3\n"); + if(argc < 3 || argc > 4) + PRINTF_ERROR("argc must be 3 or 4\n"); /* Parse UUID */ if(0 != uuid_parse(argv[1], pool_uuid)) @@ -21,6 +22,14 @@ int main(int argc, char *argv[]) { if(H5Pset_fapl_daosm(fapl, MPI_COMM_WORLD, MPI_INFO_NULL, pool_uuid, pool_grp) < 0) ERROR; + /* Open snapshot if specified */ + if(argc == 4) { + snap_id = (H5VL_daosm_snap_id_t)atoi(argv[3]); + printf("Opening snapshot %llu\n", (long long unsigned)snap_id); + if(H5Pset_daosm_snap_open(fapl, snap_id) < 0) + ERROR; + } /* end if */ + /* Open file */ if((file = H5Fopen_ff(argv[2], H5F_ACC_RDONLY, fapl, NULL)) < 0) ERROR; |