Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
include cleanups (mostly surf/surf.hpp)
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Thu, 30 Sep 2021 12:22:19 +0000 (14:22 +0200)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Thu, 30 Sep 2021 12:22:19 +0000 (14:22 +0200)
38 files changed:
src/instr/instr_config.cpp
src/instr/instr_interface.cpp
src/instr/instr_platform.cpp
src/kernel/EngineImpl.cpp
src/kernel/activity/CommImpl.hpp
src/kernel/activity/ExecImpl.hpp
src/kernel/activity/IoImpl.hpp
src/kernel/activity/SleepImpl.hpp
src/kernel/activity/SynchroRaw.hpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/VivaldiZone.cpp
src/kernel/routing/WifiZone.cpp
src/plugins/host_energy.cpp
src/plugins/host_load.cpp
src/plugins/link_energy.cpp
src/plugins/link_energy_wifi.cpp
src/plugins/link_load.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/s4u/s4u_Engine.cpp
src/simgrid/sg_config.cpp
src/smpi/include/smpi_utils.hpp
src/surf/cpu_cas01.cpp
src/surf/cpu_interface.cpp
src/surf/disk_s19.cpp
src/surf/host_clm03.cpp
src/surf/network_constant.cpp
src/surf/network_ib.cpp
src/surf/network_interface.cpp
src/surf/network_smpi.cpp
src/surf/ptask_L07.cpp
src/surf/sg_platf.cpp
src/surf/surf_c_bindings.cpp
src/surf/xml/surfxml_parseplatf.cpp
src/surf/xml/surfxml_sax_cb.cpp

index 3c22b9b..d3e3128 100644 (file)
@@ -3,12 +3,12 @@
 /* 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 "include/xbt/config.hpp"
-#include "simgrid/Exception.hpp"
-#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/version.h"
+#include <simgrid/Exception.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/version.h>
+
 #include "src/instr/instr_private.hpp"
-#include "surf/surf.hpp"
+#include "xbt/config.hpp"
 
 #include <sys/stat.h>
 #ifdef WIN32
@@ -420,7 +420,7 @@ static void on_simulation_end()
     return;
 
   /* dump trace buffer */
-  last_timestamp_to_dump = surf_get_clock();
+  last_timestamp_to_dump = simgrid_get_clock();
   dump_buffer(true);
 
   const Type* root_type = Container::get_root()->get_type();
