Commit 08438176 authored by Shane Snyder's avatar Shane Snyder
Browse files

slight update to code structure/naming

parent bd6ef308
...@@ -37,4 +37,6 @@ void darshan_core_lookup_id( ...@@ -37,4 +37,6 @@ void darshan_core_lookup_id(
int printable_flag, int printable_flag,
darshan_file_id *id); darshan_file_id *id);
double darshan_core_wtime(void);
#endif /* __DARSHAN_CORE_H */ #endif /* __DARSHAN_CORE_H */
...@@ -26,8 +26,8 @@ static void darshan_shutdown(void); ...@@ -26,8 +26,8 @@ static void darshan_shutdown(void);
static char *darshan_get_exe_and_mounts(int rank); static char *darshan_get_exe_and_mounts(int rank);
static void darshan_get_exe_and_mounts_root(char* trailing_data, int space_left); static void darshan_get_exe_and_mounts_root(char* trailing_data, int space_left);
/* internal variables */
static struct darshan_job_runtime *darshan_global_job = NULL; static struct darshan_job_runtime *darshan_global_job = NULL;
static int darshan_mem_alignment = 1;
#define CP_MAX_MNTS 64 #define CP_MAX_MNTS 64
#define CP_MAX_MNT_PATH 256 #define CP_MAX_MNT_PATH 256
...@@ -90,12 +90,9 @@ static void darshan_initialize(int *argc, char ***argv) ...@@ -90,12 +90,9 @@ static void darshan_initialize(int *argc, char ***argv)
int rank; int rank;
int internal_timing_flag = 0; int internal_timing_flag = 0;
double init_start, init_time, init_max; double init_start, init_time, init_max;
char *mem_align;
char* truncate_string = "<TRUNCATED>"; char* truncate_string = "<TRUNCATED>";
int truncate_offset; int truncate_offset;
int chars_left = 0; int chars_left = 0;
int ret;
int tmpval;
DARSHAN_MPI_CALL(PMPI_Comm_size)(MPI_COMM_WORLD, &nprocs); DARSHAN_MPI_CALL(PMPI_Comm_size)(MPI_COMM_WORLD, &nprocs);
DARSHAN_MPI_CALL(PMPI_Comm_rank)(MPI_COMM_WORLD, &rank); DARSHAN_MPI_CALL(PMPI_Comm_rank)(MPI_COMM_WORLD, &rank);
...@@ -109,30 +106,6 @@ static void darshan_initialize(int *argc, char ***argv) ...@@ -109,30 +106,6 @@ static void darshan_initialize(int *argc, char ***argv)
/* setup darshan runtime if darshan is enabled and hasn't been initialized already */ /* setup darshan runtime if darshan is enabled and hasn't been initialized already */
if (!getenv("DARSHAN_DISABLE") && !darshan_global_job) if (!getenv("DARSHAN_DISABLE") && !darshan_global_job)
{ {
#if (__CP_MEM_ALIGNMENT < 1)
#error Darshan must be configured with a positive value for --with-mem-align
#endif
mem_align = getenv("DARSHAN_MEMALIGN");
if (mem_align)
{
ret = sscanf(mem_align, "%d", &tmpval);
/* silently ignore if the env variable is set poorly */
if(ret == 1 && tmpval > 0)
{
darshan_mem_alignment = tmpval;
}
}
else
{
darshan_mem_alignment == __CP_MEM_ALIGNMENT;
}
/* avoid floating point errors on faulty input */
if (darshan_mem_alignment < 1)
{
darshan_mem_alignment = 1;
}
/* allocate structure to track darshan_global_job information */ /* allocate structure to track darshan_global_job information */
darshan_global_job = malloc(sizeof(*darshan_global_job)); darshan_global_job = malloc(sizeof(*darshan_global_job));
if (darshan_global_job) if (darshan_global_job)
...@@ -144,13 +117,6 @@ static void darshan_initialize(int *argc, char ***argv) ...@@ -144,13 +117,6 @@ static void darshan_initialize(int *argc, char ***argv)
darshan_global_job->flags |= CP_FLAG_NOTIMING; darshan_global_job->flags |= CP_FLAG_NOTIMING;
} }
/* set up file records */
for(i=0; i<CP_MAX_FILES; i++)
{
darshan_global_job->file_runtime_array[i].log_file =
&darshan_global_job->file_array[i];
}
strcpy(darshan_global_job->log_job.version_string, CP_VERSION); strcpy(darshan_global_job->log_job.version_string, CP_VERSION);
darshan_global_job->log_job.magic_nr = CP_MAGIC_NR; darshan_global_job->log_job.magic_nr = CP_MAGIC_NR;
darshan_global_job->log_job.uid = getuid(); darshan_global_job->log_job.uid = getuid();
...@@ -424,6 +390,15 @@ void darshan_core_lookup_id( ...@@ -424,6 +390,15 @@ void darshan_core_lookup_id(
return; return;
} }
double darshan_core_wtime()
{
if(!darshan_global_job || darshan_global_job->flags & CP_FLAG_NOTIMING)
{
return(0);
}
return DARSHAN_MPI_CALL(PMPI_Wtime)();
}
/* /*
* Local variables: * Local variables:
......
...@@ -83,9 +83,6 @@ DARSHAN_FORWARD_DECL(lio_listio64, int, (int mode, struct aiocb64 *const aiocb_l ...@@ -83,9 +83,6 @@ DARSHAN_FORWARD_DECL(lio_listio64, int, (int mode, struct aiocb64 *const aiocb_l
DARSHAN_FORWARD_DECL(aio_return, ssize_t, (struct aiocb *aiocbp)); DARSHAN_FORWARD_DECL(aio_return, ssize_t, (struct aiocb *aiocbp));
DARSHAN_FORWARD_DECL(aio_return64, ssize_t, (struct aiocb64 *aiocbp)); DARSHAN_FORWARD_DECL(aio_return64, ssize_t, (struct aiocb64 *aiocbp));
pthread_mutex_t cp_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static struct stat64 cp_stat_buf;
/* struct to track information about aio operations in flight */ /* struct to track information about aio operations in flight */
struct darshan_aio_tracker struct darshan_aio_tracker
{ {
...@@ -109,21 +106,22 @@ static char* exclusions[] = { ...@@ -109,21 +106,22 @@ static char* exclusions[] = {
NULL NULL
}; };
static int posix_mod_registered = 0; static int darshan_mem_alignment = 1;
static int posix_mod_initialized = 0;
static int posix_mod_mem_limit = 0;
static pthread_mutex_t posix_mod_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static struct darshan_module_funcs posix_mod_funcs = static struct darshan_module_funcs posix_mod_funcs =
{ {
}; };
static int posix_runtime_mem_limit = 0;
#define DARSHAN_REGISTER_POSIX_MOD() do{ \
if (!posix_mod_registered) { \
darshan_core_register_module("POSIX", &posix_mod_funcs, &posix_runtime_mem_limit); \
posix_mod_registered = 1; \
} \
} while(0)
static void posix_runtime_initialize(void);
static double posix_wtime(void); static double posix_wtime(void);
#define POSIX_LOCK() pthread_mutex_lock(&posix_mod_mutex)
#define POSIX_UNLOCK() pthread_mutex_unlock(&posix_mod_mutex)
static void cp_access_counter(struct darshan_file_runtime* file, ssize_t size, enum cp_counter_type type); static void cp_access_counter(struct darshan_file_runtime* file, ssize_t size, enum cp_counter_type type);
static void darshan_aio_tracker_add(int fd, void *aiocbp); static void darshan_aio_tracker_add(int fd, void *aiocbp);
static struct darshan_aio_tracker* darshan_aio_tracker_del(int fd, void *aiocbp); static struct darshan_aio_tracker* darshan_aio_tracker_del(int fd, void *aiocbp);
...@@ -300,7 +298,6 @@ static struct darshan_aio_tracker* darshan_aio_tracker_del(int fd, void *aiocbp) ...@@ -300,7 +298,6 @@ static struct darshan_aio_tracker* darshan_aio_tracker_del(int fd, void *aiocbp)
CP_F_INC_NO_OVERLAP(file, __tm1, __tm2, file->last_posix_meta_end, CP_F_POSIX_META_TIME); \ CP_F_INC_NO_OVERLAP(file, __tm1, __tm2, file->last_posix_meta_end, CP_F_POSIX_META_TIME); \
} while (0) } while (0)
#if 0
int DARSHAN_DECL(close)(int fd) int DARSHAN_DECL(close)(int fd)
{ {
struct darshan_file_runtime* file; struct darshan_file_runtime* file;
...@@ -310,13 +307,14 @@ int DARSHAN_DECL(close)(int fd) ...@@ -310,13 +307,14 @@ int DARSHAN_DECL(close)(int fd)
MAP_OR_FAIL(close); MAP_OR_FAIL(close);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real_close(fd); ret = __real_close(fd);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
CP_LOCK(); POSIX_LOCK();
posix_runtime_initialize();
#if 0
file = darshan_file_by_fd(tmp_fd); file = darshan_file_by_fd(tmp_fd);
if(file) if(file)
{ {
...@@ -326,11 +324,14 @@ int DARSHAN_DECL(close)(int fd) ...@@ -326,11 +324,14 @@ int DARSHAN_DECL(close)(int fd)
CP_F_INC_NO_OVERLAP(file, tm1, tm2, file->last_posix_meta_end, CP_F_POSIX_META_TIME); CP_F_INC_NO_OVERLAP(file, tm1, tm2, file->last_posix_meta_end, CP_F_POSIX_META_TIME);
darshan_file_close_fd(tmp_fd); darshan_file_close_fd(tmp_fd);
} }
CP_UNLOCK(); #endif
POSIX_UNLOCK();
return(ret); return(ret);
} }
#if 0
int DARSHAN_DECL(fclose)(FILE *fp) int DARSHAN_DECL(fclose)(FILE *fp)
{ {
struct darshan_file_runtime* file; struct darshan_file_runtime* file;
...@@ -340,11 +341,9 @@ int DARSHAN_DECL(fclose)(FILE *fp) ...@@ -340,11 +341,9 @@ int DARSHAN_DECL(fclose)(FILE *fp)
MAP_OR_FAIL(fclose); MAP_OR_FAIL(fclose);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real_fclose(fp); ret = __real_fclose(fp);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
CP_LOCK(); CP_LOCK();
file = darshan_file_by_fd(tmp_fd); file = darshan_file_by_fd(tmp_fd);
...@@ -370,11 +369,9 @@ int DARSHAN_DECL(fsync)(int fd) ...@@ -370,11 +369,9 @@ int DARSHAN_DECL(fsync)(int fd)
MAP_OR_FAIL(fsync); MAP_OR_FAIL(fsync);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real_fsync(fd); ret = __real_fsync(fd);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
if(ret < 0) if(ret < 0)
return(ret); return(ret);
...@@ -399,11 +396,9 @@ int DARSHAN_DECL(fdatasync)(int fd) ...@@ -399,11 +396,9 @@ int DARSHAN_DECL(fdatasync)(int fd)
MAP_OR_FAIL(fdatasync); MAP_OR_FAIL(fdatasync);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real_fdatasync(fd); ret = __real_fdatasync(fd);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
if(ret < 0) if(ret < 0)
return(ret); return(ret);
...@@ -428,8 +423,6 @@ void* DARSHAN_DECL(mmap64)(void *addr, size_t length, int prot, int flags, ...@@ -428,8 +423,6 @@ void* DARSHAN_DECL(mmap64)(void *addr, size_t length, int prot, int flags,
MAP_OR_FAIL(mmap64); MAP_OR_FAIL(mmap64);
DARSHAN_REGISTER_POSIX_MOD();
ret = __real_mmap64(addr, length, prot, flags, fd, offset); ret = __real_mmap64(addr, length, prot, flags, fd, offset);
if(ret == MAP_FAILED) if(ret == MAP_FAILED)
return(ret); return(ret);
...@@ -454,8 +447,6 @@ void* DARSHAN_DECL(mmap)(void *addr, size_t length, int prot, int flags, ...@@ -454,8 +447,6 @@ void* DARSHAN_DECL(mmap)(void *addr, size_t length, int prot, int flags,
MAP_OR_FAIL(mmap); MAP_OR_FAIL(mmap);
DARSHAN_REGISTER_POSIX_MOD();
ret = __real_mmap(addr, length, prot, flags, fd, offset); ret = __real_mmap(addr, length, prot, flags, fd, offset);
if(ret == MAP_FAILED) if(ret == MAP_FAILED)
return(ret); return(ret);
...@@ -478,11 +469,9 @@ int DARSHAN_DECL(creat)(const char* path, mode_t mode) ...@@ -478,11 +469,9 @@ int DARSHAN_DECL(creat)(const char* path, mode_t mode)
MAP_OR_FAIL(creat); MAP_OR_FAIL(creat);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real_creat(path, mode); ret = __real_creat(path, mode);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
CP_LOCK(); CP_LOCK();
CP_RECORD_OPEN(ret, path, mode, 0, tm1, tm2); CP_RECORD_OPEN(ret, path, mode, 0, tm1, tm2);
...@@ -498,11 +487,9 @@ int DARSHAN_DECL(creat64)(const char* path, mode_t mode) ...@@ -498,11 +487,9 @@ int DARSHAN_DECL(creat64)(const char* path, mode_t mode)
MAP_OR_FAIL(creat64); MAP_OR_FAIL(creat64);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real_creat64(path, mode); ret = __real_creat64(path, mode);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
CP_LOCK(); CP_LOCK();
CP_RECORD_OPEN(ret, path, mode, 0, tm1, tm2); CP_RECORD_OPEN(ret, path, mode, 0, tm1, tm2);
...@@ -519,8 +506,6 @@ int DARSHAN_DECL(open64)(const char* path, int flags, ...) ...@@ -519,8 +506,6 @@ int DARSHAN_DECL(open64)(const char* path, int flags, ...)
MAP_OR_FAIL(open64); MAP_OR_FAIL(open64);
DARSHAN_REGISTER_POSIX_MOD();
if (flags & O_CREAT) if (flags & O_CREAT)
{ {
va_list arg; va_list arg;
...@@ -528,15 +513,15 @@ int DARSHAN_DECL(open64)(const char* path, int flags, ...) ...@@ -528,15 +513,15 @@ int DARSHAN_DECL(open64)(const char* path, int flags, ...)
mode = va_arg(arg, int); mode = va_arg(arg, int);
va_end(arg); va_end(arg);
tm1 = darshan_wtime(); tm1 = darshan_core_wtime();
ret = __real_open64(path, flags, mode); ret = __real_open64(path, flags, mode);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
} }
else else
{ {
tm1 = darshan_wtime(); tm1 = darshan_core_wtime();
ret = __real_open64(path, flags); ret = __real_open64(path, flags);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
} }
CP_LOCK(); CP_LOCK();
...@@ -555,8 +540,6 @@ int DARSHAN_DECL(open)(const char *path, int flags, ...) ...@@ -555,8 +540,6 @@ int DARSHAN_DECL(open)(const char *path, int flags, ...)
MAP_OR_FAIL(open); MAP_OR_FAIL(open);
DARSHAN_REGISTER_POSIX_MOD();
#if 0
if (flags & O_CREAT) if (flags & O_CREAT)
{ {
va_list arg; va_list arg;
...@@ -564,21 +547,22 @@ int DARSHAN_DECL(open)(const char *path, int flags, ...) ...@@ -564,21 +547,22 @@ int DARSHAN_DECL(open)(const char *path, int flags, ...)
mode = va_arg(arg, int); mode = va_arg(arg, int);
va_end(arg); va_end(arg);
tm1 = darshan_wtime(); tm1 = darshan_core_wtime();
ret = __real_open(path, flags, mode); ret = __real_open(path, flags, mode);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
} }
else else
{ {
tm1 = darshan_wtime(); tm1 = darshan_core_wtime();
ret = __real_open(path, flags); ret = __real_open(path, flags);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
} }
CP_LOCK(); POSIX_LOCK();
CP_RECORD_OPEN(ret, path, mode, 0, tm1, tm2); posix_runtime_initialize();
CP_UNLOCK();
#endif // POSIX_RECORD_OPEN(ret, path, mode, 0, tm1, tm2);
POSIX_UNLOCK();
return(ret); return(ret);
} }
...@@ -592,11 +576,9 @@ FILE* DARSHAN_DECL(fopen64)(const char *path, const char *mode) ...@@ -592,11 +576,9 @@ FILE* DARSHAN_DECL(fopen64)(const char *path, const char *mode)
MAP_OR_FAIL(fopen64); MAP_OR_FAIL(fopen64);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real_fopen64(path, mode); ret = __real_fopen64(path, mode);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
if(ret == 0) if(ret == 0)
fd = -1; fd = -1;
else else
...@@ -617,11 +599,9 @@ FILE* DARSHAN_DECL(fopen)(const char *path, const char *mode) ...@@ -617,11 +599,9 @@ FILE* DARSHAN_DECL(fopen)(const char *path, const char *mode)
MAP_OR_FAIL(fopen); MAP_OR_FAIL(fopen);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real_fopen(path, mode); ret = __real_fopen(path, mode);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
if(ret == 0) if(ret == 0)
fd = -1; fd = -1;
else else
...@@ -641,11 +621,9 @@ int DARSHAN_DECL(__xstat64)(int vers, const char *path, struct stat64 *buf) ...@@ -641,11 +621,9 @@ int DARSHAN_DECL(__xstat64)(int vers, const char *path, struct stat64 *buf)
MAP_OR_FAIL(__xstat64); MAP_OR_FAIL(__xstat64);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real___xstat64(vers, path, buf); ret = __real___xstat64(vers, path, buf);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
if(ret < 0 || !S_ISREG(buf->st_mode)) if(ret < 0 || !S_ISREG(buf->st_mode))
return(ret); return(ret);
...@@ -663,11 +641,9 @@ int DARSHAN_DECL(__lxstat64)(int vers, const char *path, struct stat64 *buf) ...@@ -663,11 +641,9 @@ int DARSHAN_DECL(__lxstat64)(int vers, const char *path, struct stat64 *buf)
MAP_OR_FAIL(__lxstat64); MAP_OR_FAIL(__lxstat64);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real___lxstat64(vers, path, buf); ret = __real___lxstat64(vers, path, buf);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
if(ret < 0 || !S_ISREG(buf->st_mode)) if(ret < 0 || !S_ISREG(buf->st_mode))
return(ret); return(ret);
...@@ -686,11 +662,9 @@ int DARSHAN_DECL(__fxstat64)(int vers, int fd, struct stat64 *buf) ...@@ -686,11 +662,9 @@ int DARSHAN_DECL(__fxstat64)(int vers, int fd, struct stat64 *buf)
MAP_OR_FAIL(__fxstat64); MAP_OR_FAIL(__fxstat64);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real___fxstat64(vers, fd, buf); ret = __real___fxstat64(vers, fd, buf);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
if(ret < 0 || !S_ISREG(buf->st_mode)) if(ret < 0 || !S_ISREG(buf->st_mode))
return(ret); return(ret);
...@@ -717,11 +691,9 @@ int DARSHAN_DECL(__xstat)(int vers, const char *path, struct stat *buf) ...@@ -717,11 +691,9 @@ int DARSHAN_DECL(__xstat)(int vers, const char *path, struct stat *buf)
MAP_OR_FAIL(__xstat); MAP_OR_FAIL(__xstat);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real___xstat(vers, path, buf); ret = __real___xstat(vers, path, buf);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
if(ret < 0 || !S_ISREG(buf->st_mode)) if(ret < 0 || !S_ISREG(buf->st_mode))
return(ret); return(ret);
...@@ -739,11 +711,9 @@ int DARSHAN_DECL(__lxstat)(int vers, const char *path, struct stat *buf) ...@@ -739,11 +711,9 @@ int DARSHAN_DECL(__lxstat)(int vers, const char *path, struct stat *buf)
MAP_OR_FAIL(__lxstat); MAP_OR_FAIL(__lxstat);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real___lxstat(vers, path, buf); ret = __real___lxstat(vers, path, buf);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
if(ret < 0 || !S_ISREG(buf->st_mode)) if(ret < 0 || !S_ISREG(buf->st_mode))
return(ret); return(ret);
...@@ -762,11 +732,9 @@ int DARSHAN_DECL(__fxstat)(int vers, int fd, struct stat *buf) ...@@ -762,11 +732,9 @@ int DARSHAN_DECL(__fxstat)(int vers, int fd, struct stat *buf)
MAP_OR_FAIL(__fxstat); MAP_OR_FAIL(__fxstat);
DARSHAN_REGISTER_POSIX_MOD(); tm1 = darshan_core_wtime();
tm1 = darshan_wtime();
ret = __real___fxstat(vers, fd, buf); ret = __real___fxstat(vers, fd, buf);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
if(ret < 0 || !S_ISREG(buf->st_mode)) if(ret < 0 || !S_ISREG(buf->st_mode))
return(ret); return(ret);
...@@ -793,14 +761,12 @@ ssize_t DARSHAN_DECL(pread64)(int fd, void *buf, size_t count, off64_t offset) ...@@ -793,14 +761,12 @@ ssize_t DARSHAN_DECL(pread64)(int fd, void *buf, size_t count, off64_t offset)
MAP_OR_FAIL(pread64); MAP_OR_FAIL(pread64);
DARSHAN_REGISTER_POSIX_MOD();
if((unsigned long)buf % darshan_mem_alignment == 0) if((unsigned long)buf % darshan_mem_alignment == 0)
aligned_flag = 1; aligned_flag = 1;
tm1 = darshan_wtime(); tm1 = darshan_core_wtime();
ret = __real_pread64(fd, buf, count, offset); ret = __real_pread64(fd, buf, count, offset);
tm2 = darshan_wtime(); tm2 = darshan_core_wtime();
CP_LOCK(); CP_LOCK();
CP_RECORD_READ(ret, fd, count, 1, offset, aligned_flag, 0, tm1, tm2); CP_RECORD_READ(ret, fd, count, 1, offset, aligned_flag, 0, tm1, tm2);
CP_UNLOCK(); CP_UNLOCK();
...@@ -815,14 +781,12 @@ ssize_t DARSHAN_DECL(pread)(int fd, void *buf, size_t count, off_t offset) ...@@ -815,14 +781,12 @@ ssize_t DARSHAN_DECL(pread)(int fd, void *buf, size_t count, off_t offset)
MAP_OR_FAIL(pread); MAP_OR_FAIL(pread);
DARSHAN_REGISTER_POSIX_MOD();
if((unsigned long)buf % darshan_mem_alignment == 0) if((unsigned long)buf % darshan_mem_alignment == 0)
aligned_flag = 1; aligned_flag = 1;
tm1 = darshan_wtime(); tm1 = darshan_core_wtime();
ret = __real_pread(fd, buf, count, offset); ret = __real_pread(fd, buf, count, offset);
tm2 = darshan_wtime();