From 4377aebcf8c0966e4828021fb155937fd998800b Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Thu, 26 Nov 2020 12:48:11 +0000 Subject: [PATCH 1/2] Bugfix MDTest calculation of multiple iterations was incorrect. --- src/mdtest.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/mdtest.c b/src/mdtest.c index 5f0bebd..145fea1 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -1291,6 +1291,20 @@ void summarize_results(int iterations, int print_time) { } } + if(print_all_proc && 0){ + // This code prints the result table for debugging + for (i = 0; i < tableSize; i++) { + for (j = 0; j < iterations; j++) { + access = mdtest_test_name(i); + if(access == NULL){ + continue; + } + curr = summary_table[j].rate[i]; + fprintf(out_logfile, "Rank %d Iter %d Test %s Rate: %e\n", rank, j, access, curr); + } + } + } + if (rank != 0) { return; } @@ -1314,7 +1328,6 @@ void summarize_results(int iterations, int print_time) { start = stop = 0; } - if(print_all_proc){ fprintf(out_logfile, "\nPer process result (%s):\n", print_time ? "time" : "rate"); for (j = 0; j < iterations; j++) { @@ -1326,7 +1339,7 @@ void summarize_results(int iterations, int print_time) { } fprintf(out_logfile, "Test %s", access); for (k=0; k < size; k++) { - curr = all[(k*tableSize*iterations) + (j*tableSize) + i]; + curr = all[j*tableSize*size + k * tableSize + i]; fprintf(out_logfile, "%c%e", (k==0 ? ' ': ','), curr); } fprintf(out_logfile, "\n"); @@ -1340,10 +1353,9 @@ void summarize_results(int iterations, int print_time) { for (i = start; i < stop; i++) { min = max = all[i]; - for (k=0; k < size; k++) { - for (j = 0; j < iterations; j++) { - curr = all[(k*tableSize*iterations) - + (j*tableSize) + i]; + for (j = 0; j < iterations; j++) { + for (k=0; k < size; k++) { + curr = all[j*tableSize*size + k*tableSize + i]; if (min > curr) { min = curr; } @@ -1372,7 +1384,6 @@ void summarize_results(int iterations, int print_time) { fflush(out_logfile); } sum = var = 0; - } // TODO generalize once more stonewall timers are supported @@ -1389,7 +1400,7 @@ void summarize_results(int iterations, int print_time) { fprintf(out_logfile, "%14s %14s %14.3f %14s\n", "NA", "NA", print_time ? stonewall_time : stonewall_items / stonewall_time, "NA"); } - /* calculate tree create/remove rates */ + /* calculate tree create/remove rates, applies only to Rank 0 */ for (i = 8; i < tableSize; i++) { min = max = all[i]; for (j = 0; j < iterations; j++) { From 11c784c8bd25292001d27ca0858d2086df562419 Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Sat, 28 Nov 2020 10:40:41 +0000 Subject: [PATCH 2/2] Integrate review feedback. --- src/mdtest.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mdtest.c b/src/mdtest.c index 145fea1..ece7ab0 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -1271,6 +1271,11 @@ char const * mdtest_test_name(int i){ return NULL; } +int calc_allreduce_index(int iter, int rank, int op){ + int tableSize = MDTEST_LAST_NUM; + return iter*tableSize*size + rank * tableSize + op; +} + void summarize_results(int iterations, int print_time) { char const * access; int i, j, k; @@ -1339,7 +1344,7 @@ void summarize_results(int iterations, int print_time) { } fprintf(out_logfile, "Test %s", access); for (k=0; k < size; k++) { - curr = all[j*tableSize*size + k * tableSize + i]; + curr = all[calc_allreduce_index(j, k, i)]; fprintf(out_logfile, "%c%e", (k==0 ? ' ': ','), curr); } fprintf(out_logfile, "\n"); @@ -1355,7 +1360,7 @@ void summarize_results(int iterations, int print_time) { min = max = all[i]; for (j = 0; j < iterations; j++) { for (k=0; k < size; k++) { - curr = all[j*tableSize*size + k*tableSize + i]; + curr = all[calc_allreduce_index(j, k, i)]; if (min > curr) { min = curr; }