Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to be more coherent, fix misleading message, and fix test.
authorAugustin Degomme <adegomme@users.noreply.github.com>
Wed, 16 Jun 2021 20:26:25 +0000 (22:26 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Wed, 16 Jun 2021 20:26:25 +0000 (22:26 +0200)
It was asking 0 iterations max, let's say that this means "exit after the first".

src/smpi/internals/smpi_bench.cpp
teshsuite/smpi/macro-sample/macro-sample.c
teshsuite/smpi/macro-sample/macro-sample.tesh

index 49eafee..1e77dc6 100644 (file)
@@ -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<thres (%f<=%f). "
+      XBT_DEBUG("No benchmark (either no need, or just ran one): count (%d) >= 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);
               
index 9df719c..56c8ed1 100644 (file)
@@ -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++;
index 5831dc4..d0d8006 100644 (file)
@@ -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.