Commit 31e76e2c authored by Shane Snyder's avatar Shane Snyder
Browse files

update MPI-IO module to reflect recent changes

parent abf1d5ea
......@@ -35,8 +35,8 @@ CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir)
LIBS = -lz @LIBBZ2@
DARSHAN_STATIC_MOD_OBJS = lib/darshan-posix.o
# TODO: lib/darshan-mpiio.o lib/darshan-hdf5.o lib/darshan-pnetcdf.o
DARSHAN_STATIC_MOD_OBJS = lib/darshan-posix.o lib/darshan-mpiio.o
# TODO: lib/darshan-hdf5.o lib/darshan-pnetcdf.o
DARSHAN_DYNAMIC_MOD_OBJS = lib/darshan-posix.po lib/darshan-mpiio.po lib/darshan-hdf5.po lib/darshan-pnetcdf.po
ifdef DARSHAN_USE_BGQ
......
......@@ -22,74 +22,40 @@
#include <assert.h>
#include <pthread.h>
#include "uthash.h"
#include "darshan.h"
#include "darshan-dynamic.h"
/* The mpiio_file_runtime structure maintains necessary runtime metadata
/* The mpiio_file_record_ref structure maintains necessary runtime metadata
* for the MPIIO file record (darshan_mpiio_file structure, defined in
* darshan-mpiio-log-format.h) pointed to by 'file_record'. This metadata
* darshan-mpiio-log-format.h) pointed to by 'file_rec'. This metadata
* assists with the instrumenting of specific statistics in the file record.
* 'hlink' is a hash table link structure used to add/remove this record
* from the hash table of MPIIO file records for this process.
*
* RATIONALE: the MPIIO module needs to track some stateful, volatile
* information about each open file (like the current file offset, most recent
* access time, etc.) to aid in instrumentation, but this information can't be
* stored in the darshan_mpiio_file struct because we don't want it to appear in
* the final darshan log file. We therefore associate a mpiio_file_runtime
* struct with each darshan_mpiio_file struct in order to track this information.
*
* NOTE: There is a one-to-one mapping of mpiio_file_runtime structs to
* darshan_mpiio_file structs.
* the final darshan log file. We therefore associate a mpiio_file_record_ref
* struct with each darshan_mpiio_file struct in order to track this information
* (i.e., the mapping between mpiio_file_record_ref structs to darshan_mpiio_file
* structs is one-to-one).
*
* NOTE: The mpiio_file_runtime struct contains a pointer to a darshan_mpiio_file
* struct (see the *file_record member) rather than simply embedding an entire
* darshan_mpiio_file struct. This is done so that all of the darshan_mpiio_file
* structs can be kept contiguous in memory as a single array to simplify
* reduction, compression, and storage.
* NOTE: we use the 'darshan_record_ref' interface (in darshan-common) to
* associate different types of handles with this mpiio_file_record_ref struct.
* This allows us to index this struct (and the underlying file record) by using
* either the corresponding Darshan record identifier (derived from the filename)
* or by a generated MPI file handle, for instance. So, while there should only
* be a single Darshan record identifier that indexes a mpiio_file_record_ref,
* there could be multiple open file handles that index it.
*/
struct mpiio_file_runtime
struct mpiio_file_record_ref
{
struct darshan_mpiio_file* file_record;
struct darshan_mpiio_file *file_rec;
enum darshan_io_type last_io_type;
double last_meta_end;
double last_read_end;
double last_write_end;
void *access_root;
int access_count;
UT_hash_handle hlink;
};
/* The mpiio_file_runtime_ref structure is used to associate a MPIIO
* file handle with an already existing MPIIO file record. This is
* necessary as many MPIIO I/O functions take only a file handle as input,
* but MPIIO file records are indexed by their full file paths (i.e., darshan
* record identifiers for MPIIO files are created by hashing the file path).
* In other words, this structure is necessary as it allows us to look up a
* file record either by a pathname (mpiio_file_runtime) or by MPIIO file
* descriptor (mpiio_file_runtime_ref), depending on which parameters are
* available. This structure includes another hash table link, since separate
* hashes are maintained for mpiio_file_runtime structures and mpiio_file_runtime_ref
* structures.
*
* RATIONALE: In theory the file handle information could be included in the
* mpiio_file_runtime struct rather than in a separate structure here. The
* reason we don't do that is to handle the potential for an MPI implementation
* to produce a new file handle instance each time MPI_File_open() is called on a
* file. Thus there might be multiple file handles referring to the same
* underlying record.
*
* NOTE: there are potentially multiple mpiio_file_runtime_ref structures
* referring to a single mpiio_file_runtime structure. Most of the time there is
* only one, however.
*/
struct mpiio_file_runtime_ref
{
struct mpiio_file_runtime* file;
MPI_File fh;
UT_hash_handle hlink;
};
/* The mpiio_runtime structure maintains necessary state for storing
......@@ -98,92 +64,106 @@ struct mpiio_file_runtime_ref
*/
struct mpiio_runtime
{
struct mpiio_file_runtime* file_runtime_array;
struct darshan_mpiio_file* file_record_array;
int file_array_ndx;
struct mpiio_file_runtime* file_hash;
struct mpiio_file_runtime_ref* fh_hash;
void *rec_id_hash;
void *fh_hash;
int file_rec_count;
};
static void mpiio_runtime_initialize(
void);
static struct mpiio_file_record_ref *mpiio_track_new_file_record(
darshan_record_id rec_id, const char *path);
static int mpiio_record_compare(
const void* a, const void* b);
static void mpiio_finalize_file_records(
void *rec_ref_p);
static void mpiio_record_reduction_op(
void* infile_v, void* inoutfile_v, int *len, MPI_Datatype *datatype);
static void mpiio_shared_record_variance(
MPI_Comm mod_comm, struct darshan_mpiio_file *inrec_array,
struct darshan_mpiio_file *outrec_array, int shared_rec_count);
static void mpiio_cleanup_runtime(
void);
static void mpiio_shutdown(
MPI_Comm mod_comm, darshan_record_id *shared_recs,
int shared_rec_count, void **mpiio_buf, int *mpiio_buf_sz);
static struct mpiio_runtime *mpiio_runtime = NULL;
static pthread_mutex_t mpiio_runtime_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static int instrumentation_disabled = 0;
static int my_rank = -1;
static void mpiio_runtime_initialize(void);
static struct mpiio_file_runtime* mpiio_file_by_name(const char *name);
static struct mpiio_file_runtime* mpiio_file_by_name_setfh(const char* name, MPI_File fh);
static struct mpiio_file_runtime* mpiio_file_by_fh(MPI_File fh);
static void mpiio_file_close_fh(MPI_File fh);
static int mpiio_record_compare(const void* a, const void* b);
static void mpiio_record_reduction_op(void* infile_v, void* inoutfile_v,
int *len, MPI_Datatype *datatype);
static void mpiio_shared_record_variance(MPI_Comm mod_comm,
struct darshan_mpiio_file *inrec_array, struct darshan_mpiio_file *outrec_array,
int shared_rec_count);
static void mpiio_begin_shutdown(void);
static void mpiio_get_output_data(MPI_Comm mod_comm, darshan_record_id *shared_recs,
int shared_rec_count, void **mpiio_buf, int *mpiio_buf_sz);
static void mpiio_shutdown(void);
#define MPIIO_LOCK() pthread_mutex_lock(&mpiio_runtime_mutex)
#define MPIIO_UNLOCK() pthread_mutex_unlock(&mpiio_runtime_mutex)
#define MPIIO_PRE_RECORD() do { \
MPIIO_LOCK(); \
if(!mpiio_runtime && !instrumentation_disabled) mpiio_runtime_initialize(); \
if(!mpiio_runtime) { \
MPIIO_UNLOCK(); \
return(ret); \
} \
} while(0)
#define MPIIO_POST_RECORD() do { \
MPIIO_UNLOCK(); \
} while(0)
#define MPIIO_RECORD_READ(__ret, __fh, __count, __datatype, __counter, __tm1, __tm2) do { \
struct mpiio_file_runtime* file; \
struct mpiio_file_record_ref *rec_ref; \
int size = 0; \
double __elapsed = __tm2-__tm1; \
if(__ret != MPI_SUCCESS) break; \
file = mpiio_file_by_fh(__fh); \
if(!file) break; \
rec_ref = darshan_lookup_record_ref(mpiio_runtime->fh_hash, &(__fh), sizeof(MPI_File)); \
if(!rec_ref) break; \
DARSHAN_MPI_CALL(PMPI_Type_size)(__datatype, &size); \
size = size * __count; \
DARSHAN_BUCKET_INC(&(file->file_record->counters[MPIIO_SIZE_READ_AGG_0_100]), size); \
darshan_common_val_counter(&file->access_root, &file->access_count, size, \
&(file->file_record->counters[MPIIO_ACCESS1_ACCESS]), \
&(file->file_record->counters[MPIIO_ACCESS1_COUNT])); \
file->file_record->counters[MPIIO_BYTES_READ] += size; \
file->file_record->counters[__counter] += 1; \
if(file->last_io_type == DARSHAN_IO_WRITE) \
file->file_record->counters[MPIIO_RW_SWITCHES] += 1; \
file->last_io_type = DARSHAN_IO_READ; \
if(file->file_record->fcounters[MPIIO_F_READ_START_TIMESTAMP] == 0) \
file->file_record->fcounters[MPIIO_F_READ_START_TIMESTAMP] = __tm1; \
file->file_record->fcounters[MPIIO_F_READ_END_TIMESTAMP] = __tm2; \
if(file->file_record->fcounters[MPIIO_F_MAX_READ_TIME] < __elapsed) { \
file->file_record->fcounters[MPIIO_F_MAX_READ_TIME] = __elapsed; \
file->file_record->counters[MPIIO_MAX_READ_TIME_SIZE] = size; } \
DARSHAN_TIMER_INC_NO_OVERLAP(file->file_record->fcounters[MPIIO_F_READ_TIME], \
__tm1, __tm2, file->last_read_end); \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[MPIIO_SIZE_READ_AGG_0_100]), size); \
darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, size, \
&(rec_ref->file_rec->counters[MPIIO_ACCESS1_ACCESS]), \
&(rec_ref->file_rec->counters[MPIIO_ACCESS1_COUNT])); \
rec_ref->file_rec->counters[MPIIO_BYTES_READ] += size; \
rec_ref->file_rec->counters[__counter] += 1; \
if(rec_ref->last_io_type == DARSHAN_IO_WRITE) \
rec_ref->file_rec->counters[MPIIO_RW_SWITCHES] += 1; \
rec_ref->last_io_type = DARSHAN_IO_READ; \
if(rec_ref->file_rec->fcounters[MPIIO_F_READ_START_TIMESTAMP] == 0) \
rec_ref->file_rec->fcounters[MPIIO_F_READ_START_TIMESTAMP] = __tm1; \
rec_ref->file_rec->fcounters[MPIIO_F_READ_END_TIMESTAMP] = __tm2; \
if(rec_ref->file_rec->fcounters[MPIIO_F_MAX_READ_TIME] < __elapsed) { \
rec_ref->file_rec->fcounters[MPIIO_F_MAX_READ_TIME] = __elapsed; \
rec_ref->file_rec->counters[MPIIO_MAX_READ_TIME_SIZE] = size; } \
DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->file_rec->fcounters[MPIIO_F_READ_TIME], \
__tm1, __tm2, rec_ref->last_read_end); \
} while(0)
#define MPIIO_RECORD_WRITE(__ret, __fh, __count, __datatype, __counter, __tm1, __tm2) do { \
struct mpiio_file_runtime* file; \
struct mpiio_file_record_ref *rec_ref; \
int size = 0; \
double __elapsed = __tm2-__tm1; \
if(__ret != MPI_SUCCESS) break; \
file = mpiio_file_by_fh(__fh); \
if(!file) break; \
rec_ref = darshan_lookup_record_ref(mpiio_runtime->fh_hash, &(__fh), sizeof(MPI_File)); \
if(!rec_ref) break; \
DARSHAN_MPI_CALL(PMPI_Type_size)(__datatype, &size); \
size = size * __count; \
DARSHAN_BUCKET_INC(&(file->file_record->counters[MPIIO_SIZE_WRITE_AGG_0_100]), size); \
darshan_common_val_counter(&file->access_root, &file->access_count, size, \
&(file->file_record->counters[MPIIO_ACCESS1_ACCESS]), \
&(file->file_record->counters[MPIIO_ACCESS1_COUNT])); \
file->file_record->counters[MPIIO_BYTES_WRITTEN] += size; \
file->file_record->counters[__counter] += 1; \
if(file->last_io_type == DARSHAN_IO_READ) \
file->file_record->counters[MPIIO_RW_SWITCHES] += 1; \
file->last_io_type = DARSHAN_IO_WRITE; \
if(file->file_record->fcounters[MPIIO_F_WRITE_START_TIMESTAMP] == 0) \
file->file_record->fcounters[MPIIO_F_WRITE_START_TIMESTAMP] = __tm1; \
file->file_record->fcounters[MPIIO_F_WRITE_END_TIMESTAMP] = __tm2; \
if(file->file_record->fcounters[MPIIO_F_MAX_WRITE_TIME] < __elapsed) { \
file->file_record->fcounters[MPIIO_F_MAX_WRITE_TIME] = __elapsed; \
file->file_record->counters[MPIIO_MAX_WRITE_TIME_SIZE] = size; } \
DARSHAN_TIMER_INC_NO_OVERLAP(file->file_record->fcounters[MPIIO_F_WRITE_TIME], \
__tm1, __tm2, file->last_write_end); \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[MPIIO_SIZE_WRITE_AGG_0_100]), size); \
darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, size, \
&(rec_ref->file_rec->counters[MPIIO_ACCESS1_ACCESS]), \
&(rec_ref->file_rec->counters[MPIIO_ACCESS1_COUNT])); \
rec_ref->file_rec->counters[MPIIO_BYTES_WRITTEN] += size; \
rec_ref->file_rec->counters[__counter] += 1; \
if(rec_ref->last_io_type == DARSHAN_IO_READ) \
rec_ref->file_rec->counters[MPIIO_RW_SWITCHES] += 1; \
rec_ref->last_io_type = DARSHAN_IO_WRITE; \
if(rec_ref->file_rec->fcounters[MPIIO_F_WRITE_START_TIMESTAMP] == 0) \
rec_ref->file_rec->fcounters[MPIIO_F_WRITE_START_TIMESTAMP] = __tm1; \
rec_ref->file_rec->fcounters[MPIIO_F_WRITE_END_TIMESTAMP] = __tm2; \
if(rec_ref->file_rec->fcounters[MPIIO_F_MAX_WRITE_TIME] < __elapsed) { \
rec_ref->file_rec->fcounters[MPIIO_F_MAX_WRITE_TIME] = __elapsed; \
rec_ref->file_rec->counters[MPIIO_MAX_WRITE_TIME_SIZE] = size; } \
DARSHAN_TIMER_INC_NO_OVERLAP(rec_ref->file_rec->fcounters[MPIIO_F_WRITE_TIME], \
__tm1, __tm2, rec_ref->last_write_end); \
} while(0)
/**********************************************************
......@@ -197,9 +177,11 @@ int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_F
#endif
{
int ret;
struct mpiio_file_runtime* file;
char* tmp;
int comm_size;
darshan_record_id rec_id;
struct mpiio_file_record_ref *rec_ref;
char *newpath;
double tm1, tm2;
tm1 = darshan_core_wtime();
......@@ -208,9 +190,6 @@ int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_F
if(ret == MPI_SUCCESS)
{
MPIIO_LOCK();
mpiio_runtime_initialize();
/* use ROMIO approach to strip prefix if present */
/* strip off prefix if there is one, but only skip prefixes
* if they are greater than length one to allow for windows
......@@ -221,31 +200,53 @@ int MPI_File_open(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_F
filename = tmp + 1;
}
file = mpiio_file_by_name_setfh(filename, (*fh));
if(file)
MPIIO_PRE_RECORD();
/* cleanup pathname and check whether we should ignore it */
newpath = darshan_clean_file_path(filename);
if(!newpath) newpath = (char *)filename;
if(darshan_core_excluded_path(newpath))
{
if(newpath != filename) free(newpath);
return(ret);
}
/* lookup the corresponding record, and create a new one if one
* does not exist
*/
rec_id = darshan_core_gen_record_id(newpath);
rec_ref = darshan_lookup_record_ref(mpiio_runtime->rec_id_hash, &rec_id,
sizeof(darshan_record_id));
if(!rec_ref) rec_ref = mpiio_track_new_file_record(rec_id, newpath);
if(rec_ref)
{
file->file_record->counters[MPIIO_MODE] = amode;
rec_ref->file_rec->counters[MPIIO_MODE] = amode;
DARSHAN_MPI_CALL(PMPI_Comm_size)(comm, &comm_size);
if(comm_size == 1)
{
file->file_record->counters[MPIIO_INDEP_OPENS] += 1;
rec_ref->file_rec->counters[MPIIO_INDEP_OPENS] += 1;
}
else
{
file->file_record->counters[MPIIO_COLL_OPENS] += 1;
rec_ref->file_rec->counters[MPIIO_COLL_OPENS] += 1;
}
if(info != MPI_INFO_NULL)
{
file->file_record->counters[MPIIO_HINTS] += 1;
rec_ref->file_rec->counters[MPIIO_HINTS] += 1;
}
if(file->file_record->fcounters[MPIIO_F_OPEN_TIMESTAMP] == 0)
file->file_record->fcounters[MPIIO_F_OPEN_TIMESTAMP] = tm1;
if(rec_ref->file_rec->fcounters[MPIIO_F_OPEN_TIMESTAMP] == 0)
rec_ref->file_rec->fcounters[MPIIO_F_OPEN_TIMESTAMP] = tm1;
DARSHAN_TIMER_INC_NO_OVERLAP(
file->file_record->fcounters[MPIIO_F_META_TIME],
tm1, tm2, file->last_meta_end);
rec_ref->file_rec->fcounters[MPIIO_F_META_TIME],
tm1, tm2, rec_ref->last_meta_end);
/* add a new record reference based on the MPI file handle */
darshan_add_record_ref(&(mpiio_runtime->fh_hash), fh,
sizeof(MPI_File), rec_ref);
}
MPIIO_UNLOCK();
if(newpath != filename) free(newpath);
MPIIO_POST_RECORD();
}
return(ret);
......@@ -261,10 +262,10 @@ int MPI_File_read(MPI_File fh, void *buf, int count,
ret = DARSHAN_MPI_CALL(PMPI_File_read)(fh, buf, count, datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_READ(ret, fh, count, datatype, MPIIO_INDEP_READS, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -283,10 +284,10 @@ int MPI_File_write(MPI_File fh, void *buf, int count,
ret = DARSHAN_MPI_CALL(PMPI_File_write)(fh, buf, count, datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_WRITE(ret, fh, count, datatype, MPIIO_INDEP_WRITES, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -301,10 +302,10 @@ int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf,
count, datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_READ(ret, fh, count, datatype, MPIIO_INDEP_READS, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -324,10 +325,10 @@ int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf,
count, datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_WRITE(ret, fh, count, datatype, MPIIO_INDEP_WRITES, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -341,10 +342,10 @@ int MPI_File_read_all(MPI_File fh, void * buf, int count, MPI_Datatype datatype,
datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_READ(ret, fh, count, datatype, MPIIO_COLL_READS, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -362,10 +363,10 @@ int MPI_File_write_all(MPI_File fh, void * buf, int count, MPI_Datatype datatype
datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_WRITE(ret, fh, count, datatype, MPIIO_COLL_WRITES, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -380,10 +381,10 @@ int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void * buf,
count, datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_READ(ret, fh, count, datatype, MPIIO_COLL_READS, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -403,10 +404,10 @@ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void * buf,
count, datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_WRITE(ret, fh, count, datatype, MPIIO_COLL_WRITES, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -420,10 +421,10 @@ int MPI_File_read_shared(MPI_File fh, void * buf, int count, MPI_Datatype dataty
datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_READ(ret, fh, count, datatype, MPIIO_INDEP_READS, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -441,10 +442,10 @@ int MPI_File_write_shared(MPI_File fh, void * buf, int count, MPI_Datatype datat
datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_WRITE(ret, fh, count, datatype, MPIIO_INDEP_WRITES, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -459,10 +460,10 @@ int MPI_File_read_ordered(MPI_File fh, void * buf, int count,
datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_READ(ret, fh, count, datatype, MPIIO_COLL_READS, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -482,10 +483,10 @@ int MPI_File_write_ordered(MPI_File fh, void * buf, int count,
datatype, status);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_WRITE(ret, fh, count, datatype, MPIIO_COLL_WRITES, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -498,10 +499,10 @@ int MPI_File_read_all_begin(MPI_File fh, void * buf, int count, MPI_Datatype dat
ret = DARSHAN_MPI_CALL(PMPI_File_read_all_begin)(fh, buf, count, datatype);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_READ(ret, fh, count, datatype, MPIIO_SPLIT_READS, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -518,10 +519,10 @@ int MPI_File_write_all_begin(MPI_File fh, void * buf, int count, MPI_Datatype da
ret = DARSHAN_MPI_CALL(PMPI_File_write_all_begin)(fh, buf, count, datatype);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_WRITE(ret, fh, count, datatype, MPIIO_SPLIT_WRITES, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -536,10 +537,10 @@ int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void * buf,
count, datatype);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_READ(ret, fh, count, datatype, MPIIO_SPLIT_READS, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -559,10 +560,10 @@ int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void * buf,
buf, count, datatype);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_WRITE(ret, fh, count, datatype, MPIIO_SPLIT_WRITES, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -576,10 +577,10 @@ int MPI_File_read_ordered_begin(MPI_File fh, void * buf, int count, MPI_Datatype
datatype);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_READ(ret, fh, count, datatype, MPIIO_SPLIT_READS, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -597,10 +598,10 @@ int MPI_File_write_ordered_begin(MPI_File fh, void * buf, int count, MPI_Datatyp
datatype);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_WRITE(ret, fh, count, datatype, MPIIO_SPLIT_WRITES, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -613,10 +614,10 @@ int MPI_File_iread(MPI_File fh, void * buf, int count, MPI_Datatype datatype, __
ret = DARSHAN_MPI_CALL(PMPI_File_iread)(fh, buf, count, datatype, request);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_READ(ret, fh, count, datatype, MPIIO_NB_READS, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -635,10 +636,10 @@ int MPI_File_iwrite(MPI_File fh, void * buf, int count,
ret = DARSHAN_MPI_CALL(PMPI_File_iwrite)(fh, buf, count, datatype, request);
tm2 = darshan_core_wtime();
MPIIO_LOCK();
mpiio_runtime_initialize();
MPIIO_PRE_RECORD();
MPIIO_RECORD_WRITE(ret, fh, count, datatype, MPIIO_NB_WRITES, tm1, tm2);
MPIIO_UNLOCK();
MPIIO_POST_RECORD();
return(ret);
}
......@@ -653,10 +654,10 @@ int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void * buf,