Commit af8200c0 authored by Kevin Harms's avatar Kevin Harms
Browse files

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: 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];
......@@ -387,14 +389,19 @@ void darshan_shutdown(int timing_flag)
/* note: getpwuid() causes link errors for static binaries */
/* 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,
__CP_LOG_PATH, (my_tm->tm_year+1900),
(my_tm->tm_mon+1), my_tm->tm_mday,
cuser, __progname, jobid,
(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),
if(ret == (PATH_MAX-1))
/* file name was too big; squish it down */
Supports Markdown
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