darshan-stdio-log-format.h 3.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
/*
 * 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

13 14 15
/*
 * functions for opening streams
 * --------------
16
 * FILE    *fdopen(int, const char *);                     DONE
17 18 19 20 21
 * FILE    *fopen(const char *, const char *);
 * FILE    *freopen(const char *, const char *, FILE *);
 *
 * functions for closing streams
 * --------------
22
 * int      fclose(FILE *);                                DONE
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
 *
 * functions for flushing streams
 * --------------
 * int      fflush(FILE *);
 *
 * functions for reading data
 * --------------
 * int      fgetc(FILE *);
 * char    *fgets(char *, int, FILE *);
 * size_t   fread(void *, size_t, size_t, FILE *);
 * int      fscanf(FILE *, const char *, ...);
 * int      getc(FILE *);
 * int      getc_unlocked(FILE *);
 * int      getw(FILE *);
 *
 * functions for writing data
 * --------------
 * int      fprintf(FILE *, const char *, ...);
 * int      fputc(int, FILE *);
 * int      fputs(const char *, FILE *);
 * size_t   fwrite(const void *, size_t, size_t, FILE *);
 * int      putc(int, FILE *);
 * int      putc_unlocked(int, FILE *);
 * int      putw(int, FILE *);
 * int      vfprintf(FILE *, const char *, va_list);
 *
 * functions for changing file position
 * --------------
 * int      fseek(FILE *, long int, int);
 * int      fseeko(FILE *, off_t, int);
 * int      fsetpos(FILE *, const fpos_t *);
 * void     rewind(FILE *);
 * int      ungetc(int, FILE *);
 */

58
#define STDIO_COUNTERS \
59 60
    /* count of fopens */\
    X(STDIO_FOPENS) \
61 62 63 64
    /* end of counters */\
    X(STDIO_NUM_INDICES)

#define STDIO_F_COUNTERS \
65 66 67 68
    /* timestamp of first open */\
    X(STDIO_F_OPEN_START_TIMESTAMP) \
    /* timestamp of last open completion */\
    X(STDIO_F_OPEN_END_TIMESTAMP) \
69 70 71 72
    /* timestamp of first close */\
    X(STDIO_F_CLOSE_START_TIMESTAMP) \
    /* timestamp of last close completion */\
    X(STDIO_F_CLOSE_END_TIMESTAMP) \
73 74
    /* cumulative meta time */\
    X(STDIO_F_META_TIME) \
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
    /* end of counters */\
    X(STDIO_F_NUM_INDICES)

#define X(a) a,
/* integer counters for the "STDIO" example module */
enum darshan_stdio_indices
{
    STDIO_COUNTERS
};

/* floating point counters for the "STDIO" example module */
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.)
 */
100
struct darshan_stdio_record
101 102 103 104 105 106 107 108
{
    darshan_record_id f_id;
    int64_t rank;
    int64_t counters[STDIO_NUM_INDICES];
    double fcounters[STDIO_F_NUM_INDICES];
};

#endif /* __DARSHAN_STDIO_LOG_FORMAT_H */