index a1b6da9..798e1c0 100644 (file)
@@ -3,13 +3,13 @@
 /* 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 "simgrid/Exception.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
+#include <simgrid/Exception.hpp>
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <xbt/random.hpp>
+
 #include "src/instr/instr_private.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/surf_private.hpp"
-#include "surf/surf.hpp"
-#include "xbt/random.hpp"
 #include <algorithm>
 #include <cmath>
 
index 81e64bb..3d83425 100644 (file)
@@ -3,22 +3,21 @@
 /* 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 "src/instr/instr_private.hpp"
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Actor.hpp>
+#include <simgrid/s4u/Comm.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/Exec.hpp>
+#include <simgrid/s4u/Host.hpp>
+#include <simgrid/s4u/VirtualMachine.hpp>
+#include <xbt/graph.h>
 
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/Actor.hpp"
-#include "simgrid/s4u/Comm.hpp"
-#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/s4u/Exec.hpp"
-#include "simgrid/s4u/Host.hpp"
-#include "simgrid/s4u/VirtualMachine.hpp"
+#include "src/instr/instr_private.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
-#include "surf/surf.hpp"
-#include "xbt/graph.h"
 
 #include <fstream>
 
@@ -429,13 +428,13 @@ void define_callbacks()
     s4u::Host::on_speed_change.connect([](s4u::Host const& host) {
       Container::by_name(host.get_name())
           ->get_variable("speed")
-          ->set_event(surf_get_clock(), host.get_core_count() * host.get_available_speed());
+          ->set_event(simgrid_get_clock(), host.get_core_count() * host.get_available_speed());
     });
     s4u::Link::on_creation.connect(on_link_creation);
     s4u::Link::on_bandwidth_change.connect([](s4u::Link const& link) {
       Container::by_name(link.get_name())
           ->get_variable("bandwidth")
-          ->set_event(surf_get_clock(), sg_bandwidth_factor * link.get_bandwidth());
+          ->set_event(simgrid_get_clock(), sg_bandwidth_factor * link.get_bandwidth());
     });
     s4u::NetZone::on_seal.connect([](s4u::NetZone const& /*netzone*/) { currentContainer.pop_back(); });
     kernel::routing::NetPoint::on_creation.connect([](kernel::routing::NetPoint const& netpoint) {
index 4f74809..cb65b17 100644 (file)
@@ -3,22 +3,22 @@
 /* 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 "src/kernel/EngineImpl.hpp"
+#include <simgrid/Exception.hpp>
+#include <simgrid/kernel/Timer.hpp>
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Host.hpp>
+#include <simgrid/sg_config.hpp>
+
 #include "mc/mc.h"
-#include "simgrid/Exception.hpp"
-#include "simgrid/kernel/Timer.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/Host.hpp"
-#include "simgrid/sg_config.hpp"
-#include "src/include/surf/surf.hpp" //get_clock() and surf_solve()
-#include "src/kernel/resource/DiskImpl.hpp"
+#include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/resource/profile/Profile.hpp"
 #include "src/mc/mc_record.hpp"
 #include "src/mc/mc_replay.hpp"
 #include "src/smpi/include/smpi_actor.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/xml/platf.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here
+#include "surf/surf.hpp"          //surf_presolve() and surf_solve()
 #include "xbt/xbt_modinter.h"     /* whether initialization was already done */
 
 #include <boost/algorithm/string/predicate.hpp>
@@ -473,7 +473,7 @@ void EngineImpl::run()
   do {
     XBT_DEBUG("New Schedule Round; size(queue)=%zu", actors_to_run_.size());
 
-    if (cfg_breakpoint >= 0.0 && surf_get_clock() >= cfg_breakpoint) {
+    if (cfg_breakpoint >= 0.0 && simgrid_get_clock() >= cfg_breakpoint) {
       XBT_DEBUG("Breakpoint reached (%g)", cfg_breakpoint.get());
       cfg_breakpoint = -1.0;
 #ifdef SIGTRAP
index 475eda9..4221a89 100644 (file)
@@ -8,8 +8,6 @@
 
 #include "src/kernel/activity/ActivityImpl.hpp"
 #include "src/kernel/actor/ActorImpl.hpp"
-#include "surf/surf.hpp"
-
 
 namespace simgrid {
 namespace kernel {
index 9fc5f88..e02c10f 100644 (file)
@@ -6,10 +6,10 @@
 #ifndef SIMGRID_KERNEL_ACTIVITY_EXEC_HPP
 #define SIMGRID_KERNEL_ACTIVITY_EXEC_HPP
 
-#include "simgrid/s4u/Exec.hpp"
+#include <simgrid/s4u/Exec.hpp>
+
 #include "src/kernel/activity/ActivityImpl.hpp"
 #include "src/kernel/context/Context.hpp"
-#include "surf/surf.hpp"
 
 namespace simgrid {
 namespace kernel {
index 758d9ec..3bd9c7b 100644 (file)
@@ -7,7 +7,6 @@
 #define SIMGRID_KERNEL_ACTIVITY_IO_HPP
 
 #include "src/kernel/activity/ActivityImpl.hpp"
-#include "surf/surf.hpp"
 #include <simgrid/s4u/Io.hpp>
 
 namespace simgrid {
index f1519a6..2e3284f 100644 (file)
@@ -7,7 +7,6 @@
 #define SIMGRID_KERNEL_ACTIVITY_SLEEP_HPP
 
 #include "src/kernel/activity/ActivityImpl.hpp"
-#include "surf/surf.hpp"
 
 namespace simgrid {
 namespace kernel {
index b4ed393..1c9ad28 100644 (file)
@@ -7,7 +7,7 @@
 #define SIMGRID_KERNEL_ACTIVITY_SYNCHRO_RAW_HPP
 
 #include "src/kernel/activity/ActivityImpl.hpp"
-#include "surf/surf.hpp"
+
 #include <functional>
 
 namespace simgrid {
index d47dc4d..5381c38 100644 (file)
@@ -3,11 +3,11 @@
 /* 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 "simgrid/kernel/routing/DijkstraZone.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
+#include <simgrid/kernel/routing/DijkstraZone.hpp>
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <xbt/string.hpp>
+
 #include "src/surf/network_interface.hpp"
-#include "surf/surf.hpp"
-#include "xbt/string.hpp"
 
 #include <climits>
 #include <queue>
index 8de2e8c..7a134c5 100644 (file)
@@ -3,11 +3,11 @@
 /* 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 "simgrid/kernel/routing/FloydZone.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
+#include <simgrid/kernel/routing/FloydZone.hpp>
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <xbt/string.hpp>
+
 #include "src/surf/network_interface.hpp"
-#include "surf/surf.hpp"
-#include "xbt/string.hpp"
 
 #include <climits>
 
index 6ec3408..132dc87 100644 (file)
@@ -3,10 +3,10 @@
 /* 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 "simgrid/kernel/routing/FullZone.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
+#include <simgrid/kernel/routing/FullZone.hpp>
+#include <simgrid/kernel/routing/NetPoint.hpp>
+
 #include "src/surf/network_interface.hpp"
-#include "surf/surf.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
 
index bfcf4ce..0b875ed 100644 (file)
@@ -3,10 +3,11 @@
 /* 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 "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/s4u/Host.hpp"
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/Host.hpp>
+
 #include "src/include/simgrid/sg_config.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/resource/DiskImpl.hpp"
@@ -14,7 +15,6 @@
 #include "src/surf/SplitDuplexLinkImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/network_interface.hpp"
-#include "surf/surf.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_route);
 
index 27a9be2..c68526d 100644 (file)
@@ -3,12 +3,12 @@
 /* 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 "simgrid/kernel/routing/VivaldiZone.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/s4u/Host.hpp"
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/kernel/routing/VivaldiZone.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/Host.hpp>
+
 #include "src/surf/network_interface.hpp"
-#include "surf/surf.hpp"
 
 #include <boost/algorithm/string.hpp>
 
index 2acdb0e..1e16ca1 100644 (file)
@@ -3,12 +3,10 @@
 /* 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 "simgrid/kernel/routing/WifiZone.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "src/surf/network_interface.hpp"
-#include "surf/surf.hpp"
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/kernel/routing/WifiZone.hpp>
 
-#include <unordered_set>
+#include "src/surf/network_interface.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_wifi, surf, "Routing part of surf");
 
index 7917c2d..b72b8c7 100644 (file)
@@ -3,11 +3,11 @@
 /* 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 "simgrid/Exception.hpp"
-#include "simgrid/plugins/energy.h"
-#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/s4u/Exec.hpp"
-#include "src/include/surf/surf.hpp"
+#include <simgrid/Exception.hpp>
+#include <simgrid/plugins/energy.h>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/Exec.hpp>
+
 #include "src/kernel/activity/ExecImpl.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
@@ -140,7 +140,7 @@ class HostEnergy {
   const int pstate_off_ = -1;
   double watts_off_     = 0.0;              /*< Consumption when the machine is turned off (shutdown) */
   double total_energy_  = 0.0;              /*< Total energy consumed by the host */
-  double last_updated_  = surf_get_clock(); /*< Timestamp of the last energy update event*/
+  double last_updated_  = simgrid::s4u::Engine::get_clock(); /*< Timestamp of the last energy update event*/
 
   /* Only used to split total energy into unused/used hosts.
    * If you want to get this info for something else, rather use the host_load plugin
@@ -180,7 +180,7 @@ bool HostEnergy::has_pstate_power_values() const {
 void HostEnergy::update()
 {
   double start_time  = last_updated_;
-  double finish_time = surf_get_clock();
+  double finish_time = simgrid::s4u::Engine::get_clock();
   //
   // We may have start == finish if the past consumption was updated since the simcall was started
   // for example if 2 actors requested to update the same host's consumption in a given scheduling round.
@@ -331,7 +331,7 @@ double HostEnergy::get_current_watts_value(double cpu_load) const
 
 double HostEnergy::get_consumed_energy()
 {
-  if (last_updated_ < surf_get_clock()) // We need to simcall this as it modifies the environment
+  if (last_updated_ < simgrid::s4u::Engine::get_clock()) // We need to simcall this as it modifies the environment
     simgrid::kernel::actor::simcall(std::bind(&HostEnergy::update, this));
 
   return total_energy_;
@@ -420,7 +420,7 @@ static void on_action_state_change(simgrid::kernel::resource::CpuAction const& a
       // Get the host_energy extension for the relevant host
       auto* host_energy = host->extension<HostEnergy>();
 
-      if (host_energy->get_last_update_time() < surf_get_clock())
+      if (host_energy->get_last_update_time() < simgrid::s4u::Engine::get_clock())
         host_energy->update();
     }
   }
index 477e8e2..6f00606 100644 (file)
@@ -3,11 +3,11 @@
 /* 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 "simgrid/plugins/load.h"
-#include "src/include/surf/surf.hpp"
+#include <simgrid/plugins/load.h>
+#include <simgrid/s4u.hpp>
+
 #include "src/kernel/activity/ExecImpl.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
-#include <simgrid/s4u.hpp>
 
 // Makes sure that this plugin can be activated from the command line with ``--cfg=plugin:host_load``
 SIMGRID_REGISTER_PLUGIN(host_load, "Cpu load", &sg_host_load_plugin_init)
@@ -57,8 +57,8 @@ public:
 
   explicit HostLoad(simgrid::s4u::Host* ptr)
       : host_(ptr)
-      , last_updated_(surf_get_clock())
-      , last_reset_(surf_get_clock())
+      , last_updated_(simgrid_get_clock())
+      , last_reset_(simgrid_get_clock())
       , current_speed_(host_->get_speed())
       , current_flops_(host_->get_load())
   {
@@ -115,7 +115,7 @@ void HostLoad::add_activity(simgrid::kernel::activity::ExecImpl* activity)
 
 void HostLoad::update()
 {
-  double now = surf_get_clock();
+  double now = simgrid_get_clock();
 
   // This loop updates the flops that the host executed for the ongoing computations
   auto iter = begin(current_activities);
@@ -178,8 +178,8 @@ double HostLoad::get_current_load() const
  */
 void HostLoad::reset()
 {
-  last_updated_    = surf_get_clock();
-  last_reset_      = surf_get_clock();
+  last_updated_    = simgrid_get_clock();
+  last_reset_      = simgrid_get_clock();
   idle_time_       = 0;
   computed_flops_  = 0;
   theor_max_flops_ = 0;
index f97f316..636b8bf 100644 (file)
@@ -10,7 +10,6 @@
 #include "simgrid/simix.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "surf/surf.hpp"
 
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
@@ -60,7 +59,7 @@ class LinkEnergy {
 public:
   static xbt::Extension<simgrid::s4u::Link, LinkEnergy> EXTENSION_ID;
 
-  explicit LinkEnergy(s4u::Link* ptr) : link_(ptr), last_updated_(surf_get_clock()) {}
+  explicit LinkEnergy(s4u::Link* ptr) : link_(ptr), last_updated_(simgrid::s4u::Engine::get_clock()) {}
 
   void init_watts_range_list();
   double get_consumed_energy();
@@ -75,7 +74,7 @@ void LinkEnergy::update()
     init_watts_range_list();
 
   double power = get_power();
-  double now   = surf_get_clock();
+  double now   = simgrid::s4u::Engine::get_clock();
   total_energy_ += power * (now - last_updated_);
   last_updated_ = now;
 }
@@ -138,7 +137,7 @@ double LinkEnergy::get_power() const
 
 double LinkEnergy::get_consumed_energy()
 {
-  if (last_updated_ < surf_get_clock()) // We need to simcall this as it modifies the environment
+  if (last_updated_ < simgrid::s4u::Engine::get_clock()) // We need to simcall this as it modifies the environment
     kernel::actor::simcall(std::bind(&LinkEnergy::update, this));
   return this->total_energy_;
 }
index f9332d1..dca8c04 100644 (file)
@@ -3,17 +3,17 @@
 /* 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 "simgrid/Exception.hpp"
-#include "simgrid/plugins/energy.h"
-#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/s4u/Host.hpp"
-#include "simgrid/s4u/Link.hpp"
+#include <simgrid/Exception.hpp>
+#include <simgrid/plugins/energy.h>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/Host.hpp>
+#include <simgrid/s4u/Link.hpp>
+#include <xbt/config.hpp>
+
 #include "src/surf/network_interface.hpp"
 #include "src/surf/network_wifi.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "surf/surf.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
-#include "xbt/config.hpp"
 
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
@@ -104,8 +104,8 @@ xbt::Extension<s4u::Link, LinkEnergyWifi> LinkEnergyWifi::EXTENSION_ID;
 void LinkEnergyWifi::update_destroy()
 {
   auto const* wifi_link = static_cast<kernel::resource::NetworkWifiLink*>(link_->get_impl());
-  double duration       = surf_get_clock() - prev_update_;
-  prev_update_          = surf_get_clock();
+  double duration       = simgrid::s4u::Engine::get_clock() - prev_update_;
+  prev_update_          = simgrid::s4u::Engine::get_clock();
 
   dur_idle_ += duration;
 
@@ -120,8 +120,8 @@ void LinkEnergyWifi::update(const kernel::resource::NetworkAction&)
 {
   init_watts_range_list();
 
-  double duration = surf_get_clock() - prev_update_;
-  prev_update_    = surf_get_clock();
+  double duration = simgrid::s4u::Engine::get_clock() - prev_update_;
+  prev_update_    = simgrid::s4u::Engine::get_clock();
 
   // we don't update for null durations
   if(duration < 1e-6)
@@ -162,8 +162,8 @@ void LinkEnergyWifi::update(const kernel::resource::NetworkAction&)
       double du = // durUsage on the current flow
           (action->get_cost() - it->second.first) / action->get_rate();
 
-      if(du > surf_get_clock()-it->second.second)
-        du = surf_get_clock()-it->second.second;
+      if (du > simgrid::s4u::Engine::get_clock() - it->second.second)
+        du = simgrid::s4u::Engine::get_clock() - it->second.second;
 
       // if the flow has been more active than the others
       if(du > durUsage)
@@ -171,7 +171,7 @@ void LinkEnergyWifi::update(const kernel::resource::NetworkAction&)
 
       // update the amount of data already sent by the flow
       it->second.first += du * action->get_rate();
-      it->second.second =  surf_get_clock();
+      it->second.second = simgrid::s4u::Engine::get_clock();
 
       // important: if the transmission finished, remove it (needed for performance and multi-message flows)
       if(it->second.first >= action->get_cost())
index 9373f60..6936082 100644 (file)
@@ -3,12 +3,11 @@
 /* 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 "simgrid/host.h"
 #include "simgrid/plugins/load.h"
+#include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Link.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "surf/surf.hpp"
 
 #include <limits>
 
@@ -100,7 +99,7 @@ void LinkLoad::reset()
   max_bytes_per_second_ = std::numeric_limits<double>::lowest();
   XBT_DEBUG("min_bytes_per_second_ = %g", min_bytes_per_second_);
   XBT_DEBUG("max_bytes_per_second_ = %g", max_bytes_per_second_);
-  last_reset_   = surf_get_clock();
+  last_reset_   = simgrid::s4u::Engine::get_clock();
   last_updated_ = last_reset_;
 }
 
@@ -113,7 +112,7 @@ void LinkLoad::update()
              link_->get_cname());
 
   double current_instantaneous_bytes_per_second = link_->get_usage();
-  double now                                    = surf_get_clock();
+  double now                                    = simgrid::s4u::Engine::get_clock();
 
   // Update minimum/maximum observed values if needed
   min_bytes_per_second_ = std::min(min_bytes_per_second_, current_instantaneous_bytes_per_second);
@@ -150,7 +149,7 @@ double LinkLoad::get_average_bytes()
 {
   update();
 
-  double now = surf_get_clock();
+  double now = simgrid::s4u::Engine::get_clock();
   if (now > last_reset_)
     return cumulated_bytes_ / (now - last_reset_);
   else
@@ -186,7 +185,8 @@ static void on_communicate(const simgrid::kernel::resource::NetworkAction& actio
  */
 void sg_link_load_plugin_init()
 {
-  xbt_assert(sg_host_count() == 0, "Please call sg_link_load_plugin_init() BEFORE initializing the platform.");
+  xbt_assert(simgrid::s4u::Engine::get_instance()->get_host_count() == 0,
+             "Please call sg_link_load_plugin_init() BEFORE initializing the platform.");
   xbt_assert(not LinkLoad::EXTENSION_ID.valid(), "Double call to sg_link_load_plugin_init. Aborting.");
   LinkLoad::EXTENSION_ID = simgrid::s4u::Link::extension_create<LinkLoad>();
 
index 3799bc5..9875260 100644 (file)
@@ -9,7 +9,6 @@
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Exec.hpp"
 #include "simgrid/sg_config.hpp"
-#include "src/include/surf/surf.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/activity/ExecImpl.hpp"
 #include "src/surf/cpu_cas01.hpp"
index d1e2a9a..a61da7c 100644 (file)
@@ -3,11 +3,11 @@
 /* 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 "simgrid/Exception.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "simgrid/s4u/Actor.hpp"
-#include "simgrid/vm.h"
-#include "src/include/surf/surf.hpp"
+#include <simgrid/Exception.hpp>
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/s4u/Actor.hpp>
+#include <simgrid/vm.h>
+
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/plugins/vm/VmHostExt.hpp"
 #include "src/surf/cpu_cas01.hpp"
index ecf8e96..67d048a 100644 (file)
@@ -5,23 +5,24 @@
 /* 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 <simgrid/Exception.hpp>
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Disk.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/Host.hpp>
+#include <simgrid/s4u/Mailbox.hpp>
+#include <simgrid/s4u/NetZone.hpp>
+#include <simgrid/simix.h>
+
 #include "mc/mc.h"
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/Disk.hpp"
-#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/s4u/Host.hpp"
-#include "simgrid/s4u/Mailbox.hpp"
-#include "simgrid/s4u/NetZone.hpp"
-#include "simgrid/simix.h"
 #include "src/instr/instr_private.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/kernel/actor/ActorImpl.hpp"
 #include "src/mc/mc_replay.hpp"
 #include "src/surf/network_interface.hpp"
-#include "surf/surf.hpp" // routing_platf. FIXME:KILLME. SOON
-#include <simgrid/Exception.hpp>
+#include "surf/surf.hpp"
 
 #include <algorithm>
 #include <string>
index d7e6bdb..43d486f 100644 (file)
@@ -5,9 +5,11 @@
 
 /* sg_config: configuration infrastructure for the simulation world         */
 
+#include <simgrid/instr.h>
+#include <simgrid/version.h>
+#include <xbt/config.hpp>
+
 #include "simgrid/sg_config.hpp"
-#include "simgrid/instr.h"
-#include "simgrid/version.h"
 #include "src/instr/instr_private.hpp"
 #include "src/internal_config.h"
 #include "src/kernel/lmm/maxmin.hpp"
@@ -15,8 +17,6 @@
 #include "src/mc/mc_replay.hpp"
 #include "src/smpi/include/smpi_config.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "surf/surf.hpp"
-#include "xbt/config.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf, "About the configuration of SimGrid");
 
index 977b9ad..fecadbd 100644 (file)
@@ -5,11 +5,13 @@
 
 #ifndef SMPI_UTILS_HPP
 #define SMPI_UTILS_HPP
-#include "xbt/base.h"
+#include <xbt/base.h>
+
+#include "smpi_f2c.hpp"
+
 #include <cstddef>
 #include <string>
 #include <vector>
-#include "smpi_f2c.hpp"
 
 // Methods used to parse and store the values for timing injections in smpi
 struct s_smpi_factor_t {
@@ -17,25 +19,24 @@ struct s_smpi_factor_t {
   std::vector<double> values;
 };
 
-
 namespace simgrid {
 namespace smpi {
 namespace utils {
-  XBT_PUBLIC std::vector<s_smpi_factor_t> parse_factor(const std::string& smpi_coef_string);
-  XBT_PUBLIC void add_benched_time(double time);
-  XBT_PUBLIC void account_malloc_size(size_t size, const std::string& file, int line, void* ptr);
-  XBT_PUBLIC void account_shared_size(size_t size);
-  XBT_PUBLIC void print_time_analysis(double time);
-  XBT_PUBLIC void print_buffer_info();
-  XBT_PUBLIC void print_memory_analysis();
-  XBT_PUBLIC void print_current_handle();
-  XBT_PUBLIC void set_current_handle(F2C* handle);
-  XBT_PUBLIC void set_current_buffer(int i, const char* name, const void* handle);
-  XBT_PUBLIC size_t get_buffer_size(const void* ptr);
-  XBT_PUBLIC void account_free(const void* ptr);
-
-}
-}
-}
 
+XBT_PUBLIC std::vector<s_smpi_factor_t> parse_factor(const std::string& smpi_coef_string);
+XBT_PUBLIC void add_benched_time(double time);
+XBT_PUBLIC void account_malloc_size(size_t size, const std::string& file, int line, void* ptr);
+XBT_PUBLIC void account_shared_size(size_t size);
+XBT_PUBLIC void print_time_analysis(double time);
+XBT_PUBLIC void print_buffer_info();
+XBT_PUBLIC void print_memory_analysis();
+XBT_PUBLIC void print_current_handle();
+XBT_PUBLIC void set_current_handle(F2C* handle);
+XBT_PUBLIC void set_current_buffer(int i, const char* name, const void* handle);
+XBT_PUBLIC size_t get_buffer_size(const void* ptr);
+XBT_PUBLIC void account_free(const void* ptr);
+
+} // namespace utils
+} // namespace smpi
+} // namespace simgrid
 #endif
index 47b5397..1142c22 100644 (file)
@@ -3,8 +3,8 @@
 /* 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 "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/Engine.hpp"
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Engine.hpp>
 
 #include "simgrid/sg_config.hpp"
 #include "src/kernel/EngineImpl.hpp"
index d9a6e9f..9fab82d 100644 (file)
@@ -3,11 +3,10 @@
 /* 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 "cpu_interface.hpp"
-#include "cpu_ti.hpp"
+#include "src/surf/cpu_interface.hpp"
 #include "src/kernel/resource/profile/Profile.hpp"
+#include "src/surf/cpu_ti.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "surf/surf.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_cpu, ker_resource, "CPU resource, fueling execution activites");
 
index c1edbda..1b7ef1b 100644 (file)
@@ -3,16 +3,15 @@
 /* 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 "disk_s19.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/s4u/Host.hpp"
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/Host.hpp>
+
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
 #include "src/kernel/resource/profile/Event.hpp"
-#include "src/surf/xml/platf.hpp"
-#include "surf/surf.hpp"
+#include "src/surf/disk_s19.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_disk);
 
index f58719d..21c9623 100644 (file)
@@ -3,13 +3,13 @@
 /* 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 "src/surf/host_clm03.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/Engine.hpp"
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Engine.hpp>
+
 #include "simgrid/sg_config.hpp"
 #include "src/kernel/EngineImpl.hpp"
-#include "surf/surf.hpp"
+#include "src/surf/host_clm03.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_host);
 
index 7d36bab..fa25c66 100644 (file)
@@ -3,12 +3,12 @@
 /* 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 "network_constant.hpp"
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/Engine.hpp"
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Engine.hpp>
+
 #include "src/kernel/EngineImpl.hpp"
+#include "src/surf/network_constant.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "surf/surf.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
 
index 47d7ef6..6262018 100644 (file)
@@ -3,13 +3,13 @@
 /* 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 "src/surf/network_ib.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
+#include <simgrid/kernel/routing/NetPoint.hpp>
+
 #include "simgrid/sg_config.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/surf/HostImpl.hpp"
+#include "src/surf/network_ib.hpp"
 #include "src/surf/xml/platf.hpp"
-#include "surf/surf.hpp"
 
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
index 16f5397..c18d8d7 100644 (file)
@@ -3,12 +3,12 @@
 /* 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 "network_interface.hpp"
-#include "simgrid/s4u/Engine.hpp"
+#include <simgrid/s4u/Engine.hpp>
+
 #include "simgrid/sg_config.hpp"
 #include "src/kernel/resource/profile/Profile.hpp"
+#include "src/surf/network_interface.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "surf/surf.hpp"
 
 #include <numeric>
 
index 4fcd646..ab023e9 100644 (file)
@@ -3,14 +3,13 @@
 /* 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 "network_smpi.hpp"
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/Engine.hpp"
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Engine.hpp>
+
 #include "simgrid/sg_config.hpp"
 #include "smpi_utils.hpp"
 #include "src/kernel/EngineImpl.hpp"
-#include "src/surf/surf_interface.hpp"
-#include "surf/surf.hpp"
+#include "src/surf/network_smpi.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
 
index cc27a24..593ca1e 100644 (file)
@@ -3,13 +3,13 @@
 /* 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 "ptask_L07.hpp"
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/Engine.hpp"
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <xbt/config.hpp>
+
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/resource/profile/Event.hpp"
-#include "surf/surf.hpp"
-#include "xbt/config.hpp"
+#include "src/surf/ptask_L07.hpp"
 
 #include <unordered_set>
 
index 5db4b7e..d716fb8 100644 (file)
@@ -3,27 +3,28 @@
 /* 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 "simgrid/Exception.hpp"
-#include "simgrid/kernel/routing/DijkstraZone.hpp"
-#include "simgrid/kernel/routing/DragonflyZone.hpp"
-#include "simgrid/kernel/routing/EmptyZone.hpp"
-#include "simgrid/kernel/routing/FatTreeZone.hpp"
-#include "simgrid/kernel/routing/FloydZone.hpp"
-#include "simgrid/kernel/routing/FullZone.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/kernel/routing/TorusZone.hpp"
-#include "simgrid/kernel/routing/VivaldiZone.hpp"
-#include "simgrid/kernel/routing/WifiZone.hpp"
-#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/s4u/NetZone.hpp"
-#include "src/include/simgrid/sg_config.hpp"
-#include "src/include/surf/surf.hpp"
+#include <simgrid/Exception.hpp>
+#include <simgrid/kernel/routing/DijkstraZone.hpp>
+#include <simgrid/kernel/routing/DragonflyZone.hpp>
+#include <simgrid/kernel/routing/EmptyZone.hpp>
+#include <simgrid/kernel/routing/FatTreeZone.hpp>
+#include <simgrid/kernel/routing/FloydZone.hpp>
+#include <simgrid/kernel/routing/FullZone.hpp>
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/kernel/routing/TorusZone.hpp>
+#include <simgrid/kernel/routing/VivaldiZone.hpp>
+#include <simgrid/kernel/routing/WifiZone.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/NetZone.hpp>
+
+#include "simgrid/sg_config.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/resource/DiskImpl.hpp"
 #include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/xml/platf_private.hpp"
+#include "surf/surf.hpp"
 
 #include <algorithm>
 #include <string>
index 85e56b7..d050de8 100644 (file)
@@ -3,13 +3,14 @@
 /* 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 "simgrid/s4u/Engine.hpp"
-#include "src/include/surf/surf.hpp"
+#include <simgrid/s4u/Engine.hpp>
+
 #include "src/instr/instr_private.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/resource/DiskImpl.hpp"
 #include "src/kernel/resource/profile/FutureEvtSet.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
+#include "surf/surf.hpp"
 
 #include <algorithm>
 
index 674d7f5..15f70cf 100644 (file)
@@ -3,16 +3,16 @@
 /* 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 <simgrid/s4u/Engine.hpp>
+
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
 #include "surf/surf.hpp"
-#include <simgrid/s4u/Engine.hpp>
 
 #include <vector>
 
-
 #if SIMGRID_HAVE_LUA
 #include "src/bindings/lua/simgrid_lua.hpp"
 
index 1ebfbd1..6bac0f9 100644 (file)
@@ -3,18 +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 "simgrid/Exception.hpp"
-#include "simgrid/kernel/routing/NetPoint.hpp"
-#include "simgrid/s4u/Engine.hpp"
+#include <simgrid/Exception.hpp>
+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <xbt/file.hpp>
+#include <xbt/parse_units.hpp>
+
 #include "simgrid/sg_config.hpp"
 #include "src/kernel/resource/profile/FutureEvtSet.hpp"
 #include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
-#include "surf/surf.hpp"
-#include "xbt/file.hpp"
-#include "xbt/parse_units.hpp"
 
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>