[Darshan-commits] [Git][darshan/darshan][dev-detailed-hdf5-mod] 2 commits: support for h5d chunking & common access
Shane Snyder
xgitlab at cels.anl.gov
Tue Mar 31 14:16:55 CDT 2020
Shane Snyder pushed to branch dev-detailed-hdf5-mod at darshan / darshan
Commits:
23a8c503 by Shane Snyder at 2020-03-31T14:07:11-05:00
support for h5d chunking & common access
- - - - -
a7f10928 by Shane Snyder at 2020-03-31T14:16:17-05:00
updated hdf5 logutils code
- - - - -
14 changed files:
- darshan-hdf5-log-format.h
- darshan-runtime/darshan-common.h
- darshan-runtime/lib/darshan-common.c
- darshan-runtime/lib/darshan-hdf5.c
- darshan-runtime/lib/darshan-mpiio.c
- darshan-runtime/lib/darshan-posix.c
- darshan-util/darshan-dxt-logutils.c
- darshan-util/darshan-hdf5-logutils.c
- darshan-util/darshan-lustre-logutils.c
- darshan-util/darshan-mpiio-logutils.c
- darshan-util/darshan-null-logutils.c
- darshan-util/darshan-pnetcdf-logutils.c
- darshan-util/darshan-posix-logutils.c
- darshan-util/darshan-stdio-logutils.c
Changes:
=====================================
darshan-hdf5-log-format.h
=====================================
@@ -8,9 +8,11 @@
#define __DARSHAN_HDF5_LOG_FORMAT_H
/* current HDF5 log format versions */
-#define DARSHAN_H5F_VER 2
+#define DARSHAN_H5F_VER 3
#define DARSHAN_H5D_VER 1
+#define H5D_MAX_NDIMS 5
+
#define H5F_COUNTERS \
/* count of HDF5 file opens/creates */\
X(H5F_OPENS) \
@@ -81,11 +83,53 @@
X(H5D_SIZE_WRITE_AGG_10M_100M) \
X(H5D_SIZE_WRITE_AGG_100M_1G) \
X(H5D_SIZE_WRITE_AGG_1G_PLUS) \
- /* the four most frequently appearing H5D access sizes */\
+ /* the four most frequently appearing H5D accesses, identified by
+ * access size and access lengths (count * block) and strides
+ * in last 5 hyperslab dimensions */\
X(H5D_ACCESS1_ACCESS) \
+ X(H5D_ACCESS1_LENGTH_D1) \
+ X(H5D_ACCESS1_LENGTH_D2) \
+ X(H5D_ACCESS1_LENGTH_D3) \
+ X(H5D_ACCESS1_LENGTH_D4) \
+ X(H5D_ACCESS1_LENGTH_D5) \
+ X(H5D_ACCESS1_STRIDE_D1) \
+ X(H5D_ACCESS1_STRIDE_D2) \
+ X(H5D_ACCESS1_STRIDE_D3) \
+ X(H5D_ACCESS1_STRIDE_D4) \
+ X(H5D_ACCESS1_STRIDE_D5) \
X(H5D_ACCESS2_ACCESS) \
+ X(H5D_ACCESS2_LENGTH_D1) \
+ X(H5D_ACCESS2_LENGTH_D2) \
+ X(H5D_ACCESS2_LENGTH_D3) \
+ X(H5D_ACCESS2_LENGTH_D4) \
+ X(H5D_ACCESS2_LENGTH_D5) \
+ X(H5D_ACCESS2_STRIDE_D1) \
+ X(H5D_ACCESS2_STRIDE_D2) \
+ X(H5D_ACCESS2_STRIDE_D3) \
+ X(H5D_ACCESS2_STRIDE_D4) \
+ X(H5D_ACCESS2_STRIDE_D5) \
X(H5D_ACCESS3_ACCESS) \
+ X(H5D_ACCESS3_LENGTH_D1) \
+ X(H5D_ACCESS3_LENGTH_D2) \
+ X(H5D_ACCESS3_LENGTH_D3) \
+ X(H5D_ACCESS3_LENGTH_D4) \
+ X(H5D_ACCESS3_LENGTH_D5) \
+ X(H5D_ACCESS3_STRIDE_D1) \
+ X(H5D_ACCESS3_STRIDE_D2) \
+ X(H5D_ACCESS3_STRIDE_D3) \
+ X(H5D_ACCESS3_STRIDE_D4) \
+ X(H5D_ACCESS3_STRIDE_D5) \
X(H5D_ACCESS4_ACCESS) \
+ X(H5D_ACCESS4_LENGTH_D1) \
+ X(H5D_ACCESS4_LENGTH_D2) \
+ X(H5D_ACCESS4_LENGTH_D3) \
+ X(H5D_ACCESS4_LENGTH_D4) \
+ X(H5D_ACCESS4_LENGTH_D5) \
+ X(H5D_ACCESS4_STRIDE_D1) \
+ X(H5D_ACCESS4_STRIDE_D2) \
+ X(H5D_ACCESS4_STRIDE_D3) \
+ X(H5D_ACCESS4_STRIDE_D4) \
+ X(H5D_ACCESS4_STRIDE_D5) \
/* count of each of the most frequent H5D access sizes */\
X(H5D_ACCESS1_COUNT) \
X(H5D_ACCESS2_COUNT) \
@@ -97,6 +141,13 @@
X(H5D_DATASPACE_NPOINTS) \
/* size of dataset elements in bytes */\
X(H5D_DATATYPE_SIZE) \
+ /* chunk sizes in the last 5 dimensions of the dataset */\
+ /* NOTE: D1 is the last dimension (i.e., row) , D2 is 2nd to last (i.e., column), and so on */\
+ X(H5D_CHUNK_SIZE_D1) \
+ X(H5D_CHUNK_SIZE_D2) \
+ X(H5D_CHUNK_SIZE_D3) \
+ X(H5D_CHUNK_SIZE_D4) \
+ X(H5D_CHUNK_SIZE_D5) \
/* flag indicating use of MPI-IO collectives */\
X(H5D_USE_MPIIO_COLLECTIVE) \
/* flag indicating whether deprecated create/open calls were used */\
=====================================
darshan-runtime/darshan-common.h
=====================================
@@ -67,8 +67,13 @@
*(__bucket_base_p + 9) += 1; \
} while(0)
-/* potentially set or increment a common value counter, depending on the __count
- * for the given __value. This macro ensures common values are stored first in
+/* maximum number of common values that darshan will track per file at runtime */
+#define DARSHAN_COMMON_VAL_MAX_RUNTIME_COUNT 32
+/* maximum number of counters in each common value */
+#define DARSHAN_COMMON_VAL_MAX_NCOUNTERS 12
+
+/* potentially set or add common value counters, depending on the __val_count
+ * for the given __vals. This macro ensures common values are stored first in
* decreasing order of their total count, and second by decreasing order of
* their value.
@@ -79,33 +84,32 @@
* counters) and __cnt_p is a pointer to the base of the count counters (i.e.
* the first of 4 contiguous common count counters). It is assumed your counters
* are stored as int64_t types. __add_flag is set if the given count should be
- * added to the common access counter, rather than just incrementing it.
+ * added to the common access counter, rather than just setting it.
*/
-#define DARSHAN_COMMON_VAL_COUNTER_INC(__val_p, __cnt_p, __value, __count, __add_flag) do {\
+#define DARSHAN_UPDATE_COMMON_VAL_COUNTERS(__val_p, __cnt_p, __vals, __val_size, __val_count, __add_flag) do {\
int i; \
- int inc_count, total_count; \
- int64_t tmp_val[4] = {0}; \
+ int total_count = __val_count; \
+ int64_t tmp_val[4*DARSHAN_COMMON_VAL_MAX_NCOUNTERS] = {0}; \
int64_t tmp_cnt[4] = {0}; \
int tmp_ndx = 0; \
- if(__value == 0) break; \
- if(__add_flag) \
- inc_count = 1; \
- else \
- inc_count = __count; \
+ if(*(int64_t *)__vals == 0) break; \
for(i=0; i<4; i++) { \
- if(*(__val_p + i) == __value) { \
- total_count = *(__cnt_p + i) + inc_count; \
+ if(__add_flag && \
+ !memcmp(__val_p + (i * sizeof(*__vals) * __val_size), \
+ __vals, sizeof(*__vals) * __val_size)) { \
+ total_count += *(__cnt_p + i); \
break; \
} \
} \
- if(i == 4) total_count = __count; \
/* first, copy over any counters that should be sorted above this one \
* (counters with higher counts or equal counts and larger values) \
*/ \
- for(i=0;i < 4; i++) { \
+ for(i=0; i < 4; i++) { \
if((*(__cnt_p + i) > total_count) || \
- ((*(__cnt_p + i) == total_count) && (*(__val_p + i) > __value))) { \
- tmp_val[tmp_ndx] = *(__val_p + i); \
+ ((*(__cnt_p + i) == total_count) && \
+ (*(__val_p + (i * sizeof(*__vals) * __val_size)) > *(int64_t *)__vals))) { \
+ memcpy(&tmp_val[tmp_ndx * __val_size], __val_p + (i * sizeof(*__vals) * __val_size), \
+ sizeof(*__vals) * __val_size); \
tmp_cnt[tmp_ndx] = *(__cnt_p + i); \
tmp_ndx++; \
} \
@@ -113,27 +117,28 @@
} \
if(tmp_ndx == 4) break; /* all done, updated counter is not added */ \
/* next, add the updated counter */ \
- tmp_val[tmp_ndx] = __value; \
+ memcpy(&tmp_val[tmp_ndx * __val_size], __vals, sizeof(*__vals) * __val_size); \
tmp_cnt[tmp_ndx] = total_count; \
tmp_ndx++; \
/* last, copy over any remaining counters to make sure we have 4 sets total */ \
while(tmp_ndx != 4) { \
- if(*(__val_p + i) != __value) { \
- tmp_val[tmp_ndx] = *(__val_p + i); \
+ if(memcmp(__val_p + (i * sizeof(*__vals) * __val_size), \
+ __vals, sizeof(*__vals) * __val_size)) { \
+ memcpy(&tmp_val[tmp_ndx * __val_size], __val_p + (i * sizeof(*__vals) * __val_size), \
+ sizeof(*__vals) * __val_size); \
tmp_cnt[tmp_ndx] = *(__cnt_p + i); \
tmp_ndx++; \
} \
i++; \
} \
- memcpy(__val_p, tmp_val, 4*sizeof(int64_t)); \
+ memcpy(__val_p, tmp_val, 4*sizeof(int64_t)*__val_size); \
memcpy(__cnt_p, tmp_cnt, 4*sizeof(int64_t)); \
} while(0)
-/* maximum number of common values that darshan will track per file at runtime */
-#define DARSHAN_COMMON_VAL_MAX_RUNTIME_COUNT 32
struct darshan_common_val_counter
{
- int64_t val;
+ int64_t vals[DARSHAN_COMMON_VAL_MAX_NCOUNTERS];
+ int nvals;
int freq;
};
@@ -245,8 +250,8 @@ void darshan_record_sort(
int rec_count,
int rec_size);
-/* darshan_common_val_counter()
- *
+/* darshan_track_common_val_counters()
+ * XXX
* Potentially increment an existing common value counter or allocate
* a new one to keep track of commonly occuring values. Example use
* cases would be to track the most frequent access sizes or strides
@@ -260,12 +265,11 @@ void darshan_record_sort(
* a pointer to the base counter of the common counts (which are
* again expected to be contiguous in memory).
*/
-void darshan_common_val_counter(
+struct darshan_common_val_counter *darshan_track_common_val_counters(
void **common_val_root,
- int *common_val_count,
- int64_t val,
- int64_t *val_p,
- int64_t *cnt_p);
+ int64_t *vals,
+ int nvals,
+ int *common_val_count);
#ifdef HAVE_MPI
/* darshan_variance_reduce()
=====================================
darshan-runtime/lib/darshan-common.c
=====================================
@@ -213,34 +213,29 @@ void darshan_record_sort(void *rec_buf, int rec_count, int rec_size)
return;
}
-static int darshan_common_val_compare(const void *a_p, const void *b_p)
+static int darshan_common_vals_compare(const void *a_p, const void *b_p)
{
const struct darshan_common_val_counter* a = a_p;
const struct darshan_common_val_counter* b = b_p;
- if(a->val < b->val)
- return(-1);
- if(a->val > b->val)
- return(1);
- return(0);
+ return(memcmp(a->vals, b->vals, sizeof(*(a->vals)) * a->nvals));
}
-void darshan_common_val_counter(void **common_val_root, int *common_val_count,
- int64_t val, int64_t *common_val_p, int64_t *common_cnt_p)
+struct darshan_common_val_counter *darshan_track_common_val_counters(
+ void **common_val_root, int64_t *vals, int nvals, int *common_val_count)
{
struct darshan_common_val_counter* counter;
struct darshan_common_val_counter* found = NULL;
struct darshan_common_val_counter tmp_counter;
void* tmp;
- /* don't count any values of 0 */
- if(val == 0)
- return;
+ assert(nvals <= DARSHAN_COMMON_VAL_MAX_NCOUNTERS);
/* check to see if this val is already recorded */
- tmp_counter.val = val;
+ memcpy(tmp_counter.vals, vals, sizeof(*vals) * nvals);
+ tmp_counter.nvals = nvals;
tmp_counter.freq = 1;
- tmp = tfind(&tmp_counter, common_val_root, darshan_common_val_compare);
+ tmp = tfind(&tmp_counter, common_val_root, darshan_common_vals_compare);
if(tmp)
{
found = *(struct darshan_common_val_counter**)tmp;
@@ -252,13 +247,14 @@ void darshan_common_val_counter(void **common_val_root, int *common_val_count,
counter = malloc(sizeof(*counter));
if(!counter)
{
- return;
+ return(NULL);
}
- counter->val = val;
+ memcpy(counter->vals, vals, sizeof(*vals) * nvals);
+ counter->nvals = nvals;
counter->freq = 1;
- tmp = tsearch(counter, common_val_root, darshan_common_val_compare);
+ tmp = tsearch(counter, common_val_root, darshan_common_vals_compare);
found = *(struct darshan_common_val_counter**)tmp;
/* if we get a new answer out here we are in trouble; this was
* already checked with the tfind()
@@ -268,15 +264,7 @@ void darshan_common_val_counter(void **common_val_root, int *common_val_count,
(*common_val_count)++;
}
- /* update common access counters as we go, as long as we haven't already
- * hit the limit in the number we are willing to track */
- if(found)
- {
- DARSHAN_COMMON_VAL_COUNTER_INC(common_val_p, common_cnt_p,
- found->val, found->freq, 1);
- }
-
- return;
+ return(found);
}
#ifdef HAVE_MPI
=====================================
darshan-runtime/lib/darshan-hdf5.c
=====================================
@@ -146,7 +146,7 @@ static int my_rank = -1;
if(__newpath != __path) free(__newpath); \
break; \
} \
- if(H5Pget_fapl_mpio(__fapl, NULL, NULL) >= 0) \
+ if(__fapl != H5P_DEFAULT && H5Pget_fapl_mpio(__fapl, NULL, NULL) >= 0) \
__rec_ref->file_rec->counters[H5F_USE_MPIIO] = 1; \
__rec_ref->file_rec->counters[H5F_OPENS] += 1; \
if(__rec_ref->file_rec->fcounters[H5F_F_OPEN_START_TIMESTAMP] == 0 || \
@@ -190,6 +190,7 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags,
tm1 = darshan_core_wtime();
ret = __real_H5Fcreate(filename, flags, create_plist, access_plist);
tm2 = darshan_core_wtime();
+
if(ret >= 0)
{
/* use ROMIO approach to strip prefix if present */
@@ -241,6 +242,7 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
tm1 = darshan_core_wtime();
ret = __real_H5Fopen(filename, flags, access_plist);
tm2 = darshan_core_wtime();
+
if(ret >= 0)
{
/* use ROMIO approach to strip prefix if present */
@@ -276,20 +278,23 @@ herr_t H5Fflush(hid_t object_id, H5F_scope_t scope)
tm2 = darshan_core_wtime();
/* convert object_id to file_id so we can look it up */
- file_id = H5Iget_file_id(object_id);
- if(file_id > 0)
+ if(ret >= 0)
{
- H5F_PRE_RECORD();
- rec_ref = darshan_lookup_record_ref(hdf5_file_runtime->hid_hash,
- &file_id, sizeof(hid_t));
- if(rec_ref)
+ file_id = H5Iget_file_id(object_id);
+ if(file_id > 0)
{
- rec_ref->file_rec->counters[H5F_FLUSHES] += 1;
- DARSHAN_TIMER_INC_NO_OVERLAP(
- rec_ref->file_rec->fcounters[H5F_F_META_TIME],
- tm1, tm2, rec_ref->last_meta_end);
+ H5F_PRE_RECORD();
+ rec_ref = darshan_lookup_record_ref(hdf5_file_runtime->hid_hash,
+ &file_id, sizeof(hid_t));
+ if(rec_ref)
+ {
+ rec_ref->file_rec->counters[H5F_FLUSHES] += 1;
+ DARSHAN_TIMER_INC_NO_OVERLAP(
+ rec_ref->file_rec->fcounters[H5F_F_META_TIME],
+ tm1, tm2, rec_ref->last_meta_end);
+ }
+ H5F_POST_RECORD();
}
- H5F_POST_RECORD();
}
return(ret);
@@ -307,22 +312,25 @@ herr_t DARSHAN_DECL(H5Fclose)(hid_t file_id)
ret = __real_H5Fclose(file_id);
tm2 = darshan_core_wtime();
- H5F_PRE_RECORD();
- rec_ref = darshan_lookup_record_ref(hdf5_file_runtime->hid_hash,
- &file_id, sizeof(hid_t));
- if(rec_ref)
+ if(ret >= 0)
{
- if(rec_ref->file_rec->fcounters[H5F_F_CLOSE_START_TIMESTAMP] == 0 ||
- rec_ref->file_rec->fcounters[H5F_F_CLOSE_START_TIMESTAMP] > tm1)
- rec_ref->file_rec->fcounters[H5F_F_CLOSE_START_TIMESTAMP] = tm1;
- rec_ref->file_rec->fcounters[H5F_F_CLOSE_END_TIMESTAMP] = tm2;
- DARSHAN_TIMER_INC_NO_OVERLAP(
- rec_ref->file_rec->fcounters[H5F_F_META_TIME],
- tm1, tm2, rec_ref->last_meta_end);
- darshan_delete_record_ref(&(hdf5_file_runtime->hid_hash),
+ H5F_PRE_RECORD();
+ rec_ref = darshan_lookup_record_ref(hdf5_file_runtime->hid_hash,
&file_id, sizeof(hid_t));
+ if(rec_ref)
+ {
+ if(rec_ref->file_rec->fcounters[H5F_F_CLOSE_START_TIMESTAMP] == 0 ||
+ rec_ref->file_rec->fcounters[H5F_F_CLOSE_START_TIMESTAMP] > tm1)
+ rec_ref->file_rec->fcounters[H5F_F_CLOSE_START_TIMESTAMP] = tm1;
+ rec_ref->file_rec->fcounters[H5F_F_CLOSE_END_TIMESTAMP] = tm2;
+ DARSHAN_TIMER_INC_NO_OVERLAP(
+ rec_ref->file_rec->fcounters[H5F_F_META_TIME],
+ tm1, tm2, rec_ref->last_meta_end);
+ darshan_delete_record_ref(&(hdf5_file_runtime->hid_hash),
+ &file_id, sizeof(hid_t));
+ }
+ H5F_POST_RECORD();
}
- H5F_POST_RECORD();
return(ret);
@@ -349,12 +357,14 @@ herr_t DARSHAN_DECL(H5Fclose)(hid_t file_id)
HDF5_UNLOCK(); \
} while(0)
-#define H5D_RECORD_OPEN(__ret, __loc_id, __name, __type_id, __space_id, __use_depr, __tm1, __tm2) do { \
+#define H5D_RECORD_OPEN(__ret, __loc_id, __name, __type_id, __space_id, __dcpl_id, __use_depr, __tm1, __tm2) do { \
char *__file_path, *__tmp_ptr; \
char __rec_name[DARSHAN_HDF5_MAX_NAME_LEN] = {0}; \
ssize_t __req_name_len = DARSHAN_HDF5_MAX_NAME_LEN-1, __ret_name_len; \
darshan_record_id __rec_id; \
struct hdf5_dataset_record_ref *__rec_ref; \
+ hsize_t __chunk_dims[H5D_MAX_NDIMS] = {0}; \
+ int __i, __n_chunk_dims = 0; \
/* get corresponding file name */\
__ret_name_len = H5Fget_name(__loc_id, __rec_name, __req_name_len); \
if(__ret_name_len < 0) break; \
@@ -396,6 +406,12 @@ herr_t DARSHAN_DECL(H5Fclose)(hid_t file_id)
__tm1, __tm2, __rec_ref->last_meta_end); \
__rec_ref->dataset_rec->counters[H5D_DATASPACE_NDIMS] = H5Sget_simple_extent_ndims(__space_id); \
__rec_ref->dataset_rec->counters[H5D_DATASPACE_NPOINTS] = H5Sget_simple_extent_npoints(__space_id); \
+ if(__dcpl_id != H5P_DEFAULT && H5Pget_layout(__dcpl_id) == H5D_CHUNKED) { \
+ __n_chunk_dims = H5Pget_chunk(__dcpl_id, H5D_MAX_NDIMS, __chunk_dims); \
+ __n_chunk_dims = (__n_chunk_dims < H5D_MAX_NDIMS) ? __n_chunk_dims : H5D_MAX_NDIMS; \
+ for(__i = 0; __i < __n_chunk_dims; __i++) \
+ __rec_ref->dataset_rec->counters[H5D_CHUNK_SIZE_D1 + __i] = __chunk_dims[__n_chunk_dims - __i - 1]; \
+ } \
__rec_ref->dataset_rec->counters[H5D_DATATYPE_SIZE] = H5Tget_size(__type_id); \
darshan_add_record_ref(&(hdf5_dataset_runtime->hid_hash), &__ret, sizeof(hid_t), __rec_ref); \
} while(0)
@@ -411,9 +427,12 @@ hid_t H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
ret = __real_H5Dcreate1(loc_id, name, type_id, space_id, dcpl_id);
tm2 = darshan_core_wtime();
- H5D_PRE_RECORD();
- H5D_RECORD_OPEN(ret, loc_id, name, type_id, space_id, 1, tm1, tm2);
- H5D_POST_RECORD();
+ if(ret >= 0)
+ {
+ H5D_PRE_RECORD();
+ H5D_RECORD_OPEN(ret, loc_id, name, type_id, space_id, dcpl_id, 1, tm1, tm2);
+ H5D_POST_RECORD();
+ }
return(ret);
}
@@ -430,9 +449,12 @@ hid_t H5Dcreate2(hid_t loc_id, const char *name, hid_t dtype_id, hid_t space_id,
ret = __real_H5Dcreate2(loc_id, name, dtype_id, space_id, lcpl_id, dcpl_id, dapl_id);
tm2 = darshan_core_wtime();
- H5D_PRE_RECORD();
- H5D_RECORD_OPEN(ret, loc_id, name, dtype_id, space_id, 0, tm1, tm2);
- H5D_POST_RECORD();
+ if(ret >= 0)
+ {
+ H5D_PRE_RECORD();
+ H5D_RECORD_OPEN(ret, loc_id, name, dtype_id, space_id, dcpl_id, 0, tm1, tm2);
+ H5D_POST_RECORD();
+ }
return(ret);
}
@@ -441,6 +463,7 @@ hid_t H5Dopen1(hid_t loc_id, const char *name)
{
hid_t dtype_id;
hid_t space_id;
+ hid_t dcpl_id;
double tm1, tm2;
hid_t ret;
@@ -450,23 +473,34 @@ hid_t H5Dopen1(hid_t loc_id, const char *name)
ret = __real_H5Dopen1(loc_id, name);
tm2 = darshan_core_wtime();
- /* query dataset datatype, dataspace, and creation property list */
- dtype_id = H5Dget_type(ret);
- if(dtype_id < 0)
- return(ret);
- space_id = H5Dget_space(ret);
- if(space_id < 0)
+ if(ret >= 0)
{
- H5Tclose(dtype_id);
- return(ret);
- }
+ /* query dataset datatype, dataspace, and creation property list */
+ dtype_id = H5Dget_type(ret);
+ if(dtype_id < 0)
+ return(ret);
+ space_id = H5Dget_space(ret);
+ if(space_id < 0)
+ {
+ H5Tclose(dtype_id);
+ return(ret);
+ }
+ dcpl_id = H5Dget_create_plist(ret);
+ if(dcpl_id < 0)
+ {
+ H5Tclose(dtype_id);
+ H5Sclose(space_id);
+ return(ret);
+ }
- H5D_PRE_RECORD();
- H5D_RECORD_OPEN(ret, loc_id, name, dtype_id, space_id, 1, tm1, tm2);
- H5D_POST_RECORD();
+ H5D_PRE_RECORD();
+ H5D_RECORD_OPEN(ret, loc_id, name, dtype_id, space_id, dcpl_id, 1, tm1, tm2);
+ H5D_POST_RECORD();
- H5Tclose(dtype_id);
- H5Sclose(space_id);
+ H5Tclose(dtype_id);
+ H5Sclose(space_id);
+ H5Pclose(dcpl_id);
+ }
return(ret);
}
@@ -475,6 +509,7 @@ hid_t H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id)
{
hid_t dtype_id;
hid_t space_id;
+ hid_t dcpl_id;
double tm1, tm2;
hid_t ret;
@@ -484,23 +519,34 @@ hid_t H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id)
ret = __real_H5Dopen2(loc_id, name, dapl_id);
tm2 = darshan_core_wtime();
- /* query dataset datatype, dataspace, and creation property list */
- dtype_id = H5Dget_type(ret);
- if(dtype_id < 0)
- return(ret);
- space_id = H5Dget_space(ret);
- if(space_id < 0)
+ if(ret >= 0)
{
- H5Tclose(dtype_id);
- return(ret);
- }
+ /* query dataset datatype, dataspace, and creation property list */
+ dtype_id = H5Dget_type(ret);
+ if(dtype_id < 0)
+ return(ret);
+ space_id = H5Dget_space(ret);
+ if(space_id < 0)
+ {
+ H5Tclose(dtype_id);
+ return(ret);
+ }
+ dcpl_id = H5Dget_create_plist(ret);
+ if(dcpl_id < 0)
+ {
+ H5Tclose(dtype_id);
+ H5Sclose(space_id);
+ return(ret);
+ }
- H5D_PRE_RECORD();
- H5D_RECORD_OPEN(ret, loc_id, name, dtype_id, space_id, 0, tm1, tm2);
- H5D_POST_RECORD();
+ H5D_PRE_RECORD();
+ H5D_RECORD_OPEN(ret, loc_id, name, dtype_id, space_id, dcpl_id, 0, tm1, tm2);
+ H5D_POST_RECORD();
- H5Tclose(dtype_id);
- H5Sclose(space_id);
+ H5Tclose(dtype_id);
+ H5Sclose(space_id);
+ H5Pclose(dcpl_id);
+ }
return(ret);
}
@@ -513,7 +559,14 @@ herr_t H5Dread(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
size_t type_size;
ssize_t file_sel_npoints;
H5S_sel_type file_sel_type;
+ hsize_t start_dims[H5D_MAX_NDIMS] = {0};
+ hsize_t stride_dims[H5D_MAX_NDIMS] = {0};
+ hsize_t count_dims[H5D_MAX_NDIMS] = {0};
+ hsize_t block_dims[H5D_MAX_NDIMS] = {0};
+ int64_t common_access_vals[H5D_MAX_NDIMS+H5D_MAX_NDIMS+1] = {0};
H5FD_mpio_xfer_t xfer_mode;
+ struct darshan_common_val_counter *cvc;
+ int i;
double tm1, tm2, elapsed;
herr_t ret;
herr_t tmp_ret;
@@ -525,62 +578,83 @@ herr_t H5Dread(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
xfer_plist_id, buf);
tm2 = darshan_core_wtime();
- H5D_PRE_RECORD();
- rec_ref = darshan_lookup_record_ref(hdf5_dataset_runtime->hid_hash,
- &dataset_id, sizeof(hid_t));
- if(rec_ref)
+ if(ret >= 0)
{
- rec_ref->dataset_rec->counters[H5D_READS] += 1;
- if(rec_ref->last_io_type == DARSHAN_IO_WRITE)
- rec_ref->dataset_rec->counters[H5D_RW_SWITCHES] += 1;
- rec_ref->last_io_type = DARSHAN_IO_READ;
- if(file_space_id == H5S_ALL)
- {
- file_sel_npoints = rec_ref->dataset_rec->counters[H5D_DATASPACE_NPOINTS];
- file_sel_type = H5S_SEL_ALL;
- }
- else
- {
- file_sel_npoints = H5Sget_select_npoints(file_space_id);
- file_sel_type = H5Sget_select_type(file_space_id);
- }
- if(file_sel_type == H5S_SEL_POINTS)
- rec_ref->dataset_rec->counters[H5D_POINT_SELECTS] += 1;
- else if(file_sel_type == H5S_SEL_ALL)
- rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS] += 1;
- else
+ H5D_PRE_RECORD();
+ rec_ref = darshan_lookup_record_ref(hdf5_dataset_runtime->hid_hash,
+ &dataset_id, sizeof(hid_t));
+ if(rec_ref)
{
- if(H5Sis_regular_hyperslab(file_space_id))
+ rec_ref->dataset_rec->counters[H5D_READS] += 1;
+ if(rec_ref->last_io_type == DARSHAN_IO_WRITE)
+ rec_ref->dataset_rec->counters[H5D_RW_SWITCHES] += 1;
+ rec_ref->last_io_type = DARSHAN_IO_READ;
+ if(file_space_id == H5S_ALL)
+ {
+ file_sel_npoints = rec_ref->dataset_rec->counters[H5D_DATASPACE_NPOINTS];
+ file_sel_type = H5S_SEL_ALL;
+ }
+ else
+ {
+ file_sel_npoints = H5Sget_select_npoints(file_space_id);
+ file_sel_type = H5Sget_select_type(file_space_id);
+ }
+ if(file_sel_type == H5S_SEL_ALL)
rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS] += 1;
+ else if(file_sel_type == H5S_SEL_POINTS)
+ rec_ref->dataset_rec->counters[H5D_POINT_SELECTS] += 1;
else
- rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS] += 1;
- }
- type_size = rec_ref->dataset_rec->counters[H5D_DATATYPE_SIZE];
- access_size = file_sel_npoints * type_size;
- rec_ref->dataset_rec->counters[H5D_BYTES_READ] += access_size;
- DARSHAN_BUCKET_INC(
- &(rec_ref->dataset_rec->counters[H5D_SIZE_READ_AGG_0_100]), access_size);
- darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, access_size,
- &(rec_ref->dataset_rec->counters[H5D_ACCESS1_ACCESS]),
- &(rec_ref->dataset_rec->counters[H5D_ACCESS1_COUNT]));
- tmp_ret = H5Pget_dxpl_mpio(xfer_plist_id, &xfer_mode);
- if(tmp_ret >= 0 && xfer_mode == H5FD_MPIO_COLLECTIVE)
- rec_ref->dataset_rec->counters[H5D_USE_MPIIO_COLLECTIVE] = 1;
- if(rec_ref->dataset_rec->fcounters[H5D_F_READ_START_TIMESTAMP] == 0 ||
- rec_ref->dataset_rec->fcounters[H5D_F_READ_START_TIMESTAMP] > tm1)
- rec_ref->dataset_rec->fcounters[H5D_F_READ_START_TIMESTAMP] = tm1;
- rec_ref->dataset_rec->fcounters[H5D_F_READ_END_TIMESTAMP] = tm2;
- elapsed = tm2 - tm1;
- if(rec_ref->dataset_rec->fcounters[H5D_F_MAX_READ_TIME] < elapsed)
- {
- rec_ref->dataset_rec->fcounters[H5D_F_MAX_READ_TIME] = elapsed;
- rec_ref->dataset_rec->counters[H5D_MAX_READ_TIME_SIZE] = access_size;
+ {
+ if(H5Sis_regular_hyperslab(file_space_id))
+ {
+ rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS] += 1;
+ H5Sget_regular_hyperslab(file_space_id,
+ start_dims, stride_dims, count_dims, block_dims);
+ for(i = 0; i < H5D_MAX_NDIMS; i++)
+ {
+ common_access_vals[1+i] = count_dims[H5D_MAX_NDIMS - i - 1] *
+ block_dims[H5D_MAX_NDIMS - i - 1];
+ common_access_vals[1+i+H5D_MAX_NDIMS] =
+ stride_dims[H5D_MAX_NDIMS - i - 1];
+ }
+ }
+ else
+ rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS] += 1;
+ }
+ type_size = rec_ref->dataset_rec->counters[H5D_DATATYPE_SIZE];
+ access_size = file_sel_npoints * type_size;
+ rec_ref->dataset_rec->counters[H5D_BYTES_READ] += access_size;
+ DARSHAN_BUCKET_INC(
+ &(rec_ref->dataset_rec->counters[H5D_SIZE_READ_AGG_0_100]), access_size);
+ common_access_vals[0] = access_size;
+ cvc = darshan_track_common_val_counters(&rec_ref->access_root,
+ common_access_vals, H5D_MAX_NDIMS+H5D_MAX_NDIMS+1, &rec_ref->access_count);
+ if(cvc) DARSHAN_UPDATE_COMMON_VAL_COUNTERS(
+ &(rec_ref->dataset_rec->counters[H5D_ACCESS1_ACCESS]),
+ &(rec_ref->dataset_rec->counters[H5D_ACCESS1_COUNT]),
+ cvc->vals, cvc->nvals, cvc->freq, 0);
+ if(xfer_plist_id != H5P_DEFAULT)
+ {
+ tmp_ret = H5Pget_dxpl_mpio(xfer_plist_id, &xfer_mode);
+ if(tmp_ret >= 0 && xfer_mode == H5FD_MPIO_COLLECTIVE)
+ rec_ref->dataset_rec->counters[H5D_USE_MPIIO_COLLECTIVE] = 1;
+ }
+ if(rec_ref->dataset_rec->fcounters[H5D_F_READ_START_TIMESTAMP] == 0 ||
+ rec_ref->dataset_rec->fcounters[H5D_F_READ_START_TIMESTAMP] > tm1)
+ rec_ref->dataset_rec->fcounters[H5D_F_READ_START_TIMESTAMP] = tm1;
+ rec_ref->dataset_rec->fcounters[H5D_F_READ_END_TIMESTAMP] = tm2;
+ elapsed = tm2 - tm1;
+ if(rec_ref->dataset_rec->fcounters[H5D_F_MAX_READ_TIME] < elapsed)
+ {
+ rec_ref->dataset_rec->fcounters[H5D_F_MAX_READ_TIME] = elapsed;
+ rec_ref->dataset_rec->counters[H5D_MAX_READ_TIME_SIZE] = access_size;
+ }
+ DARSHAN_TIMER_INC_NO_OVERLAP(
+ rec_ref->dataset_rec->fcounters[H5D_F_READ_TIME],
+ tm1, tm2, rec_ref->last_read_end);
}
- DARSHAN_TIMER_INC_NO_OVERLAP(
- rec_ref->dataset_rec->fcounters[H5D_F_READ_TIME],
- tm1, tm2, rec_ref->last_read_end);
+ H5D_POST_RECORD();
}
- H5D_POST_RECORD();
return(ret);
}
@@ -593,7 +667,14 @@ herr_t H5Dwrite(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
size_t type_size;
ssize_t file_sel_npoints;
H5S_sel_type file_sel_type;
+ hsize_t start_dims[H5D_MAX_NDIMS] = {0};
+ hsize_t stride_dims[H5D_MAX_NDIMS] = {0};
+ hsize_t count_dims[H5D_MAX_NDIMS] = {0};
+ hsize_t block_dims[H5D_MAX_NDIMS] = {0};
+ int64_t common_access_vals[H5D_MAX_NDIMS+H5D_MAX_NDIMS+1] = {0};
H5FD_mpio_xfer_t xfer_mode;
+ struct darshan_common_val_counter *cvc;
+ int i;
double tm1, tm2, elapsed;
herr_t ret;
herr_t tmp_ret;
@@ -605,62 +686,83 @@ herr_t H5Dwrite(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
xfer_plist_id, buf);
tm2 = darshan_core_wtime();
- H5D_PRE_RECORD();
- rec_ref = darshan_lookup_record_ref(hdf5_dataset_runtime->hid_hash,
- &dataset_id, sizeof(hid_t));
- if(rec_ref)
+ if(ret >= 0)
{
- rec_ref->dataset_rec->counters[H5D_WRITES] += 1;
- if(rec_ref->last_io_type == DARSHAN_IO_READ)
- rec_ref->dataset_rec->counters[H5D_RW_SWITCHES] += 1;
- rec_ref->last_io_type = DARSHAN_IO_WRITE;
- if(file_space_id == H5S_ALL)
- {
- file_sel_npoints = rec_ref->dataset_rec->counters[H5D_DATASPACE_NPOINTS];
- file_sel_type = H5S_SEL_ALL;
- }
- else
- {
- file_sel_npoints = H5Sget_select_npoints(file_space_id);
- file_sel_type = H5Sget_select_type(file_space_id);
- }
- if(file_sel_type == H5S_SEL_POINTS)
- rec_ref->dataset_rec->counters[H5D_POINT_SELECTS] += 1;
- else if(file_sel_type == H5S_SEL_ALL)
- rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS] += 1;
- else
+ H5D_PRE_RECORD();
+ rec_ref = darshan_lookup_record_ref(hdf5_dataset_runtime->hid_hash,
+ &dataset_id, sizeof(hid_t));
+ if(rec_ref)
{
- if(H5Sis_regular_hyperslab(file_space_id))
+ rec_ref->dataset_rec->counters[H5D_WRITES] += 1;
+ if(rec_ref->last_io_type == DARSHAN_IO_READ)
+ rec_ref->dataset_rec->counters[H5D_RW_SWITCHES] += 1;
+ rec_ref->last_io_type = DARSHAN_IO_WRITE;
+ if(file_space_id == H5S_ALL)
+ {
+ file_sel_npoints = rec_ref->dataset_rec->counters[H5D_DATASPACE_NPOINTS];
+ file_sel_type = H5S_SEL_ALL;
+ }
+ else
+ {
+ file_sel_npoints = H5Sget_select_npoints(file_space_id);
+ file_sel_type = H5Sget_select_type(file_space_id);
+ }
+ if(file_sel_type == H5S_SEL_POINTS)
+ rec_ref->dataset_rec->counters[H5D_POINT_SELECTS] += 1;
+ else if(file_sel_type == H5S_SEL_ALL)
rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS] += 1;
else
- rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS] += 1;
- }
- type_size = rec_ref->dataset_rec->counters[H5D_DATATYPE_SIZE];
- access_size = file_sel_npoints * type_size;
- rec_ref->dataset_rec->counters[H5D_BYTES_WRITTEN] += access_size;
- DARSHAN_BUCKET_INC(
- &(rec_ref->dataset_rec->counters[H5D_SIZE_WRITE_AGG_0_100]), access_size);
- darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, access_size,
- &(rec_ref->dataset_rec->counters[H5D_ACCESS1_ACCESS]),
- &(rec_ref->dataset_rec->counters[H5D_ACCESS1_COUNT]));
- tmp_ret = H5Pget_dxpl_mpio(xfer_plist_id, &xfer_mode);
- if(tmp_ret >= 0 && xfer_mode == H5FD_MPIO_COLLECTIVE)
- rec_ref->dataset_rec->counters[H5D_USE_MPIIO_COLLECTIVE] = 1;
- if(rec_ref->dataset_rec->fcounters[H5D_F_WRITE_START_TIMESTAMP] == 0 ||
- rec_ref->dataset_rec->fcounters[H5D_F_WRITE_START_TIMESTAMP] > tm1)
- rec_ref->dataset_rec->fcounters[H5D_F_WRITE_START_TIMESTAMP] = tm1;
- rec_ref->dataset_rec->fcounters[H5D_F_WRITE_END_TIMESTAMP] = tm2;
- elapsed = tm2 - tm1;
- if(rec_ref->dataset_rec->fcounters[H5D_F_MAX_WRITE_TIME] < elapsed)
- {
- rec_ref->dataset_rec->fcounters[H5D_F_MAX_WRITE_TIME] = elapsed;
- rec_ref->dataset_rec->counters[H5D_MAX_WRITE_TIME_SIZE] = access_size;
+ {
+ if(H5Sis_regular_hyperslab(file_space_id))
+ {
+ rec_ref->dataset_rec->counters[H5D_REGULAR_HYPERSLAB_SELECTS] += 1;
+ H5Sget_regular_hyperslab(file_space_id,
+ start_dims, stride_dims, count_dims, block_dims);
+ for(i = 0; i < H5D_MAX_NDIMS; i++)
+ {
+ common_access_vals[1+i] = count_dims[H5D_MAX_NDIMS - i - 1] *
+ block_dims[H5D_MAX_NDIMS - i - 1];
+ common_access_vals[1+i+H5D_MAX_NDIMS] =
+ stride_dims[H5D_MAX_NDIMS - i - 1];
+ }
+ }
+ else
+ rec_ref->dataset_rec->counters[H5D_IRREGULAR_HYPERSLAB_SELECTS] += 1;
+ }
+ type_size = rec_ref->dataset_rec->counters[H5D_DATATYPE_SIZE];
+ access_size = file_sel_npoints * type_size;
+ rec_ref->dataset_rec->counters[H5D_BYTES_WRITTEN] += access_size;
+ DARSHAN_BUCKET_INC(
+ &(rec_ref->dataset_rec->counters[H5D_SIZE_WRITE_AGG_0_100]), access_size);
+ common_access_vals[0] = access_size;
+ cvc = darshan_track_common_val_counters(&rec_ref->access_root,
+ common_access_vals, H5D_MAX_NDIMS+H5D_MAX_NDIMS+1, &rec_ref->access_count);
+ if(cvc) DARSHAN_UPDATE_COMMON_VAL_COUNTERS(
+ &(rec_ref->dataset_rec->counters[H5D_ACCESS1_ACCESS]),
+ &(rec_ref->dataset_rec->counters[H5D_ACCESS1_COUNT]),
+ cvc->vals, cvc->nvals, cvc->freq, 0);
+ if(xfer_plist_id != H5P_DEFAULT)
+ {
+ tmp_ret = H5Pget_dxpl_mpio(xfer_plist_id, &xfer_mode);
+ if(tmp_ret >= 0 && xfer_mode == H5FD_MPIO_COLLECTIVE)
+ rec_ref->dataset_rec->counters[H5D_USE_MPIIO_COLLECTIVE] = 1;
+ }
+ if(rec_ref->dataset_rec->fcounters[H5D_F_WRITE_START_TIMESTAMP] == 0 ||
+ rec_ref->dataset_rec->fcounters[H5D_F_WRITE_START_TIMESTAMP] > tm1)
+ rec_ref->dataset_rec->fcounters[H5D_F_WRITE_START_TIMESTAMP] = tm1;
+ rec_ref->dataset_rec->fcounters[H5D_F_WRITE_END_TIMESTAMP] = tm2;
+ elapsed = tm2 - tm1;
+ if(rec_ref->dataset_rec->fcounters[H5D_F_MAX_WRITE_TIME] < elapsed)
+ {
+ rec_ref->dataset_rec->fcounters[H5D_F_MAX_WRITE_TIME] = elapsed;
+ rec_ref->dataset_rec->counters[H5D_MAX_WRITE_TIME_SIZE] = access_size;
+ }
+ DARSHAN_TIMER_INC_NO_OVERLAP(
+ rec_ref->dataset_rec->fcounters[H5D_F_WRITE_TIME],
+ tm1, tm2, rec_ref->last_write_end);
}
- DARSHAN_TIMER_INC_NO_OVERLAP(
- rec_ref->dataset_rec->fcounters[H5D_F_WRITE_TIME],
- tm1, tm2, rec_ref->last_write_end);
+ H5D_POST_RECORD();
}
- H5D_POST_RECORD();
return(ret);
}
@@ -677,17 +779,20 @@ herr_t H5Dflush(hid_t dataset_id)
ret = __real_H5Dflush(dataset_id);
tm2 = darshan_core_wtime();
- H5D_PRE_RECORD();
- rec_ref = darshan_lookup_record_ref(hdf5_dataset_runtime->hid_hash,
- &dataset_id, sizeof(hid_t));
- if(rec_ref)
+ if(ret >= 0)
{
- rec_ref->dataset_rec->counters[H5D_FLUSHES] += 1;
- DARSHAN_TIMER_INC_NO_OVERLAP(
- rec_ref->dataset_rec->fcounters[H5D_F_META_TIME],
- tm1, tm2, rec_ref->last_meta_end);
+ H5D_PRE_RECORD();
+ rec_ref = darshan_lookup_record_ref(hdf5_dataset_runtime->hid_hash,
+ &dataset_id, sizeof(hid_t));
+ if(rec_ref)
+ {
+ rec_ref->dataset_rec->counters[H5D_FLUSHES] += 1;
+ DARSHAN_TIMER_INC_NO_OVERLAP(
+ rec_ref->dataset_rec->fcounters[H5D_F_META_TIME],
+ tm1, tm2, rec_ref->last_meta_end);
+ }
+ H5D_POST_RECORD();
}
- H5D_POST_RECORD();
return(ret);
}
@@ -704,20 +809,23 @@ herr_t H5Dclose(hid_t dataset_id)
ret = __real_H5Dclose(dataset_id);
tm2 = darshan_core_wtime();
- H5D_PRE_RECORD();
- rec_ref = darshan_lookup_record_ref(hdf5_dataset_runtime->hid_hash,
- &dataset_id, sizeof(hid_t));
- if(rec_ref)
+ if(ret >= 0)
{
- if(rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_START_TIMESTAMP] == 0 ||
- rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_START_TIMESTAMP] > tm1)
- rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_START_TIMESTAMP] = tm1;
- rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_END_TIMESTAMP] = tm2;
- DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->dataset_rec->fcounters[H5D_F_META_TIME],
- tm1, tm2, rec_ref->last_meta_end);
- darshan_delete_record_ref(&(hdf5_dataset_runtime->hid_hash), &dataset_id, sizeof(hid_t));
+ H5D_PRE_RECORD();
+ rec_ref = darshan_lookup_record_ref(hdf5_dataset_runtime->hid_hash,
+ &dataset_id, sizeof(hid_t));
+ if(rec_ref)
+ {
+ if(rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_START_TIMESTAMP] == 0 ||
+ rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_START_TIMESTAMP] > tm1)
+ rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_START_TIMESTAMP] = tm1;
+ rec_ref->dataset_rec->fcounters[H5D_F_CLOSE_END_TIMESTAMP] = tm2;
+ DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->dataset_rec->fcounters[H5D_F_META_TIME],
+ tm1, tm2, rec_ref->last_meta_end);
+ darshan_delete_record_ref(&(hdf5_dataset_runtime->hid_hash), &dataset_id, sizeof(hid_t));
+ }
+ H5D_POST_RECORD();
}
- H5D_POST_RECORD();
return(ret);
}
@@ -994,7 +1102,7 @@ static void hdf5_dataset_record_reduction_op(void* inrec_v, void* inoutrec_v,
struct darshan_hdf5_dataset tmp_dataset;
struct darshan_hdf5_dataset *inrec = inrec_v;
struct darshan_hdf5_dataset *inoutrec = inoutrec_v;
- int i, j, k;
+ int i, j, j2, k, k2;
for(i=0; i<*len; i++)
{
@@ -1016,39 +1124,52 @@ static void hdf5_dataset_record_reduction_op(void* inrec_v, void* inoutrec_v,
}
/* first collapse any duplicates */
- for(j=H5D_ACCESS1_ACCESS; j<=H5D_ACCESS4_ACCESS; j++)
+ for(j=H5D_ACCESS1_ACCESS, j2=H5D_ACCESS1_COUNT; j<=H5D_ACCESS4_ACCESS;
+ j+=(H5D_MAX_NDIMS+H5D_MAX_NDIMS+1), j2++)
{
- for(k=H5D_ACCESS1_ACCESS; k<=H5D_ACCESS4_ACCESS; k++)
+ for(k=H5D_ACCESS1_ACCESS, k2=H5D_ACCESS1_COUNT; k<=H5D_ACCESS4_ACCESS;
+ k+=(H5D_MAX_NDIMS+H5D_MAX_NDIMS+1), k2++)
{
- if(inrec->counters[j] == inoutrec->counters[k])
+ if(!memcmp(&inrec->counters[j], &inoutrec->counters[k],
+ sizeof(int64_t) * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1)))
{
- inrec->counters[j+4] += inoutrec->counters[k+4];
- inoutrec->counters[k] = 0;
- inoutrec->counters[k+4] = 0;
+ memset(&inoutrec->counters[k], 0, sizeof(int64_t) *
+ (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1));
+ inrec->counters[j2] += inoutrec->counters[k2];
+ inoutrec->counters[k2] = 0;
}
}
}
/* first set */
- for(j=H5D_ACCESS1_ACCESS; j<=H5D_ACCESS4_ACCESS; j++)
+ for(j=H5D_ACCESS1_ACCESS, j2=H5D_ACCESS1_COUNT; j<=H5D_ACCESS4_ACCESS;
+ j+=(H5D_MAX_NDIMS+H5D_MAX_NDIMS+1), j2++)
{
- DARSHAN_COMMON_VAL_COUNTER_INC(&(tmp_dataset.counters[H5D_ACCESS1_ACCESS]),
- &(tmp_dataset.counters[H5D_ACCESS1_COUNT]), inrec->counters[j],
- inrec->counters[j+4], 0);
+ DARSHAN_UPDATE_COMMON_VAL_COUNTERS(
+ &(tmp_dataset.counters[H5D_ACCESS1_ACCESS]),
+ &(tmp_dataset.counters[H5D_ACCESS1_COUNT]),
+ &inrec->counters[j], H5D_MAX_NDIMS+H5D_MAX_NDIMS+1,
+ inrec->counters[j2], 0);
}
/* second set */
- for(j=H5D_ACCESS1_ACCESS; j<=H5D_ACCESS4_ACCESS; j++)
+ for(j=H5D_ACCESS1_ACCESS, j2=H5D_ACCESS1_COUNT; j<=H5D_ACCESS4_ACCESS;
+ j+=(H5D_MAX_NDIMS+H5D_MAX_NDIMS+1), j2++)
{
- DARSHAN_COMMON_VAL_COUNTER_INC(&(tmp_dataset.counters[H5D_ACCESS1_ACCESS]),
- &(tmp_dataset.counters[H5D_ACCESS1_COUNT]), inoutrec->counters[j],
- inoutrec->counters[j+4], 0);
+ DARSHAN_UPDATE_COMMON_VAL_COUNTERS(
+ &(tmp_dataset.counters[H5D_ACCESS1_ACCESS]),
+ &(tmp_dataset.counters[H5D_ACCESS1_COUNT]),
+ &inoutrec->counters[j], H5D_MAX_NDIMS+H5D_MAX_NDIMS+1,
+ inoutrec->counters[j2], 0);
}
tmp_dataset.counters[H5D_DATASPACE_NDIMS] = inrec->counters[H5D_DATASPACE_NDIMS];
tmp_dataset.counters[H5D_DATASPACE_NPOINTS] = inrec->counters[H5D_DATASPACE_NPOINTS];
tmp_dataset.counters[H5D_DATATYPE_SIZE] = inrec->counters[H5D_DATATYPE_SIZE];
+ for(j=H5D_CHUNK_SIZE_D1; j<=H5D_CHUNK_SIZE_D5; j++)
+ tmp_dataset.counters[j] = inrec->counters[j];
+
if(inoutrec->counters[H5D_USE_MPIIO_COLLECTIVE] == 1 ||
inrec->counters[H5D_USE_MPIIO_COLLECTIVE] == 1)
tmp_dataset.counters[H5D_USE_MPIIO_COLLECTIVE] = 1;
=====================================
darshan-runtime/lib/darshan-mpiio.c
=====================================
@@ -239,6 +239,8 @@ static int my_rank = -1;
#define MPIIO_RECORD_READ(__ret, __fh, __count, __datatype, __counter, __tm1, __tm2) do { \
struct mpiio_file_record_ref *rec_ref; \
int size = 0; \
+ int64_t size_ll; \
+ struct darshan_common_val_counter *cvc; \
double __elapsed = __tm2-__tm1; \
if(__ret != MPI_SUCCESS) break; \
rec_ref = darshan_lookup_record_ref(mpiio_runtime->fh_hash, &(__fh), sizeof(MPI_File)); \
@@ -248,9 +250,13 @@ static int my_rank = -1;
/* DXT to record detailed read tracing information */ \
dxt_mpiio_read(rec_ref->file_rec->base_rec.id, size, __tm1, __tm2); \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[MPIIO_SIZE_READ_AGG_0_100]), size); \
- darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, size, \
+ size_ll = size; \
+ cvc = darshan_track_common_val_counters(&rec_ref->access_root, &size_ll, 1, \
+ &rec_ref->access_count); \
+ if(cvc) DARSHAN_UPDATE_COMMON_VAL_COUNTERS( \
&(rec_ref->file_rec->counters[MPIIO_ACCESS1_ACCESS]), \
- &(rec_ref->file_rec->counters[MPIIO_ACCESS1_COUNT])); \
+ &(rec_ref->file_rec->counters[MPIIO_ACCESS1_COUNT]), \
+ cvc->vals, 1, cvc->freq, 0); \
rec_ref->file_rec->counters[MPIIO_BYTES_READ] += size; \
rec_ref->file_rec->counters[__counter] += 1; \
if(rec_ref->last_io_type == DARSHAN_IO_WRITE) \
@@ -270,6 +276,8 @@ static int my_rank = -1;
#define MPIIO_RECORD_WRITE(__ret, __fh, __count, __datatype, __counter, __tm1, __tm2) do { \
struct mpiio_file_record_ref *rec_ref; \
int size = 0; \
+ int64_t size_ll; \
+ struct darshan_common_val_counter *cvc; \
double __elapsed = __tm2-__tm1; \
if(__ret != MPI_SUCCESS) break; \
rec_ref = darshan_lookup_record_ref(mpiio_runtime->fh_hash, &(__fh), sizeof(MPI_File)); \
@@ -279,9 +287,13 @@ static int my_rank = -1;
/* DXT to record detailed write tracing information */ \
dxt_mpiio_write(rec_ref->file_rec->base_rec.id, size, __tm1, __tm2); \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[MPIIO_SIZE_WRITE_AGG_0_100]), size); \
- darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, size, \
+ size_ll = size; \
+ cvc = darshan_track_common_val_counters(&rec_ref->access_root, &size_ll, 1, \
+ &rec_ref->access_count); \
+ if(cvc) DARSHAN_UPDATE_COMMON_VAL_COUNTERS( \
&(rec_ref->file_rec->counters[MPIIO_ACCESS1_ACCESS]), \
- &(rec_ref->file_rec->counters[MPIIO_ACCESS1_COUNT])); \
+ &(rec_ref->file_rec->counters[MPIIO_ACCESS1_COUNT]), \
+ cvc->vals, 1, cvc->freq, 0); \
rec_ref->file_rec->counters[MPIIO_BYTES_WRITTEN] += size; \
rec_ref->file_rec->counters[__counter] += 1; \
if(rec_ref->last_io_type == DARSHAN_IO_READ) \
@@ -1268,17 +1280,19 @@ static void mpiio_record_reduction_op(void* infile_v, void* inoutfile_v,
/* first set */
for(j=MPIIO_ACCESS1_ACCESS; j<=MPIIO_ACCESS4_ACCESS; j++)
{
- DARSHAN_COMMON_VAL_COUNTER_INC(&(tmp_file.counters[MPIIO_ACCESS1_ACCESS]),
- &(tmp_file.counters[MPIIO_ACCESS1_COUNT]), infile->counters[j],
- infile->counters[j+4], 0);
+ DARSHAN_UPDATE_COMMON_VAL_COUNTERS(
+ &(tmp_file.counters[MPIIO_ACCESS1_ACCESS]),
+ &(tmp_file.counters[MPIIO_ACCESS1_COUNT]),
+ &infile->counters[j], 1, infile->counters[j+4], 1);
}
/* second set */
for(j=MPIIO_ACCESS1_ACCESS; j<=MPIIO_ACCESS4_ACCESS; j++)
{
- DARSHAN_COMMON_VAL_COUNTER_INC(&(tmp_file.counters[MPIIO_ACCESS1_ACCESS]),
- &(tmp_file.counters[MPIIO_ACCESS1_COUNT]), inoutfile->counters[j],
- inoutfile->counters[j+4], 0);
+ DARSHAN_UPDATE_COMMON_VAL_COUNTERS(
+ &(tmp_file.counters[MPIIO_ACCESS1_ACCESS]),
+ &(tmp_file.counters[MPIIO_ACCESS1_COUNT]),
+ &inoutfile->counters[j], 1, inoutfile->counters[j+4], 1);
}
/* min non-zero (if available) value */
=====================================
darshan-runtime/lib/darshan-posix.c
=====================================
@@ -247,6 +247,7 @@ static int darshan_mem_alignment = 1;
size_t stride; \
int64_t this_offset; \
int64_t file_alignment; \
+ struct darshan_common_val_counter *cvc; \
double __elapsed = __tm2-__tm1; \
if(__ret < 0) break; \
rec_ref = darshan_lookup_record_ref(posix_runtime->fd_hash, &(__fd), sizeof(int)); \
@@ -273,12 +274,18 @@ static int darshan_mem_alignment = 1;
rec_ref->file_rec->counters[POSIX_BYTES_READ] += __ret; \
rec_ref->file_rec->counters[POSIX_READS] += 1; \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[POSIX_SIZE_READ_0_100]), __ret); \
- darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, __ret, \
+ cvc = darshan_track_common_val_counters(&rec_ref->access_root, &__ret, 1, \
+ &rec_ref->access_count); \
+ if(cvc) DARSHAN_UPDATE_COMMON_VAL_COUNTERS( \
&(rec_ref->file_rec->counters[POSIX_ACCESS1_ACCESS]), \
- &(rec_ref->file_rec->counters[POSIX_ACCESS1_COUNT])); \
- darshan_common_val_counter(&rec_ref->stride_root, &rec_ref->stride_count, stride, \
+ &(rec_ref->file_rec->counters[POSIX_ACCESS1_COUNT]), \
+ cvc->vals, 1, cvc->freq, 0); \
+ cvc = darshan_track_common_val_counters(&rec_ref->stride_root, &stride, 1, \
+ &rec_ref->stride_count); \
+ if(cvc) DARSHAN_UPDATE_COMMON_VAL_COUNTERS( \
&(rec_ref->file_rec->counters[POSIX_STRIDE1_STRIDE]), \
- &(rec_ref->file_rec->counters[POSIX_STRIDE1_COUNT])); \
+ &(rec_ref->file_rec->counters[POSIX_STRIDE1_COUNT]), \
+ cvc->vals, 1, cvc->freq, 0); \
if(!__aligned) \
rec_ref->file_rec->counters[POSIX_MEM_NOT_ALIGNED] += 1; \
file_alignment = rec_ref->file_rec->counters[POSIX_FILE_ALIGNMENT]; \
@@ -303,6 +310,7 @@ static int darshan_mem_alignment = 1;
size_t stride; \
int64_t this_offset; \
int64_t file_alignment; \
+ struct darshan_common_val_counter *cvc; \
double __elapsed = __tm2-__tm1; \
if(__ret < 0) break; \
rec_ref = darshan_lookup_record_ref(posix_runtime->fd_hash, &__fd, sizeof(int)); \
@@ -329,12 +337,18 @@ static int darshan_mem_alignment = 1;
rec_ref->file_rec->counters[POSIX_BYTES_WRITTEN] += __ret; \
rec_ref->file_rec->counters[POSIX_WRITES] += 1; \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[POSIX_SIZE_WRITE_0_100]), __ret); \
- darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, __ret, \
+ cvc = darshan_track_common_val_counters(&rec_ref->access_root, &__ret, 1, \
+ &rec_ref->access_count); \
+ if(cvc) DARSHAN_UPDATE_COMMON_VAL_COUNTERS( \
&(rec_ref->file_rec->counters[POSIX_ACCESS1_ACCESS]), \
- &(rec_ref->file_rec->counters[POSIX_ACCESS1_COUNT])); \
- darshan_common_val_counter(&rec_ref->stride_root, &rec_ref->stride_count, stride, \
+ &(rec_ref->file_rec->counters[POSIX_ACCESS1_COUNT]), \
+ cvc->vals, 1, cvc->freq, 0); \
+ cvc = darshan_track_common_val_counters(&rec_ref->stride_root, &stride, 1, \
+ &rec_ref->stride_count); \
+ if(cvc) DARSHAN_UPDATE_COMMON_VAL_COUNTERS( \
&(rec_ref->file_rec->counters[POSIX_STRIDE1_STRIDE]), \
- &(rec_ref->file_rec->counters[POSIX_STRIDE1_COUNT])); \
+ &(rec_ref->file_rec->counters[POSIX_STRIDE1_COUNT]), \
+ cvc->vals, 1, cvc->freq, 0); \
if(!__aligned) \
rec_ref->file_rec->counters[POSIX_MEM_NOT_ALIGNED] += 1; \
file_alignment = rec_ref->file_rec->counters[POSIX_FILE_ALIGNMENT]; \
@@ -1280,7 +1294,7 @@ int DARSHAN_DECL(aio_write64)(struct aiocb64 *aiocbp)
ssize_t DARSHAN_DECL(aio_return)(struct aiocb *aiocbp)
{
- int ret;
+ ssize_t ret;
double tm2;
struct posix_aio_tracker *tmp;
int aligned_flag = 0;
@@ -1317,7 +1331,7 @@ ssize_t DARSHAN_DECL(aio_return)(struct aiocb *aiocbp)
ssize_t DARSHAN_DECL(aio_return64)(struct aiocb64 *aiocbp)
{
- int ret;
+ ssize_t ret;
double tm2;
struct posix_aio_tracker *tmp;
int aligned_flag = 0;
@@ -1717,16 +1731,18 @@ static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
/* first set */
for(j=POSIX_STRIDE1_STRIDE; j<=POSIX_STRIDE4_STRIDE; j++)
{
- DARSHAN_COMMON_VAL_COUNTER_INC(&(tmp_file.counters[POSIX_STRIDE1_STRIDE]),
- &(tmp_file.counters[POSIX_STRIDE1_COUNT]), infile->counters[j],
- infile->counters[j+4], 0);
+ DARSHAN_UPDATE_COMMON_VAL_COUNTERS(
+ &(tmp_file.counters[POSIX_STRIDE1_STRIDE]),
+ &(tmp_file.counters[POSIX_STRIDE1_COUNT]),
+ &infile->counters[j], 1, infile->counters[j+4], 1);
}
/* second set */
for(j=POSIX_STRIDE1_STRIDE; j<=POSIX_STRIDE4_STRIDE; j++)
{
- DARSHAN_COMMON_VAL_COUNTER_INC(&(tmp_file.counters[POSIX_STRIDE1_STRIDE]),
- &(tmp_file.counters[POSIX_STRIDE1_COUNT]), inoutfile->counters[j],
- inoutfile->counters[j+4], 0);
+ DARSHAN_UPDATE_COMMON_VAL_COUNTERS(
+ &(tmp_file.counters[POSIX_STRIDE1_STRIDE]),
+ &(tmp_file.counters[POSIX_STRIDE1_COUNT]),
+ &inoutfile->counters[j], 1, inoutfile->counters[j+4], 1);
}
/* same for access counts */
@@ -1748,16 +1764,18 @@ static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
/* first set */
for(j=POSIX_ACCESS1_ACCESS; j<=POSIX_ACCESS4_ACCESS; j++)
{
- DARSHAN_COMMON_VAL_COUNTER_INC(&(tmp_file.counters[POSIX_ACCESS1_ACCESS]),
- &(tmp_file.counters[POSIX_ACCESS1_COUNT]), infile->counters[j],
- infile->counters[j+4], 0);
+ DARSHAN_UPDATE_COMMON_VAL_COUNTERS(
+ &(tmp_file.counters[POSIX_ACCESS1_ACCESS]),
+ &(tmp_file.counters[POSIX_ACCESS1_COUNT]),
+ &infile->counters[j], 1, infile->counters[j+4], 1);
}
/* second set */
for(j=POSIX_ACCESS1_ACCESS; j<=POSIX_ACCESS4_ACCESS; j++)
{
- DARSHAN_COMMON_VAL_COUNTER_INC(&(tmp_file.counters[POSIX_ACCESS1_ACCESS]),
- &(tmp_file.counters[POSIX_ACCESS1_COUNT]), inoutfile->counters[j],
- inoutfile->counters[j+4], 0);
+ DARSHAN_UPDATE_COMMON_VAL_COUNTERS(
+ &(tmp_file.counters[POSIX_ACCESS1_ACCESS]),
+ &(tmp_file.counters[POSIX_ACCESS1_COUNT]),
+ &inoutfile->counters[j], 1, inoutfile->counters[j+4], 1);
}
/* min non-zero (if available) value */
=====================================
darshan-util/darshan-dxt-logutils.c
=====================================
@@ -88,6 +88,14 @@ static int dxt_log_get_posix_file(darshan_fd fd, void** dxt_posix_buf_p)
if(fd->mod_map[DXT_POSIX_MOD].len == 0)
return(0);
+ if(fd->mod_ver[DXT_POSIX_MOD] == 0 ||
+ fd->mod_ver[DXT_POSIX_MOD] > DXT_POSIX_VER)
+ {
+ fprintf(stderr, "Error: Invalid DXT POSIX module version number (got %d)\n",
+ fd->mod_ver[DXT_POSIX_MOD]);
+ return(-1);
+ }
+
ret = darshan_log_get_mod(fd, DXT_POSIX_MOD, &tmp_rec,
sizeof(struct dxt_file_record));
if(ret < 0)
@@ -156,6 +164,14 @@ static int dxt_log_get_mpiio_file(darshan_fd fd, void** dxt_mpiio_buf_p)
if(fd->mod_map[DXT_MPIIO_MOD].len == 0)
return(0);
+ if(fd->mod_ver[DXT_MPIIO_MOD] == 0 ||
+ fd->mod_ver[DXT_MPIIO_MOD] > DXT_MPIIO_VER)
+ {
+ fprintf(stderr, "Error: Invalid DXT MPIIO module version number (got %d)\n",
+ fd->mod_ver[DXT_MPIIO_MOD]);
+ return(-1);
+ }
+
ret = darshan_log_get_mod(fd, DXT_MPIIO_MOD, &tmp_rec,
sizeof(struct dxt_file_record));
if(ret < 0)
=====================================
darshan-util/darshan-hdf5-logutils.c
=====================================
@@ -37,6 +37,7 @@ char *h5d_f_counter_names[] = {
#undef X
#define DARSHAN_H5F_FILE_SIZE_1 40
+#define DARSHAN_H5F_FILE_SIZE_2 56
static int darshan_log_get_hdf5_file(darshan_fd fd, void** hdf5_buf_p);
static int darshan_log_put_hdf5_file(darshan_fd fd, void* hdf5_buf);
@@ -86,6 +87,14 @@ static int darshan_log_get_hdf5_file(darshan_fd fd, void** hdf5_buf_p)
if(fd->mod_map[DARSHAN_H5F_MOD].len == 0)
return(0);
+ if(fd->mod_ver[DARSHAN_H5F_MOD] == 0 ||
+ fd->mod_ver[DARSHAN_H5F_MOD] > DARSHAN_H5F_VER)
+ {
+ fprintf(stderr, "Error: Invalid H5F module version number (got %d)\n",
+ fd->mod_ver[DARSHAN_H5F_MOD]);
+ return(-1);
+ }
+
if(*hdf5_buf_p == NULL)
{
file = malloc(sizeof(*file));
@@ -107,20 +116,45 @@ static int darshan_log_get_hdf5_file(darshan_fd fd, void** hdf5_buf_p)
char *src_p, *dest_p;
int len;
- rec_len = DARSHAN_H5F_FILE_SIZE_1;
- ret = darshan_log_get_mod(fd, DARSHAN_H5F_MOD, scratch, rec_len);
- if(ret != rec_len)
- goto exit;
-
- /* upconvert version 1 to version 2 in-place */
- dest_p = scratch + (sizeof(struct darshan_base_record) +
- (1 * sizeof(int64_t)) + (3 * sizeof(double)));
- src_p = dest_p - (2 * sizeof(double));
- len = sizeof(double);
- memmove(dest_p, src_p, len);
- /* set F_CLOSE_START and F_OPEN_END to -1 */
- *((double *)src_p) = -1;
- *((double *)(src_p + sizeof(double))) = -1;
+ if(fd->mod_ver[DARSHAN_H5F_MOD] == 1)
+ {
+ rec_len = DARSHAN_H5F_FILE_SIZE_1;
+ ret = darshan_log_get_mod(fd, DARSHAN_H5F_MOD, scratch, rec_len);
+ if(ret != rec_len)
+ goto exit;
+
+ /* upconvert version 1 to version 2 in-place */
+ dest_p = scratch + (sizeof(struct darshan_base_record) +
+ (1 * sizeof(int64_t)) + (3 * sizeof(double)));
+ src_p = dest_p - (2 * sizeof(double));
+ len = sizeof(double);
+ memmove(dest_p, src_p, len);
+ /* set F_CLOSE_START and F_OPEN_END to -1 */
+ *((double *)src_p) = -1;
+ *((double *)(src_p + sizeof(double))) = -1;
+ }
+ if(fd->mod_ver[DARSHAN_H5F_MOD] <= 2)
+ {
+ if(fd->mod_ver[DARSHAN_H5F_MOD] == 2)
+ {
+ rec_len = DARSHAN_H5F_FILE_SIZE_2;
+ ret = darshan_log_get_mod(fd, DARSHAN_H5F_MOD, scratch, rec_len);
+ if(ret != rec_len)
+ goto exit;
+ }
+
+ /* upconvert version 2 to version 3 in-place */
+ dest_p = scratch + (sizeof(struct darshan_base_record) +
+ (3 * sizeof(int64_t)));
+ src_p = dest_p - (2 * sizeof(int64_t));
+ len = 4 * sizeof(double);
+ memmove(dest_p, src_p, len);
+ /* set H5F_FLUSHES, H5F_USE_MPIIO to -1 */
+ *((int64_t *)src_p) = -1;
+ *((int64_t *)(src_p + sizeof(int64_t))) = -1;
+ /* set H5F_F_META_TIME to -1 */
+ *((double *)(dest_p + (4 * sizeof(double)))) = -1;
+ }
memcpy(file, scratch, sizeof(struct darshan_hdf5_file));
}
@@ -146,7 +180,15 @@ exit:
DARSHAN_BSWAP64(&(file->base_rec.id));
DARSHAN_BSWAP64(&(file->base_rec.rank));
for(i=0; i<H5F_NUM_INDICES; i++)
+ {
+ /* skip counters we explicitly set to -1 since they don't
+ * need to be byte swapped
+ */
+ if((fd->mod_ver[DARSHAN_H5F_MOD] < 3) &&
+ ((i == H5F_FLUSHES) || (i == H5F_USE_MPIIO)))
+ continue;
DARSHAN_BSWAP64(&file->counters[i]);
+ }
for(i=0; i<H5F_F_NUM_INDICES; i++)
{
/* skip counters we explicitly set to -1 since they don't
@@ -156,6 +198,9 @@ exit:
((i == H5F_F_CLOSE_START_TIMESTAMP) ||
(i == H5F_F_OPEN_END_TIMESTAMP)))
continue;
+ if((fd->mod_ver[DARSHAN_H5F_MOD] < 3) &&
+ (i == H5F_F_META_TIME))
+ continue;
DARSHAN_BSWAP64(&file->fcounters[i]);
}
}
@@ -174,6 +219,14 @@ static int darshan_log_get_hdf5_dataset(darshan_fd fd, void** hdf5_buf_p)
if(fd->mod_map[DARSHAN_H5D_MOD].len == 0)
return(0);
+ if(fd->mod_ver[DARSHAN_H5D_MOD] == 0 ||
+ fd->mod_ver[DARSHAN_H5D_MOD] > DARSHAN_H5D_VER)
+ {
+ fprintf(stderr, "Error: Invalid H5D module version number (got %d)\n",
+ fd->mod_ver[DARSHAN_H5D_MOD]);
+ return(-1);
+ }
+
if(*hdf5_buf_p == NULL)
{
ds = malloc(sizeof(*ds));
@@ -310,10 +363,15 @@ static void darshan_log_print_hdf5_file_description(int ver)
if(ver == 1)
{
- printf("\n# WARNING: HDF5 module log format version 1 does not support the following counters:\n");
+ printf("\n# WARNING: H5F module log format version 1 does not support the following counters:\n");
printf("# - H5F_F_CLOSE_START_TIMESTAMP\n");
printf("# - H5F_F_OPEN_END_TIMESTAMP\n");
}
+ if(ver <= 2)
+ {
+ printf("\n# WARNING: H5F module log format version <=2 does not support the following counters:\n");
+ printf("# \t- H5F_F_META_TIME\n");
+ }
return;
}
@@ -330,21 +388,22 @@ static void darshan_log_print_hdf5_dataset_description(int ver)
printf("# H5D_*_SELECTS: number of different access selections (regular/irregular hyperslab or points).\n");
printf("# H5D_MAX_*_TIME_SIZE: size of the slowest read and write operations.\n");
printf("# H5D_SIZE_*_AGG_*: histogram of H5D total access sizes for read and write operations.\n");
- printf("# H5D_ACCESS*_ACCESS: the four most common total access sizes.\n");
+ printf("# H5D_ACCESS*_*: the four most common total accesses, in terms of size and length/stride (in last 5 dimensions).\n");
printf("# H5D_ACCESS*_COUNT: count of the four most common total access sizes.\n");
printf("# H5D_DATASPACE_NDIMS: number of dimensions in dataset's dataspace.\n");
printf("# H5D_DATASPACE_NPOINTS: number of points in dataset's dataspace.\n");
printf("# H5D_DATATYPE_SIZE: size of each dataset element.\n");
- printf("# H5F_USE_MPIIO_COLLECTIVE: flag indicating whether MPI-IO collectives were used to access this file.\n");
- printf("# H5F_USE_DEPRECATED: flag indicating whether deprecated H5D calls were used.\n");
- printf("# H5D_*_RANK: rank of the processes that were the fastest and slowest at I/O (for shared files).\n");
- printf("# H5D_*_RANK_BYTES: total bytes transferred at H5D layer by the fastest and slowest ranks (for shared files).\n");
- printf("# H5D_F_*_START_TIMESTAMP: timestamp of first HDF5 file open/read/write/close.\n");
- printf("# H5D_F_*_END_TIMESTAMP: timestamp of last HDF5 file open/read/write/close.\n");
+ printf("# H5D_CHUNK_SIZE_D*: chunk size in last 5 dimensions of dataset.\n");
+ printf("# H5D_USE_MPIIO_COLLECTIVE: flag indicating whether MPI-IO collectives were used to access this dataset.\n");
+ printf("# H5D_USE_DEPRECATED: flag indicating whether deprecated H5D calls were used.\n");
+ printf("# H5D_*_RANK: rank of the processes that were the fastest and slowest at I/O (for shared datasets).\n");
+ printf("# H5D_*_RANK_BYTES: total bytes transferred at H5D layer by the fastest and slowest ranks (for shared datasets).\n");
+ printf("# H5D_F_*_START_TIMESTAMP: timestamp of first HDF5 dataset open/read/write/close.\n");
+ printf("# H5D_F_*_END_TIMESTAMP: timestamp of last HDF5 datset open/read/write/close.\n");
printf("# H5D_F_READ/WRITE/META_TIME: cumulative time spent in H5D read, write, or metadata operations.\n");
printf("# H5D_F_MAX_*_TIME: duration of the slowest H5D read and write operations.\n");
- printf("# H5D_F_*_RANK_TIME: fastest and slowest I/O time for a single rank (for shared files).\n");
- printf("# H5D_F_VARIANCE_RANK_*: variance of total I/O time and bytes moved for all ranks (for shared files).\n");
+ printf("# H5D_F_*_RANK_TIME: fastest and slowest I/O time for a single rank (for shared datasets).\n");
+ printf("# H5D_F_VARIANCE_RANK_*: variance of total I/O time and bytes moved for all ranks (for shared datasets).\n");
return;
}
@@ -565,9 +624,9 @@ static void darshan_log_agg_hdf5_datasets(void *rec, void *agg_rec, int init_fla
{
struct darshan_hdf5_dataset *hdf5_rec = (struct darshan_hdf5_dataset *)rec;
struct darshan_hdf5_dataset *agg_hdf5_rec = (struct darshan_hdf5_dataset *)agg_rec;
- int i, j, k;
+ int i, j, j2, k, k2;
int total_count;
- int64_t tmp_val[4];
+ int64_t tmp_val[4 * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1)];
int64_t tmp_cnt[4];
int tmp_ndx;
double old_M;
@@ -631,72 +690,145 @@ static void darshan_log_agg_hdf5_datasets(void *rec, void *agg_rec, int init_fla
if(hdf5_rec->counters[i] == 0) break;
/* first, collapse duplicates */
- for(j = i; j < i + 4; j++)
+ for(j = i, j2 = H5D_ACCESS1_COUNT; j <= H5D_ACCESS4_ACCESS;
+ j += (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1), j2++)
{
- for(k = 0; k < 4; k++)
+ for(k = i, k2 = H5D_ACCESS1_COUNT; k <= H5D_ACCESS4_ACCESS;
+ k += (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1), k2++)
{
- if(agg_hdf5_rec->counters[i + k] == hdf5_rec->counters[j])
+ if(!memcmp(&hdf5_rec->counters[j], &agg_hdf5_rec->counters[k],
+ sizeof(int64_t) * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1)))
{
- agg_hdf5_rec->counters[i + k + 4] += hdf5_rec->counters[j + 4];
- hdf5_rec->counters[j] = hdf5_rec->counters[j + 4] = 0;
+ memset(&hdf5_rec->counters[j], 0, sizeof(int64_t) *
+ (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1));
+ agg_hdf5_rec->counters[k2] += hdf5_rec->counters[j2];
+ hdf5_rec->counters[j2] = 0;
}
}
}
/* second, add new counters */
- for(j = i; j < i + 4; j++)
+ for(j = i, j2 = H5D_ACCESS1_COUNT; j <= H5D_ACCESS4_ACCESS;
+ j += (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1), j2++)
{
tmp_ndx = 0;
- memset(tmp_val, 0, 4 * sizeof(int64_t));
+ memset(tmp_val, 0, 4 * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1) * sizeof(int64_t));
memset(tmp_cnt, 0, 4 * sizeof(int64_t));
if(hdf5_rec->counters[j] == 0) break;
- for(k = 0; k < 4; k++)
+ for(k = i, k2 = H5D_ACCESS1_COUNT; k <= H5D_ACCESS4_ACCESS;
+ k += (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1), k2++)
{
- if(agg_hdf5_rec->counters[i + k] == hdf5_rec->counters[j])
+ if(!memcmp(&hdf5_rec->counters[j], &agg_hdf5_rec->counters[k],
+ sizeof(int64_t) * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1)))
{
- total_count = agg_hdf5_rec->counters[i + k + 4] +
- hdf5_rec->counters[j + 4];
+ total_count = agg_hdf5_rec->counters[k2] +
+ hdf5_rec->counters[j2];
break;
}
}
- if(k == 4) total_count = hdf5_rec->counters[j + 4];
+ if(k > H5D_ACCESS4_ACCESS) total_count = hdf5_rec->counters[j2];
- for(k = 0; k < 4; k++)
+ for(k = i, k2 = H5D_ACCESS1_COUNT; k <= H5D_ACCESS4_ACCESS;
+ k += (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1), k2++)
{
- if((agg_hdf5_rec->counters[i + k + 4] > total_count) ||
- ((agg_hdf5_rec->counters[i + k + 4] == total_count) &&
- (agg_hdf5_rec->counters[i + k] > hdf5_rec->counters[j])))
+ if((agg_hdf5_rec->counters[k2] > total_count) ||
+ ((agg_hdf5_rec->counters[k2] == total_count) &&
+ (agg_hdf5_rec->counters[k] > hdf5_rec->counters[j])))
{
- tmp_val[tmp_ndx] = agg_hdf5_rec->counters[i + k];
- tmp_cnt[tmp_ndx] = agg_hdf5_rec->counters[i + k + 4];
+ memcpy(&tmp_val[tmp_ndx * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1)],
+ &agg_hdf5_rec->counters[k],
+ sizeof(int64_t) * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1));
+ tmp_cnt[tmp_ndx] = agg_hdf5_rec->counters[k2];
tmp_ndx++;
}
else break;
}
if(tmp_ndx == 4) break;
- tmp_val[tmp_ndx] = hdf5_rec->counters[j];
- tmp_cnt[tmp_ndx] = hdf5_rec->counters[j + 4];
+ memcpy(&tmp_val[tmp_ndx * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1)],
+ &hdf5_rec->counters[j],
+ sizeof(int64_t) * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1));
+ tmp_cnt[tmp_ndx] = hdf5_rec->counters[j2];
tmp_ndx++;
while(tmp_ndx != 4)
{
- if(agg_hdf5_rec->counters[i + k] != hdf5_rec->counters[j])
+ if(memcmp(&agg_hdf5_rec->counters[k], &hdf5_rec->counters[j],
+ sizeof(int64_t) * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1)))
{
- tmp_val[tmp_ndx] = agg_hdf5_rec->counters[i + k];
- tmp_cnt[tmp_ndx] = agg_hdf5_rec->counters[i + k + 4];
+ memcpy(&tmp_val[tmp_ndx * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1)],
+ &agg_hdf5_rec->counters[k],
+ sizeof(int64_t) * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1));
+ tmp_cnt[tmp_ndx] = agg_hdf5_rec->counters[k2];
tmp_ndx++;
}
- k++;
+ k += (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1);
+ k2++;
}
- memcpy(&(agg_hdf5_rec->counters[i]), tmp_val, 4 * sizeof(int64_t));
- memcpy(&(agg_hdf5_rec->counters[i + 4]), tmp_cnt, 4 * sizeof(int64_t));
+ memcpy(&(agg_hdf5_rec->counters[H5D_ACCESS1_ACCESS]), tmp_val,
+ 4 * (H5D_MAX_NDIMS+H5D_MAX_NDIMS+1) * sizeof(int64_t));
+ memcpy(&(agg_hdf5_rec->counters[H5D_ACCESS1_COUNT]), tmp_cnt,
+ 4 * sizeof(int64_t));
}
break;
+ case H5D_ACCESS1_LENGTH_D1:
+ case H5D_ACCESS1_LENGTH_D2:
+ case H5D_ACCESS1_LENGTH_D3:
+ case H5D_ACCESS1_LENGTH_D4:
+ case H5D_ACCESS1_LENGTH_D5:
+ case H5D_ACCESS1_STRIDE_D1:
+ case H5D_ACCESS1_STRIDE_D2:
+ case H5D_ACCESS1_STRIDE_D3:
+ case H5D_ACCESS1_STRIDE_D4:
+ case H5D_ACCESS1_STRIDE_D5:
+ case H5D_ACCESS2_ACCESS:
+ case H5D_ACCESS2_LENGTH_D1:
+ case H5D_ACCESS2_LENGTH_D2:
+ case H5D_ACCESS2_LENGTH_D3:
+ case H5D_ACCESS2_LENGTH_D4:
+ case H5D_ACCESS2_LENGTH_D5:
+ case H5D_ACCESS2_STRIDE_D1:
+ case H5D_ACCESS2_STRIDE_D2:
+ case H5D_ACCESS2_STRIDE_D3:
+ case H5D_ACCESS2_STRIDE_D4:
+ case H5D_ACCESS2_STRIDE_D5:
+ case H5D_ACCESS3_ACCESS:
+ case H5D_ACCESS3_LENGTH_D1:
+ case H5D_ACCESS3_LENGTH_D2:
+ case H5D_ACCESS3_LENGTH_D3:
+ case H5D_ACCESS3_LENGTH_D4:
+ case H5D_ACCESS3_LENGTH_D5:
+ case H5D_ACCESS3_STRIDE_D1:
+ case H5D_ACCESS3_STRIDE_D2:
+ case H5D_ACCESS3_STRIDE_D3:
+ case H5D_ACCESS3_STRIDE_D4:
+ case H5D_ACCESS3_STRIDE_D5:
+ case H5D_ACCESS4_ACCESS:
+ case H5D_ACCESS4_LENGTH_D1:
+ case H5D_ACCESS4_LENGTH_D2:
+ case H5D_ACCESS4_LENGTH_D3:
+ case H5D_ACCESS4_LENGTH_D4:
+ case H5D_ACCESS4_LENGTH_D5:
+ case H5D_ACCESS4_STRIDE_D1:
+ case H5D_ACCESS4_STRIDE_D2:
+ case H5D_ACCESS4_STRIDE_D3:
+ case H5D_ACCESS4_STRIDE_D4:
+ case H5D_ACCESS4_STRIDE_D5:
+ case H5D_ACCESS1_COUNT:
+ case H5D_ACCESS2_COUNT:
+ case H5D_ACCESS3_COUNT:
+ case H5D_ACCESS4_COUNT:
+ /* these are set all at once with common counters above */
+ break;
case H5D_DATASPACE_NDIMS:
case H5D_DATASPACE_NPOINTS:
case H5D_DATATYPE_SIZE:
+ case H5D_CHUNK_SIZE_D1:
+ case H5D_CHUNK_SIZE_D2:
+ case H5D_CHUNK_SIZE_D3:
+ case H5D_CHUNK_SIZE_D4:
+ case H5D_CHUNK_SIZE_D5:
/* just set to the input value */
agg_hdf5_rec->counters[i] = hdf5_rec->counters[i];
break;
=====================================
darshan-util/darshan-lustre-logutils.c
=====================================
@@ -53,6 +53,14 @@ static int darshan_log_get_lustre_record(darshan_fd fd, void** lustre_buf_p)
if(fd->mod_map[DARSHAN_LUSTRE_MOD].len == 0)
return(0);
+ if(fd->mod_ver[DARSHAN_LUSTRE_MOD] == 0 ||
+ fd->mod_ver[DARSHAN_LUSTRE_MOD] > DARSHAN_LUSTRE_VER)
+ {
+ fprintf(stderr, "Error: Invalid Lustre module version number (got %d)\n",
+ fd->mod_ver[DARSHAN_LUSTRE_MOD]);
+ return(-1);
+ }
+
/* retrieve the fixed-size portion of the record */
ret = darshan_log_get_mod(fd, DARSHAN_LUSTRE_MOD, &tmp_rec,
sizeof(struct darshan_lustre_record));
=====================================
darshan-util/darshan-mpiio-logutils.c
=====================================
@@ -61,6 +61,14 @@ static int darshan_log_get_mpiio_file(darshan_fd fd, void** mpiio_buf_p)
if(fd->mod_map[DARSHAN_MPIIO_MOD].len == 0)
return(0);
+ if(fd->mod_ver[DARSHAN_MPIIO_MOD] == 0 ||
+ fd->mod_ver[DARSHAN_MPIIO_MOD] > DARSHAN_MPIIO_VER)
+ {
+ fprintf(stderr, "Error: Invalid MPIIO module version number (got %d)\n",
+ fd->mod_ver[DARSHAN_MPIIO_MOD]);
+ return(-1);
+ }
+
if(*mpiio_buf_p == NULL)
{
file = malloc(sizeof(*file));
=====================================
darshan-util/darshan-null-logutils.c
=====================================
@@ -68,6 +68,14 @@ static int darshan_log_get_null_record(darshan_fd fd, void** null_buf_p)
if(fd->mod_map[DARSHAN_NULL_MOD].len == 0)
return(0);
+ if(fd->mod_ver[DARSHAN_NULL_MOD] == 0 ||
+ fd->mod_ver[DARSHAN_NULL_MOD] > DARSHAN_NULL_VER)
+ {
+ fprintf(stderr, "Error: Invalid NHLL module version number (got %d)\n",
+ fd->mod_ver[DARSHAN_NULL_MOD]);
+ return(-1);
+ }
+
if(*null_buf_p == NULL)
{
rec = malloc(sizeof(*rec));
=====================================
darshan-util/darshan-pnetcdf-logutils.c
=====================================
@@ -61,6 +61,14 @@ static int darshan_log_get_pnetcdf_file(darshan_fd fd, void** pnetcdf_buf_p)
if(fd->mod_map[DARSHAN_PNETCDF_MOD].len == 0)
return(0);
+ if(fd->mod_ver[DARSHAN_PNETCDF_MOD] == 0 ||
+ fd->mod_ver[DARSHAN_PNETCDF_MOD] > DARSHAN_PNETCDF_VER)
+ {
+ fprintf(stderr, "Error: Invalid PNetCDF module version number (got %d)\n",
+ fd->mod_ver[DARSHAN_PNETCDF_MOD]);
+ return(-1);
+ }
+
if(*pnetcdf_buf_p == NULL)
{
file = malloc(sizeof(*file));
=====================================
darshan-util/darshan-posix-logutils.c
=====================================
@@ -63,6 +63,14 @@ static int darshan_log_get_posix_file(darshan_fd fd, void** posix_buf_p)
if(fd->mod_map[DARSHAN_POSIX_MOD].len == 0)
return(0);
+ if(fd->mod_ver[DARSHAN_POSIX_MOD] == 0 ||
+ fd->mod_ver[DARSHAN_POSIX_MOD] > DARSHAN_POSIX_VER)
+ {
+ fprintf(stderr, "Error: Invalid POSIX module version number (got %d)\n",
+ fd->mod_ver[DARSHAN_POSIX_MOD]);
+ return(-1);
+ }
+
if(*posix_buf_p == NULL)
{
file = malloc(sizeof(*file));
@@ -198,7 +206,7 @@ exit:
((i == POSIX_F_CLOSE_START_TIMESTAMP) ||
(i == POSIX_F_OPEN_END_TIMESTAMP)))
continue;
- if ((fd->mod_ver[DARSHAN_POSIX_MOD] < 4) &&
+ if((fd->mod_ver[DARSHAN_POSIX_MOD] < 4) &&
((i == POSIX_RENAME_SOURCES) || (i == POSIX_RENAME_TARGETS) ||
(i == POSIX_RENAMED_FROM)))
continue;
=====================================
darshan-util/darshan-stdio-logutils.c
=====================================
@@ -71,6 +71,14 @@ static int darshan_log_get_stdio_record(darshan_fd fd, void** stdio_buf_p)
if(fd->mod_map[DARSHAN_STDIO_MOD].len == 0)
return(0);
+ if(fd->mod_ver[DARSHAN_STDIO_MOD] == 0 ||
+ fd->mod_ver[DARSHAN_STDIO_MOD] > DARSHAN_STDIO_VER)
+ {
+ fprintf(stderr, "Error: Invalid STDIO module version number (got %d)\n",
+ fd->mod_ver[DARSHAN_STDIO_MOD]);
+ return(-1);
+ }
+
if(*stdio_buf_p == NULL)
{
file = malloc(sizeof(*file));
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/55c469885b7e17d0995c4c67a1e205d0dc4d18ee...a7f10928db3897f714ad9fd34840b99d311c33f4
--
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/55c469885b7e17d0995c4c67a1e205d0dc4d18ee...a7f10928db3897f714ad9fd34840b99d311c33f4
You're receiving this email because of your account on xgitlab.cels.anl.gov.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20200331/15c4078b/attachment-0001.html>
More information about the Darshan-commits
mailing list