darshan-log-format.h 1.35 KB
Newer Older
1 2 3 4 5
/*
 *  (C) 2009 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */

6 7 8 9 10 11
#ifndef __DARSHAN_LOG_FORMAT_H
#define __DARSHAN_LOG_FORMAT_H

#include <unistd.h>
#include <sys/types.h>
#include <stdint.h>
12
#include <inttypes.h>
13

14 15
#if !defined PRId64
#error failed to detect PRId64
16
#endif
17 18
#if !defined PRIu64
#error failed to detect PRIu64
Philip Carns's avatar
Philip Carns committed
19
#endif
20

21
/* update this on file format changes */
22
#define CP_VERSION "3.00"
23

24 25 26
/* magic number for validating output files and checking byte order */
#define CP_MAGIC_NR 6567223

27
/* size (in bytes) of job record */
Philip Carns's avatar
Philip Carns committed
28
#define CP_JOB_RECORD_SIZE 4096
29 30 31 32

/* max length of exe string within job record (not counting '\0') */
#define CP_EXE_LEN (CP_JOB_RECORD_SIZE - sizeof(struct darshan_job) - 1)

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
typedef uint64_t darshan_record_id;

struct darshan_header
{
    char version_string[8];
    int64_t magic_nr;
    uint8_t comp_type;
    uint8_t mod_count;
};

struct darshan_record
{
    char* name;
    darshan_record_id id;
    //int64_t rank; /* TODO: maybe rank doesn't go here ? */
};

50
/* statistics for the job as a whole */
51
#define DARSHAN_JOB_METADATA_LEN 1024 /* including null terminator! */
52 53
struct darshan_job
{
54 55 56 57
    int64_t uid;
    int64_t start_time;
    int64_t end_time;
    int64_t nprocs;
58
    int64_t jobid;
59
    char metadata[DARSHAN_JOB_METADATA_LEN]; /* TODO: what is this? */
60 61 62
};

#endif /* __DARSHAN_LOG_FORMAT_H */