[Darshan-commits] [Darshan] branch, dev-modular, updated. darshan-2.3.1-85-g9ac0bd9

Service Account git at mcs.anl.gov
Wed Apr 1 17:39:07 CDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".

The branch, dev-modular has been updated
       via  9ac0bd93aef0907e40850308c6467498f155cd03 (commit)
       via  339ed2516fcee2d3bd1ae92bbe19804c73629f7d (commit)
      from  d9750b4949076c42d7adab1b556f1de416bfcbf9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9ac0bd93aef0907e40850308c6467498f155cd03
Author: Shane Snyder <ssnyder at mcs.anl.gov>
Date:   Wed Apr 1 17:38:26 2015 -0500

    depracate old counters & update mod_register

commit 339ed2516fcee2d3bd1ae92bbe19804c73629f7d
Author: Shane Snyder <ssnyder at mcs.anl.gov>
Date:   Wed Apr 1 16:58:46 2015 -0500

    add support for slowest/fastest rank counters

-----------------------------------------------------------------------

Summary of changes:
 darshan-posix-log-format.h          |   23 +++------
 darshan-runtime/configure.in        |    7 ---
 darshan-runtime/darshan.h           |    3 +-
 darshan-runtime/lib/darshan-core.c  |   14 +++--
 darshan-runtime/lib/darshan-mpiio.c |    3 +-
 darshan-runtime/lib/darshan-posix.c |   92 +++++++++++++++++++++++++++--------
 darshan-util/darshan-posix-parser.c |   18 ++++++-
 7 files changed, 108 insertions(+), 52 deletions(-)


Diff of changes:
diff --git a/darshan-posix-log-format.h b/darshan-posix-log-format.h
index bdf8546..df8cf7a 100644
--- a/darshan-posix-log-format.h
+++ b/darshan-posix-log-format.h
@@ -37,8 +37,8 @@ enum darshan_posix_indices
     MEM_NOT_ALIGNED,          /* count of accesses not mem aligned */
     MEM_ALIGNMENT,            /* mem alignment in bytes */
     FILE_NOT_ALIGNED,         /* count of accesses not file aligned */
-#endif
     FILE_ALIGNMENT,           /* file alignment in bytes */
+#endif
     POSIX_MAX_READ_TIME_SIZE,
     POSIX_MAX_WRITE_TIME_SIZE,
 #if 0
@@ -81,15 +81,11 @@ enum darshan_posix_indices
     ACCESS2_COUNT,
     ACCESS3_COUNT,
     ACCESS4_COUNT,
-    DEVICE,                   /* device id reported by stat */
-#endif
-    SIZE_AT_OPEN,
-#if 0
-    FASTEST_RANK,
-    FASTEST_RANK_BYTES,
-    SLOWEST_RANK,
-    SLOWEST_RANK_BYTES,
 #endif
+    POSIX_FASTEST_RANK,
+    POSIX_FASTEST_RANK_BYTES,
+    POSIX_SLOWEST_RANK,
+    POSIX_SLOWEST_RANK_BYTES,
 
     POSIX_NUM_INDICES,
 };
@@ -108,13 +104,10 @@ enum darshan_posix_f_indices
     POSIX_F_META_TIME,             /* cumulative posix meta time */
     POSIX_F_MAX_READ_TIME,
     POSIX_F_MAX_WRITE_TIME,
+    /* Total I/O and meta time consumed by fastest and slowest ranks */ 
+    POSIX_F_FASTEST_RANK_TIME,
+    POSIX_F_SLOWEST_RANK_TIME,
 #if 0
-    /* Total I/O and meta time consumed by fastest and slowest ranks, 
-     * reported in either MPI or POSIX time depending on how the file 
-     * was accessed.
-     */
-    F_FASTEST_RANK_TIME,
-    F_SLOWEST_RANK_TIME,
     F_VARIANCE_RANK_TIME,
     F_VARIANCE_RANK_BYTES,
 #endif
