[Darshan-commits] [Git][darshan/darshan][mmap-dev] simplify common counter logic

Shane Snyder xgitlab at cels.anl.gov
Tue Jun 14 15:33:36 CDT 2016


Shane Snyder pushed to branch mmap-dev at darshan / darshan


Commits:
f5ff61de by Shane Snyder at 2016-06-14T14:46:15-05:00
simplify common counter logic

- - - - -


3 changed files:

- darshan-runtime/lib/darshan-common.c
- darshan-runtime/lib/darshan-mpiio.c
- darshan-runtime/lib/darshan-posix.c


Changes:

=====================================
darshan-runtime/lib/darshan-common.c
=====================================
--- a/darshan-runtime/lib/darshan-common.c
+++ b/darshan-runtime/lib/darshan-common.c
@@ -196,29 +196,6 @@ void darshan_record_sort(void *rec_buf, int rec_count, int rec_size)
     return;
 }
 
-/* HACK: global variables for determining 4 most common values */
-static int64_t* walker_val_p = NULL;
-static int64_t* walker_cnt_p = NULL;
-
-static void darshan_common_val_walker(const void *nodep, const VISIT which,
-    const int depth)
-{
-    struct darshan_common_val_counter* counter;
-
-    switch (which)
-    {
-        case postorder:
-        case leaf:
-            counter = *(struct darshan_common_val_counter**)nodep;
-            DARSHAN_COMMON_VAL_COUNTER_INC(walker_val_p, walker_cnt_p,
-                counter->val, counter->freq, 0);
-        default:
-            break;
-    }
-
-    return;
-}
-
 static int darshan_common_val_compare(const void *a_p, const void *b_p)
 {
     const struct darshan_common_val_counter* a = a_p;
@@ -274,24 +251,10 @@ void darshan_common_val_counter(void **common_val_root, int *common_val_count,
         (*common_val_count)++;
     }
 
-#ifdef __DARSHAN_ENABLE_MMAP_LOGS
-    /* if we are using darshan's mmap feature, update common access
-     * counters as we go
-     */
+    /* update common access counters as we go */
     DARSHAN_COMMON_VAL_COUNTER_INC(common_val_p, common_cnt_p,
         found->val, found->freq, 1);
-#endif
-
-    return;
-}
-
-void darshan_walk_common_vals(void *common_val_root, int64_t *val_p,
-    int64_t *cnt_p)
-{
-    walker_val_p = val_p;
-    walker_cnt_p = cnt_p;
 
-    twalk(common_val_root, darshan_common_val_walker);
     return;
 }
 


=====================================
darshan-runtime/lib/darshan-mpiio.c
=====================================
--- a/darshan-runtime/lib/darshan-mpiio.c
+++ b/darshan-runtime/lib/darshan-mpiio.c
@@ -899,19 +899,7 @@ static void mpiio_finalize_file_records(void *rec_ref_p)
     struct mpiio_file_record_ref *rec_ref =
         (struct mpiio_file_record_ref *)rec_ref_p;
 
-#ifndef __DARSHAN_ENABLE_MMAP_LOGS
-    /* walk common counters to get 4 most common -- only if mmap
-     * feature is disabled (mmap updates counters on the go)
-     */
-
-    /* common accesses */
-    darshan_walk_common_vals(rec_ref->access_root,
-        &(rec_ref->file_rec->counters[MPIIO_ACCESS1_ACCESS]),
-        &(rec_ref->file_rec->counters[MPIIO_ACCESS1_COUNT]));
-#endif
-
     tdestroy(rec_ref->access_root, free);
-
     return;
 }
 


=====================================
darshan-runtime/lib/darshan-posix.c
=====================================
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-posix.c
@@ -1543,24 +1543,8 @@ static void posix_finalize_file_records(void *rec_ref_p)
     struct posix_file_record_ref *rec_ref =
         (struct posix_file_record_ref *)rec_ref_p;
 
-#ifndef __DARSHAN_ENABLE_MMAP_LOGS
-    /* walk common counters to get 4 most common -- only if mmap
-     * feature is disabled (mmap updates counters on the go)
-     */
-
-    /* common accesses */
-    darshan_walk_common_vals(rec_ref->access_root,
-        &(rec_ref->file_rec->counters[POSIX_ACCESS1_ACCESS]),
-        &(rec_ref->file_rec->counters[POSIX_ACCESS1_COUNT]));
-    /* common strides */
-    darshan_walk_common_vals(rec_ref->stride_root,
-        &(rec_ref->file_rec->counters[POSIX_STRIDE1_STRIDE]),
-        &(rec_ref->file_rec->counters[POSIX_STRIDE1_COUNT]));
-#endif
-
     tdestroy(rec_ref->access_root, free);
     tdestroy(rec_ref->stride_root, free);
-
     return;
 }
 



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/f5ff61de48a561feeb2cd0f08195f771fbe785dc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20160614/a19876a3/attachment-0001.html>


More information about the Darshan-commits mailing list