From 2f7158a5d4f63e3590260c2d06b105a5811f7b86 Mon Sep 17 00:00:00 2001 From: carns Date: Wed, 2 Jul 2014 17:34:13 +0000 Subject: [PATCH] change open timestamp behavior git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@898 3b7491f3-a168-0410-bf4b-c445ed680a29 --- ChangeLog | 5 +++++ darshan-runtime/lib/darshan-hdf5.c | 8 ++++++-- darshan-runtime/lib/darshan-mpi-io.c | 2 +- darshan-runtime/lib/darshan-pnetcdf.c | 8 ++++++-- darshan-runtime/lib/darshan-posix.c | 2 +- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ad6d87..859b75e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ Darshan Release Change Log -------------------------- +darshan-2.3.1-pre1 +============= +* Change OPEN_TIMESTAMP field to report timestamp right before open() is + invoked rather than after timestamp after open is completed + darshan-2.3.0 ============= * Fix incorrect version numbering in darshan-runtime component of Darshan diff --git a/darshan-runtime/lib/darshan-hdf5.c b/darshan-runtime/lib/darshan-hdf5.c index 9ff0739..979ab67 100644 --- a/darshan-runtime/lib/darshan-hdf5.c +++ b/darshan-runtime/lib/darshan-hdf5.c @@ -60,9 +60,11 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags, int ret; struct darshan_file_runtime* file; char* tmp; + double tm1; MAP_OR_FAIL(H5Fcreate); + tm1 = darshan_wtime(); ret = __real_H5Fcreate(filename, flags, create_plist, access_plist); if(ret >= 0) { @@ -82,7 +84,7 @@ hid_t DARSHAN_DECL(H5Fcreate)(const char *filename, unsigned flags, { if(CP_F_VALUE(file, CP_F_OPEN_TIMESTAMP) == 0) CP_F_SET(file, CP_F_OPEN_TIMESTAMP, - PMPI_Wtime()); + tm1); CP_INC(file, CP_HDF5_OPENS, 1); } CP_UNLOCK(); @@ -97,9 +99,11 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags, int ret; struct darshan_file_runtime* file; char* tmp; + double tm1; MAP_OR_FAIL(H5Fopen); + tm1 = darshan_wtime(); ret = __real_H5Fopen(filename, flags, access_plist); if(ret >= 0) { @@ -119,7 +123,7 @@ hid_t DARSHAN_DECL(H5Fopen)(const char *filename, unsigned flags, { if(CP_F_VALUE(file, CP_F_OPEN_TIMESTAMP) == 0) CP_F_SET(file, CP_F_OPEN_TIMESTAMP, - PMPI_Wtime()); + tm1); CP_INC(file, CP_HDF5_OPENS, 1); } diff --git a/darshan-runtime/lib/darshan-mpi-io.c b/darshan-runtime/lib/darshan-mpi-io.c index 002ac51..638bb43 100644 --- a/darshan-runtime/lib/darshan-mpi-io.c +++ b/darshan-runtime/lib/darshan-mpi-io.c @@ -711,7 +711,7 @@ int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_F CP_F_INC_NO_OVERLAP(file, tm1, tm2, file->last_mpi_meta_end, CP_F_MPI_META_TIME); if(CP_F_VALUE(file, CP_F_OPEN_TIMESTAMP) == 0) CP_F_SET(file, CP_F_OPEN_TIMESTAMP, - DARSHAN_MPI_CALL(PMPI_Wtime)()); + tm1); DARSHAN_MPI_CALL(PMPI_Comm_size)(comm, &comm_size); if(comm_size == 1) { diff --git a/darshan-runtime/lib/darshan-pnetcdf.c b/darshan-runtime/lib/darshan-pnetcdf.c index 907da21..cfad272 100644 --- a/darshan-runtime/lib/darshan-pnetcdf.c +++ b/darshan-runtime/lib/darshan-pnetcdf.c @@ -56,9 +56,11 @@ int DARSHAN_DECL(ncmpi_create)(MPI_Comm comm, const char *path, struct darshan_file_runtime* file; char* tmp; int comm_size; + double tm1; MAP_OR_FAIL(ncmpi_create); + tm1 = darshan_wtime(); ret = __real_ncmpi_create(comm, path, cmode, info, ncidp); if(ret == 0) { @@ -78,7 +80,7 @@ int DARSHAN_DECL(ncmpi_create)(MPI_Comm comm, const char *path, { if(CP_F_VALUE(file, CP_F_OPEN_TIMESTAMP) == 0) CP_F_SET(file, CP_F_OPEN_TIMESTAMP, - PMPI_Wtime()); + tm1); PMPI_Comm_size(comm, &comm_size); if(comm_size == 1) { @@ -102,9 +104,11 @@ int DARSHAN_DECL(ncmpi_open)(MPI_Comm comm, const char *path, struct darshan_file_runtime* file; char* tmp; int comm_size; + double tm1; MAP_OR_FAIL(ncmpi_open); + tm1 = darshan_wtime(); ret = __real_ncmpi_open(comm, path, omode, info, ncidp); if(ret == 0) { @@ -124,7 +128,7 @@ int DARSHAN_DECL(ncmpi_open)(MPI_Comm comm, const char *path, { if(CP_F_VALUE(file, CP_F_OPEN_TIMESTAMP) == 0) CP_F_SET(file, CP_F_OPEN_TIMESTAMP, - PMPI_Wtime()); + tm1); PMPI_Comm_size(comm, &comm_size); if(comm_size == 1) { diff --git a/darshan-runtime/lib/darshan-posix.c b/darshan-runtime/lib/darshan-posix.c index 78a0e4a..1771bf9 100644 --- a/darshan-runtime/lib/darshan-posix.c +++ b/darshan-runtime/lib/darshan-posix.c @@ -325,7 +325,7 @@ static struct darshan_aio_tracker* darshan_aio_tracker_del(int fd, void *aiocbp) else \ CP_INC(file, CP_POSIX_OPENS, 1); \ if(CP_F_VALUE(file, CP_F_OPEN_TIMESTAMP) == 0) \ - CP_F_SET(file, CP_F_OPEN_TIMESTAMP, posix_wtime()); \ + CP_F_SET(file, CP_F_OPEN_TIMESTAMP, __tm1); \ CP_F_INC_NO_OVERLAP(file, __tm1, __tm2, file->last_posix_meta_end, CP_F_POSIX_META_TIME); \ } while (0) -- 2.26.2