Commit 7d239a9b authored by Philip Carns's avatar Philip Carns

bug fix to error handling when using log-path-by-env. This fixes a problem

in which Darshan would hang if the specified environment variable is not
set.


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@582 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 06bb928c
......@@ -504,13 +504,7 @@ void darshan_shutdown(int timing_flag)
}
#endif
if(!logpath && !logpath_override)
{
/* we could not find any location to write the log file */
darshan_finalize(final_job);
return;
}
if(logpath_override)
{
ret = snprintf(logfile_name, PATH_MAX,
......@@ -529,7 +523,7 @@ void darshan_shutdown(int timing_flag)
logpath_override, jobid);
}
}
else
else if(logpath)
{
ret = snprintf(logfile_name, PATH_MAX,
"%s/%d/%d/%d/%s_%s_id%d_%d-%d-%d-%" PRIu64 ".darshan_partial",
......@@ -548,6 +542,10 @@ void darshan_shutdown(int timing_flag)
logpath, jobid);
}
}
else
{
logfile_name[0] = '\0';
}
/* add jobid */
final_job->log_job.jobid = (int64_t)jobid;
......@@ -558,6 +556,13 @@ void darshan_shutdown(int timing_flag)
DARSHAN_MPI_CALL(PMPI_Bcast)(logfile_name, PATH_MAX, MPI_CHAR, 0,
MPI_COMM_WORLD);
if(strlen(logfile_name) == 0)
{
/* failed to generate log file name */
darshan_finalize(final_job);
return;
}
final_job->log_job.end_time = time(NULL);
/* reduce records for shared files */
......
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