diff --git a/darshan-runtime/configure.in b/darshan-runtime/configure.in
index 74b4dbd..313574c 100644
--- a/darshan-runtime/configure.in
+++ b/darshan-runtime/configure.in
@@ -50,13 +50,6 @@ AC_ARG_ENABLE(group-readable-logs,
 fi]
 ,)
 
-AC_ARG_ENABLE(stat-at-open, 
-[  --enable-stat-at-open   Perform stat() call at open time to gather extra statistics], 
-[if test "x$enableval" = "xyes" ; then
-    AC_DEFINE(__CP_STAT_AT_OPEN, 1, Define if Darshan should stat files at open time to collect extra statistics)
-fi]
-,)
-
 AC_ARG_WITH(mem-align,
 [  --with-mem-align=<num>  Memory alignment in bytes],
     if test x$withval = xyes; then
diff --git a/darshan-runtime/darshan.h b/darshan-runtime/darshan.h
index 5a31115..d9ea161 100644
--- a/darshan-runtime/darshan.h
+++ b/darshan-runtime/darshan.h
@@ -141,7 +141,8 @@ extern char* darshan_path_exclusions[]; /* defined in lib/darshan-core.c */
 void darshan_core_register_module(
     darshan_module_id mod_id,
     struct darshan_module_funcs *funcs,
-    int *runtime_mem_limit);
+    int *mod_mem_limit,
+    int *sys_mem_alignment);
 
 void darshan_core_unregister_module(
     darshan_module_id mod_id);
diff --git a/darshan-runtime/lib/darshan-core.c b/darshan-runtime/lib/darshan-core.c
index 1393b15..2d074af 100644
--- a/darshan-runtime/lib/darshan-core.c
+++ b/darshan-runtime/lib/darshan-core.c
@@ -36,6 +36,7 @@ static struct darshan_core_runtime *darshan_core = NULL;
 static pthread_mutex_t darshan_core_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 static int my_rank = -1;
 static int nprocs = -1;
