X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6b188a3ca7fe91cf125a08229fb4fe51eee26e6d..184f7cbedd7496fb81e192e78f7beae87f942ee5:/src/smpi/smpi_bench.c diff --git a/src/smpi/smpi_bench.c b/src/smpi/smpi_bench.c index d69573014f..2134e47357 100644 --- a/src/smpi/smpi_bench.c +++ b/src/smpi/smpi_bench.c @@ -133,11 +133,11 @@ static void smpi_execute_flops(double flops) host = SIMIX_host_self(); XBT_DEBUG("Handle real computation time: %f flops", flops); - action = SIMIX_req_host_execute("computation", host, flops, 1); + action = simcall_host_execute("computation", host, flops, 1); #ifdef HAVE_TRACING - SIMIX_req_set_category (action, TRACE_internal_smpi_get_category()); + simcall_set_category (action, TRACE_internal_smpi_get_category()); #endif - SIMIX_req_host_execution_wait(action); + simcall_host_execution_wait(action); } static void smpi_execute(double duration) @@ -189,6 +189,26 @@ int smpi_gettimeofday(struct timeval *tv, struct timezone *tz) return 0; } +extern double sg_maxmin_precision; +unsigned long long smpi_rastro_resolution (void) +{ + smpi_bench_end(); + double resolution = (1/sg_maxmin_precision); + smpi_bench_begin(); + return (unsigned long long)resolution; +} + +unsigned long long smpi_rastro_timestamp (void) +{ + smpi_bench_end(); + double now = SIMIX_get_clock(); + + unsigned long long sec = (unsigned long long)now; + unsigned long long pre = (now - sec) * smpi_rastro_resolution(); + smpi_bench_begin(); + return (unsigned long long)sec * smpi_rastro_resolution() + pre; +} + static char *sample_location(int global, const char *file, int line) { if (global) {