From 61270581ab9406eb95fc6279c41201b1bd853a8d Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 4 Aug 2012 17:15:42 +0200 Subject: [PATCH] dafuk? don't mix seconds and flops! SMPI_SAMPLE_DELAY parameter were an amount of flops. Consider it as a delay instead. Introduce SMPI_SAMPLE_FLOPS to report an amount of flops into the simulo (and use it in the replay part of SMPI) --- include/smpi/smpi.h | 4 ++-- src/smpi/private.h | 1 + src/smpi/smpi_bench.c | 8 +------- src/smpi/smpi_replay.c | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index b2267a7691..bba6c24f2a 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -431,7 +431,6 @@ XBT_PUBLIC(void) smpi_sample_1(int global, const char *file, int line, int iters, double threshold); XBT_PUBLIC(int) smpi_sample_2(int global, const char *file, int line); XBT_PUBLIC(void) smpi_sample_3(int global, const char *file, int line); -XBT_PUBLIC(void) smpi_sample_flops(double flops); #define SMPI_SAMPLE_LOCAL(iters,thres) for(smpi_sample_1(0, __FILE__, __LINE__, iters, thres); \ smpi_sample_2(0, __FILE__, __LINE__); \ @@ -441,7 +440,8 @@ XBT_PUBLIC(void) smpi_sample_flops(double flops); smpi_sample_2(1, __FILE__, __LINE__); \ smpi_sample_3(1, __FILE__, __LINE__)) -#define SMPI_SAMPLE_DELAY(flops) for(smpi_sample_flops(flops); 0; ) +#define SMPI_SAMPLE_DELAY(duration) for(smpi_execute(duration); 0; ) +#define SMPI_SAMPLE_FLOPS(flops) for(smpi_execute_flops(flops); 0; ) XBT_PUBLIC(void *) smpi_shared_malloc(size_t size, const char *file, int line); diff --git a/src/smpi/private.h b/src/smpi/private.h index a01ffef124..dbe46814d6 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -180,6 +180,7 @@ int smpi_coll_basic_alltoallv(void *sendbuf, int *sendcounts, void smpi_bench_destroy(void); void smpi_bench_begin(void); void smpi_bench_end(void); +void smpi_execute_flops(double flops); // f77 wrappers void mpi_init__(int*); diff --git a/src/smpi/smpi_bench.c b/src/smpi/smpi_bench.c index ad115e170e..f2a5feff80 100644 --- a/src/smpi/smpi_bench.c +++ b/src/smpi/smpi_bench.c @@ -115,8 +115,7 @@ void smpi_bench_destroy(void) xbt_dict_free(&calls); } -static void smpi_execute_flops(double flops) -{ +void smpi_execute_flops(double flops) { smx_action_t action; smx_host_t host; host = SIMIX_host_self(); @@ -325,11 +324,6 @@ void smpi_sample_3(int global, const char *file, int line) data->benching = 0; } -void smpi_sample_flops(double flops) -{ - smpi_execute_flops(flops); -} - void *smpi_shared_malloc(size_t size, const char *file, int line) { char *loc = bprintf("%zu_%s_%d", (size_t)getpid(), file, line); diff --git a/src/smpi/smpi_replay.c b/src/smpi/smpi_replay.c index 657b3a4cb3..27d08977d8 100644 --- a/src/smpi/smpi_replay.c +++ b/src/smpi/smpi_replay.c @@ -26,7 +26,7 @@ static double parse_double(const char *string) static void action_compute(const char *const *action) { XBT_DEBUG("Start to compute %.0f flops", parse_double(action[2])); - smpi_sample_flops(parse_double(action[2])); + smpi_execute_flops(parse_double(action[2])); } static void action_send(const char *const *action) -- 2.20.1