darshan-stdio-log-format.h 2.92 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 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
/*
 * functions for opening streams
 * --------------
 * FILE    *fdopen(int, const char *);
 * FILE    *fopen(const char *, const char *);
 * FILE    *freopen(const char *, const char *, FILE *);
 *
 * functions for closing streams
 * --------------
 * int      fclose(FILE *);
 *
 * 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 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
#define STDIO_COUNTERS \
    /* count of number of 'bar' function calls */\
    X(STDIO_BARS) \
    /* arbitrary data value set by last call to 'bar' */\
    X(STDIO_BAR_DAT) \
    /* end of counters */\
    X(STDIO_NUM_INDICES)

#define STDIO_F_COUNTERS \
    /* timestamp of the first call to function 'bar' */\
    X(STDIO_F_BAR_TIMESTAMP) \
    /* timer indicating duration of last call to 'bar' */\
    X(STDIO_F_BAR_DURATION) \
    /* 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.)
 */
96
struct darshan_stdio_file
97 98 99 100 101 102 103 104
{
    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 */