Commit d2776592 authored by Shane Snyder's avatar Shane Snyder

more mpiio counters

parent 53fa81e8
......@@ -172,6 +172,12 @@ struct darshan_module_funcs
);
};
enum darshan_io_type
{
DARSHAN_IO_READ = 1,
DARSHAN_IO_WRITE = 2,
};
/* paths that darshan will not trace */
extern char* darshan_path_exclusions[]; /* defined in lib/darshan-core.c */
......
......@@ -56,6 +56,7 @@
struct mpiio_file_runtime
{
struct darshan_mpiio_file* file_record;
enum darshan_io_type last_io_type;
double last_meta_end;
double last_read_end;
double last_write_end;
......@@ -136,41 +137,52 @@ static void mpiio_shutdown(void);
#define MPIIO_RECORD_READ(__ret, __fh, __count, __datatype, __counter, __tm1, __tm2) do { \
struct mpiio_file_runtime* file; \
int size = 0; \
MPI_Aint extent = 0; \
double __elapsed = __tm2-__tm1; \
if(__ret != MPI_SUCCESS) break; \
file = mpiio_file_by_fh(__fh); \
if(!file) break; \
DARSHAN_MPI_CALL(PMPI_Type_size)(__datatype, &size); \
size = size * __count; \
DARSHAN_MPI_CALL(PMPI_Type_extent)(__datatype, &extent); \
DARSHAN_BUCKET_INC(file->file_record, MPIIO_SIZE_READ_AGG_0_100, size); \
DARSHAN_BUCKET_INC(file->file_record, MPIIO_EXTENT_READ_0_100, extent); \
DARSHAN_COUNTER_INC(file->file_record, MPIIO_BYTES_READ, size); \
DARSHAN_COUNTER_INC(file->file_record, __counter, 1); \
if(file->last_io_type == DARSHAN_IO_WRITE) \
DARSHAN_COUNTER_INC(file->file_record, MPIIO_RW_SWITCHES, 1); \
file->last_io_type = DARSHAN_IO_READ; \
DARSHAN_COUNTER_F_INC_NO_OVERLAP(file->file_record, __tm1, __tm2, \
file->last_read_end, MPIIO_F_READ_TIME); \
if(DARSHAN_COUNTER_F_VALUE(file->file_record, MPIIO_F_READ_START_TIMESTAMP) == 0) \
DARSHAN_COUNTER_F_SET(file->file_record, MPIIO_F_READ_START_TIMESTAMP, __tm1); \
DARSHAN_COUNTER_F_SET(file->file_record, MPIIO_F_READ_END_TIMESTAMP, __tm2); \
if(DARSHAN_COUNTER_F_VALUE(file->file_record, MPIIO_F_MAX_READ_TIME) < __elapsed) { \
DARSHAN_COUNTER_F_SET(file->file_record, MPIIO_F_MAX_READ_TIME, __elapsed); \
DARSHAN_COUNTER_SET(file->file_record, MPIIO_MAX_READ_TIME_SIZE, size); } \
} while(0)
#define MPIIO_RECORD_WRITE(__ret, __fh, __count, __datatype, __counter, __tm1, __tm2) do { \
struct mpiio_file_runtime* file; \
int size = 0; \
MPI_Aint extent = 0; \
double __elapsed = __tm2-__tm1; \
if(__ret != MPI_SUCCESS) break; \
if(__ret != MPI_SUCCESS) break; \
file = mpiio_file_by_fh(__fh); \
if(!file) break; \
DARSHAN_MPI_CALL(PMPI_Type_size)(__datatype, &size); \
size = size * __count; \
DARSHAN_MPI_CALL(PMPI_Type_extent)(__datatype, &extent); \
DARSHAN_BUCKET_INC(file->file_record, MPIIO_SIZE_WRITE_AGG_0_100, size); \
DARSHAN_BUCKET_INC(file->file_record, MPIIO_EXTENT_WRITE_0_100, extent); \
DARSHAN_COUNTER_INC(file->file_record, MPIIO_BYTES_WRITTEN, size); \
DARSHAN_COUNTER_INC(file->file_record, __counter, 1); \
if(file->last_io_type == DARSHAN_IO_READ) \
DARSHAN_COUNTER_INC(file->file_record, MPIIO_RW_SWITCHES, 1); \
file->last_io_type = DARSHAN_IO_WRITE; \
DARSHAN_COUNTER_F_INC_NO_OVERLAP(file->file_record, __tm1, __tm2, \
file->last_write_end, MPIIO_F_WRITE_TIME); \
if(DARSHAN_COUNTER_F_VALUE(file->file_record, MPIIO_F_WRITE_START_TIMESTAMP) == 0) \
DARSHAN_COUNTER_F_SET(file->file_record, MPIIO_F_WRITE_START_TIMESTAMP, __tm1); \
DARSHAN_COUNTER_F_SET(file->file_record, MPIIO_F_WRITE_END_TIMESTAMP, __tm2); \
if(DARSHAN_COUNTER_F_VALUE(file->file_record, MPIIO_F_MAX_WRITE_TIME) < __elapsed) { \
DARSHAN_COUNTER_F_SET(file->file_record, MPIIO_F_MAX_WRITE_TIME, __elapsed); \
DARSHAN_COUNTER_SET(file->file_record, MPIIO_MAX_WRITE_TIME_SIZE, size); } \
} while(0)
/**********************************************************
......
......@@ -96,12 +96,6 @@ DARSHAN_FORWARD_DECL(lio_listio64, int, (int mode, struct aiocb64 *const aiocb_l
*/
#define POSIX_MAX_ACCESS_COUNT_RUNTIME 32
enum posix_io_type
{
POSIX_READ = 1,
POSIX_WRITE = 2,
};
enum posix_counter_type
{
POSIX_COUNTER_ACCESS,
......@@ -151,7 +145,7 @@ struct posix_file_runtime
int64_t offset;
int64_t last_byte_read;
int64_t last_byte_written;
enum posix_io_type last_io_type;
enum darshan_io_type last_io_type;
double last_meta_end;
double last_read_end;
double last_write_end;
......@@ -336,9 +330,9 @@ static void posix_shutdown(void);
file_alignment = DARSHAN_COUNTER_VALUE(file->file_record, POSIX_FILE_ALIGNMENT); \
if(file_alignment > 0 && (this_offset % file_alignment) != 0) \
DARSHAN_COUNTER_INC(file->file_record, POSIX_FILE_NOT_ALIGNED, 1); \
if(file->last_io_type == POSIX_WRITE) \
if(file->last_io_type == DARSHAN_IO_WRITE) \
DARSHAN_COUNTER_INC(file->file_record, POSIX_RW_SWITCHES, 1); \
file->last_io_type = POSIX_READ; \
file->last_io_type = DARSHAN_IO_READ; \
DARSHAN_COUNTER_F_INC_NO_OVERLAP(file->file_record, __tm1, __tm2, file->last_read_end, POSIX_F_READ_TIME); \
if(DARSHAN_COUNTER_F_VALUE(file->file_record, POSIX_F_READ_START_TIMESTAMP) == 0) \
DARSHAN_COUNTER_F_SET(file->file_record, POSIX_F_READ_START_TIMESTAMP, __tm1); \
......@@ -386,9 +380,9 @@ static void posix_shutdown(void);
file_alignment = DARSHAN_COUNTER_VALUE(file->file_record, POSIX_FILE_ALIGNMENT); \
if(file_alignment > 0 && (this_offset % file_alignment) != 0) \
DARSHAN_COUNTER_INC(file->file_record, POSIX_FILE_NOT_ALIGNED, 1); \
if(file->last_io_type == POSIX_READ) \
if(file->last_io_type == DARSHAN_IO_READ) \
DARSHAN_COUNTER_INC(file->file_record, POSIX_RW_SWITCHES, 1); \
file->last_io_type = POSIX_WRITE; \
file->last_io_type = DARSHAN_IO_WRITE; \
DARSHAN_COUNTER_F_INC_NO_OVERLAP(file->file_record, __tm1, __tm2, file->last_write_end, POSIX_F_WRITE_TIME); \
if(DARSHAN_COUNTER_F_VALUE(file->file_record, POSIX_F_WRITE_START_TIMESTAMP) == 0) \
DARSHAN_COUNTER_F_SET(file->file_record, POSIX_F_WRITE_START_TIMESTAMP, __tm1); \
......
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