darshan-logutils.h 1.32 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 12 13 14
#ifndef __DARSHAN_LOG_UTILS_H
#define __DARSHAN_LOG_UTILS_H
#include <darshan-log-format.h>
#include <zlib.h>
typedef gzFile darshan_fd;

extern char *darshan_names[];
extern char *darshan_f_names[];

15
darshan_fd darshan_log_open(const char *name);
16
int darshan_log_getjob(darshan_fd file, struct darshan_job *job);
17 18 19
int darshan_log_getfile(darshan_fd fd, 
    struct darshan_job* job, 
    struct darshan_file *file);
20 21
int darshan_log_getexe(darshan_fd fd, char *buf, int *flag);
void darshan_log_close(darshan_fd file);
22
void darshan_log_print_version_warnings(struct darshan_job *job);
23

24 25 26 27 28 29 30 31 32 33 34 35 36
/* convenience macros for printing out counters */
#define CP_PRINT_HEADER() printf("#<rank>\t<file>\t<counter>\t<value>\t<name suffix>\n")
#define CP_PRINT(__job, __file, __counter) do {\
        printf("%d\t%llu\t%s\t%lld\t...%s\n", \
            (__file)->rank, llu((__file)->hash), darshan_names[__counter], \
            lld((__file)->counters[__counter]), (__file)->name_suffix); \
} while(0)
#define CP_F_PRINT(__job, __file, __counter) do {\
        printf("%d\t%llu\t%s\t%f\t...%s\n", \
            (__file)->rank, llu((__file)->hash), darshan_f_names[__counter], \
            (__file)->fcounters[__counter], (__file)->name_suffix); \
} while(0)

37
#endif