X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/453ff30e808b8aa38d9b0a6db090981cd37b6605..257a3f5cec44f5ff92b998a2cccb4b32113552a1:/src/smpi/smpi_bench.c diff --git a/src/smpi/smpi_bench.c b/src/smpi/smpi_bench.c index e91f9c7482..363381559f 100644 --- a/src/smpi/smpi_bench.c +++ b/src/smpi/smpi_bench.c @@ -171,18 +171,22 @@ void smpi_bench_end(void) unsigned int smpi_sleep(unsigned int secs) { + smpi_bench_end(); smpi_execute((double) secs); + smpi_bench_begin(); return secs; } int smpi_gettimeofday(struct timeval *tv, struct timezone *tz) { - double now = SIMIX_get_clock(); - + double now; + smpi_bench_end(); + now = SIMIX_get_clock(); if (tv) { - tv->tv_sec = (time_t) now; - tv->tv_usec = (suseconds_t) (now * 1e6); + tv->tv_sec = (time_t)now; + tv->tv_usec = (suseconds_t)((now - tv->tv_sec) * 1e6); } + smpi_bench_begin(); return 0; } @@ -368,7 +372,8 @@ int smpi_shared_known_call(const char* func, const char* input) { TRY { xbt_dict_get(calls, loc); /* Succeed or throw */ known = 1; - } CATCH(ex) { + } + CATCH(ex) { if(ex.category == not_found_error) { known = 0; xbt_ex_free(ex);