[Darshan-commits] [Git][darshan/darshan][master] possible bug fix to io start timestamps

Philip Carns xgitlab at cels.anl.gov
Sun May 1 08:56:23 CDT 2016


Philip Carns pushed to branch master at darshan / darshan


Commits:
2faf2460 by Phil Carns at 2016-05-01T09:55:22-04:00
possible bug fix to io start timestamps

- read and write start timestamps should record start timestamp of first
  read/write to *begin*, not start timestamp of first read/write to
  complete
- mirrors earlier fix to open timestamps

- - - - -


2 changed files:

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


Changes:

=====================================
darshan-runtime/lib/darshan-mpiio.c
=====================================
--- a/darshan-runtime/lib/darshan-mpiio.c
+++ b/darshan-runtime/lib/darshan-mpiio.c
@@ -173,7 +173,8 @@ static void mpiio_shutdown(void);
     if(file->last_io_type == DARSHAN_IO_WRITE) \
         file->file_record->counters[MPIIO_RW_SWITCHES] += 1; \
     file->last_io_type = DARSHAN_IO_READ; \
-    if(file->file_record->fcounters[MPIIO_F_READ_START_TIMESTAMP] == 0) \
+    if(file->file_record->fcounters[MPIIO_F_READ_START_TIMESTAMP] == 0 || \
+     file->file_record->fcounters[MPIIO_F_READ_START_TIMESTAMP] > __tm1) \
         file->file_record->fcounters[MPIIO_F_READ_START_TIMESTAMP] = __tm1; \
     file->file_record->fcounters[MPIIO_F_READ_END_TIMESTAMP] = __tm2; \
     if(file->file_record->fcounters[MPIIO_F_MAX_READ_TIME] < __elapsed) { \
@@ -198,7 +199,8 @@ static void mpiio_shutdown(void);
     if(file->last_io_type == DARSHAN_IO_READ) \
         file->file_record->counters[MPIIO_RW_SWITCHES] += 1; \
     file->last_io_type = DARSHAN_IO_WRITE; \
-    if(file->file_record->fcounters[MPIIO_F_WRITE_START_TIMESTAMP] == 0) \
+    if(file->file_record->fcounters[MPIIO_F_READ_START_TIMESTAMP] == 0 || \
+     file->file_record->fcounters[MPIIO_F_READ_START_TIMESTAMP] > __tm1) \
         file->file_record->fcounters[MPIIO_F_WRITE_START_TIMESTAMP] = __tm1; \
     file->file_record->fcounters[MPIIO_F_WRITE_END_TIMESTAMP] = __tm2; \
     if(file->file_record->fcounters[MPIIO_F_MAX_WRITE_TIME] < __elapsed) { \


=====================================
darshan-runtime/lib/darshan-posix.c
=====================================
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-posix.c
@@ -274,7 +274,8 @@ static void posix_shutdown(void);
     if(file->last_io_type == DARSHAN_IO_WRITE) \
         file->file_record->counters[POSIX_RW_SWITCHES] += 1; \
     file->last_io_type = DARSHAN_IO_READ; \
-    if(file->file_record->fcounters[POSIX_F_READ_START_TIMESTAMP] == 0) \
+    if(file->file_record->fcounters[POSIX_F_READ_START_TIMESTAMP] == 0 || \
+     file->file_record->fcounters[POSIX_F_READ_START_TIMESTAMP] > __tm1) \
         file->file_record->fcounters[POSIX_F_READ_START_TIMESTAMP] = __tm1; \
     file->file_record->fcounters[POSIX_F_READ_END_TIMESTAMP] = __tm2; \
     if(file->file_record->fcounters[POSIX_F_MAX_READ_TIME] < __elapsed) { \
@@ -325,7 +326,8 @@ static void posix_shutdown(void);
     if(file->last_io_type == DARSHAN_IO_READ) \
         file->file_record->counters[POSIX_RW_SWITCHES] += 1; \
     file->last_io_type = DARSHAN_IO_WRITE; \
-    if(file->file_record->fcounters[POSIX_F_WRITE_START_TIMESTAMP] == 0) \
+    if(file->file_record->fcounters[POSIX_F_WRITE_START_TIMESTAMP] == 0 || \
+     file->file_record->fcounters[POSIX_F_WRITE_START_TIMESTAMP] > __tm1) \
         file->file_record->fcounters[POSIX_F_WRITE_START_TIMESTAMP] = __tm1; \
     file->file_record->fcounters[POSIX_F_WRITE_END_TIMESTAMP] = __tm2; \
     if(file->file_record->fcounters[POSIX_F_MAX_WRITE_TIME] < __elapsed) { \



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/2faf24600acfb7bece70bd134183ae53b06e53c1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20160501/4f75a487/attachment.html>


More information about the Darshan-commits mailing list