Commit e0eb27be authored by Shane Snyder's avatar Shane Snyder

xmacro posix/mpiio counters to maintain ordering

parent d2776592
......@@ -9,84 +9,126 @@
#include "darshan-log-format.h"
/* TODO: slowest/fastest rank (f)counters */
/* TODO: access size and extent common counters? */
#define MPIIO_COUNTERS \
/* count of MPI independent opens */\
X(MPIIO_INDEP_OPENS) \
/* count of MPI collective opens */\
X(MPIIO_COLL_OPENS) \
/* count of MPI independent reads */\
X(MPIIO_INDEP_READS) \
/* count of MPI independent writes */\
X(MPIIO_INDEP_WRITES) \
/* count of MPI collective reads */\
X(MPIIO_COLL_READS) \
/* count of MPI collective writes */\
X(MPIIO_COLL_WRITES) \
/* count of MPI split collective reads */\
X(MPIIO_SPLIT_READS) \
/* count of MPI split collective writes */\
X(MPIIO_SPLIT_WRITES) \
/* count of MPI nonblocking reads */\
X(MPIIO_NB_READS) \
/* count of MPI nonblocking writes */\
X(MPIIO_NB_WRITES) \
/* count of MPI file syncs */\
X(MPIIO_SYNCS) \
/* count of MPI hints used */\
X(MPIIO_HINTS) \
/* count of MPI set view calls */\
X(MPIIO_VIEWS) \
/* total bytes read at MPI-IO layer */\
X(MPIIO_BYTES_READ) \
/* total bytes written at MPI-IO layer */\
X(MPIIO_BYTES_WRITTEN) \
/* number of times switching between MPI read and write */\
X(MPIIO_RW_SWITCHES) \
/* sizes of the maximum read/write operations */\
X(MPIIO_MAX_READ_TIME_SIZE) \
X(MPIIO_MAX_WRITE_TIME_SIZE) \
/* buckets for MPI read size ranges */\
X(MPIIO_SIZE_READ_AGG_0_100) \
X(MPIIO_SIZE_READ_AGG_100_1K) \
X(MPIIO_SIZE_READ_AGG_1K_10K) \
X(MPIIO_SIZE_READ_AGG_10K_100K) \
X(MPIIO_SIZE_READ_AGG_100K_1M) \
X(MPIIO_SIZE_READ_AGG_1M_4M) \
X(MPIIO_SIZE_READ_AGG_4M_10M) \
X(MPIIO_SIZE_READ_AGG_10M_100M) \
X(MPIIO_SIZE_READ_AGG_100M_1G) \
X(MPIIO_SIZE_READ_AGG_1G_PLUS) \
/* buckets for MPI write size ranges */\
X(MPIIO_SIZE_WRITE_AGG_0_100) \
X(MPIIO_SIZE_WRITE_AGG_100_1K) \
X(MPIIO_SIZE_WRITE_AGG_1K_10K) \
X(MPIIO_SIZE_WRITE_AGG_10K_100K) \
X(MPIIO_SIZE_WRITE_AGG_100K_1M) \
X(MPIIO_SIZE_WRITE_AGG_1M_4M) \
X(MPIIO_SIZE_WRITE_AGG_4M_10M) \
X(MPIIO_SIZE_WRITE_AGG_10M_100M) \
X(MPIIO_SIZE_WRITE_AGG_100M_1G) \
X(MPIIO_SIZE_WRITE_AGG_1G_PLUS) \
/* rank and number of bytes moved for fastest/slowest ranks */\
X(MPIIO_FASTEST_RANK) \
X(MPIIO_FASTEST_RANK_BYTES) \
X(MPIIO_SLOWEST_RANK) \
X(MPIIO_SLOWEST_RANK_BYTES) \
/* end of counters */\
X(MPIIO_NUM_INDICES)
#define MPIIO_F_COUNTERS \
/* timestamp of first open */\
X(MPIIO_F_OPEN_TIMESTAMP) \
/* timestamp of first read */\
X(MPIIO_F_READ_START_TIMESTAMP) \
/* timestamp of first write */\
X(MPIIO_F_WRITE_START_TIMESTAMP) \
/* timestamp of last read */\
X(MPIIO_F_READ_END_TIMESTAMP) \
/* timestamp of last write */\
X(MPIIO_F_WRITE_END_TIMESTAMP) \
/* timestamp of last close */\
X(MPIIO_F_CLOSE_TIMESTAMP) \
/* cumulative MPI-IO read time */\
X(MPIIO_F_READ_TIME) \
/* cumulative MPI-IO write time */\
X(MPIIO_F_WRITE_TIME) \
/* cumulative MPI-IO meta time */\
X(MPIIO_F_META_TIME) \
/* maximum MPI-IO read duration */\
X(MPIIO_F_MAX_READ_TIME) \
/* maximum MPI-IO write duration */\
X(MPIIO_F_MAX_WRITE_TIME) \
/* total i/o and meta time for fastest/slowest ranks */\
X(MPIIO_F_FASTEST_RANK_TIME) \
X(MPIIO_F_SLOWEST_RANK_TIME) \
/* end of counters*/\
X(MPIIO_F_NUM_INDICES)
#define X(a) a,
/* integer statistics for MPI-IO file records */
enum darshan_mpiio_indices
{
MPIIO_INDEP_OPENS, /* count of MPI independent opens */
MPIIO_COLL_OPENS, /* count of MPI collective opens */
MPIIO_INDEP_READS, /* count of MPI independent reads */
MPIIO_INDEP_WRITES, /* count of MPI independent writes */
MPIIO_COLL_READS, /* count of MPI collective reads */
MPIIO_COLL_WRITES, /* count of MPI collective writes */
MPIIO_SPLIT_READS, /* count of MPI split collective reads */
MPIIO_SPLIT_WRITES, /* count of MPI split collective writes */
MPIIO_NB_READS, /* count of MPI nonblocking reads */
MPIIO_NB_WRITES, /* count of MPI nonblocking writes */
MPIIO_SYNCS, /* count of MPI file syncs */
MPIIO_HINTS, /* count of MPI hints used */
MPIIO_VIEWS, /* count of MPI set view calls */
/* buckets */
MPIIO_SIZE_READ_AGG_0_100, /* count of MPI read size ranges */
MPIIO_SIZE_READ_AGG_100_1K,
MPIIO_SIZE_READ_AGG_1K_10K,
MPIIO_SIZE_READ_AGG_10K_100K,
MPIIO_SIZE_READ_AGG_100K_1M,
MPIIO_SIZE_READ_AGG_1M_4M,
MPIIO_SIZE_READ_AGG_4M_10M,
MPIIO_SIZE_READ_AGG_10M_100M,
MPIIO_SIZE_READ_AGG_100M_1G,
MPIIO_SIZE_READ_AGG_1G_PLUS,
/* buckets */
MPIIO_SIZE_WRITE_AGG_0_100, /* count of MPI write size ranges */
MPIIO_SIZE_WRITE_AGG_100_1K,
MPIIO_SIZE_WRITE_AGG_1K_10K,
MPIIO_SIZE_WRITE_AGG_10K_100K,
MPIIO_SIZE_WRITE_AGG_100K_1M,
MPIIO_SIZE_WRITE_AGG_1M_4M,
MPIIO_SIZE_WRITE_AGG_4M_10M,
MPIIO_SIZE_WRITE_AGG_10M_100M,
MPIIO_SIZE_WRITE_AGG_100M_1G,
MPIIO_SIZE_WRITE_AGG_1G_PLUS,
/* buckets */
MPIIO_EXTENT_READ_0_100, /* count of MPI read extent ranges */
MPIIO_EXTENT_READ_100_1K,
MPIIO_EXTENT_READ_1K_10K,
MPIIO_EXTENT_READ_10K_100K,
MPIIO_EXTENT_READ_100K_1M,
MPIIO_EXTENT_READ_1M_4M,
MPIIO_EXTENT_READ_4M_10M,
MPIIO_EXTENT_READ_10M_100M,
MPIIO_EXTENT_READ_100M_1G,
MPIIO_EXTENT_READ_1G_PLUS,
/* buckets */
MPIIO_EXTENT_WRITE_0_100, /* count of MPI write extent ranges */
MPIIO_EXTENT_WRITE_100_1K,
MPIIO_EXTENT_WRITE_1K_10K,
MPIIO_EXTENT_WRITE_10K_100K,
MPIIO_EXTENT_WRITE_100K_1M,
MPIIO_EXTENT_WRITE_1M_4M,
MPIIO_EXTENT_WRITE_4M_10M,
MPIIO_EXTENT_WRITE_10M_100M,
MPIIO_EXTENT_WRITE_100M_1G,
MPIIO_EXTENT_WRITE_1G_PLUS,
MPIIO_NUM_INDICES,
MPIIO_COUNTERS
};
/* floating point statistics for MPI-IO file records */
enum darshan_mpiio_f_indices
{
MPIIO_F_OPEN_TIMESTAMP,
MPIIO_F_READ_START_TIMESTAMP,
MPIIO_F_WRITE_START_TIMESTAMP,
MPIIO_F_READ_END_TIMESTAMP,
MPIIO_F_WRITE_END_TIMESTAMP,
MPIIO_F_CLOSE_TIMESTAMP,
MPIIO_F_READ_TIME,
MPIIO_F_WRITE_TIME,
MPIIO_F_META_TIME,
MPIIO_F_NUM_INDICES,
MPIIO_F_COUNTERS
};
#undef X
/* file record structure for MPI-IO files. a record is created and stored for
* every MPI-IO file opened by the original application. For the MPI-IO module,
* the record includes:
* - a corresponding record identifier (created by hashing the file path)
* - the rank of the process which opened the file (-1 for shared files)
* - integer file I/O statistics (open, read/write counts, etc)
* - floating point I/O statistics (timestamps, cumulative timers, etc.)
*/
struct darshan_mpiio_file
{
darshan_record_id f_id;
......
......@@ -8,112 +8,155 @@
#include "darshan-log-format.h"
/* TODO: X macro this stuff so counter indices and string names don't diverge */
/* TODO we need to be able to run more reduction operations to get
* time and byte variances for shared files. currently, darshan-core
* just runs a single reduction, which is used to reduce all other
* shared record fields. (VARIANCE_RANK_TIME, VARIANCE_RANK_BYTES) */
#define POSIX_COUNTERS \
/* count of posix opens */\
X(POSIX_OPENS) \
/* count of posix reads */\
X(POSIX_READS) \
/* count of posix writes */\
X(POSIX_WRITES) \
/* count of posix seeks */\
X(POSIX_SEEKS) \
/* count of posix stat/lstat/fstats */\
X(POSIX_STATS) \
/* count of posix mmaps */\
X(POSIX_MMAPS) \
/* count of posix fopens */\
X(POSIX_FOPENS) \
/* count of posix freads */\
X(POSIX_FREADS) \
/* count of posix fwrites */\
X(POSIX_FWRITES) \
/* count of posix fseeks */\
X(POSIX_FSEEKS) \
/* count of posix fsyncs */\
X(POSIX_FSYNCS) \
/* count of posix fdatasyncs */\
X(POSIX_FDSYNCS) \
/* mode of file */\
X(POSIX_MODE) \
/* total bytes read */\
X(POSIX_BYTES_READ) \
/* total bytes written */\
X(POSIX_BYTES_WRITTEN) \
/* highest offset byte read */\
X(POSIX_MAX_BYTE_READ) \
/* highest offset byte written */\
X(POSIX_MAX_BYTE_WRITTEN) \
/* count of consecutive reads */\
X(POSIX_CONSEC_READS) \
/* count of consecutive writes */\
X(POSIX_CONSEC_WRITES) \
/* count of sequential reads */\
X(POSIX_SEQ_READS) \
/* count of sequential writes */\
X(POSIX_SEQ_WRITES) \
/* number of times switched between read and write */\
X(POSIX_RW_SWITCHES) \
/* count of accesses not mem aligned */\
X(POSIX_MEM_NOT_ALIGNED) \
/* mem alignment in bytes */\
X(POSIX_MEM_ALIGNMENT) \
/* count of accesses not file aligned */\
X(POSIX_FILE_NOT_ALIGNED) \
/* file alignment in bytes */\
X(POSIX_FILE_ALIGNMENT) \
X(POSIX_MAX_READ_TIME_SIZE) \
X(POSIX_MAX_WRITE_TIME_SIZE) \
/* buckets for POSIX read size ranges */\
X(POSIX_SIZE_READ_0_100) \
X(POSIX_SIZE_READ_100_1K) \
X(POSIX_SIZE_READ_1K_10K) \
X(POSIX_SIZE_READ_10K_100K) \
X(POSIX_SIZE_READ_100K_1M) \
X(POSIX_SIZE_READ_1M_4M) \
X(POSIX_SIZE_READ_4M_10M) \
X(POSIX_SIZE_READ_10M_100M) \
X(POSIX_SIZE_READ_100M_1G) \
X(POSIX_SIZE_READ_1G_PLUS) \
/* buckets for POSIX write size ranges */\
X(POSIX_SIZE_WRITE_0_100) \
X(POSIX_SIZE_WRITE_100_1K) \
X(POSIX_SIZE_WRITE_1K_10K) \
X(POSIX_SIZE_WRITE_10K_100K) \
X(POSIX_SIZE_WRITE_100K_1M) \
X(POSIX_SIZE_WRITE_1M_4M) \
X(POSIX_SIZE_WRITE_4M_10M) \
X(POSIX_SIZE_WRITE_10M_100M) \
X(POSIX_SIZE_WRITE_100M_1G) \
X(POSIX_SIZE_WRITE_1G_PLUS) \
/* the four most frequently appearing strides */\
X(POSIX_STRIDE1_STRIDE) \
X(POSIX_STRIDE2_STRIDE) \
X(POSIX_STRIDE3_STRIDE) \
X(POSIX_STRIDE4_STRIDE) \
/* count of each of the most frequent strides */\
X(POSIX_STRIDE1_COUNT) \
X(POSIX_STRIDE2_COUNT) \
X(POSIX_STRIDE3_COUNT) \
X(POSIX_STRIDE4_COUNT) \
/* the four most frequently appearing access sizes */\
X(POSIX_ACCESS1_ACCESS) \
X(POSIX_ACCESS2_ACCESS) \
X(POSIX_ACCESS3_ACCESS) \
X(POSIX_ACCESS4_ACCESS) \
/* count of each of the most frequent access sizes */\
X(POSIX_ACCESS1_COUNT) \
X(POSIX_ACCESS2_COUNT) \
X(POSIX_ACCESS3_COUNT) \
X(POSIX_ACCESS4_COUNT) \
X(POSIX_FASTEST_RANK) \
X(POSIX_FASTEST_RANK_BYTES) \
X(POSIX_SLOWEST_RANK) \
X(POSIX_SLOWEST_RANK_BYTES) \
/* end of counters */\
X(POSIX_NUM_INDICES)
#define POSIX_F_COUNTERS \
/* timestamp of first open */\
X(POSIX_F_OPEN_TIMESTAMP) \
/* timestamp of first read */\
X(POSIX_F_READ_START_TIMESTAMP) \
/* timestamp of first write */\
X(POSIX_F_WRITE_START_TIMESTAMP) \
/* timestamp of last read */\
X(POSIX_F_READ_END_TIMESTAMP) \
/* timestamp of last write */\
X(POSIX_F_WRITE_END_TIMESTAMP) \
/* timestamp of last close */\
X(POSIX_F_CLOSE_TIMESTAMP) \
/* cumulative posix read time */\
X(POSIX_F_READ_TIME) \
/* cumulative posix write time */\
X(POSIX_F_WRITE_TIME) \
/* cumulative posix meta time */\
X(POSIX_F_META_TIME) \
X(POSIX_F_MAX_READ_TIME) \
X(POSIX_F_MAX_WRITE_TIME) \
/* total i/o and meta time consumed for fastest/slowest ranks */\
X(POSIX_F_FASTEST_RANK_TIME) \
X(POSIX_F_SLOWEST_RANK_TIME) \
/* end of counters */\
X(POSIX_F_NUM_INDICES)
#define X(a) a,
/* integer statistics for POSIX file records */
enum darshan_posix_indices
{
POSIX_OPENS, /* count of posix opens */
POSIX_READS, /* count of posix reads */
POSIX_WRITES, /* count of posix writes */
POSIX_SEEKS, /* count of posix seeks */
POSIX_STATS, /* count of posix stat/lstat/fstats */
POSIX_MMAPS, /* count of posix mmaps */
POSIX_FOPENS, /* count of posix fopens */
POSIX_FREADS, /* count of posix freads */
POSIX_FWRITES, /* count of posix fwrites */
POSIX_FSEEKS, /* count of posix fseeks */
POSIX_FSYNCS, /* count of posix fsyncs */
POSIX_FDSYNCS, /* count of posix fdatasyncs */
POSIX_MODE, /* mode of file */
POSIX_BYTES_READ, /* total bytes read */
POSIX_BYTES_WRITTEN, /* total bytes written */
POSIX_MAX_BYTE_READ, /* highest offset byte read */
POSIX_MAX_BYTE_WRITTEN, /* highest offset byte written */
POSIX_CONSEC_READS, /* count of consecutive reads */
POSIX_CONSEC_WRITES, /* count of consecutive writes */
POSIX_SEQ_READS, /* count of sequential reads */
POSIX_SEQ_WRITES, /* count of sequential writes */
POSIX_RW_SWITCHES, /* number of times switched between read and write */
POSIX_MEM_NOT_ALIGNED, /* count of accesses not mem aligned */
POSIX_MEM_ALIGNMENT, /* mem alignment in bytes */
POSIX_FILE_NOT_ALIGNED, /* count of accesses not file aligned */
POSIX_FILE_ALIGNMENT, /* file alignment in bytes */
POSIX_MAX_READ_TIME_SIZE,
POSIX_MAX_WRITE_TIME_SIZE,
/* buckets */
POSIX_SIZE_READ_0_100, /* count of posix read size ranges */
POSIX_SIZE_READ_100_1K,
POSIX_SIZE_READ_1K_10K,
POSIX_SIZE_READ_10K_100K,
POSIX_SIZE_READ_100K_1M,
POSIX_SIZE_READ_1M_4M,
POSIX_SIZE_READ_4M_10M,
POSIX_SIZE_READ_10M_100M,
POSIX_SIZE_READ_100M_1G,
POSIX_SIZE_READ_1G_PLUS,
/* buckets */
POSIX_SIZE_WRITE_0_100, /* count of posix write size ranges */
POSIX_SIZE_WRITE_100_1K,
POSIX_SIZE_WRITE_1K_10K,
POSIX_SIZE_WRITE_10K_100K,
POSIX_SIZE_WRITE_100K_1M,
POSIX_SIZE_WRITE_1M_4M,
POSIX_SIZE_WRITE_4M_10M,
POSIX_SIZE_WRITE_10M_100M,
POSIX_SIZE_WRITE_100M_1G,
POSIX_SIZE_WRITE_1G_PLUS,
/* stride/access counters */
POSIX_STRIDE1_STRIDE, /* the four most frequently appearing strides */
POSIX_STRIDE2_STRIDE,
POSIX_STRIDE3_STRIDE,
POSIX_STRIDE4_STRIDE,
POSIX_STRIDE1_COUNT, /* count of each of the most frequent strides */
POSIX_STRIDE2_COUNT,
POSIX_STRIDE3_COUNT,
POSIX_STRIDE4_COUNT,
POSIX_ACCESS1_ACCESS, /* the four most frequently appearing access sizes */
POSIX_ACCESS2_ACCESS,
POSIX_ACCESS3_ACCESS,
POSIX_ACCESS4_ACCESS,
POSIX_ACCESS1_COUNT, /* count of each of the most frequent access sizes */
POSIX_ACCESS2_COUNT,
POSIX_ACCESS3_COUNT,
POSIX_ACCESS4_COUNT,
POSIX_FASTEST_RANK,
POSIX_FASTEST_RANK_BYTES,
POSIX_SLOWEST_RANK,
POSIX_SLOWEST_RANK_BYTES,
POSIX_NUM_INDICES,
POSIX_COUNTERS
};
/* floating point statistics for POSIX file records */
enum darshan_posix_f_indices
{
POSIX_F_OPEN_TIMESTAMP = 0, /* timestamp of first open */
POSIX_F_READ_START_TIMESTAMP, /* timestamp of first read */
POSIX_F_WRITE_START_TIMESTAMP, /* timestamp of first write */
POSIX_F_READ_END_TIMESTAMP, /* timestamp of last read */
POSIX_F_WRITE_END_TIMESTAMP, /* timestamp of last write */
POSIX_F_CLOSE_TIMESTAMP, /* timestamp of last close */
POSIX_F_READ_TIME, /* cumulative posix read time */
POSIX_F_WRITE_TIME, /* cumulative posix write time */
POSIX_F_META_TIME, /* cumulative posix meta time */
POSIX_F_MAX_READ_TIME,
POSIX_F_MAX_WRITE_TIME,
/* Total I/O and meta time consumed by fastest and slowest ranks */
POSIX_F_FASTEST_RANK_TIME,
POSIX_F_SLOWEST_RANK_TIME,
/* TODO we need to be able to run more reduction operations to get
* time and byte variances for shared files. currently, darshan-core
* just runs a single reduction, which is used to reduce all other
* shared record fields. */
//F_VARIANCE_RANK_TIME,
//F_VARIANCE_RANK_BYTES,
POSIX_F_NUM_INDICES,
POSIX_F_COUNTERS
};
#undef X
/* file record structure for POSIX files. a record is created and stored for
* every POSIX file opened by the original application. For the POSIX module,
......
......@@ -19,6 +19,17 @@
#include "darshan-mpiio-logutils.h"
/* counter name strings for the MPI-IO module */
#define X(a) #a,
char *mpiio_counter_names[] = {
MPIIO_COUNTERS
};
char *mpiio_f_counter_names[] = {
MPIIO_F_COUNTERS
};
#undef X
int darshan_log_get_mpiio_file(darshan_fd fd, struct darshan_mpiio_file *file)
{
int i;
......
......@@ -10,6 +10,21 @@
#include "darshan-logutils.h"
#include "darshan-mpiio-log-format.h"
extern char *mpiio_counter_names[];
extern char *mpiio_f_counter_names[];
int darshan_log_get_mpiio_file(darshan_fd fd, struct darshan_mpiio_file *file);
#define MPIIO_COUNTER_PRINT(__file_rec, __counter) do { \
printf("%" PRId64 "\t%" PRIu64 "\t%s\t%" PRId64 "\n", \
(__file_rec)->rank, (__file_rec)->f_id, mpiio_counter_names[__counter], \
(__file_rec)->counters[__counter]); \
} while(0)
#define MPIIO_F_COUNTER_PRINT(__file_rec, __counter) do { \
printf("%" PRId64 "\t%" PRIu64 "\t%s\t%f\n", \
(__file_rec)->rank, (__file_rec)->f_id, mpiio_f_counter_names[__counter], \
(__file_rec)->fcounters[__counter]); \
} while(0)
#endif
......@@ -151,8 +151,6 @@ int main(int argc, char **argv)
/* end TODO */
/*******************************************/
printf("\n*** FILE RECORD DATA ***\n");
ret = darshan_log_get_mpiio_file(fd, &next_file);
if(ret < 0)
{
......@@ -168,58 +166,20 @@ int main(int argc, char **argv)
}
/* loop over each stored MPIIO file record and print counters */
i = 1;
do
{
/* get the pathname for this record */
HASH_FIND(hlink, rec_hash, &next_file.f_id, sizeof(darshan_record_id), ref);
assert(ref);
printf("\tRecord %d: id=%"PRIu64" (path=%s, rank=%"PRId64")\n",
i, next_file.f_id, ref->rec.name, next_file.rank);
/* TODO: does it make sense to put these in a header or something?
* Down side of listing them here is ordering dependency between enum
* in header and names here.
*/
printf(
"\t\tMPIIO_INDEP_OPENS:\t%"PRIu64"\n"
"\t\tMPIIO_COLL_OPENS:\t%"PRIu64"\n"
"\t\tMPIIO_INDEP_READS:\t%"PRIu64"\n"
"\t\tMPIIO_INDEP_WRITES:\t%"PRIu64"\n"
"\t\tMPIIO_COLL_READS:\t%"PRIu64"\n"
"\t\tMPIIO_COLL_WRITES:\t%"PRIu64"\n"
"\t\tMPIIO_SPLIT_READS:\t%"PRIu64"\n"
"\t\tMPIIO_SPLIT_WRITES:\t%"PRIu64"\n"
"\t\tMPIIO_NB_READS:\t%"PRIu64"\n"
"\t\tMPIIO_NB_WRITES:\t%"PRIu64"\n"
"\t\tMPIIO_SYNCS:\t%"PRIu64"\n"
"\t\tMPIIO_HINTS:\t%"PRIu64"\n"
"\t\tMPIIO_VIEWS:\t%"PRIu64"\n"
"\t\tMPIIO_F_OPEN_TIMESTAMP:\t%lf\n"
"\t\tMPIIO_F_CLOSE_TIMESTAMP:\t%lf\n"
"\t\tMPIIO_F_READ_TIME:\t%lf\n"
"\t\tMPIIO_F_WRITE_TIME:\t%lf\n"
"\t\tMPIIO_F_META_TIME:\t%lf\n",
next_file.counters[MPIIO_INDEP_OPENS],
next_file.counters[MPIIO_COLL_OPENS],
next_file.counters[MPIIO_INDEP_READS],
next_file.counters[MPIIO_INDEP_WRITES],
next_file.counters[MPIIO_COLL_READS],
next_file.counters[MPIIO_COLL_WRITES],
next_file.counters[MPIIO_SPLIT_READS],
next_file.counters[MPIIO_SPLIT_WRITES],
next_file.counters[MPIIO_NB_READS],
next_file.counters[MPIIO_NB_WRITES],
next_file.counters[MPIIO_SYNCS],
next_file.counters[MPIIO_HINTS],
next_file.counters[MPIIO_VIEWS],
next_file.fcounters[MPIIO_F_OPEN_TIMESTAMP],
next_file.fcounters[MPIIO_F_CLOSE_TIMESTAMP],
next_file.fcounters[MPIIO_F_READ_TIME],
next_file.fcounters[MPIIO_F_WRITE_TIME],
next_file.fcounters[MPIIO_F_META_TIME]);
i++;
for(i=0; i<MPIIO_NUM_INDICES; i++)
{
MPIIO_COUNTER_PRINT(&next_file, i);
}
for(i=0; i<MPIIO_F_NUM_INDICES; i++)
{
MPIIO_F_COUNTER_PRINT(&next_file, i);
}
} while((ret = darshan_log_get_mpiio_file(fd, &next_file)) == 1);
/* free mount info */
......
......@@ -19,6 +19,17 @@
#include "darshan-posix-logutils.h"
/* counter name strings for the POSIX module */
#define X(a) #a,
char *posix_counter_names[] = {
POSIX_COUNTERS
};
char *posix_f_counter_names[] = {
POSIX_F_COUNTERS
};
#undef X
int darshan_log_get_posix_file(darshan_fd fd, struct darshan_posix_file *file)
{
int i;
......
......@@ -10,6 +10,21 @@
#include "darshan-logutils.h"
#include "darshan-posix-log-format.h"
extern char *posix_counter_names[];
extern char *posix_f_counter_names[];
int darshan_log_get_posix_file(darshan_fd fd, struct darshan_posix_file *file);
#define POSIX_COUNTER_PRINT(__file_rec, __counter) do { \
printf("%" PRId64 "\t%" PRIu64 "\t%s\t%" PRId64 "\n", \
(__file_rec)->rank, (__file_rec)->f_id, posix_counter_names[__counter], \
(__file_rec)->counters[__counter]); \
} while(0)
#define POSIX_F_COUNTER_PRINT(__file_rec, __counter) do { \
printf("%" PRId64 "\t%" PRIu64 "\t%s\t%f\n", \
(__file_rec)->rank, (__file_rec)->f_id, posix_f_counter_names[__counter], \
(__file_rec)->fcounters[__counter]); \
} while(0)
#endif
......@@ -160,180 +160,21 @@ int main(int argc, char **argv)
}
/* loop over each stored POSIX file record and print counters */
i = 1;
do
{
/* get the pathname for this record */
HASH_FIND(hlink, rec_hash, &next_file.f_id, sizeof(darshan_record_id), ref);
assert(ref);
printf("\tRecord %d: id=%"PRIu64" (path=%s, rank=%"PRId64")\n",
i, next_file.f_id, ref->rec.name, next_file.rank);
printf(
"\t\tPOSIX_OPENS:\t%"PRIu64"\n"
"\t\tPOSIX_READS:\t%"PRIu64"\n"
"\t\tPOSIX_WRITES:\t%"PRIu64"\n"
"\t\tPOSIX_SEEKS:\t%"PRIu64"\n"
"\t\tPOSIX_STATS:\t%"PRIu64"\n"
"\t\tPOSIX_MMAPS:\t%"PRIu64"\n"
"\t\tPOSIX_FOPENS:\t%"PRIu64"\n"
"\t\tPOSIX_FREADS:\t%"PRIu64"\n"
"\t\tPOSIX_FWRITES:\t%"PRIu64"\n"
"\t\tPOSIX_FSEEKS:\t%"PRIu64"\n"
"\t\tPOSIX_FSYNCS:\t%"PRIu64"\n"
"\t\tPOSIX_FDSYNCS:\t%"PRIu64"\n"
"\t\tPOSIX_MODE:\t%"PRIu64"\n"
"\t\tPOSIX_BYTES_READ:\t%"PRIu64"\n"
"\t\tPOSIX_BYTES_WRITTEN:\t%"PRIu64"\n"
"\t\tPOSIX_MAX_BYTE_READ:\t%"PRIu64"\n"
"\t\tPOSIX_MAX_BYTE_WRITTEN:\t%"PRIu64"\n"
"\t\tPOSIX_CONSE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:\t%lf\n"
"\t\tPOSIX_F_READ_END_TIMESTAMP:\t%lf\n"
"\t\tPOSIX_F_WRITE_END_TIMESTAMP:\t%lf\n"
"\t\tPOSIX_F_CLOSE_TIMESTAMP:\t%lf\n"
"\t\tPOSIX_F_READ_TIME:\t%lf\n"
"\t\tPOSIX_F_WRITE_TIME:\t%lf\n"
"\t\tPOSIX_F_META_TIME:\t%lf\n"
"\t\tPOSIX_F_MAX_READ_TIME:\t%lf\n"
"\t\tPOSIX_F_MAX_WRITE_TIME:\t%lf\n"
"\t\tPOSIX_F_FASTEST_RANK_TIME:\t%lf\n"
"\t\tPOSIX_F_SLOWEST_RANK_TIME:\t%lf\n",
next_file.counters[POSIX_OPENS],
next_file.counters[POSIX_READS],
next_file.counters[POSIX_WRITES],
next_file.counters[POSIX_SEEKS],
next_file.counters[POSIX_STATS],
next_file.counters[POSIX_MMAPS],
next_file.counters[POSIX_FOPENS],
next_file.counters[POSIX_FREADS],
next_file.counters[POSIX_FWRITES],
next_file.counters[POSIX_FSEEKS],
next_file.counters[POSIX_FSYNCS],
next_file.counters[POSIX_FDSYNCS],
next_file.counters[POSIX_MODE],
next_file.counters[POSIX_BYTES_READ],
next_file.counters[POSIX_BYTES_WRITTEN],
next_file.counters[POSIX_MAX_BYTE_READ],
next_file.counters[POSIX_MAX_BYTE_WRITTEN],
next_file.counters[POSIX_CONSEC_READS],
next_file.counters[POSIX_CONSEC_WRITES],
next_file.counters[POSIX_SEQ_READS],
next_file.counters[POSIX_SEQ_WRITES],
next_file.counters[POSIX_RW_SWITCHES],
next_file.counters[POSIX_MEM_NOT_ALIGNED],
next_file.counters[POSIX_MEM_ALIGNMENT],
next_file.counters[POSIX_FILE_NOT_ALIGNED],
next_file.counters[POSIX_FILE_ALIGNMENT],
next_file.counters[POSIX_MAX_READ_TIME_SIZE],
next_file.counters[POSIX_MAX_WRITE_TIME_SIZE],
next_file.counters[POSIX_SIZE_READ_0_100],
next_file.counters[POSIX_SIZE_READ_100_1K],
next_file.counters[POSIX_SIZE_READ_1K_10K],
next_file.counters[POSIX_SIZE_READ_10K_100K],
next_file.counters[POSIX_SIZE_READ_100K_1M],
next_file.counters[POSIX_SIZE_READ_1M_4M],
next_file</