Commit e8f5eb46 authored by fisaila's avatar fisaila

Defined an environment var DARSHAN_POSIX_EPOCH for starting an epoch for a POSIX write.


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/branches/darshan-florin-extensions-addcounters-datatypes@844 3b7491f3-a168-0410-bf4b-c445ed680a29
parent abe16bb2
......@@ -951,8 +951,12 @@ ssize_t DARSHAN_DECL(write)(int fd, const void *buf, size_t count)
ssize_t ret;
int aligned_flag = 0;
double tm1, tm2;
char *value;
MAP_OR_FAIL(write);
if (value = getenv("DARSHAN_POSIX_EPOCH"))
darshan_start_epoch();
if((unsigned long)buf % darshan_mem_alignment == 0)
aligned_flag = 1;
......@@ -963,6 +967,10 @@ ssize_t DARSHAN_DECL(write)(int fd, const void *buf, size_t count)
CP_LOCK();
CP_RECORD_WRITE(ret, fd, count, 0, 0, aligned_flag, 0, tm1, tm2);
CP_UNLOCK();
if (value = getenv("DARSHAN_POSIX_EPOCH"))
darshan_end_epoch();
return(ret);
}
......
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