darshan-logutils.h 1.59 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
int darshan_log_getexe(darshan_fd fd, char *buf, int *flag);
21 22
int darshan_log_getmounts(darshan_fd fd, int** devs, char*** mnt_pts, char***
    fs_types, int* count, int *flag);
23
void darshan_log_close(darshan_fd file);
24
void darshan_log_print_version_warnings(struct darshan_job *job);
25

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

41
#endif