+static int darshan_mem_alignment = 1;
 
 /* paths prefixed with the following directories are not traced by darshan */
 char* darshan_path_exclusions[] = {
@@ -1524,10 +1525,11 @@ static int darshan_log_append_all(MPI_File log_fh, struct darshan_core_runtime *
 void darshan_core_register_module(
     darshan_module_id mod_id,
     struct darshan_module_funcs *funcs,
-    int *runtime_mem_limit)
+    int *mod_mem_limit,
+    int *sys_mem_alignment)
 {
     struct darshan_core_module* mod;
-    *runtime_mem_limit = 0;
+    *mod_mem_limit = 0;
 
     if(!darshan_core || (mod_id >= DARSHAN_MAX_MODS))
         return;
@@ -1550,7 +1552,6 @@ void darshan_core_register_module(
         return;
     }
     memset(mod, 0, sizeof(*mod));
-
     mod->id = mod_id;
     mod->mod_funcs = *funcs;
 
@@ -1558,14 +1559,17 @@ void darshan_core_register_module(
     darshan_core->mod_array[mod_id] = mod;
 
     /* TODO: something smarter than just 2 MiB per module */
-    *runtime_mem_limit = 2 * 1024 * 1024;
+    *mod_mem_limit = 2 * 1024 * 1024;
+
+    if(sys_mem_alignment)
+        *sys_mem_alignment = darshan_mem_alignment;
 
     DARSHAN_CORE_UNLOCK();
 
     return;
 }
 
-/* TODO: implement & test*/
+/* TODO: test */
 void darshan_core_unregister_module(
     darshan_module_id mod_id)
 {
diff --git a/darshan-runtime/lib/darshan-mpiio.c b/darshan-runtime/lib/darshan-mpiio.c
index 995ee76..8f33800 100644
--- a/darshan-runtime/lib/darshan-mpiio.c
+++ b/darshan-runtime/lib/darshan-mpiio.c
@@ -206,7 +206,8 @@ static void mpiio_runtime_initialize()
     darshan_core_register_module(
         DARSHAN_MPIIO_MOD,
         &mpiio_mod_fns,
-        &mem_limit);
+        &mem_limit,
+        NULL);
 
     /* return if no memory assigned by darshan core */
     if(mem_limit == 0)
diff --git a/darshan-runtime/lib/darshan-posix.c b/darshan-runtime/lib/darshan-posix.c
index ee48afc..3c77887 100644
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-posix.c
@@ -181,6 +181,7 @@ static struct posix_runtime *posix_runtime = NULL;
 static pthread_mutex_t posix_runtime_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 static int instrumentation_disabled = 0;
 static int my_rank = -1;
+static int darshan_mem_alignment = 1;
 
 #define POSIX_LOCK() pthread_mutex_lock(&posix_runtime_mutex)
 #define POSIX_UNLOCK() pthread_mutex_unlock(&posix_runtime_mutex)
@@ -198,7 +199,6 @@ static int my_rank = -1;
     if(exclude) break; \
     file = posix_file_by_name_setfd(__path, __ret); \
     if(!file) break; \
-    /* CP_STAT_FILE(file, __path, __ret); */ \
     file->file_record->rank = my_rank; \
     if(__mode) \
         DARSHAN_COUNTER_SET(file->file_record, POSIX_MODE, __mode); \
@@ -332,10 +332,6 @@ static int my_rank = -1;
 } while(0)
 
 #define POSIX_RECORD_STAT(__file, __statbuf, __tm1, __tm2) do { \
-    if(!DARSHAN_COUNTER_VALUE((__file)->file_record, POSIX_STATS) && !DARSHAN_COUNTER_VALUE((__file)->file_record, POSIX_OPENS)){ \
-        DARSHAN_COUNTER_SET((__file)->file_record, FILE_ALIGNMENT, (__statbuf)->st_blksize); \
-        DARSHAN_COUNTER_SET((__file)->file_record, SIZE_AT_OPEN, (__statbuf)->st_size); \
-    }\
     (__file)->file_record->rank = my_rank; \
     DARSHAN_COUNTER_F_INC_NO_OVERLAP((__file)->file_record, __tm1, __tm2, (__file)->last_meta_end, POSIX_F_META_TIME); \
     DARSHAN_COUNTER_INC((__file)->file_record, POSIX_STATS, 1); \
@@ -1020,13 +1016,6 @@ int DARSHAN_DECL(__fxstat)(int vers, int fd, struct stat *buf)
     if(ret < 0 || !S_ISREG(buf->st_mode))
         return(ret);
 
-    /* TODO */
-#if 0
-    /* skip logging if this was triggered internally */
-    if((void*)buf == (void*)&cp_stat_buf)
-        return(ret);
-#endif
-
     POSIX_LOCK();
     posix_runtime_initialize();
     file = posix_file_by_fd(fd);
@@ -1054,13 +1043,6 @@ int DARSHAN_DECL(__fxstat64)(int vers, int fd, struct stat64 *buf)
     if(ret < 0 || !S_ISREG(buf->st_mode))
         return(ret);
 
-    /* TODO */
-#if 0
-    /* skip logging if this was triggered internally */
-    if((void*)buf == (void*)&cp_stat_buf)
-        return(ret);
-#endif
-
     POSIX_LOCK();
     posix_runtime_initialize();
     file = posix_file_by_fd(fd);
@@ -1265,7 +1247,8 @@ static void posix_runtime_initialize()
     darshan_core_register_module(
         DARSHAN_POSIX_MOD,
         &posix_mod_fns,
-        &mem_limit);
+        &mem_limit,
+        &darshan_mem_alignment);
 
     /* return if no memory assigned by darshan core */
     if(mem_limit == 0)
