[Darshan-commits] [Git][darshan/darshan][master] 2 commits: two darshan_core_wtime fixes

Shane Snyder xgitlab at cels.anl.gov
Thu Dec 19 15:54:06 CST 2019



Shane Snyder pushed to branch master at darshan / darshan


Commits:
d88e8161 by Shane Snyder at 2019-12-19T21:51:56Z
two darshan_core_wtime fixes

1) make sure wtime_offset is set properly when using MPI
2) fix ifdef logic to properly get wtime in all non-MPI cases

- - - - -
d89229b7 by Shane Snyder at 2019-12-19T21:53:22Z
bug fix for segfaults when reducing hdf5 recs

- - - - -


2 changed files:

- darshan-runtime/lib/darshan-core.c
- darshan-runtime/lib/darshan-hdf5.c


Changes:

=====================================
darshan-runtime/lib/darshan-core.c
=====================================
@@ -279,10 +279,6 @@ void darshan_core_initialize(int argc, char **argv)
     if(init_core)
     {
         memset(init_core, 0, sizeof(*init_core));
-        /* record absolute start time at startup so that we can later
-         * generate relative times with this as a reference point.
-         */
-        init_core->wtime_offset = darshan_core_wtime_absolute();
 
 #ifdef HAVE_MPI
         PMPI_Initialized(&using_mpi);
@@ -294,6 +290,11 @@ void darshan_core_initialize(int argc, char **argv)
         }
 #endif
 
+        /* record absolute start time at startup so that we can later
+         * generate relative times with this as a reference point.
+         */
+        init_core->wtime_offset = darshan_core_wtime_absolute();
+
     /* TODO: do we alloc new memory as we go or just do everything up front? */
 
 #ifndef __DARSHAN_ENABLE_MMAP_LOGS
@@ -2352,11 +2353,11 @@ static double darshan_core_wtime_absolute(void)
 #ifdef HAVE_MPI
     if(using_mpi)
         return(PMPI_Wtime());
-#else
+#endif
+
     struct timeval tval;
     gettimeofday(&tval, NULL);
     return(tval.tv_sec + (tval.tv_usec / 1000000.0));
-#endif
 }
 
 #ifdef DARSHAN_PRELOAD


=====================================
darshan-runtime/lib/darshan-hdf5.c
=====================================
@@ -420,7 +420,7 @@ static void hdf5_mpi_redux(
 {
     int hdf5_rec_count;
     struct hdf5_file_record_ref *rec_ref;
-    struct darshan_hdf5_file *hdf5_rec_buf = *(struct darshan_hdf5_file **)hdf5_buf;
+    struct darshan_hdf5_file *hdf5_rec_buf = (struct darshan_hdf5_file *)hdf5_buf;
     struct darshan_hdf5_file *red_send_buf = NULL;
     struct darshan_hdf5_file *red_recv_buf = NULL;
     MPI_Datatype red_type;
@@ -430,6 +430,8 @@ static void hdf5_mpi_redux(
     HDF5_LOCK();
     assert(hdf5_runtime);
 
+    hdf5_rec_count = hdf5_runtime->file_rec_count;
+
     /* necessary initialization of shared records */
     for(i = 0; i < shared_rec_count; i++)
     {



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/2178526ff9412090d9ed9c77de1e83f0540d51b8...d89229b7b1c04aa4900ec7fa66e95bb678a53839

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/2178526ff9412090d9ed9c77de1e83f0540d51b8...d89229b7b1c04aa4900ec7fa66e95bb678a53839
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/20191219/57b31092/attachment-0001.html>


More information about the Darshan-commits mailing list