From ae717b7deffa6e3d2577c4d4d480733ec67af0b6 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Wed, 16 Jun 2021 22:26:25 +0200 Subject: [PATCH] Try to be more coherent, fix misleading message, and fix test. It was asking 0 iterations max, let's say that this means "exit after the first". --- src/smpi/internals/smpi_bench.cpp | 7 +++---- teshsuite/smpi/macro-sample/macro-sample.c | 1 + teshsuite/smpi/macro-sample/macro-sample.tesh | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index 49eafee052..1e77dc6b14 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -299,9 +299,8 @@ public: bool LocalData::need_more_benchs() const { - bool res = (count < iters) && (threshold > 0.0 && (count < 2 || // not enough data - relstderr > threshold // stderr too high yet - )); + bool res = (count < iters) && (threshold < 0.0 || count < 2 || // not enough data + relstderr >= threshold); // stderr too high yet XBT_DEBUG("%s (count:%d iter:%d stderr:%f thres:%f mean:%fs)", (res ? "need more data" : "enough benchs"), count, iters, relstderr, threshold, mean); return res; @@ -368,7 +367,7 @@ int smpi_sample_2(int global, const char *file, int line, int iter_count) // Enough data, no more bench (either we got enough data from previous visits to this benched nest, or we just //ran one bench and need to bail out now that our job is done). Just sleep instead if (not data.need_more_benchs()){ - XBT_DEBUG("No benchmark (either no need, or just ran one): count >= iter (%d >= %d) or stderr= iter (%d) (or <2) or stderr (%f) < thres (%f), or thresh is negative and ignored. " "Mean is %f, will be injected %d times", data.count, data.iters, data.relstderr, data.threshold, data.mean, iter_count); diff --git a/teshsuite/smpi/macro-sample/macro-sample.c b/teshsuite/smpi/macro-sample/macro-sample.c index 9df719c1c1..56c8ed186c 100644 --- a/teshsuite/smpi/macro-sample/macro-sample.c +++ b/teshsuite/smpi/macro-sample/macro-sample.c @@ -44,6 +44,7 @@ int main(int argc, char *argv[]) } n = 0; + //Use 0 as max iter, but one will always be performed by design. SMPI_SAMPLE_LOCAL (int i = 0, i < 5, i++,0, 0.1){ if (verbose || n < 2) { n++; diff --git a/teshsuite/smpi/macro-sample/macro-sample.tesh b/teshsuite/smpi/macro-sample/macro-sample.tesh index 5831dc424b..d0d8006be6 100644 --- a/teshsuite/smpi/macro-sample/macro-sample.tesh +++ b/teshsuite/smpi/macro-sample/macro-sample.tesh @@ -7,11 +7,8 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform > (0) Run the first computation. It's globally benched, and I want no more than 4 benchmarks (thres<0) > (0) Run the first computation. It's globally benched, and I want no more than 4 benchmarks (thres<0) > (1) [rank:0] Run the second (locally benched) computation. It's locally benched, and I want the standard error to go below 0.1 second (count is not >0) -> (1) [rank:0] Run the second (locally benched) computation. It's locally benched, and I want the standard error to go below 0.1 second (count is not >0) -> (1) [rank:1] Run the second (locally benched) computation. It's locally benched, and I want the standard error to go below 0.1 second (count is not >0) > (1) [rank:1] Run the second (locally benched) computation. It's locally benched, and I want the standard error to go below 0.1 second (count is not >0) > (1) [rank:2] Run the second (locally benched) computation. It's locally benched, and I want the standard error to go below 0.1 second (count is not >0) -> (1) [rank:2] Run the second (locally benched) computation. It's locally benched, and I want the standard error to go below 0.1 second (count is not >0) > (2) [rank:0] Done. > (2) [rank:1] Done. > (2) [rank:2] Done. -- 2.20.1