Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use #include <...> for foreign header files.
[simgrid.git] / src / smpi / internals / smpi_global.cpp
index 3994112..9e1c6c0 100644 (file)
@@ -1,9 +1,8 @@
-/* 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 "mc/mc.h"
 #include "simgrid/Exception.hpp"
 #include "simgrid/plugins/file_system.h"
 #include "simgrid/s4u/Engine.hpp"
@@ -13,6 +12,7 @@
 #include "smpi_host.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
+#include "src/mc/mc.h"
 #include "src/mc/mc_replay.hpp"
 #include "src/smpi/include/smpi_actor.hpp"
 #include "xbt/config.hpp"
@@ -36,7 +36,7 @@
 #endif
 
 #if HAVE_PAPI
-#include "papi.h"
+#include <papi.h>
 #endif
 
 #if not defined(__APPLE__) && not defined(__HAIKU__)
@@ -72,7 +72,7 @@ std::map</* computation unit name */ std::string, papi_process_data, std::less<>
 std::unordered_map<std::string, double> location2speedup;
 
 static int smpi_exit_status = 0;
-xbt_os_timer_t global_timer;
+static xbt_os_timer_t global_timer;
 static std::vector<std::string> privatize_libs_paths;
 
 // No instance gets manually created; check also the smpirun.in script as
@@ -561,12 +561,15 @@ int smpi_main(const char* executable, int argc, char* argv[])
   SMPI_app_instance_register(smpi_default_instance_name.c_str(), nullptr, rank_counts);
   MPI_COMM_WORLD = *smpi_deployment_comm_world(smpi_default_instance_name);
 
-  /* Clean IO before the run */
+  /* Flush output streams before and after the run */
   fflush(stdout);
   fflush(stderr);
 
   engine.get_impl()->run(-1);
 
+  fflush(stderr);
+  fflush(stdout);
+
   xbt_os_walltimer_stop(global_timer);
   simgrid::smpi::utils::print_time_analysis(xbt_os_timer_elapsed(global_timer));