Commit 0ddc4ea7 authored by Philip Carns's avatar Philip Carns

converting to fixed sized types with 64 bit alignment


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@243 3b7491f3-a168-0410-bf4b-c445ed680a29
parent e844c632
...@@ -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("%d\t%llu\t%s\t%lld\t...%s\n", printf("%lld\t%llu\t%s\t%lld\t...%s\n",
cp_file1.rank, llu(cp_file1.hash), darshan_names[i], lld(cp_file1.rank), llu(cp_file1.hash), darshan_names[i],
lld(cp_file1.counters[i]), cp_file1.name_suffix); lld(cp_file1.counters[i]), cp_file1.name_suffix);
printf("+ "); printf("+ ");
printf("%d\t%llu\t%s\t%lld\t...%s\n", printf("%lld\t%llu\t%s\t%lld\t...%s\n",
cp_file2.rank, llu(cp_file2.hash), darshan_names[i], lld(cp_file2.rank), llu(cp_file2.hash), darshan_names[i],
lld(cp_file2.counters[i]), cp_file2.name_suffix); lld(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("%d\t%llu\t%s\t%f\t...%s\n", printf("%lld\t%llu\t%s\t%f\t...%s\n",
cp_file1.rank, llu(cp_file1.hash), darshan_f_names[i], lld(cp_file1.rank), llu(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("%d\t%llu\t%s\t%f\t...%s\n", printf("%lld\t%llu\t%s\t%f\t...%s\n",
cp_file2.rank, llu(cp_file2.hash), darshan_f_names[i], lld(cp_file2.rank), llu(cp_file2.hash), darshan_f_names[i],
cp_file2.fcounters[i], cp_file2.name_suffix); cp_file2.fcounters[i], cp_file2.name_suffix);
} }
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "darshan-config.h" #include "darshan-config.h"
/* update this on file format changes */ /* update this on file format changes */
#define CP_VERSION "1.24" #define CP_VERSION "2.00"
/* size (in bytes) of job record */ /* size (in bytes) of job record */
#define CP_JOB_RECORD_SIZE 1024 #define CP_JOB_RECORD_SIZE 1024
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#define CP_FILE_RECORD_SIZE (sizeof(struct darshan_file)) #define CP_FILE_RECORD_SIZE (sizeof(struct darshan_file))
/* max length of name suffix string within file record (not counting '\0') */ /* max length of name suffix string within file record (not counting '\0') */
#define CP_NAME_SUFFIX_LEN 11 #define CP_NAME_SUFFIX_LEN 15
/* per file statistics */ /* per file statistics */
enum darshan_indices enum darshan_indices
...@@ -207,20 +207,20 @@ enum f_darshan_indices ...@@ -207,20 +207,20 @@ enum f_darshan_indices
struct darshan_file struct darshan_file
{ {
uint64_t hash; uint64_t hash;
int rank; int64_t rank;
char name_suffix[CP_NAME_SUFFIX_LEN+1];
int64_t counters[CP_NUM_INDICES]; int64_t counters[CP_NUM_INDICES];
double fcounters[CP_F_NUM_INDICES]; double fcounters[CP_F_NUM_INDICES];
char name_suffix[CP_NAME_SUFFIX_LEN+1];
}; };
/* statistics for the job as a whole */ /* statistics for the job as a whole */
struct darshan_job struct darshan_job
{ {
char version_string[10]; char version_string[8];
uid_t uid; int64_t uid;
long start_time; int64_t start_time;
long end_time; int64_t end_time;
int nprocs; int64_t nprocs;
}; };
#if SIZEOF_LONG_INT == 4 #if SIZEOF_LONG_INT == 4
......
...@@ -26,14 +26,14 @@ void darshan_log_print_version_warnings(struct darshan_job *job); ...@@ -26,14 +26,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("%d\t%llu\t%s\t%lld\t...%s\t%s\t%s\n", \ printf("%lld\t%llu\t%s\t%lld\t...%s\t%s\t%s\n", \
(__file)->rank, llu((__file)->hash), darshan_names[__counter], \ lld((__file)->rank), llu((__file)->hash), darshan_names[__counter], \
lld((__file)->counters[__counter]), (__file)->name_suffix, \ lld((__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("%d\t%llu\t%s\t%f\t...%s\t%s\t%s\n", \ printf("%lld\t%llu\t%s\t%f\t...%s\t%s\t%s\n", \
(__file)->rank, llu((__file)->hash), darshan_f_names[__counter], \ lld((__file)->rank), llu((__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)
......
...@@ -69,15 +69,16 @@ int main(int argc, char **argv) ...@@ -69,15 +69,16 @@ 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: %d\n", job.uid); printf("# uid: %lld\n", lld(job.uid));
printf("# start_time: %ld\n", (long)job.start_time); printf("# start_time: %lld\n", lld(job.start_time));
tmp_time = (time_t)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: %ld\n", (long)job.end_time); printf("# end_time: %lld\n", lld(job.end_time));
tmp_time = (time_t)job.end_time; tmp_time = 0;
tmp_time += job.end_time;
printf("# end_time_asci: %s", ctime(&tmp_time)); printf("# end_time_asci: %s", ctime(&tmp_time));
printf("# nprocs: %d\n", job.nprocs); printf("# nprocs: %lld\n", lld(job.nprocs));
printf("# run time: %ld\n", (long)(job.end_time - job.start_time + 1)); printf("# run time: %lld\n", lld(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,
......
...@@ -218,6 +218,7 @@ void darshan_shutdown(int timing_flag) ...@@ -218,6 +218,7 @@ void darshan_shutdown(int timing_flag)
char* trailing_data = NULL; char* trailing_data = NULL;
int i, j; int i, j;
int map_index = 0; int map_index = 0;
time_t start_time_tmp = 0;
CP_LOCK(); CP_LOCK();
if(!darshan_global_job) if(!darshan_global_job)
...@@ -358,7 +359,8 @@ void darshan_shutdown(int timing_flag) ...@@ -358,7 +359,8 @@ void darshan_shutdown(int timing_flag)
} }
/* break out time into something human readable */ /* break out time into something human readable */
my_tm = localtime(&final_job->log_job.start_time); start_time_tmp += final_job->log_job.start_time;
my_tm = localtime(&start_time_tmp);
/* note: getpwuid() causes link errors for static binaries */ /* note: getpwuid() causes link errors for static binaries */
cuserid(cuser); cuserid(cuser);
......
...@@ -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: %d\n", job.uid); printf("# uid: %lld\n", lld(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: %d\n", job.nprocs); printf("# nprocs: %lld\n", lld(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