[Darshan-commits] [Git][darshan/darshan][carns/issue-312-log-time-name] bug fix to internal shutdown timing

Philip Carns xgitlab at cels.anl.gov
Wed Mar 24 15:55:44 CDT 2021



Philip Carns pushed to branch carns/issue-312-log-time-name at darshan / darshan


Commits:
d26bf896 by Phil Carns at 2021-03-24T16:55:23-04:00
bug fix to internal shutdown timing

- - - - -


1 changed file:

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


Changes:

=====================================
darshan-runtime/lib/darshan-core.c
=====================================
@@ -444,13 +444,20 @@ void darshan_core_shutdown()
     darshan_core = NULL;
     DARSHAN_CORE_UNLOCK();
 
+    /* NOTE: from this point on, this function must use
+     * darshan_core_wtime_absolute() rather than darshan_core_wtime() to
+     * collect timestamps for internal timing calculations.  The former no
+     * longer works because it relies on runtime state to calculate
+     * timestamps relative to job start.
+     */
+
     /* grab some initial timing information */
 #ifdef HAVE_MPI
     /* if using mpi, sync across procs first */
     if(using_mpi)
         PMPI_Barrier(final_core->mpi_comm);
 #endif
-    start_log_time = darshan_core_wtime();
+    start_log_time = darshan_core_wtime_absolute();
     final_core->log_job_p->end_time = time(NULL);
 
     if(getenv("DARSHAN_INTERNAL_TIMING"))
@@ -524,31 +531,31 @@ void darshan_core_shutdown()
     }
 
     if(internal_timing_flag)
-        open1 = darshan_core_wtime();
+        open1 = darshan_core_wtime_absolute();
     /* open the darshan log file */
     ret = darshan_log_open(logfile_name, final_core, &log_fh);
     if(internal_timing_flag)
-        open2 = darshan_core_wtime();
+        open2 = darshan_core_wtime_absolute();
     /* error out if unable to open log file */
     DARSHAN_CHECK_ERR(ret, "unable to create log file %s", logfile_name);
     log_created = 1;
 
     if(internal_timing_flag)
-        job1 = darshan_core_wtime();
+        job1 = darshan_core_wtime_absolute();
     /* write the the compressed darshan job information */
     ret = darshan_log_write_job_record(log_fh, final_core, &gz_fp);
     if(internal_timing_flag)
-        job2 = darshan_core_wtime();
+        job2 = darshan_core_wtime_absolute();
     /* error out if unable to write job information */
     DARSHAN_CHECK_ERR(ret, "unable to write job record to file %s", logfile_name);
 
     if(internal_timing_flag)
-        rec1 = darshan_core_wtime();
+        rec1 = darshan_core_wtime_absolute();
     /* write the record name->id hash to the log file */
     final_core->log_hdr_p->name_map.off = gz_fp;
     ret = darshan_log_write_name_record_hash(log_fh, final_core, &gz_fp);
     if(internal_timing_flag)
-        rec2 = darshan_core_wtime();
+        rec2 = darshan_core_wtime_absolute();
     final_core->log_hdr_p->name_map.len = gz_fp - final_core->log_hdr_p->name_map.off;
     /* error out if unable to write name records */
     DARSHAN_CHECK_ERR(ret, "unable to write name records to log file %s", logfile_name);
@@ -574,7 +581,7 @@ void darshan_core_shutdown()
         }
 
         if(internal_timing_flag)
-            mod1[i] = darshan_core_wtime();
+            mod1[i] = darshan_core_wtime_absolute();
 
         /* if module is registered locally, perform module shutdown operations */
         if(this_mod)
@@ -626,7 +633,7 @@ void darshan_core_shutdown()
             free(mod_buf);
 
         if(internal_timing_flag)
-            mod2[i] = darshan_core_wtime();
+            mod2[i] = darshan_core_wtime_absolute();
 
         /* error out if unable to write module data */
         DARSHAN_CHECK_ERR(ret, "unable to write %s module data to log file %s",
@@ -634,10 +641,10 @@ void darshan_core_shutdown()
     }
 
     if(internal_timing_flag)
-        header1 = darshan_core_wtime();
+        header1 = darshan_core_wtime_absolute();
     ret = darshan_log_write_header(log_fh, final_core);
     if(internal_timing_flag)
-        header2 = darshan_core_wtime();
+        header2 = darshan_core_wtime_absolute();
     DARSHAN_CHECK_ERR(ret, "unable to write header to file %s", logfile_name);
 
     /* done writing data, close the log file */
@@ -655,7 +662,7 @@ void darshan_core_shutdown()
         double mod_tm[DARSHAN_MAX_MODS];
         double all_tm;
 
-        tm_end = darshan_core_wtime();
+        tm_end = darshan_core_wtime_absolute();
 
         open_tm = open2 - open1;
         header_tm = header2 - header1;



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/commit/d26bf89688397c045dd5517cbc0a4ca04246299e

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/commit/d26bf89688397c045dd5517cbc0a4ca04246299e
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/20210324/8f90dacb/attachment-0001.html>


More information about the Darshan-commits mailing list