Commit 454cc132 authored by Philip Carns's avatar Philip Carns

move print macros and use name arrays instead of enum name


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@125 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 1d3113d4
......@@ -33,10 +33,10 @@ mklibdir::
mktestdir::
mkdir -p test
darshan-parser: darshan-parser.c darshan.h darshan-log-format.h darshan-logutils.o
darshan-parser: darshan-parser.c darshan.h darshan-log-format.h darshan-logutils.h darshan-logutils.o
gcc $(CFLAGS) -lz $< darshan-logutils.o -o $@
darshan-analyzer: darshan-analyzer.c darshan.h darshan-log-format.h darshan-logutils.o
darshan-analyzer: darshan-analyzer.c darshan.h darshan-log-format.h darshan-logutils.h darshan-logutils.o
gcc $(CFLAGS) -lz $< darshan-logutils.o -o $@
darshan-log-params: darshan-log-params.c darshan-log-format.h
......
......@@ -221,9 +221,6 @@ struct darshan_job
int nprocs;
};
/* convenience macros for printing out counters */
#define CP_PRINT_HEADER() printf("#<rank>\t<file>\t<counter>\t<value>\t<name suffix>\n")
#if SIZEOF_LONG_INT == 4
# define llu(x) (x)
# define lld(x) (x)
......@@ -236,18 +233,4 @@ struct darshan_job
# error Unexpected sizeof(long int)
#endif
/* for integers */
#define CP_PRINT(__job, __file, __counter) do {\
printf("%d\t%llu\t%s\t%lld\t...%s\n", \
(__file)->rank, llu((__file)->hash), #__counter, \
lld((__file)->counters[__counter]), (__file)->name_suffix); \
} while(0)
/* for double floats */
#define CP_F_PRINT(__job, __file, __counter) do {\
printf("%d\t%llu\t%s\t%f\t...%s\n", \
(__file)->rank, llu((__file)->hash), #__counter, \
(__file)->fcounters[__counter], (__file)->name_suffix); \
} while(0)
#endif /* __DARSHAN_LOG_FORMAT_H */
......@@ -21,4 +21,17 @@ int darshan_log_getexe(darshan_fd fd, char *buf, int *flag);
void darshan_log_close(darshan_fd file);
void darshan_log_print_version_warnings(struct darshan_job *job);
/* 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)
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment