From: Augustin Degomme Date: Sun, 14 Mar 2021 19:54:27 +0000 (+0100) Subject: attempt to fix en issue when timing functions are called before initialization X-Git-Tag: v3.27~138 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/cfbf3bda3a828313326d322fa92fb6719904d1a4 attempt to fix en issue when timing functions are called before initialization --- diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index 702ec1aef0..8eac4e7d43 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -207,7 +207,7 @@ int smpi_nanosleep(const struct timespec* tp, struct timespec* t) int smpi_gettimeofday(struct timeval* tv, struct timezone* tz) { - if (not smpi_process()) + if (not smpi_process()->initialized() || smpi_process()->finalized() || smpi_process()->sampling()) return gettimeofday(tv, tz); smpi_bench_end(); @@ -233,7 +233,7 @@ int smpi_clock_gettime(clockid_t clk_id, struct timespec* tp) errno = EFAULT; return -1; } - if (not smpi_process()) + if (not smpi_process()->initialized() || smpi_process()->finalized() || smpi_process()->sampling()) return clock_gettime(clk_id, tp); //there is only one time in SMPI, so clk_id is ignored. smpi_bench_end();