Commit f4df41a3 authored by Shane Snyder's avatar Shane Snyder

add slowest/fastest rank counters to mpiio

parent a708b0ce
......@@ -9,7 +9,6 @@
#include "darshan-log-format.h"
/* TODO: slowest/fastest rank (f)counters */
/* TODO: maybe use a counter to track cases in which a derived datatype is used? */
#define MPIIO_COUNTERS \
......
......@@ -1059,6 +1059,7 @@ static void mpiio_setup_reduction(
{
struct mpiio_file_runtime *file;
int i;
double mpiio_time;
assert(mpiio_runtime);
......@@ -1069,6 +1070,31 @@ static void mpiio_setup_reduction(
sizeof(darshan_record_id), file);
assert(file);
mpiio_time =
file->file_record->fcounters[MPIIO_F_READ_TIME] +
file->file_record->fcounters[MPIIO_F_WRITE_TIME] +
file->file_record->fcounters[MPIIO_F_META_TIME];
/* initialize fastest/slowest info prior to the reduction */
file->file_record->counters[MPIIO_FASTEST_RANK] =
file->file_record->rank;
file->file_record->counters[MPIIO_FASTEST_RANK_BYTES] =
file->file_record->counters[MPIIO_BYTES_READ] +
file->file_record->counters[MPIIO_BYTES_WRITTEN];
file->file_record->fcounters[MPIIO_F_FASTEST_RANK_TIME] =
mpiio_time;
/* until reduction occurs, we assume that this rank is both
* the fastest and slowest. It is up to the reduction operator
* to find the true min and max.
*/
file->file_record->counters[MPIIO_SLOWEST_RANK] =
file->file_record->counters[MPIIO_FASTEST_RANK];
file->file_record->counters[MPIIO_SLOWEST_RANK_BYTES] =
file->file_record->counters[MPIIO_FASTEST_RANK_BYTES];
file->file_record->fcounters[MPIIO_F_SLOWEST_RANK_TIME] =
file->file_record->fcounters[MPIIO_F_FASTEST_RANK_TIME];
file->file_record->rank = -1;
}
......@@ -1228,6 +1254,48 @@ static void mpiio_record_reduction_op(
inoutfile->counters[MPIIO_MAX_WRITE_TIME_SIZE];
}
/* min (zeroes are ok here; some procs don't do I/O) */
if(infile->fcounters[MPIIO_F_FASTEST_RANK_TIME] <
inoutfile->fcounters[MPIIO_F_FASTEST_RANK_TIME])
{
tmp_file.counters[MPIIO_FASTEST_RANK] =
infile->counters[MPIIO_FASTEST_RANK];
tmp_file.counters[MPIIO_FASTEST_RANK_BYTES] =
infile->counters[MPIIO_FASTEST_RANK_BYTES];
tmp_file.fcounters[MPIIO_F_FASTEST_RANK_TIME] =
infile->fcounters[MPIIO_F_FASTEST_RANK_TIME];
}
else
{
tmp_file.counters[MPIIO_FASTEST_RANK] =
inoutfile->counters[MPIIO_FASTEST_RANK];
tmp_file.counters[MPIIO_FASTEST_RANK_BYTES] =
inoutfile->counters[MPIIO_FASTEST_RANK_BYTES];
tmp_file.fcounters[MPIIO_F_FASTEST_RANK_TIME] =
inoutfile->fcounters[MPIIO_F_FASTEST_RANK_TIME];
}
/* max */
if(infile->fcounters[MPIIO_F_SLOWEST_RANK_TIME] >
inoutfile->fcounters[MPIIO_F_SLOWEST_RANK_TIME])
{
tmp_file.counters[MPIIO_SLOWEST_RANK] =
infile->counters[MPIIO_SLOWEST_RANK];
tmp_file.counters[MPIIO_SLOWEST_RANK_BYTES] =
infile->counters[MPIIO_SLOWEST_RANK_BYTES];
tmp_file.fcounters[MPIIO_F_SLOWEST_RANK_TIME] =
infile->fcounters[MPIIO_F_SLOWEST_RANK_TIME];
}
else
{
tmp_file.counters[MPIIO_SLOWEST_RANK] =
inoutfile->counters[MPIIO_SLOWEST_RANK];
tmp_file.counters[MPIIO_SLOWEST_RANK_BYTES] =
inoutfile->counters[MPIIO_SLOWEST_RANK_BYTES];
tmp_file.fcounters[MPIIO_F_SLOWEST_RANK_TIME] =
inoutfile->fcounters[MPIIO_F_SLOWEST_RANK_TIME];
}
/* update pointers */
*inoutfile = tmp_file;
inoutfile++;
......
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