darshan-stdio-log-format.h 2.58 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
/*
 * Copyright (C) 2015 University of Chicago.
 * See COPYRIGHT notice in top-level directory.
 *
 */

#ifndef __DARSHAN_STDIO_LOG_FORMAT_H
#define __DARSHAN_STDIO_LOG_FORMAT_H

/* current log format version, to support backwards compatibility */
#define DARSHAN_STDIO_VER 1

#define STDIO_COUNTERS \
14
    /* count of fopens */\
15
    X(STDIO_OPENS) \
16
    /* number of reads */ \
17
    X(STDIO_READS) \
18 19
    /* number of writes */ \
    X(STDIO_WRITES) \
20 21
    /* count of seeks */\
    X(STDIO_SEEKS) \
Philip Carns's avatar
Philip Carns committed
22 23
    /* count of flushes */\
    X(STDIO_FLUSHES) \
24 25 26 27 28 29 30 31
    /* total bytes written */ \
    X(STDIO_BYTES_WRITTEN) \
    /* total bytes read */ \
    X(STDIO_BYTES_READ) \
    /* maximum byte (offset) read */\
    X(STDIO_MAX_BYTE_READ) \
    /* maximum byte (offset) written */\
    X(STDIO_MAX_BYTE_WRITTEN) \
32 33 34 35
    /* end of counters */\
    X(STDIO_NUM_INDICES)

#define STDIO_F_COUNTERS \
36 37 38 39 40 41
    /* cumulative meta time */\
    X(STDIO_F_META_TIME) \
    /* cumulative write time */\
    X(STDIO_F_WRITE_TIME) \
    /* cumulative read time */\
    X(STDIO_F_READ_TIME) \
42 43
    /* timestamp of first open */\
    X(STDIO_F_OPEN_START_TIMESTAMP) \
44 45
    /* timestamp of first close */\
    X(STDIO_F_CLOSE_START_TIMESTAMP) \
46 47
    /* timestamp of first write */\
    X(STDIO_F_WRITE_START_TIMESTAMP) \
48 49
    /* timestamp of first read */\
    X(STDIO_F_READ_START_TIMESTAMP) \
50 51 52 53 54 55
    /* timestamp of last open completion */\
    X(STDIO_F_OPEN_END_TIMESTAMP) \
    /* timestamp of last close completion */\
    X(STDIO_F_CLOSE_END_TIMESTAMP) \
    /* timestamp of last write completion */\
    X(STDIO_F_WRITE_END_TIMESTAMP) \
56 57
    /* timestamp of last read completion */\
    X(STDIO_F_READ_END_TIMESTAMP) \
58 59 60 61
    /* end of counters */\
    X(STDIO_F_NUM_INDICES)

#define X(a) a,
62
/* integer counters for the "STDIO" module */
63 64 65 66 67
enum darshan_stdio_indices
{
    STDIO_COUNTERS
};

68
/* floating point counters for the "STDIO" module */
69 70 71 72 73 74 75 76 77 78 79 80 81 82
enum darshan_stdio_f_indices
{
    STDIO_F_COUNTERS
};
#undef X

/* the darshan_stdio_record structure encompasses the high-level data/counters
 * which would actually be logged to file by Darshan for the "STDIO"
 * module. This logs the following data for each record:
 *      - a corresponding Darshan record identifier
 *      - the rank of the process responsible for the record
 *      - integer I/O counters (operation counts, I/O sizes, etc.)
 *      - floating point I/O counters (timestamps, cumulative timers, etc.)
 */
83
struct darshan_stdio_file
84
{
85
    struct darshan_base_record base_rec;
86 87 88 89 90
    int64_t counters[STDIO_NUM_INDICES];
    double fcounters[STDIO_F_NUM_INDICES];
};

#endif /* __DARSHAN_STDIO_LOG_FORMAT_H */