From cfbf3bda3a828313326d322fa92fb6719904d1a4 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Sun, 14 Mar 2021 20:54:27 +0100 Subject: [PATCH] attempt to fix en issue when timing functions are called before initialization --- src/smpi/internals/smpi_bench.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); -- 2.20.1