Commit af8200c0 authored by Kevin Harms's avatar Kevin Harms

Added a "random" value to the filename of the darshan log. This random

value is the 64bit hash of the hostname that rank 0 is running on. This
allows multiple MPI jobs running under the same job number to produce
unique logs.


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@347 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 7cfcae6e
......@@ -237,6 +237,8 @@ void darshan_shutdown(int timing_flag)
int i, j;
int map_index = 0;
time_t start_time_tmp = 0;
uint64_t logmod;
char hname[HOST_NAME_MAX];
CP_LOCK();
if(!darshan_global_job)
......@@ -387,14 +389,19 @@ void darshan_shutdown(int timing_flag)
/* note: getpwuid() causes link errors for static binaries */
cuserid(cuser);
/* generate a random number to help differentiate the log */
(void) gethostname(hname, sizeof(hname));
logmod = darshan_hash((void*)hname,strlen(hname),0);
ret = snprintf(logfile_name, PATH_MAX,
"%s/%d/%d/%d/%s_%s_id%d_%d-%d-%d.darshan_partial",
"%s/%d/%d/%d/%s_%s_id%d_%d-%d-%d-%llu.darshan_partial",
__CP_LOG_PATH, (my_tm->tm_year+1900),
(my_tm->tm_mon+1), my_tm->tm_mday,
cuser, __progname, jobid,
(my_tm->tm_mon+1),
my_tm->tm_mday,
(my_tm->tm_hour*60*60 + my_tm->tm_min*60 + my_tm->tm_sec));
(my_tm->tm_hour*60*60 + my_tm->tm_min*60 + my_tm->tm_sec),
llu(logmod));
if(ret == (PATH_MAX-1))
{
/* file name was too big; squish it down */
......
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