From: SUTER Frederic Date: Thu, 30 Sep 2021 12:22:19 +0000 (+0200) Subject: include cleanups (mostly surf/surf.hpp) X-Git-Tag: v3.29~31 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1f5cc4e090af49a98da0e25e9ee21a8ce6ce30f8 include cleanups (mostly surf/surf.hpp) --- diff --git a/src/instr/instr_config.cpp b/src/instr/instr_config.cpp index 3c22b9b5ce..d3e31284e3 100644 --- a/src/instr/instr_config.cpp +++ b/src/instr/instr_config.cpp @@ -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 +#include +#include + #include "src/instr/instr_private.hpp" -#include "surf/surf.hpp" +#include "xbt/config.hpp" #include #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(); diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index a1b6da9dac..798e1c0477 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -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 +#include +#include + #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 #include diff --git a/src/instr/instr_platform.cpp b/src/instr/instr_platform.cpp index 81e64bb7d9..3d83425728 100644 --- a/src/instr/instr_platform.cpp +++ b/src/instr/instr_platform.cpp @@ -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 +#include +#include +#include +#include +#include +#include +#include +#include -#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 @@ -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) { diff --git a/src/kernel/EngineImpl.cpp b/src/kernel/EngineImpl.cpp index 4f748093a3..cb65b17d0b 100644 --- a/src/kernel/EngineImpl.cpp +++ b/src/kernel/EngineImpl.cpp @@ -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 +#include +#include +#include +#include +#include + #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 @@ -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 diff --git a/src/kernel/activity/CommImpl.hpp b/src/kernel/activity/CommImpl.hpp index 475eda9a04..4221a89536 100644 --- a/src/kernel/activity/CommImpl.hpp +++ b/src/kernel/activity/CommImpl.hpp @@ -8,8 +8,6 @@ #include "src/kernel/activity/ActivityImpl.hpp" #include "src/kernel/actor/ActorImpl.hpp" -#include "surf/surf.hpp" - namespace simgrid { namespace kernel { diff --git a/src/kernel/activity/ExecImpl.hpp b/src/kernel/activity/ExecImpl.hpp index 9fc5f882b5..e02c10f2d3 100644 --- a/src/kernel/activity/ExecImpl.hpp +++ b/src/kernel/activity/ExecImpl.hpp @@ -6,10 +6,10 @@ #ifndef SIMGRID_KERNEL_ACTIVITY_EXEC_HPP #define SIMGRID_KERNEL_ACTIVITY_EXEC_HPP -#include "simgrid/s4u/Exec.hpp" +#include + #include "src/kernel/activity/ActivityImpl.hpp" #include "src/kernel/context/Context.hpp" -#include "surf/surf.hpp" namespace simgrid { namespace kernel { diff --git a/src/kernel/activity/IoImpl.hpp b/src/kernel/activity/IoImpl.hpp index 758d9ec702..3bd9c7b5cc 100644 --- a/src/kernel/activity/IoImpl.hpp +++ b/src/kernel/activity/IoImpl.hpp @@ -7,7 +7,6 @@ #define SIMGRID_KERNEL_ACTIVITY_IO_HPP #include "src/kernel/activity/ActivityImpl.hpp" -#include "surf/surf.hpp" #include namespace simgrid { diff --git a/src/kernel/activity/SleepImpl.hpp b/src/kernel/activity/SleepImpl.hpp index f1519a6f67..2e3284f797 100644 --- a/src/kernel/activity/SleepImpl.hpp +++ b/src/kernel/activity/SleepImpl.hpp @@ -7,7 +7,6 @@ #define SIMGRID_KERNEL_ACTIVITY_SLEEP_HPP #include "src/kernel/activity/ActivityImpl.hpp" -#include "surf/surf.hpp" namespace simgrid { namespace kernel { diff --git a/src/kernel/activity/SynchroRaw.hpp b/src/kernel/activity/SynchroRaw.hpp index b4ed3931c6..1c9ad284fb 100644 --- a/src/kernel/activity/SynchroRaw.hpp +++ b/src/kernel/activity/SynchroRaw.hpp @@ -7,7 +7,7 @@ #define SIMGRID_KERNEL_ACTIVITY_SYNCHRO_RAW_HPP #include "src/kernel/activity/ActivityImpl.hpp" -#include "surf/surf.hpp" + #include namespace simgrid { diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index d47dc4d769..5381c38f84 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -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 +#include +#include + #include "src/surf/network_interface.hpp" -#include "surf/surf.hpp" -#include "xbt/string.hpp" #include #include diff --git a/src/kernel/routing/FloydZone.cpp b/src/kernel/routing/FloydZone.cpp index 8de2e8cd46..7a134c5747 100644 --- a/src/kernel/routing/FloydZone.cpp +++ b/src/kernel/routing/FloydZone.cpp @@ -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 +#include +#include + #include "src/surf/network_interface.hpp" -#include "surf/surf.hpp" -#include "xbt/string.hpp" #include diff --git a/src/kernel/routing/FullZone.cpp b/src/kernel/routing/FullZone.cpp index 6ec3408a1e..132dc8746f 100644 --- a/src/kernel/routing/FullZone.cpp +++ b/src/kernel/routing/FullZone.cpp @@ -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 +#include + #include "src/surf/network_interface.hpp" -#include "surf/surf.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf"); diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index bfcf4cee95..0b875ed417 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -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 +#include +#include +#include + #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); diff --git a/src/kernel/routing/VivaldiZone.cpp b/src/kernel/routing/VivaldiZone.cpp index 27a9be27c9..c68526d9f7 100644 --- a/src/kernel/routing/VivaldiZone.cpp +++ b/src/kernel/routing/VivaldiZone.cpp @@ -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 +#include +#include +#include + #include "src/surf/network_interface.hpp" -#include "surf/surf.hpp" #include diff --git a/src/kernel/routing/WifiZone.cpp b/src/kernel/routing/WifiZone.cpp index 2acdb0e6ce..1e16ca11bc 100644 --- a/src/kernel/routing/WifiZone.cpp +++ b/src/kernel/routing/WifiZone.cpp @@ -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 +#include -#include +#include "src/surf/network_interface.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_wifi, surf, "Routing part of surf"); diff --git a/src/plugins/host_energy.cpp b/src/plugins/host_energy.cpp index 7917c2df1c..b72b8c765a 100644 --- a/src/plugins/host_energy.cpp +++ b/src/plugins/host_energy.cpp @@ -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 +#include +#include +#include + #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(); - 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(); } } diff --git a/src/plugins/host_load.cpp b/src/plugins/host_load.cpp index 477e8e2bce..6f00606d8b 100644 --- a/src/plugins/host_load.cpp +++ b/src/plugins/host_load.cpp @@ -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 +#include + #include "src/kernel/activity/ExecImpl.hpp" #include "src/plugins/vm/VirtualMachineImpl.hpp" -#include // 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; diff --git a/src/plugins/link_energy.cpp b/src/plugins/link_energy.cpp index f97f316b12..636b8bf23e 100644 --- a/src/plugins/link_energy.cpp +++ b/src/plugins/link_energy.cpp @@ -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 #include @@ -60,7 +59,7 @@ class LinkEnergy { public: static xbt::Extension 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_; } diff --git a/src/plugins/link_energy_wifi.cpp b/src/plugins/link_energy_wifi.cpp index f9332d1d1a..dca8c0453d 100644 --- a/src/plugins/link_energy_wifi.cpp +++ b/src/plugins/link_energy_wifi.cpp @@ -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 +#include +#include +#include +#include +#include + #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 #include @@ -104,8 +104,8 @@ xbt::Extension LinkEnergyWifi::EXTENSION_ID; void LinkEnergyWifi::update_destroy() { auto const* wifi_link = static_cast(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()) diff --git a/src/plugins/link_load.cpp b/src/plugins/link_load.cpp index 9373f60f33..6936082b52 100644 --- a/src/plugins/link_load.cpp +++ b/src/plugins/link_load.cpp @@ -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 @@ -100,7 +99,7 @@ void LinkLoad::reset() max_bytes_per_second_ = std::numeric_limits::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(); diff --git a/src/plugins/vm/VirtualMachineImpl.cpp b/src/plugins/vm/VirtualMachineImpl.cpp index 3799bc5aca..9875260ff8 100644 --- a/src/plugins/vm/VirtualMachineImpl.cpp +++ b/src/plugins/vm/VirtualMachineImpl.cpp @@ -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" diff --git a/src/plugins/vm/s4u_VirtualMachine.cpp b/src/plugins/vm/s4u_VirtualMachine.cpp index d1e2a9a90d..a61da7cdb9 100644 --- a/src/plugins/vm/s4u_VirtualMachine.cpp +++ b/src/plugins/vm/s4u_VirtualMachine.cpp @@ -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 +#include +#include +#include + #include "src/plugins/vm/VirtualMachineImpl.hpp" #include "src/plugins/vm/VmHostExt.hpp" #include "src/surf/cpu_cas01.hpp" diff --git a/src/s4u/s4u_Engine.cpp b/src/s4u/s4u_Engine.cpp index ecf8e961f5..67d048a956 100644 --- a/src/s4u/s4u_Engine.cpp +++ b/src/s4u/s4u_Engine.cpp @@ -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 +#include +#include +#include +#include +#include +#include +#include +#include + #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 +#include "surf/surf.hpp" #include #include diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index d7e6bdb895..43d486fbb6 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -5,9 +5,11 @@ /* sg_config: configuration infrastructure for the simulation world */ +#include +#include +#include + #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"); diff --git a/src/smpi/include/smpi_utils.hpp b/src/smpi/include/smpi_utils.hpp index 977b9ad444..fecadbd1d3 100644 --- a/src/smpi/include/smpi_utils.hpp +++ b/src/smpi/include/smpi_utils.hpp @@ -5,11 +5,13 @@ #ifndef SMPI_UTILS_HPP #define SMPI_UTILS_HPP -#include "xbt/base.h" +#include + +#include "smpi_f2c.hpp" + #include #include #include -#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 values; }; - namespace simgrid { namespace smpi { namespace utils { - XBT_PUBLIC std::vector 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 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 diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index 47b539702a..1142c220b1 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -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 +#include #include "simgrid/sg_config.hpp" #include "src/kernel/EngineImpl.hpp" diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index d9a6e9f4f5..9fab82d475 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -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"); diff --git a/src/surf/disk_s19.cpp b/src/surf/disk_s19.cpp index c1edbdab7e..1b7ef1b731 100644 --- a/src/surf/disk_s19.cpp +++ b/src/surf/disk_s19.cpp @@ -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 +#include +#include +#include + #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); diff --git a/src/surf/host_clm03.cpp b/src/surf/host_clm03.cpp index f58719d544..21c9623761 100644 --- a/src/surf/host_clm03.cpp +++ b/src/surf/host_clm03.cpp @@ -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 +#include +#include + #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); diff --git a/src/surf/network_constant.cpp b/src/surf/network_constant.cpp index 7d36babf7f..fa25c6678e 100644 --- a/src/surf/network_constant.cpp +++ b/src/surf/network_constant.cpp @@ -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 +#include + #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); diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index 47d7ef6302..62620183c7 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -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 + #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 #include diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index 16f5397f87..c18d8d759b 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -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 + #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 diff --git a/src/surf/network_smpi.cpp b/src/surf/network_smpi.cpp index 4fcd646267..ab023e913e 100644 --- a/src/surf/network_smpi.cpp +++ b/src/surf/network_smpi.cpp @@ -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 +#include + #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); diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index cc27a24688..593ca1e63f 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -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 +#include +#include + #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 diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 5db4b7e937..d716fb8723 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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 #include diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index 85e56b72a0..d050de8537 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -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 + #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 diff --git a/src/surf/xml/surfxml_parseplatf.cpp b/src/surf/xml/surfxml_parseplatf.cpp index 674d7f5daa..15f70cff0f 100644 --- a/src/surf/xml/surfxml_parseplatf.cpp +++ b/src/surf/xml/surfxml_parseplatf.cpp @@ -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 + #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 #include - #if SIMGRID_HAVE_LUA #include "src/bindings/lua/simgrid_lua.hpp" diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index 1ebfbd1c51..6bac0f9d19 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -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 +#include +#include +#include +#include + #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 #include