Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Code style.
[simgrid.git] / src / smpi / smpi_bench.cpp
index a284bb1..1942087 100644 (file)
@@ -3,34 +3,18 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <cstring>
-
-#include <unordered_map>
-#include <utility>
-
 #include "src/internal_config.h"
 #include "private.h"
 #include "private.hpp"
-#include <xbt/ex.hpp>
-#include "xbt/dict.h"
-#include "xbt/sysdep.h"
-#include "xbt/ex.h"
-#include "surf/surf.h"
-#include "simgrid/sg_config.h"
 #include "simgrid/modelchecker.h"
 #include "src/mc/mc_replay.h"
+#include "src/smpi/smpi_process.hpp"
+#include "src/smpi/smpi_comm.hpp"
 
-#include <sys/types.h>
 #ifndef WIN32
 #include <sys/mman.h>
 #endif
-#include <sys/stat.h>
-#include <errno.h>
-#include <fcntl.h>
 #include <math.h> // sqrt
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
 
 #if HAVE_PAPI
 #include <papi.h>
@@ -41,7 +25,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_bench, smpi, "Logging specific to SMPI (ben
 
 xbt_dict_t samples = nullptr;         /* Allocated on first use */
 
-double smpi_cpu_threshold;
+double smpi_cpu_threshold = -1;
 double smpi_host_speed;
 
 shared_malloc_type smpi_cfg_shared_malloc = shmalloc_global;
@@ -94,9 +78,16 @@ void smpi_execute(double duration)
   }
 }
 
+void smpi_execute_public(double duration)
+{
+  smpi_bench_end();
+  smpi_execute(duration);
+  smpi_bench_begin();
+}
+
 void smpi_bench_begin()
 {
-  if (smpi_privatize_global_variables) {
+  if (smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) {
     smpi_switch_data_segment(smpi_process()->index());
   }