From 18fe60ae10b4b5abb6992e7b9b2ae7b22dfa9156 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Thu, 31 May 2018 11:45:20 -0500 Subject: (1) Made the change according to the pull request feedback. (2) Removed the performance test form test/th5o.c: will decide on what needs to be done to show speedup via HDFFV-10463. --- fortran/src/H5Gf.c | 3 +- test/th5o.c | 202 +---------------------------------------------------- 2 files changed, 2 insertions(+), 203 deletions(-) diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 4ce7970..def67e1 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -200,8 +200,7 @@ h5gget_obj_info_idx_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, /* Query the object's information */ if(H5Lget_name_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, c_idx, c_obj_name, c_obj_namelen, H5P_DEFAULT) < 0) goto DONE; - /* TO DO: See flags for H5Oget_info in H5Opublic.h */ - if(H5Oget_info_by_idx2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, c_idx, &oinfo, 0, H5P_DEFAULT) < 0) + if(H5Oget_info_by_idx2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, c_idx, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) goto DONE; /* XXX: Switch from using H5Gget_objtype_by_idx() means that this routine won't diff --git a/test/th5o.c b/test/th5o.c index eeef373..63fee5f 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -30,10 +30,6 @@ #define TEST6_DIM1 100 #define TEST6_DIM2 100 -#define NUM_GROUPS 100 -#define NUM_ATTRS 10 -#define NUM_DSETS 50 - /**************************************************************** ** @@ -1353,6 +1349,7 @@ test_h5o_getinfo_same_file(void) } /* test_h5o_getinfo_same_file() */ #ifndef H5_NO_DEPRECATED_SYMBOLS + /**************************************************************** ** ** visit_obj_cb(): @@ -1480,202 +1477,6 @@ test_h5o_getinfo_visit(void) } /* test_h5o_getinfo_visit() */ - -/**************************************************************** -** -** perform_visit_obj_cb(): -** This is the callback function invoked by H5Ovisit1 and -** H5Ovisit2() used in test_h5o_perform_getinfo_visit(). -** -****************************************************************/ -static int -perform_visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *name, - const H5O_info_t H5_ATTR_UNUSED *oinfo, void H5_ATTR_UNUSED *_op_data) -{ - return(H5_ITER_CONT); -} /* end visit_obj_cb() */ - -/**************************************************************** -** -** test_h5o_perform_getinfo_visit(): -** Verify that H5Ovisit2 performs better than H5Ovisit1: -** --H5Ovisit2 has fields = 0 passed to the internal -** library routine H5O_get_info() -** --H5Ovisit1 has fields = H5O_INFO_ALL passed to -** internal library routine H5O_get_info() -** 1) Create an HDF5 file -** 2) Create a group with NUM_GROUPS sub-groups -** 3) Attach NUM_ATTRS attributes to each sub-group -** 4) Create NUM_DSETS datasets for each sub-group -** 5) Visit all the objects from the root group via -** H5Ovisit1 and H5Ovisit2 -** 6) Verify the iteration time used for H5Ovisit2 is -** less than H5Ovisit1 -** -****************************************************************/ -static void -test_h5o_perform_getinfo_visit(void) -{ - hid_t fid = -1; /* HDF5 File ID */ - hid_t fapl = -1; /* File access property list */ - hid_t gid = -1; /* Group IDs */ - hid_t asid = -1; /* Dataspace ID for the attribute */ - unsigned i, j; /* Local index variable */ - struct timeval startTime; /* Starting time */ - struct timeval endTime; /* Ending time */ - time_t new_runtime = 0.0; /* Time used for H5Oget_info2 */ - time_t old_runtime = 0.0; /* time used for H5Oget_info1 */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t sid = -1; /* Dataspace ID for dataset */ - hid_t did = -1; /* Dataset ID */ - hsize_t dims[2]; /* Dimension sizes */ - hsize_t max_dims[2]; /* Maximum dimension sizes */ - hsize_t chunk_dims[2]; /* Chunk dimension sizes */ - unsigned wbuf[10][30]; /* Data buffer */ - herr_t ret; /* Value returned from API calls */ - - fapl = H5Pcreate(H5P_FILE_ACCESS); - CHECK(fapl, FAIL, "H5Pcreate"); - ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - CHECK(ret, FAIL, "H5Pset_libver_bounds"); - - /* Create a new HDF5 file */ - fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - CHECK(fid, FAIL, "H5Fcreate"); - - /* Create dataspace for the attribute */ - asid = H5Screate(H5S_SCALAR); - CHECK(asid, FAIL, "H5Screate"); - - /* Set up to create a chunked dataset in the group: this will use v2 B-tree chunk indexing */ - dcpl = H5Pcreate(H5P_DATASET_CREATE); - chunk_dims[0] = chunk_dims[1] = 10; - H5Pset_chunk(dcpl, 2, chunk_dims); - dims[0] = 10; - dims[1] = 30; - max_dims[0] = max_dims[1] = H5S_UNLIMITED; - sid = H5Screate_simple(2, dims, max_dims); - - /* Initialize write buffer */ - for(i=0; i