Commit d26bf896 authored by Philip Carns's avatar Philip Carns
Browse files

bug fix to internal shutdown timing

parent e62a6255
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment