Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New function SMPI_app_instance_start() to easily start a MPI instance in your S4U...
[simgrid.git] / src / smpi / internals / smpi_bench.cpp
index e398719..82752a6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
 
 /* 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 "smpi_comm.hpp"
 #include "smpi_utils.hpp"
 #include "src/internal_config.h"
+#include "src/kernel/lmm/System.hpp" // sg_precision_timing
 #include "src/mc/mc_replay.hpp"
-#include "src/surf/surf_interface.hpp" // sg_surf_precision
 #include "xbt/config.hpp"
 #include "xbt/file.hpp"
 
 #include "src/smpi/include/smpi_actor.hpp"
-#include <unordered_map>
 
-#ifndef WIN32
-#include <sys/mman.h>
-#endif
 #include <cerrno>
 #include <cmath>
+#include <sys/mman.h>
+#include <unordered_map>
 
 #if HAVE_PAPI
 #include <papi.h>
@@ -211,7 +209,7 @@ int smpi_gettimeofday(struct timeval* tv, struct timezone* tz)
     double secs  = trunc(now);
     double usecs = (now - secs) * 1e6;
     tv->tv_sec   = static_cast<time_t>(secs);
-    tv->tv_usec  = static_cast<decltype(tv->tv_usec)>(usecs); // suseconds_t (or useconds_t on WIN32)
+    tv->tv_usec  = static_cast<decltype(tv->tv_usec)>(usecs); // suseconds_t
   }
   if (smpi_wtime_sleep > 0)
     simgrid::s4u::this_actor::sleep_for(smpi_wtime_sleep);
@@ -258,13 +256,13 @@ double smpi_mpi_wtime()
 unsigned long long smpi_rastro_resolution ()
 {
   const SmpiBenchGuard suspend_bench;
-  return static_cast<unsigned long long>(1.0 / sg_surf_precision);
+  return static_cast<unsigned long long>(1.0 / sg_precision_timing);
 }
 
 unsigned long long smpi_rastro_timestamp ()
 {
   const SmpiBenchGuard suspend_bench;
-  return static_cast<unsigned long long>(simgrid::s4u::Engine::get_clock() / sg_surf_precision);
+  return static_cast<unsigned long long>(simgrid::s4u::Engine::get_clock() / sg_precision_timing);
 }
 
 /* ****************************** Functions related to the SMPI_SAMPLE_ macros ************************************/