Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
dafuk? don't mix seconds and flops!
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 4 Aug 2012 15:15:42 +0000 (17:15 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 4 Aug 2012 15:15:42 +0000 (17:15 +0200)
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
src/smpi/private.h
src/smpi/smpi_bench.c
src/smpi/smpi_replay.c

index b2267a7..bba6c24 100644 (file)
@@ -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);
                               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__);      \
 
 #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__))
 
                                             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);
 
 XBT_PUBLIC(void *) smpi_shared_malloc(size_t size, const char *file,
                                       int line);
index a01ffef..dbe4681 100644 (file)
@@ -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_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*);
 
 // f77 wrappers
 void mpi_init__(int*);
index ad115e1..f2a5fef 100644 (file)
@@ -115,8 +115,7 @@ void smpi_bench_destroy(void)
   xbt_dict_free(&calls);
 }
 
   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();
   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;
 }
 
   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);
 void *smpi_shared_malloc(size_t size, const char *file, int line)
 {
   char *loc = bprintf("%zu_%s_%d", (size_t)getpid(), file, line);
index 657b3a4..27d0897 100644 (file)
@@ -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]));
 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)
 }
 
 static void action_send(const char *const *action)