Commit ed103a2a authored by Shane Snyder's avatar Shane Snyder
Browse files

add base record concept to utilities

parent 05acb6d4
...@@ -68,7 +68,7 @@ int process_log(const char *fname, double *io_ratio, int *used_mpio, int *used_p ...@@ -68,7 +68,7 @@ int process_log(const char *fname, double *io_ratio, int *used_mpio, int *used_p
{ {
f_count += 1; f_count += 1;
if (psx_rec.rank == -1) if (psx_rec.base_rec.rank == -1)
*used_shared = 1; *used_shared = 1;
else else
*used_fpp = 1; *used_fpp = 1;
......
...@@ -654,7 +654,7 @@ void posix_accum_file(struct darshan_posix_file *pfile, ...@@ -654,7 +654,7 @@ void posix_accum_file(struct darshan_posix_file *pfile,
hfile->procs += 1; hfile->procs += 1;
if(pfile->rank == -1) if(pfile->base_rec.rank == -1)
{ {
hfile->slowest_time = pfile->fcounters[POSIX_F_SLOWEST_RANK_TIME]; hfile->slowest_time = pfile->fcounters[POSIX_F_SLOWEST_RANK_TIME];
} }
...@@ -666,7 +666,7 @@ void posix_accum_file(struct darshan_posix_file *pfile, ...@@ -666,7 +666,7 @@ void posix_accum_file(struct darshan_posix_file *pfile,
pfile->fcounters[POSIX_F_WRITE_TIME])); pfile->fcounters[POSIX_F_WRITE_TIME]));
} }
if(pfile->rank == -1) if(pfile->base_rec.rank == -1)
{ {
hfile->procs = nprocs; hfile->procs = nprocs;
hfile->type |= FILETYPE_SHARED; hfile->type |= FILETYPE_SHARED;
...@@ -1029,7 +1029,7 @@ void posix_accum_perf(struct darshan_posix_file *pfile, ...@@ -1029,7 +1029,7 @@ void posix_accum_perf(struct darshan_posix_file *pfile,
* by_slowest: use slowest rank time from log data * by_slowest: use slowest rank time from log data
* (most accurate but requires newer log version) * (most accurate but requires newer log version)
*/ */
if(pfile->rank == -1) if(pfile->base_rec.rank == -1)
{ {
/* by_open */ /* by_open */
if(pfile->fcounters[POSIX_F_CLOSE_TIMESTAMP] > if(pfile->fcounters[POSIX_F_CLOSE_TIMESTAMP] >
...@@ -1080,11 +1080,12 @@ void posix_accum_perf(struct darshan_posix_file *pfile, ...@@ -1080,11 +1080,12 @@ void posix_accum_perf(struct darshan_posix_file *pfile,
*/ */
else else
{ {
pdata->rank_cumul_io_time[pfile->rank] += pdata->rank_cumul_io_time[pfile->base_rec.rank] +=
(pfile->fcounters[POSIX_F_META_TIME] + (pfile->fcounters[POSIX_F_META_TIME] +
pfile->fcounters[POSIX_F_READ_TIME] + pfile->fcounters[POSIX_F_READ_TIME] +
pfile->fcounters[POSIX_F_WRITE_TIME]); pfile->fcounters[POSIX_F_WRITE_TIME]);
pdata->rank_cumul_md_time[pfile->rank] += pfile->fcounters[POSIX_F_META_TIME]; pdata->rank_cumul_md_time[pfile->base_rec.rank] +=
pfile->fcounters[POSIX_F_META_TIME];
} }
return; return;
......
...@@ -62,15 +62,15 @@ static int darshan_log_get_posix_file(darshan_fd fd, void* posix_buf, ...@@ -62,15 +62,15 @@ static int darshan_log_get_posix_file(darshan_fd fd, void* posix_buf,
if(fd->swap_flag) if(fd->swap_flag)
{ {
/* swap bytes if necessary */ /* swap bytes if necessary */
DARSHAN_BSWAP64(&file->f_id); DARSHAN_BSWAP64(&file->base_rec.id);
DARSHAN_BSWAP64(&file->rank); DARSHAN_BSWAP64(&file->base_rec.rank);
for(i=0; i<POSIX_NUM_INDICES; i++) for(i=0; i<POSIX_NUM_INDICES; i++)
DARSHAN_BSWAP64(&file->counters[i]); DARSHAN_BSWAP64(&file->counters[i]);
for(i=0; i<POSIX_F_NUM_INDICES; i++) for(i=0; i<POSIX_F_NUM_INDICES; i++)
DARSHAN_BSWAP64(&file->fcounters[i]); DARSHAN_BSWAP64(&file->fcounters[i]);
} }
*rec_id = file->f_id; *rec_id = file->base_rec.id;
return(1); return(1);
} }
} }
...@@ -98,15 +98,17 @@ static void darshan_log_print_posix_file(void *file_rec, char *file_name, ...@@ -98,15 +98,17 @@ static void darshan_log_print_posix_file(void *file_rec, char *file_name,
for(i=0; i<POSIX_NUM_INDICES; i++) for(i=0; i<POSIX_NUM_INDICES; i++)
{ {
DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD], DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
posix_file_rec->rank, posix_file_rec->f_id, posix_counter_names[i], posix_file_rec->base_rec.rank, posix_file_rec->base_rec.id,
posix_file_rec->counters[i], file_name, mnt_pt, fs_type); posix_counter_names[i], posix_file_rec->counters[i],
file_name, mnt_pt, fs_type);
} }
for(i=0; i<POSIX_F_NUM_INDICES; i++) for(i=0; i<POSIX_F_NUM_INDICES; i++)
{ {
DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD], DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_POSIX_MOD],
posix_file_rec->rank, posix_file_rec->f_id, posix_f_counter_names[i], posix_file_rec->base_rec.rank, posix_file_rec->base_rec.id,
posix_file_rec->fcounters[i], file_name, mnt_pt, fs_type); posix_f_counter_names[i], posix_file_rec->fcounters[i],
file_name, mnt_pt, fs_type);
} }
return; return;
......
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