@@ -1469,6 +1452,7 @@ static void posix_prepare_for_reduction(
 {
     struct posix_file_runtime *file;
     int i;
+    double posix_time;
 
     assert(posix_runtime);
 
@@ -1479,7 +1463,31 @@ static void posix_prepare_for_reduction(
             sizeof(darshan_record_id), file);
         assert(file);
 
-        /* TODO: any initialization before reduction */
+        posix_time =
+            file->file_record->fcounters[POSIX_F_READ_TIME] +
+            file->file_record->fcounters[POSIX_F_WRITE_TIME] +
+            file->file_record->fcounters[POSIX_F_META_TIME];
+
+        /* initialize fastest/slowest info prior to the reduction */
+        file->file_record->counters[POSIX_FASTEST_RANK] =
+            file->file_record->rank;
+        file->file_record->counters[POSIX_FASTEST_RANK_BYTES] = 
+            file->file_record->counters[POSIX_BYTES_READ] +
+            file->file_record->counters[POSIX_BYTES_WRITTEN];
+        file->file_record->fcounters[POSIX_F_FASTEST_RANK_TIME] = 
+            posix_time;
+
+        /* until reduction occurs, we assume that this rank is both
+         * the fastest and slowest. It is up to the reduction operator
+         * to find the true min and max.
+         */
+        file->file_record->counters[POSIX_SLOWEST_RANK] =
+            file->file_record->counters[POSIX_FASTEST_RANK];
+        file->file_record->counters[POSIX_SLOWEST_RANK_BYTES] =
+            file->file_record->counters[POSIX_FASTEST_RANK_BYTES];
+        file->file_record->fcounters[POSIX_F_SLOWEST_RANK_TIME] =
+            file->file_record->fcounters[POSIX_F_FASTEST_RANK_TIME];
+
         file->file_record->rank = -1;
     }
 
@@ -1620,6 +1628,48 @@ static void posix_record_reduction_op(
                 inoutfile->counters[POSIX_MAX_WRITE_TIME_SIZE];
         }
 
+        /* min (zeroes are ok here; some procs don't do I/O) */
+        if(infile->fcounters[POSIX_F_FASTEST_RANK_TIME] <
+           inoutfile->fcounters[POSIX_F_FASTEST_RANK_TIME])
+        {
+            tmp_file.counters[POSIX_FASTEST_RANK] =
+                infile->counters[POSIX_FASTEST_RANK];
+            tmp_file.counters[POSIX_FASTEST_RANK_BYTES] =
+                infile->counters[POSIX_FASTEST_RANK_BYTES];
+            tmp_file.fcounters[POSIX_F_FASTEST_RANK_TIME] =
+                infile->fcounters[POSIX_F_FASTEST_RANK_TIME];
+        }
+        else
+        {
+            tmp_file.counters[POSIX_FASTEST_RANK] =
+                inoutfile->counters[POSIX_FASTEST_RANK];
+            tmp_file.counters[POSIX_FASTEST_RANK_BYTES] =
+                inoutfile->counters[POSIX_FASTEST_RANK_BYTES];
+            tmp_file.fcounters[POSIX_F_FASTEST_RANK_TIME] =
+                inoutfile->fcounters[POSIX_F_FASTEST_RANK_TIME];
+        }
+
+        /* max */
+        if(infile->fcounters[POSIX_F_SLOWEST_RANK_TIME] >
+           inoutfile->fcounters[POSIX_F_SLOWEST_RANK_TIME])
+        {
+            tmp_file.counters[POSIX_SLOWEST_RANK] =
+                infile->counters[POSIX_SLOWEST_RANK];
+            tmp_file.counters[POSIX_SLOWEST_RANK_BYTES] =
+                infile->counters[POSIX_SLOWEST_RANK_BYTES];
+            tmp_file.fcounters[POSIX_F_SLOWEST_RANK_TIME] =
+                infile->fcounters[POSIX_F_SLOWEST_RANK_TIME];
+        }
+        else
+        {
+            tmp_file.counters[POSIX_SLOWEST_RANK] =
+                inoutfile->counters[POSIX_SLOWEST_RANK];
+            tmp_file.counters[POSIX_SLOWEST_RANK_BYTES] =
+                inoutfile->counters[POSIX_SLOWEST_RANK_BYTES];
+            tmp_file.fcounters[POSIX_F_SLOWEST_RANK_TIME] =
+                inoutfile->fcounters[POSIX_F_SLOWEST_RANK_TIME];
+        }
+
         /* update pointers */
         *inoutfile = tmp_file;
         inoutfile++;
diff --git a/darshan-util/darshan-posix-parser.c b/darshan-util/darshan-posix-parser.c
index 9ff4a41..1a16ec0 100644
--- a/darshan-util/darshan-posix-parser.c
+++ b/darshan-util/darshan-posix-parser.c
@@ -196,6 +196,10 @@ int main(int argc, char **argv)
             "\t\tPOSIX_MAX_READ_TIME_SIZE:\t%"PRIu64"\n"
             "\t\tPOSIX_MAX_WRITE_TIME_SIZE:\t%"PRIu64"\n"
             "\t\tSIZE_AT_OPEN:\t%"PRIu64"\n"
+            "\t\tPOSIX_FASTEST_RANK:\t%"PRIu64"\n"
+            "\t\tPOSIX_FASTEST_RANK_BYTES:\t%"PRIu64"\n"
+            "\t\tPOSIX_SLOWEST_RANK:\t%"PRIu64"\n"
+            "\t\tPOSIX_SLOWEST_RANK_BYTES:\t%"PRIu64"\n"
             "\t\tPOSIX_F_OPEN_TIMESTAMP:\t%lf\n"
             "\t\tPOSIX_F_READ_START_TIMESTAMP:\t%lf\n"
             "\t\tPOSIX_F_WRITE_START_TIMESTAMP:\t%lf\n"
@@ -204,8 +208,11 @@ int main(int argc, char **argv)
             "\t\tPOSIX_F_CLOSE_TIMESTAMP:\t%lf\n"
             "\t\tPOSIX_F_READ_TIME:\t%lf\n"
             "\t\tPOSIX_F_WRITE_TIME:\t%lf\n"
+            "\t\tPOSIX_F_META_TIME:\t%lf\n"
             "\t\tPOSIX_F_MAX_READ_TIME:\t%lf\n"
-            "\t\tPOSIX_F_MAX_WRITE_TIME:\t%lf\n",
+            "\t\tPOSIX_F_MAX_WRITE_TIME:\t%lf\n"
+            "\t\tPOSIX_F_FASTEST_RANK_TIME:\t%lf\n"
+            "\t\tPOSIX_F_SLOWEST_RANK_TIME:\t%lf\n",
             next_file.counters[POSIX_OPENS],
             next_file.counters[POSIX_READS],
             next_file.counters[POSIX_WRITES],
@@ -232,6 +239,10 @@ int main(int argc, char **argv)
             next_file.counters[POSIX_MAX_READ_TIME_SIZE],
             next_file.counters[POSIX_MAX_WRITE_TIME_SIZE],
             next_file.counters[SIZE_AT_OPEN],
+            next_file.counters[POSIX_FASTEST_RANK],
+            next_file.counters[POSIX_FASTEST_RANK_BYTES],
+            next_file.counters[POSIX_SLOWEST_RANK],
+            next_file.counters[POSIX_SLOWEST_RANK_BYTES],
             next_file.fcounters[POSIX_F_OPEN_TIMESTAMP],
             next_file.fcounters[POSIX_F_READ_START_TIMESTAMP],
             next_file.fcounters[POSIX_F_WRITE_START_TIMESTAMP],
@@ -240,8 +251,11 @@ int main(int argc, char **argv)
             next_file.fcounters[POSIX_F_CLOSE_TIMESTAMP],
             next_file.fcounters[POSIX_F_READ_TIME],
             next_file.fcounters[POSIX_F_WRITE_TIME],
+            next_file.fcounters[POSIX_F_META_TIME],
             next_file.fcounters[POSIX_F_MAX_READ_TIME],
-            next_file.fcounters[POSIX_F_MAX_WRITE_TIME]);
+            next_file.fcounters[POSIX_F_MAX_WRITE_TIME],
+            next_file.fcounters[POSIX_F_FASTEST_RANK_TIME],
+            next_file.fcounters[POSIX_F_SLOWEST_RANK_TIME]);
 
         i++;
     } while((ret = darshan_log_get_posix_file(fd, &next_file)) == 1);


hooks/post-receive
--



More information about the Darshan-commits mailing list