[Darshan-commits] [Git][darshan/darshan][dev-stdio] 2 commits: fix minor potential bug in open timestamp

Philip Carns xgitlab at cels.anl.gov
Sun May 1 06:58:39 CDT 2016


Philip Carns pushed to branch dev-stdio at darshan / darshan


Commits:
f88ebef6 by Phil Carns at 2016-05-01T07:57:38-04:00
fix minor potential bug in open timestamp

- be careful to record start timestamp of first open to start rather
  than start timestamp of first open to complete

- - - - -
8d3a2c8a by Phil Carns at 2016-05-01T07:58:33-04:00
Merge remote-tracking branch 'origin/master' into dev-stdio

- - - - -


4 changed files:

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


Changes:

=====================================
darshan-runtime/lib/darshan-hdf5.c
=====================================
--- a/darshan-runtime/lib/darshan-hdf5.c
+++ b/darshan-runtime/lib/darshan-hdf5.c
@@ -115,7 +115,8 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags,
         file = hdf5_file_by_name_sethid(filename, ret);
         if(file)
         {
-            if(file->file_record->fcounters[HDF5_F_OPEN_TIMESTAMP] == 0)
+            if(file->file_record->fcounters[HDF5_F_OPEN_TIMESTAMP] == 0 || 
+             file->file_record->fcounters[HDF5_F_OPEN_TIMESTAMP] > tm1)
                 file->file_record->fcounters[HDF5_F_OPEN_TIMESTAMP] = tm1;
             file->file_record->counters[HDF5_OPENS] += 1;
         }
@@ -154,7 +155,8 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags,
         file = hdf5_file_by_name_sethid(filename, ret);
         if(file)
         {
-            if(file->file_record->fcounters[HDF5_F_OPEN_TIMESTAMP] == 0)
+            if(file->file_record->fcounters[HDF5_F_OPEN_TIMESTAMP] == 0 || 
+             file->file_record->fcounters[HDF5_F_OPEN_TIMESTAMP] > tm1)
                 file->file_record->fcounters[HDF5_F_OPEN_TIMESTAMP] = tm1;
             file->file_record->counters[HDF5_OPENS] += 1;
         }


=====================================
darshan-runtime/lib/darshan-mpiio.c
=====================================
--- a/darshan-runtime/lib/darshan-mpiio.c
+++ b/darshan-runtime/lib/darshan-mpiio.c
@@ -151,7 +151,8 @@ static void mpiio_shutdown(void);
         file->file_record->counters[MPIIO_COLL_OPENS] += 1; \
     if(__info != MPI_INFO_NULL) \
         file->file_record->counters[MPIIO_HINTS] += 1; \
-    if(file->file_record->fcounters[MPIIO_F_OPEN_TIMESTAMP] == 0) \
+    if(file->file_record->fcounters[MPIIO_F_OPEN_TIMESTAMP] == 0 || \
+     file->file_record->fcounters[MPIIO_F_OPEN_TIMESTAMP] > __tm1) \
         file->file_record->fcounters[MPIIO_F_OPEN_TIMESTAMP] = __tm1; \
     DARSHAN_TIMER_INC_NO_OVERLAP(file->file_record->fcounters[MPIIO_F_META_TIME], __tm1, __tm2, file->last_meta_end); \
 } while(0)


=====================================
darshan-runtime/lib/darshan-pnetcdf.c
=====================================
--- a/darshan-runtime/lib/darshan-pnetcdf.c
+++ b/darshan-runtime/lib/darshan-pnetcdf.c
@@ -112,7 +112,8 @@ int DARSHAN_DECL(ncmpi_create)(MPI_Comm comm, const char *path,
         file = pnetcdf_file_by_name_setncid(path, (*ncidp));
         if(file)
         {
-            if(file->file_record->fcounters[PNETCDF_F_OPEN_TIMESTAMP] == 0)
+            if(file->file_record->fcounters[PNETCDF_F_OPEN_TIMESTAMP] == 0 || 
+             file->file_record->fcounters[PNETCDF_F_OPEN_TIMESTAMP] > tm1)
                 file->file_record->fcounters[PNETCDF_F_OPEN_TIMESTAMP] = tm1;
             DARSHAN_MPI_CALL(PMPI_Comm_size)(comm, &comm_size);
             if(comm_size == 1)
@@ -160,7 +161,8 @@ int DARSHAN_DECL(ncmpi_open)(MPI_Comm comm, const char *path,
         file = pnetcdf_file_by_name_setncid(path, (*ncidp));
         if(file)
         {
-            if(file->file_record->fcounters[PNETCDF_F_OPEN_TIMESTAMP] == 0)
+            if(file->file_record->fcounters[PNETCDF_F_OPEN_TIMESTAMP] == 0 || 
+             file->file_record->fcounters[PNETCDF_F_OPEN_TIMESTAMP] > tm1)
                 file->file_record->fcounters[PNETCDF_F_OPEN_TIMESTAMP] = tm1;
             DARSHAN_MPI_CALL(PMPI_Comm_size)(comm, &comm_size);
             if(comm_size == 1)


=====================================
darshan-runtime/lib/darshan-posix.c
=====================================
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-posix.c
@@ -224,7 +224,8 @@ static void posix_shutdown(void);
         file->file_record->counters[POSIX_FOPENS] += 1; \
     else \
         file->file_record->counters[POSIX_OPENS] += 1; \
-    if(file->file_record->fcounters[POSIX_F_OPEN_TIMESTAMP] == 0) \
+    if(file->file_record->fcounters[POSIX_F_OPEN_TIMESTAMP] == 0 || \
+     file->file_record->fcounters[POSIX_F_OPEN_TIMESTAMP] > __tm1) \
         file->file_record->fcounters[POSIX_F_OPEN_TIMESTAMP] = __tm1; \
     DARSHAN_TIMER_INC_NO_OVERLAP(file->file_record->fcounters[POSIX_F_META_TIME], __tm1, __tm2, file->last_meta_end); \
 } while(0)



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/841429de3ffaaaed5cf574d84e35e78206d62b5a...8d3a2c8a31d18374464745402e23d37fafaa3225
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20160501/af27624c/attachment-0001.html>


More information about the Darshan-commits mailing list