diff --git a/darshan-util/darshan-parser.c b/darshan-util/darshan-parser.c index edab499b0ab0a21be702270feee39b7ac1329361..0370233d8ef1b4c53b5c4743082e959ec61a2ee9 100644 --- a/darshan-util/darshan-parser.c +++ b/darshan-util/darshan-parser.c @@ -116,6 +116,7 @@ void mpiio_file_list(hash_entry_t *file_hash, struct darshan_name_record_ref *na void stdio_accum_perf(struct darshan_stdio_file *pfile, perf_data_t *pdata); void stdio_accum_file(struct darshan_stdio_file *pfile, hash_entry_t *hfile, int64_t nprocs); void stdio_calc_file(hash_entry_t *file_hash, file_data_t *fdata); +void stdio_file_list(hash_entry_t *file_hash, struct darshan_name_record_ref *name_hash, int detail_flag); void calc_perf(perf_data_t *pdata, int64_t nprocs); @@ -643,6 +644,13 @@ int main(int argc, char **argv) else mpiio_file_list(file_hash, name_hash, 0); } + else if(i == DARSHAN_STDIO_MOD) + { + if(mask & OPTION_FILE_LIST_DETAILED) + stdio_file_list(file_hash, name_hash, 1); + else + stdio_file_list(file_hash, name_hash, 0); + } } /* reset data structures for next module */ @@ -1700,6 +1708,90 @@ void mpiio_print_total_file(struct darshan_mpiio_file *mfile) return; } +void stdio_file_list(hash_entry_t *file_hash, + struct darshan_name_record_ref *name_hash, + int detail_flag) +{ + hash_entry_t *curr = NULL; + hash_entry_t *tmp = NULL; + struct darshan_stdio_file *file_rec = NULL; + struct darshan_name_record_ref *ref = NULL; + int i; + + /* list of columns: + * + * normal mode + * - file id + * - file name + * - nprocs + * - slowest I/O time + * - average cumulative I/O time + * + * detailed mode + * - first open + * - first read + * - first write + * - last read + * - last write + * - last close + * - STDIO opens + */ + + if(detail_flag) + printf("\n# Per-file summary of I/O activity (detailed).\n"); + else + printf("\n# Per-file summary of I/O activity.\n"); + + printf("# : darshan record id for this file\n"); + printf("# : full file name\n"); + printf("# : number of processes that opened the file\n"); + printf("# : (estimated) time in seconds consumed in IO by slowest process\n"); + printf("# : average time in seconds consumed in IO per process\n"); + if(detail_flag) + { + printf("# : start timestamp of first open, close, write, or read\n"); + printf("# : end timestamp of last open, close, write, or read\n"); + printf("# : STDIO open calls\n"); + } + + printf("\n# \t\t\t\t"); + if(detail_flag) + { + printf("\t\t\t\t"); + printf("\t\t\t\t\t"); + } + printf("\n"); + + HASH_ITER(hlink, file_hash, curr, tmp) + { + file_rec = (struct darshan_stdio_file*)curr->rec_dat; + assert(file_rec); + + HASH_FIND(hlink, name_hash, &(curr->rec_id), sizeof(darshan_record_id), ref); + assert(ref); + + printf("%" PRIu64 "\t%s\t%" PRId64 "\t%f\t%f", + curr->rec_id, + ref->name_record->name, + curr->procs, + curr->slowest_time, + curr->cumul_time/(double)curr->procs); + + if(detail_flag) + { + for(i=STDIO_F_OPEN_START_TIMESTAMP; i<=STDIO_F_READ_END_TIMESTAMP; i++) + { + printf("\t%f", file_rec->fcounters[i]); + } + printf("\t%" PRId64, file_rec->counters[STDIO_OPENS]); + } + printf("\n"); + } + + return; +} + + void posix_file_list(hash_entry_t *file_hash, struct darshan_name_record_ref *name_hash, int detail_flag)