[Darshan-commits] [Git][darshan/darshan][master] don't sum invalid posix counters

Shane Snyder xgitlab at cels.anl.gov
Fri Jun 8 15:45:03 CDT 2018


Shane Snyder pushed to branch master at darshan / darshan


Commits:
81683bb5 by Shane Snyder at 2018-06-08T15:44:49-05:00
don't sum invalid posix counters

- - - - -


2 changed files:

- darshan-runtime/lib/darshan-posix.c
- darshan-util/darshan-posix-logutils.c


Changes:

=====================================
darshan-runtime/lib/darshan-posix.c
=====================================
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-posix.c
@@ -1435,6 +1435,8 @@ static void posix_record_reduction_op(void* infile_v, void* inoutfile_v,
         for(j=POSIX_OPENS; j<=POSIX_FDSYNCS; j++)
         {
             tmp_file.counters[j] = infile->counters[j] + inoutfile->counters[j];
+            if(tmp_file.counters[j] < 0) /* make sure invalid counters are -1 exactly */
+                tmp_file.counters[j] = -1;
         }
 
         tmp_file.counters[POSIX_MODE] = infile->counters[POSIX_MODE];


=====================================
darshan-util/darshan-posix-logutils.c
=====================================
--- a/darshan-util/darshan-posix-logutils.c
+++ b/darshan-util/darshan-posix-logutils.c
@@ -387,6 +387,8 @@ static void darshan_log_agg_posix_files(void *rec, void *agg_rec, int init_flag)
             case POSIX_SIZE_WRITE_1G_PLUS:
                 /* sum */
                 agg_psx_rec->counters[i] += psx_rec->counters[i];
+                if(agg_psx_rec->counters[i] < 0) /* make sure invalid counters are -1 exactly */
+                    agg_psx_rec->counters[i] = -1;
                 break;
             case POSIX_MODE:
             case POSIX_MEM_ALIGNMENT:



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/81683bb50128ef220a8be8d52fa6d85cbb686ed6

---
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/81683bb50128ef220a8be8d52fa6d85cbb686ed6
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/20180608/6760fe9e/attachment.html>


More information about the Darshan-commits mailing list