diff --git a/src/plugins/acct_gather_profile/hdf5/hdf5_api.c b/src/plugins/acct_gather_profile/hdf5/hdf5_api.c index 3a076e07710e6e1038d3c217a96946fc026d3e4e..896010881ca0cd46a34c5f017b17091ea325d3b7 100644 --- a/src/plugins/acct_gather_profile/hdf5/hdf5_api.c +++ b/src/plugins/acct_gather_profile/hdf5/hdf5_api.c @@ -1275,40 +1275,62 @@ extern char *get_data_set_name(char *type) } -extern void hdf5_obj_info(hid_t group, char *nam_group) +static char* _H5O_type_t2str(H5O_type_t type) { + switch (type) + { + case H5O_TYPE_UNKNOWN: + return "H5O_TYPE_UNKNOWN"; + case H5O_TYPE_GROUP: + return "H5O_TYPE_GROUP"; + case H5O_TYPE_DATASET: + return "H5O_TYPE_DATASET"; + case H5O_TYPE_NAMED_DATATYPE: + return "H5O_TYPE_NAMED_DATATYPE"; + case H5O_TYPE_NTYPES: + return "H5O_TYPE_NTYPES"; + default: + return "Invalid H5O_TYPE"; + } +} - char *hdf5_typ_nam[] = {"H5G_LINK ", - "H5G_GROUP ", - "H5G_DATASET", - "H5G_TYPE "}; +extern void hdf5_obj_info(hid_t group, char *nam_group) +{ char buf[MAX_GROUP_NAME+1]; hsize_t nobj, nattr; hid_t aid; int i, len, typ; + H5G_info_t group_info; + H5O_info_t object_info; if (group < 0) { info("PROFILE: Group is not HDF5 object"); return; } - H5Gget_num_objs(group, &nobj); - nattr = H5Aget_num_attrs(group); + H5Gget_info(group, &group_info); + nobj = group_info.nlinks; + H5Oget_info(group, &object_info); + nattr = object_info.num_attrs; info("PROFILE group: %s NumObject=%d NumAttributes=%d", nam_group, (int) nobj, (int) nattr); for (i = 0; (nobj>0) && (i<nobj); i++) { - typ = H5Gget_objtype_by_idx(group, i); - len = H5Gget_objname_by_idx(group, i, buf, MAX_GROUP_NAME); + H5Oget_info_by_idx(group, ".", H5_INDEX_NAME, H5_ITER_INC, i, + &object_info, H5P_DEFAULT); + len = H5Lget_name_by_idx(group, ".", H5_INDEX_NAME, + H5_ITER_INC, i, buf, MAX_GROUP_NAME, + H5P_DEFAULT); if ((len > 0) && (len < MAX_GROUP_NAME)) { info("PROFILE: Obj=%d Type=%s Name=%s", - i, hdf5_typ_nam[typ], buf); + i, _H5O_type_t2str(object_info.type), buf); } else { info("PROFILE: Obj=%d Type=%s Name=%s (is truncated)", - i, hdf5_typ_nam[typ], buf); + i, _H5O_type_t2str(object_info.type), buf); } } for (i = 0; (nattr>0) && (i<nattr); i++) { - aid = H5Aopen_idx(group, (unsigned int)i ); + aid = H5Aopen_by_idx(group, ".", H5_INDEX_NAME, H5_ITER_INC, + i, H5P_DEFAULT, H5P_DEFAULT); // Get the name of the attribute. len = H5Aget_name(aid, MAX_ATTR_NAME, buf); if (len < MAX_ATTR_NAME) { diff --git a/src/plugins/acct_gather_profile/hdf5/sh5util/sh5util.c b/src/plugins/acct_gather_profile/hdf5/sh5util/sh5util.c index f1778f54eb981e0f082cd5a6f9968ffd67764268..20794b60202d11168131fec9fe2a2911300c0b2d 100644 --- a/src/plugins/acct_gather_profile/hdf5/sh5util/sh5util.c +++ b/src/plugins/acct_gather_profile/hdf5/sh5util/sh5util.c @@ -346,8 +346,9 @@ static void* _get_all_samples(hid_t gid_series, char* nam_series, uint32_t type, return NULL; } for (smpx=0; smpx<nsamples; smpx++) { - len = H5Gget_objname_by_idx(gid_series, smpx, name_sample, - MAX_GROUP_NAME); + len = H5Lget_name_by_idx(gid_series, ".", H5_INDEX_NAME, + H5_ITER_INC, smpx, name_sample, + MAX_GROUP_NAME, H5P_DEFAULT); if (len<1 || len>MAX_GROUP_NAME) { error("Invalid group name %s", name_sample); continue; @@ -400,7 +401,7 @@ static void* _get_all_samples(hid_t gid_series, char* nam_series, uint32_t type, static void _merge_series_data(hid_t jgid_tasks, hid_t jg_node, hid_t nsg_node) { hid_t jg_samples, nsg_samples; - hid_t g_series, obj_type, g_series_total = -1; + hid_t g_series, g_series_total = -1; hsize_t num_samples, n_series; int idsx, len; void *data = NULL, *series_total = NULL; @@ -408,6 +409,8 @@ static void _merge_series_data(hid_t jgid_tasks, hid_t jg_node, hid_t nsg_node) char *data_type; char nam_series[MAX_GROUP_NAME+1]; hdf5_api_ops_t* ops = NULL; + H5G_info_t group_info; + H5O_info_t object_info; if (jg_node < 0) { info("Job Node is not HDF5 object"); @@ -430,7 +433,8 @@ static void _merge_series_data(hid_t jgid_tasks, hid_t jg_node, hid_t nsg_node) debug("Failed to get node-step Samples"); return; } - H5Gget_num_objs(nsg_samples, &n_series); + H5Gget_info(nsg_samples, &group_info); + n_series = group_info.nlinks; if (n_series < 1) { // No series? H5Gclose(jg_samples); @@ -439,8 +443,9 @@ static void _merge_series_data(hid_t jgid_tasks, hid_t jg_node, hid_t nsg_node) return; } for (idsx = 0; idsx < n_series; idsx++) { - obj_type = H5Gget_objtype_by_idx(nsg_samples, idsx); - if (obj_type != H5G_GROUP) + H5Oget_info_by_idx(nsg_samples, ".", H5_INDEX_NAME, H5_ITER_INC, + idsx, &object_info, NULL); + if (object_info.type != H5O_TYPE_GROUP) continue; len = H5Gget_objname_by_idx(nsg_samples, idsx, nam_series, MAX_GROUP_NAME);