darshan-posix-log-format.h 5.93 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
/*
 *  (C) 2009 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */

#ifndef __DARSHAN_POSIX_LOG_FORMAT_H
#define __DARSHAN_POSIX_LOG_FORMAT_H

#include "darshan-log-format.h"

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
#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) \
108
    /* rank and number of bytes moved for fastest/slowest ranks */\
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
    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) \
135
    /* maximum posix read duration */\
136
    X(POSIX_F_MAX_READ_TIME) \
137
    /* maximum posix write duration */\
138 139 140 141
    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) \
142 143 144 145
    /* variance of total i/o time and bytes moved across all ranks */\
    /* NOTE: for shared records only */\
    X(POSIX_F_VARIANCE_RANK_TIME) \
    X(POSIX_F_VARIANCE_RANK_BYTES) \
146 147 148 149
    /* end of counters */\
    X(POSIX_F_NUM_INDICES)

#define X(a) a,
150
/* integer statistics for POSIX file records */
151 152
enum darshan_posix_indices
{
153
    POSIX_COUNTERS
154 155
};

156
/* floating point statistics for POSIX file records */
157
enum darshan_posix_f_indices
158
{
159
    POSIX_F_COUNTERS
160
};
161
#undef X
162

163 164 165 166 167 168 169 170
/* 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,
 * 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.)
 */
171 172
struct darshan_posix_file
{
173
    struct darshan_base_record base_rec;
174 175
    int64_t counters[POSIX_NUM_INDICES];
    double fcounters[POSIX_F_NUM_INDICES];
176 177
};

178 179 180 181 182 183 184
/* This macro can be used to identify files that have been opened using
 * pnetcdf, hdf5, or mpi-io, but were never opened at the posix level.  As a
 * result the record will not necessarily have all of the expected fields
 * populated.
 */
#define POSIX_FILE_PARTIAL(__file)((((__file)->counters[POSIX_OPENS] || (__file)->counters[POSIX_FOPENS] || (__file)->counters[POSIX_STATS]) ? 0 : 1))

185
#endif /* __DARSHAN_POSIX_LOG_FORMAT_H */