Commit ab4b6397 authored by Philip Carns's avatar Philip Carns

- overhaul int64 print handling (use PRId64 and friends with appropriate

  autoconf checks)
- overhaul configure test for MPIO_Request/MPI_Request
- temporarily turn off -Wall



git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@401 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 809814a8
...@@ -18,11 +18,11 @@ cp_zlib_include_flags = @__CP_ZLIB_INCLUDE_FLAGS@ ...@@ -18,11 +18,11 @@ cp_zlib_include_flags = @__CP_ZLIB_INCLUDE_FLAGS@
# deliberately avoid large file support for host side utilities to avoid # deliberately avoid large file support for host side utilities to avoid
# potentially buggy libz 64 bit offset support # potentially buggy libz 64 bit offset support
CFLAGS = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ -Wall CFLAGS = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@
CFLAGS_MPI = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ -D_LARGEFILE64_SOURCE -Wall CFLAGS_MPI = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ -D_LARGEFILE64_SOURCE
CFLAGS_MPI_SHARED = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ -D_LARGEFILE64_SOURCE -Wall -shared -fpic -DPIC -DDARSHAN_PRELOAD CFLAGS_MPI_SHARED = -I . -I $(srcdir) @CFLAGS@ @CPPFLAGS@ -D_LARGEFILE64_SOURCE -shared -fpic -DPIC -DDARSHAN_PRELOAD
CC=@MPICC@ CC=@MPICC@
LD=@MPICC@ LD=@MPICC@
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -108,26 +108,8 @@ fi ...@@ -108,26 +108,8 @@ fi
saveCC="$CC" saveCC="$CC"
CC="$MPICC" CC="$MPICC"
# redo printf int64 test for mpi compiler # checks to see how we can print 64 bit values on this architecture
AC_MSG_CHECKING(if int64 can be printed as lld without cast) gt_INTTYPES_PRI
old_cflags="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror"
AC_TRY_COMPILE(
[
#include <stdio.h>
#include <sys/types.h>
],
[
int64_t test = 0;
printf("%lld\n", test);
],
AC_MSG_RESULT(yes)
,
AC_MSG_RESULT(no)
AC_DEFINE(PRINTF_CAST_INT64_LLD, 1, Define if int64 should be cast to long long for printf)
)
CFLAGS="$old_cflags"
AC_MSG_CHECKING(whether the mpicc compiler works) AC_MSG_CHECKING(whether the mpicc compiler works)
AC_TRY_COMPILE([#include <mpi.h>], [int ret = MPI_Init(0, (void*)0)], AC_TRY_COMPILE([#include <mpi.h>], [int ret = MPI_Init(0, (void*)0)],
...@@ -209,42 +191,16 @@ AC_TRY_LINK([#include <mpi.h>], [ ...@@ -209,42 +191,16 @@ AC_TRY_LINK([#include <mpi.h>], [
AC_MSG_ERROR(Darshan requires a version of MPI with MPI-IO support) AC_MSG_ERROR(Darshan requires a version of MPI with MPI-IO support)
) )
AC_MSG_CHECKING(for generalized requests in MPI-IO) # if this version of mpi defines an MPIO_Request type, then we assume that
old_cflags="$CFLAGS" # we should use it in the nonblocking MPI-IO functions. This is necessary
CFLAGS="$CFLAGS -Wall -Werror" # for MPI 1.x implementations that did not use generalized requests yet in
AC_TRY_COMPILE( # MPI-IO. Later MPI implementations might typedef MPIO_Request to MPI_Request
[ # so there is no harm in using the former if it is available there.
#include <mpi.h> AC_CHECK_TYPE([MPIO_Request],
#include <stdlib.h> AC_DEFINE(__D_MPI_REQUEST, MPIO_Request, Generalized request type for MPI-IO)
], ,
[ AC_DEFINE(__D_MPI_REQUEST, MPI_Request, Generalized request type for MPI-IO)
MPI_Request req; ,[#include <mpi.h>])
MPI_File_iread_at(MPI_FILE_NULL, 0, NULL, 0, MPI_BYTE, &req);
],
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(__D_MPI_REQUEST, MPI_Request, Generalized request type for MPI-IO)
,
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for MPIO_Request in MPI-IO)
AC_TRY_COMPILE(
[
#include <mpi.h>
#include <stdlib.h>
],
[
MPIO_Request req;
MPI_File_iread_at(MPI_FILE_NULL, 0, NULL, 0, MPI_BYTE, &req);
],
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(__D_MPI_REQUEST, MPIO_Request, Generalized request type for MPI-IO)
,
AC_MSG_RESULT(no)
AC_MSG_ERROR(Unable to find valid request type for MPI-IO)
)
)
CFLAGS="$old_cflags"
AC_SUBST(darshan_lib_path) AC_SUBST(darshan_lib_path)
AC_SUBST(darshan_bin_path) AC_SUBST(darshan_bin_path)
......
/* darshan-config.h.in. Generated from configure.in by autoheader. */ /* darshan-config.h.in. Generated from configure.in by autoheader. */
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
/* Name of the environment variable that stores the jobid */ /* Name of the environment variable that stores the jobid */
#undef CP_JOBID #undef CP_JOBID
...@@ -57,29 +54,18 @@ ...@@ -57,29 +54,18 @@
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME #undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #undef PACKAGE_VERSION
/* Define if int64 should be cast to long long for printf */ /* Define if <inttypes.h> exists and defines unusable PRI* macros. */
#undef PRINTF_CAST_INT64_LLD #undef PRI_MACROS_BROKEN
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most /* Define to 1 if your processor stores words with the most significant byte
significant byte first (like Motorola and SPARC, unlike Intel). */ first (like Motorola and SPARC, unlike Intel and VAX). */
#if defined AC_APPLE_UNIVERSAL_BUILD #undef WORDS_BIGENDIAN
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# endif
#endif
/* Location to store log files at run time */ /* Location to store log files at run time */
#undef __CP_LOG_PATH #undef __CP_LOG_PATH
......
...@@ -24,8 +24,8 @@ static void cd_print_int(char * prefix, int arg1, int arg2) ...@@ -24,8 +24,8 @@ static void cd_print_int(char * prefix, int arg1, int arg2)
} }
static void cd_print_int64(char * prefix, int64_t arg1, int64_t arg2) static void cd_print_int64(char * prefix, int64_t arg1, int64_t arg2)
{ {
printf("- %s %lld\n", prefix, lld(arg1)); printf("- %s %PRId64\n", prefix, arg1);
printf("+ %s %lld\n", prefix, lld(arg2)); printf("+ %s %PRId64\n", prefix, arg2);
} }
...@@ -116,24 +116,24 @@ int main(int argc, char ** argv) ...@@ -116,24 +116,24 @@ int main(int argc, char ** argv)
for(i=0; i<CP_NUM_INDICES; i++) { for(i=0; i<CP_NUM_INDICES; i++) {
if (cp_file1.counters[i] != cp_file2.counters[i]) { if (cp_file1.counters[i] != cp_file2.counters[i]) {
printf("- "); printf("- ");
printf("%lld\t%llu\t%s\t%lld\t...%s\n", printf("%PRId64\t%PRIu64\t%s\t%PRId64\t...%s\n",
lld(cp_file1.rank), llu(cp_file1.hash), darshan_names[i], cp_file1.rank, cp_file1.hash, darshan_names[i],
lld(cp_file1.counters[i]), cp_file1.name_suffix); cp_file1.counters[i], cp_file1.name_suffix);
printf("+ "); printf("+ ");
printf("%lld\t%llu\t%s\t%lld\t...%s\n", printf("%PRId64\t%PRIu64\t%s\t%PRId64\t...%s\n",
lld(cp_file2.rank), llu(cp_file2.hash), darshan_names[i], cp_file2.rank, cp_file2.hash, darshan_names[i],
lld(cp_file2.counters[i]), cp_file2.name_suffix); cp_file2.counters[i], cp_file2.name_suffix);
} }
} }
for(i=0; i<CP_F_NUM_INDICES; i++) { for(i=0; i<CP_F_NUM_INDICES; i++) {
if (cp_file1.fcounters[i] != cp_file2.fcounters[i]) { if (cp_file1.fcounters[i] != cp_file2.fcounters[i]) {
printf("- "); printf("- ");
printf("%lld\t%llu\t%s\t%f\t...%s\n", printf("%PRId64\t%PRIu64\t%s\t%f\t...%s\n",
lld(cp_file1.rank), llu(cp_file1.hash), darshan_f_names[i], cp_file1.rank, cp_file1.hash, darshan_f_names[i],
cp_file1.fcounters[i], cp_file1.name_suffix); cp_file1.fcounters[i], cp_file1.name_suffix);
printf("+ "); printf("+ ");
printf("%lld\t%llu\t%s\t%f\t...%s\n", printf("%PRId64\t%PRIu64\t%s\t%f\t...%s\n",
lld(cp_file2.rank), llu(cp_file2.hash), darshan_f_names[i], cp_file2.rank, cp_file2.hash, darshan_f_names[i],
cp_file2.fcounters[i], cp_file2.name_suffix); cp_file2.fcounters[i], cp_file2.name_suffix);
} }
} }
......
...@@ -23,23 +23,23 @@ ...@@ -23,23 +23,23 @@
const char *insert_job_fmt = "insert into %s values('%d','%s','%s','%s',\ const char *insert_job_fmt = "insert into %s values('%d','%s','%s','%s',\
'%d','%ld','%ld','%d')"; '%d','%ld','%ld','%d')";
const char *insert_mnt_fmt = "insert into %s values('%d','%d','%lld','%s','%s')"; const char *insert_mnt_fmt = "insert into %s values('%d','%d','%PRId64','%s','%s')";
const char *insert_file_fmt = "insert into %s values('%d','%ld','%lld','%d',\ const char *insert_file_fmt = "insert into %s values('%d','%ld','%PRId64','%d',\
'%s',\ '%s',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld','%lld',\ '%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64','%PRId64',\
'%.16lf','%.16lf','%.16lf','%.16lf','%.16lf',\ '%.16lf','%.16lf','%.16lf','%.16lf','%.16lf',\
'%.16lf','%.16lf','%.16lf','%.16lf','%.16lf',\ '%.16lf','%.16lf','%.16lf','%.16lf','%.16lf',\
'%.16lf','%.16lf','%.16lf','%.16lf')"; '%.16lf','%.16lf','%.16lf','%.16lf')";
...@@ -192,7 +192,7 @@ jobid=%d start_time=%ld\n", ...@@ -192,7 +192,7 @@ jobid=%d start_time=%ld\n",
for (i=0; (i<count); i++) for (i=0; (i<count); i++)
{ {
snprintf(sqlstmt,MAXSQL,insert_mnt_fmt, "darshan_mountpoints_intrepid", snprintf(sqlstmt,MAXSQL,insert_mnt_fmt, "darshan_mountpoints_intrepid",
atoi(jobid), job.start_time, lld(devs[i]), mnts[i], fstypes[i]); atoi(jobid), job.start_time, devs[i], mnts[i], fstypes[i]);
if (debug) printf("sql: %s\n", sqlstmt); if (debug) printf("sql: %s\n", sqlstmt);
ret = mysql_query(mysql, sqlstmt); ret = mysql_query(mysql, sqlstmt);
......
...@@ -9,8 +9,16 @@ ...@@ -9,8 +9,16 @@
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h> #include <stdint.h>
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include "darshan-config.h" #include "darshan-config.h"
#if !defined PRId64 || PRI_MACROS_BROKEN
# undef PRId64
# define PRId64 (sizeof (long) == 8 ? "ld" : "lld")
#endif
/* update this on file format changes */ /* update this on file format changes */
#define CP_VERSION "2.00" #define CP_VERSION "2.00"
...@@ -237,14 +245,4 @@ struct darshan_job ...@@ -237,14 +245,4 @@ struct darshan_job
int64_t jobid; int64_t jobid;
}; };
#ifdef PRINTF_CAST_INT64_LLD
# define llu(x) (unsigned long long)(x)
# define lld(x) (long long)(x)
# define SCANF_lld "%ld"
#else
# define llu(x) (x)
# define lld(x) (x)
# define SCANF_lld "%lld"
#endif
#endif /* __DARSHAN_LOG_FORMAT_H */ #endif /* __DARSHAN_LOG_FORMAT_H */
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <inttypes.h>
#include "darshan-logutils.h" #include "darshan-logutils.h"
#include "darshan-config.h" #include "darshan-config.h"
...@@ -365,13 +366,8 @@ int darshan_log_getmounts(darshan_fd fd, int64_t** devs, char*** mnt_pts, char** ...@@ -365,13 +366,8 @@ int darshan_log_getmounts(darshan_fd fd, int64_t** devs, char*** mnt_pts, char**
(*fs_types)[array_index] = malloc(CP_EXE_LEN); (*fs_types)[array_index] = malloc(CP_EXE_LEN);
assert((*fs_types)[array_index]); assert((*fs_types)[array_index]);
#ifdef PRINTF_CAST_INT64_LLD ret = sscanf(++pos, "%PRId64\t%s\t%s", &(*devs)[array_index],
ret = sscanf(++pos, "%ld\t%s\t%s", &(*devs)[array_index],
(*fs_types)[array_index], (*mnt_pts)[array_index]); (*fs_types)[array_index], (*mnt_pts)[array_index]);
#else
ret = sscanf(++pos, "%lld\t%s\t%s", &(*devs)[array_index],
(*fs_types)[array_index], (*mnt_pts)[array_index]);
#endif
if(ret != 3) if(ret != 3)
{ {
......
...@@ -34,14 +34,14 @@ void darshan_log_print_version_warnings(struct darshan_job *job); ...@@ -34,14 +34,14 @@ void darshan_log_print_version_warnings(struct darshan_job *job);
/* convenience macros for printing out counters */ /* convenience macros for printing out counters */
#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_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 {\ #define CP_PRINT(__job, __file, __counter, __mnt_pt, __fs_type) do {\
printf("%lld\t%llu\t%s\t%lld\t...%s\t%s\t%s\n", \ printf("%PRId64\t%PRIu64\t%s\t%PRId64\t...%s\t%s\t%s\n", \
lld((__file)->rank), llu((__file)->hash), darshan_names[__counter], \ (__file)->rank, (__file)->hash, darshan_names[__counter], \
lld((__file)->counters[__counter]), (__file)->name_suffix, \ (__file)->counters[__counter], (__file)->name_suffix, \
__mnt_pt, __fs_type); \ __mnt_pt, __fs_type); \
} while(0) } while(0)
#define CP_F_PRINT(__job, __file, __counter, __mnt_pt, __fs_type) do {\ #define CP_F_PRINT(__job, __file, __counter, __mnt_pt, __fs_type) do {\
printf("%lld\t%llu\t%s\t%f\t...%s\t%s\t%s\n", \ printf("%PRId64\t%PRIu64\t%s\t%f\t...%s\t%s\t%s\n", \
lld((__file)->rank), llu((__file)->hash), darshan_f_names[__counter], \ (__file)->rank, (__file)->hash, darshan_f_names[__counter], \
(__file)->fcounters[__counter], (__file)->name_suffix, \ (__file)->fcounters[__counter], (__file)->name_suffix, \
__mnt_pt, __fs_type); \ __mnt_pt, __fs_type); \
} while(0) } while(0)
......
...@@ -234,17 +234,17 @@ int main(int argc, char **argv) ...@@ -234,17 +234,17 @@ int main(int argc, char **argv)
printf("# size of file statistics: %zu bytes\n", sizeof(cp_file)); printf("# size of file statistics: %zu bytes\n", sizeof(cp_file));
printf("# size of job statistics: %zu bytes\n", sizeof(job)); printf("# size of job statistics: %zu bytes\n", sizeof(job));
printf("# exe: %s\n", tmp_string); printf("# exe: %s\n", tmp_string);
printf("# uid: %lld\n", lld(job.uid)); printf("# uid: %PRId64\n", job.uid);
printf("# jobid: %lld\n", lld(job.jobid)); printf("# jobid: %PRId64\n", job.jobid);
printf("# start_time: %lld\n", lld(job.start_time)); printf("# start_time: %PRId64\n", job.start_time);
tmp_time += job.start_time; tmp_time += job.start_time;
printf("# start_time_asci: %s", ctime(&tmp_time)); printf("# start_time_asci: %s", ctime(&tmp_time));
printf("# end_time: %lld\n", lld(job.end_time)); printf("# end_time: %PRId64\n", job.end_time);
tmp_time = 0; tmp_time = 0;
tmp_time += job.end_time; tmp_time += job.end_time;
printf("# end_time_asci: %s", ctime(&tmp_time)); printf("# end_time_asci: %s", ctime(&tmp_time));
printf("# nprocs: %lld\n", lld(job.nprocs)); printf("# nprocs: %PRId64\n", job.nprocs);
printf("# run time: %lld\n", lld(job.end_time - job.start_time + 1)); printf("# run time: %PRId64\n", job.end_time - job.start_time + 1);
/* print table of mounted file systems */ /* print table of mounted file systems */
ret = darshan_log_getmounts(file, &devs, &mnt_pts, &fs_types, &mount_count, ret = darshan_log_getmounts(file, &devs, &mnt_pts, &fs_types, &mount_count,
...@@ -253,7 +253,7 @@ int main(int argc, char **argv) ...@@ -253,7 +253,7 @@ int main(int argc, char **argv)
printf("# -------------------------------------------------------\n"); printf("# -------------------------------------------------------\n");
for(i=0; i<mount_count; i++) for(i=0; i<mount_count; i++)
{ {
printf("# mount entry: %lld\t%s\t%s\n", lld(devs[i]), mnt_pts[i], fs_types[i]); printf("# mount entry: %PRId64\t%s\t%s\n", devs[i], mnt_pts[i], fs_types[i]);
} }
if(no_files_flag) if(no_files_flag)
...@@ -408,8 +408,8 @@ int main(int argc, char **argv) ...@@ -408,8 +408,8 @@ int main(int argc, char **argv)
{ {
for(i=0; i<CP_NUM_INDICES; i++) for(i=0; i<CP_NUM_INDICES; i++)
{ {
printf("total_%s: %lld\n", printf("total_%s: %PRId64\n",
darshan_names[i], lld(total.counters[i])); darshan_names[i], total.counters[i]);
} }
for(i=0; i<CP_F_NUM_INDICES; i++) for(i=0; i<CP_F_NUM_INDICES; i++)
{ {
...@@ -424,7 +424,7 @@ int main(int argc, char **argv) ...@@ -424,7 +424,7 @@ int main(int argc, char **argv)
{ {
printf("\n# performance\n"); printf("\n# performance\n");
printf("# -----------\n"); printf("# -----------\n");
printf("# total_bytes: %lld\n", lld(pdata.total_bytes)); printf("# total_bytes: %PRId64\n", pdata.total_bytes);
printf("# slowest_rank_time: %lf\n", pdata.slowest_rank_time); printf("# slowest_rank_time: %lf\n", pdata.slowest_rank_time);
printf("# slowest_rank_meta_time: %lf\n", pdata.slowest_rank_meta_time); printf("# slowest_rank_meta_time: %lf\n", pdata.slowest_rank_meta_time);
printf("# shared_time_by_cumul: %lf\n", pdata.shared_time_by_cumul); printf("# shared_time_by_cumul: %lf\n", pdata.shared_time_by_cumul);
...@@ -443,30 +443,30 @@ int main(int argc, char **argv) ...@@ -443,30 +443,30 @@ int main(int argc, char **argv)
{ {
printf("\n# files\n"); printf("\n# files\n");
printf("# -----\n"); printf("# -----\n");
printf("# total: %lld %lld %lld\n", printf("# total: %PRId64 %PRId64 %PRId64\n",
lld(fdata.total), fdata.total,
lld(fdata.total_size), fdata.total_size,
lld(fdata.total_max)); fdata.total_max);
printf("# read_only: %lld %lld %lld\n", printf("# read_only: %PRId64 %PRId64 %PRId64\n",
lld(fdata.read_only), fdata.read_only,
lld(fdata.read_only_size), fdata.read_only_size,
lld(fdata.read_only_max)); fdata.read_only_max);
printf("# write_only: %lld %lld %lld\n", printf("# write_only: %PRId64 %PRId64 %PRId64\n",
lld(fdata.write_only), fdata.write_only,
lld(fdata.write_only_size), fdata.write_only_size,
lld(fdata.write_only_max)); fdata.write_only_max);
printf("# read_write: %lld %lld %lld\n", printf("# read_write: %PRId64 %PRId64 %PRId64\n",
lld(fdata.read_write), fdata.read_write,
lld(fdata.read_write_size), fdata.read_write_size,
lld(fdata.read_write_max)); fdata.read_write_max);
printf("# unique: %lld %lld %lld\n", printf("# unique: %PRId64 %PRId64 %PRId64\n",
lld(fdata.unique), fdata.unique,
lld(fdata.unique_size), fdata.unique_size,
lld(fdata.unique_max)); fdata.unique_max);
printf("# shared: %lld %lld %lld\n", printf("# shared: %PRId64 %PRId64 %PRId64\n",
lld(fdata.shared), fdata.shared,
lld(fdata.shared_size), fdata.shared_size,
lld(fdata.shared_max)); fdata.shared_max);
} }
if(ret < 0) if(ret < 0)
......
...@@ -603,14 +603,14 @@ void darshan_shutdown(int timing_flag) ...@@ -603,14 +603,14 @@ void darshan_shutdown(int timing_flag)
logmod = darshan_hash((void*)hname,strlen(hname),0); logmod = darshan_hash((void*)hname,strlen(hname),0);
ret = snprintf(logfile_name, PATH_MAX, ret = snprintf(logfile_name, PATH_MAX,
"%s/%d/%d/%d/%s_%s_id%d_%d-%d-%d-%llu.darshan_partial", "%s/%d/%d/%d/%s_%s_id%d_%d-%d-%d-%PRIu64.darshan_partial",
logpath, (my_tm->tm_year+1900), logpath, (my_tm->tm_year+1900),
(my_tm->tm_mon+1), my_tm->tm_mday, (my_tm->tm_mon+1), my_tm->tm_mday,
cuser, __progname, jobid, cuser, __progname, jobid,
(my_tm->tm_mon+1), (my_tm->tm_mon+1),
my_tm->tm_mday, my_tm->tm_mday,
(my_tm->tm_hour*60*60 + my_tm->tm_min*60 + my_tm->tm_sec), (my_tm->tm_hour*60*60 + my_tm->tm_min*60 + my_tm->tm_sec),
llu(logmod)); logmod);
if(ret == (PATH_MAX-1)) if(ret == (PATH_MAX-1))
{ {
/* file name was too big; squish it down */ /* file name was too big; squish it down */
...@@ -1995,7 +1995,7 @@ static void cp_access_walker(const void* nodep, const VISIT which, const int dep ...@@ -1995,7 +1995,7 @@ static void cp_access_walker(const void* nodep, const VISIT which, const int dep
case leaf: case leaf:
counter = *(struct cp_access_counter**)nodep; counter = *(struct cp_access_counter**)nodep;
#if 0 #if 0
printf(" type %d size: %lld, freq: %d\n", walker_validx, counter->size, counter->freq); printf(" type %d size: %PRId64, freq: %d\n", walker_validx, counter->size, counter->freq);
#endif #endif
CP_COUNTER_INC(walker_file, counter->size, counter->freq, 1, walker_validx, walker_cntidx); CP_COUNTER_INC(walker_file, counter->size, counter->freq, 1, walker_validx, walker_cntidx);
default: default:
...@@ -2135,7 +2135,7 @@ static char* darshan_get_exe_and_mounts(struct darshan_job_runtime* final_job) ...@@ -2135,7 +2135,7 @@ static char* darshan_get_exe_and_mounts(struct darshan_job_runtime* final_job)
mnt_array_index++; mnt_array_index++;
} }
ret = snprintf(tmp_mnt, 256, "\n%lld\t%s\t%s", lld(tmp_st_dev), ret = snprintf(tmp_mnt, 256, "\n%PRId64\t%s\t%s", tmp_st_dev,
entry->mnt_type, entry->mnt_dir); entry->mnt_type, entry->mnt_dir);
if(ret >= 256) if(ret >= 256)
{ {
...@@ -2148,8 +2148,8 @@ static char* darshan_get_exe_and_mounts(struct darshan_job_runtime* final_job) ...@@ -2148,8 +2148,8 @@ static char* darshan_get_exe_and_mounts(struct darshan_job_runtime* final_job)
space_left -= strlen(tmp_mnt); space_left -= strlen(tmp_mnt);
} }
#if 0 #if 0
printf("dev: %lld, mnt_pt: %s, type: %s\n", printf("dev: %PRId64, mnt_pt: %s, type: %s\n",
lld(tmp_st_dev), entry->mnt_dir, entry->mnt_type); tmp_st_dev, entry->mnt_dir, entry->mnt_type);
#endif #endif
} }
} }
......
# inttypes-pri.m4 serial 4 (gettext-0.16)
dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
AC_PREREQ(2.52)
# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
# macros to non-string values. This is the case on AIX 4.3.3.
AC_DEFUN([gt_INTTYPES_PRI],
[
AC_CHECK_HEADERS([inttypes.h])
if test $ac_cv_header_inttypes_h = yes; then
AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
gt_cv_inttypes_pri_broken,
[
AC_TRY_COMPILE([#include <inttypes.h>
#ifdef PRId32
char *p = PRId32;
#endif
], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
])
fi
if test "$gt_cv_inttypes_pri_broken" = yes; then
AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
[Define if <inttypes.h> exists and defines unusable PRI* macros.])
PRI_MACROS_BROKEN=1
else
PRI_MACROS_BROKEN=0
fi
AC_SUBST([PRI_MACROS_BROKEN])
])
...@@ -84,10 +84,10 @@ int main(int argc, char **argv) ...@@ -84,10 +84,10 @@ int main(int argc, char **argv)
printf("# size of file statistics: %zu bytes\n", sizeof(cp_file)); printf("# size of file statistics: %zu bytes\n", sizeof(cp_file));
printf("# exe: %s\n", tmp_string); printf("# exe: %s\n", tmp_string);
printf("# uid: %lld\n", lld(job.uid)); printf("# uid: %PRId64\n", job.uid);
printf("# start_time: %ld\n", (long)job.start_time); printf("# start_time: %ld\n", (long)job.start_time);
printf("# end_time: %ld\n", (long)job.end_time); printf("# end_time: %ld\n", (long)job.end_time);
printf("# nprocs: %lld\n", lld(job.nprocs)); printf("# nprocs: %PRId64\n", job.nprocs);
printf("# run time: %ld\n", (long)(job.end_time - job.start_time + 1)); printf("# run time: %ld\n", (long)(job.end_time - job.start_time + 1));
if(no_files_flag) if(no_files_flag)
......
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