Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'actor-comms' into 'master'
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Wed, 15 Feb 2023 23:59:31 +0000 (23:59 +0000)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Wed, 15 Feb 2023 23:59:31 +0000 (23:59 +0000)
Serialize pending transitions when responding to `ACTOR_STATUS` messages on the application side

See merge request simgrid/simgrid!127

98 files changed:
CMakeLists.txt
ChangeLog
MANIFEST.in
docs/source/Configuring_SimGrid.rst
docs/source/Installing_SimGrid.rst
docs/source/app_s4u.rst
examples/c/comm-pingpong/comm-pingpong.tesh
examples/cpp/comm-pingpong/s4u-comm-pingpong.tesh
examples/cpp/network-ns3/s4u-network-ns3.cpp
examples/cpp/synchro-condition-variable-waituntil/s4u-synchro-condition-variable-waituntil.cpp
examples/cpp/synchro-condition-variable/s4u-synchro-condition-variable.cpp
examples/cpp/synchro-semaphore/s4u-synchro-semaphore.cpp
examples/platforms/config.xml
examples/smpi/replay/replay.cpp
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual.cpp
include/simgrid/plugins/file_system.h
include/simgrid/s4u/Engine.hpp
include/simgrid/s4u/Link.hpp
include/xbt/log.h
src/include/xbt/xbt_modinter.h
src/instr/instr_config.cpp
src/instr/instr_interface.cpp
src/instr/instr_private.hpp
src/kernel/EngineImpl.cpp
src/kernel/actor/ActorImpl.cpp
src/kernel/context/Context.cpp
src/kernel/context/Context.hpp
src/kernel/context/ContextSwapped.cpp
src/kernel/context/ContextThread.cpp
src/kernel/resource/LinkImpl.hpp
src/kernel/resource/NetworkModelFactors.cpp
src/kernel/resource/NetworkModelFactors.hpp
src/kernel/resource/SplitDuplexLinkImpl.cpp
src/kernel/resource/SplitDuplexLinkImpl.hpp
src/kernel/resource/StandardLinkImpl.cpp
src/kernel/resource/StandardLinkImpl.hpp
src/kernel/resource/VirtualMachineImpl.cpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/EmptyZone.cpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/NetPoint.cpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/RoutedZone.cpp
src/kernel/routing/StarZone.cpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/VivaldiZone.cpp
src/kernel/routing/WifiZone.cpp
src/plugins/chaos_monkey.cpp
src/plugins/file_system/s4u_FileSystem.cpp
src/plugins/host_load.cpp
src/plugins/link_load.cpp
src/s4u/s4u_Engine.cpp
src/s4u/s4u_Host.cpp
src/s4u/s4u_Link.cpp
src/simgrid/module.cpp [new file with mode: 0644]
src/simgrid/module.hpp [new file with mode: 0644]
src/simgrid/sg_config.cpp
src/simgrid/sg_version.cpp
src/simix/libsmx.cpp
src/smpi/include/private.hpp
src/smpi/internals/smpi_global.cpp
src/smpi/internals/smpi_memory.cpp
src/smpi/internals/smpi_shared.cpp
src/smpi/internals/smpi_utils.cpp
src/smpi/mpi/smpi_f2c.cpp
src/surf/HostImpl.cpp
src/surf/cpu_cas01.cpp
src/surf/disk_s19.cpp
src/surf/host_clm03.cpp
src/surf/network_cm02.cpp
src/surf/network_constant.cpp
src/surf/network_ib.cpp
src/surf/network_ns3.cpp
src/surf/ptask_L07.cpp
src/surf/sg_platf.cpp
src/surf/surf_interface.cpp [deleted file]
src/surf/surf_interface.hpp
src/surf/xml/surfxml_parseplatf.cpp
src/surf/xml/surfxml_sax_cb.cpp
src/xbt/log.cpp
src/xbt/mmalloc/mm_legacy.c
src/xbt/mmalloc/mm_module.c
src/xbt/mmalloc/mmorecore.c
src/xbt/mmalloc/mmprivate.h
src/xbt/xbt_main.cpp
src/xbt/xbt_replay.cpp
teshsuite/platforms/flatifier.cpp
teshsuite/platforms/flatifier.tesh
teshsuite/platforms/properties.xml
teshsuite/s4u/basic-parsing-test/basic-parsing-test.tesh
teshsuite/s4u/trace-integration/trace-integration.tesh
teshsuite/xbt/parmap_bench/parmap_bench.cpp
teshsuite/xbt/parmap_test/parmap_test.cpp
tools/cmake/DefinePackages.cmake

index 366f0e3..01a299e 100644 (file)
@@ -179,17 +179,16 @@ set(SIMGRID_DEP "-lm")
 ### Determine the assembly flavor that we need today
 set(HAVE_RAW_CONTEXTS 0)
 include(CMakeDetermineSystem)
+foreach(arch i686 x86_64 arm64)
+  set(SIMGRID_PROCESSOR_${arch} 0)
+endforeach()
 IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64")
   IF(CMAKE_SIZEOF_VOID_P EQUAL 4) # 32 bits
     message(STATUS "System processor: i686 (${CMAKE_SYSTEM_PROCESSOR}, 32 bits)")
     set(SIMGRID_PROCESSOR_i686 1)
-    set(SIMGRID_PROCESSOR_x86_64 0)
-    set(SIMGRID_PROCESSOR_arm64 0)
   ELSE()
     message(STATUS "System processor: x86_64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)")
-    set(SIMGRID_PROCESSOR_i686 0)
     set(SIMGRID_PROCESSOR_x86_64 1)
-    set(SIMGRID_PROCESSOR_arm64 0)
   ENDIF()
   if(CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
     message(STATUS "Disable fast raw contexts on x32 ABI.")
@@ -198,14 +197,9 @@ IF(CMAKE_SYSTEM_PROCESSOR MATCHES ".86|AMD64|amd64")
   endif()
 ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
   message(STATUS "System processor: arm64 (${CMAKE_SYSTEM_PROCESSOR}, 64 bits)")
-  set(SIMGRID_PROCESSOR_i686 0)
-  set(SIMGRID_PROCESSOR_x86_64 0)
   set(SIMGRID_PROCESSOR_arm64 1)
 ELSE()
   message(STATUS "System processor (${CMAKE_SYSTEM_PROCESSOR}) not explicitly accounted for")
-  set(SIMGRID_PROCESSOR_i686 0)
-  set(SIMGRID_PROCESSOR_x86_64 0)
-  set(SIMGRID_PROCESSOR_arm64 0)
 ENDIF()
 
 include(CheckFunctionExists)
index eed2b3e..a70a5dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,10 +5,14 @@ General:
  - Remove the Java bindings: they were limited to the MSG interface.
  - On Windows, you now need to install WSL2 as the native builds are now disabled.
    It was not really working anyway.
+ - Support for 32bits architecture is not tested anymore on our CI infrastructure.
+   It may break in the future, but we think that nobody's using SimGrid on 32 bits.
 
 S4U:
  - Activity::set_remaining() is not public anymore. Use for example
    Comm::set_payload_size() to change the size of the simulated data.
+ - New function: Engine::flatify_platform(), to get a fully detailed vision of the
+   configured platform.
 
 Kernel:
  - optimize an internal datastructure, leading to a potentially big
@@ -30,6 +34,8 @@ Models:
    - Same for the latency
    - Rewrite the corresponding documentation.
  - Allow to disable the TCP windowing modeling by setting network/TCP-gamma to 0.
+ - Finally kill the 'compound' host model. You can change the CPU or network model
+   with the default host model, as it should.
 
 sthread:
  - Implement pthread_join in MC mode.
@@ -38,12 +44,14 @@ Documentation:
  - New section in the user guide on the provided performance models.
  - New section presenting some technical good practices for (potential) contributors.
  - Add a section on errors and exceptions to the API documentation.
+ - Move the s4u examples to a section on their own to ease navigation.
 
 Fixed bugs (FG#.. -> FramaGit bugs; FG!.. -> FG merge requests)
  (FG: issues on Framagit; GH: issues on GitHub)
  - FG#18: Java bindings should be redone or removed
  - FG!118: Wi-Fi callback mechanism
- - FG!119: SMPI: add option to inject a barrier before every collective call, to allow...
+ - FG!119: SMPI: add option to inject a barrier before every collective call
+ - GH#383: Segfault when adding a disk after load_platform(xml)
 
 ----------------------------------------------------------------------------
 
index 44e2d4e..4ca7368 100644 (file)
@@ -2217,6 +2217,8 @@ include src/s4u/s4u_Netzone.cpp
 include src/s4u/s4u_Semaphore.cpp
 include src/s4u/s4u_VirtualMachine.cpp
 include src/simgrid/Exception.cpp
+include src/simgrid/module.cpp
+include src/simgrid/module.hpp
 include src/simgrid/sg_config.cpp
 include src/simgrid/sg_version.cpp
 include src/simgrid/util.hpp
@@ -2433,7 +2435,6 @@ include src/surf/ns3/ns3_simulator.hpp
 include src/surf/ptask_L07.cpp
 include src/surf/ptask_L07.hpp
 include src/surf/sg_platf.cpp
-include src/surf/surf_interface.cpp
 include src/surf/surf_interface.hpp
 include src/surf/xml/platf.hpp
 include src/surf/xml/platf_private.hpp
index 31095af..5634256 100644 (file)
@@ -231,27 +231,17 @@ models for all existing resources.
     simulators as network models (see :ref:`models_ns3`).
     This model can be :ref:`further configured <options_pls>`.
 
-- ``cpu/model``: specify the used CPU model.  We have only one model
-  for now:
+- ``cpu/model``: specify the used CPU model.  We have only one model for now:
 
   - **Cas01:** Simplistic CPU model (time=size/speed)
 
-- ``host/model``: The host concept is the aggregation of a CPU with a
-  network card. Three models exists, but actually, only 2 of them are
-  interesting. The "compound" one is simply due to the way our
-  internal code is organized, and can easily be ignored. So at the
-  end, you have two host models: The default one allows aggregation of
-  an existing CPU model with an existing network model, but does not
-  allow parallel tasks because these beasts need some collaboration
-  between the network and CPU model.
-
-  - **default:** Default host model. Currently, CPU:Cas01 and
-    network:LV08 (with cross traffic enabled)
-  - **compound:** Host model that is automatically chosen if
-    you change the network and CPU models
-  - **ptask_L07:** Host model somehow similar to Cas01+CM02 but
-    allowing "parallel tasks", that are intended to model the moldable
-    tasks of the grid scheduling literature.
+- ``host/model``: we have two such models for now. 
+
+  - **default:** Default host model. It simply uses the otherwise configured models for cpu, disk and network (i.e. CPU:Cas01,
+    disk:S19 and network:LV08 by default)
+  - **ptask_L07:** This model is mandatory if you plan to use parallel tasks (and useless otherwise). ptasks are intended to
+    model the moldable tasks of the grid scheduling literature. A specific host model is necessary because each such activity
+    has a both compute and communicate components, so the CPU and network models must be mixed together.
 
 - ``storage/model``: specify the used storage model. Only one model is
   provided so far.
@@ -466,7 +456,7 @@ Infiniband model
 
 InfiniBand network behavior can be modeled through 3 parameters
 ``smpi/IB-penalty-factors:"βe;βs;γs"``, as explained in `the PhD
-thesis of Jean-Marc Vincent
+thesis of Jérôme Vienne
 <http://mescal.imag.fr/membres/jean-marc.vincent/index.html/PhD/Vienne.pdf>`_ (in French)
 or more concisely in `this paper <https://hal.inria.fr/hal-00953618/document>`_,
 even if that paper does only describe models for myrinet and ethernet.
index 3d55d5a..55bfd0a 100644 (file)
@@ -394,7 +394,7 @@ Python-specific instructions
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Once you have the Python development headers installed as well as a
-recent version of the `pybind11 <https://pybind11.readthedocs.io/en/stable/>`
+recent version of the `pybind11 <https://pybind11.readthedocs.io/en/stable/>`_
 module (version at least 2.4), recompiling the Python bindings from
 the source should be as easy as:
 
@@ -409,30 +409,3 @@ simgrid without downloading the source with pip:
 .. code-block:: console
 
   $ pip install simgrid
-
-Linux Multi-Arch specific instructions
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-On a multiarch x86_64 Linux, it should be possible to compile a 32-bit
-version of SimGrid with something like:
-
-.. code-block:: console
-
-  $ CFLAGS=-m32                                                      \
-    CXXFLAGS=-m32                                                    \
-    FFLAGS=-m32                                                      \
-    PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig/             \
-    cmake .                                                          \
-      -DCMAKE_SYSTEM_PROCESSOR=i386                                  \
-      -DCMAKE_Fortran_COMPILER=/some/path/to/i686-linux-gnu-gfortran \
-      -DGFORTRAN_EXE=/some/path/to/i686-linux-gnu-gfortran           \
-      -DSMPI_C_FLAGS=-m32                                            \
-      -DSMPI_CXX_FLAGS=-m32                                          \
-      -DSMPI_Fortran_FLAGS=-m32
-
-If needed, implement ``i686-linux-gnu-gfortran`` as a script:
-
-.. code-block:: shell
-
-  #!/usr/bin/env sh
-  exec gfortran -m32 "$@"
index e5c5e71..7d3d6b0 100644 (file)
@@ -825,6 +825,7 @@ Simulation setup
 
       .. doxygenfunction:: simgrid::s4u::Engine::load_deployment
       .. doxygenfunction:: simgrid::s4u::Engine::load_platform
+      .. doxygenfunction:: simgrid::s4u::Engine::flatify_platform
       .. doxygenfunction:: simgrid::s4u::Engine::register_actor(const std::string &name)
       .. doxygenfunction:: simgrid::s4u::Engine::register_actor(const std::string &name, F code)
       .. doxygenfunction:: simgrid::s4u::Engine::register_default(const std::function< void(int, char **)> &code)
@@ -1582,6 +1583,7 @@ Querying info
       .. doxygenfunction:: simgrid::s4u::Link::get_latency() const
       .. doxygenfunction:: simgrid::s4u::Link::get_name() const
       .. doxygenfunction:: simgrid::s4u::Link::get_sharing_policy() const
+      .. doxygenfunction:: simgrid::s4u::Link::get_concurrency_limit() const
       .. doxygenfunction:: simgrid::s4u::Link::get_usage() const
       .. doxygenfunction:: simgrid::s4u::Link::is_used() const
 
index 4040d9b..3557478 100644 (file)
@@ -41,8 +41,7 @@ $ ${bindir:=.}/c-comm-pingpong ${platfdir}/small_platform.xml comm-pingpong_d.xm
 
 p Testing the surf network constant model
 
-$ ${bindir:=.}/c-comm-pingpong ${platfdir}/small_platform_routing_none.xml comm-pingpong_d.xml "--cfg=host/model:compound cpu/model:Cas01 network/model:Constant" "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ${bindir:=.}/c-comm-pingpong ${platfdir}/small_platform_routing_none.xml comm-pingpong_d.xml "--cfg=cpu/model:Cas01 network/model:Constant" "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/model' to 'Cas01'
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'Constant'
 > [  0.000000] (1:pinger@Tremblay) Ping from mailbox Mailbox 1 to mailbox Mailbox 2
index 05bcfe2..861b0df 100644 (file)
@@ -41,8 +41,7 @@ $ ${bindir:=.}/s4u-comm-pingpong ${platfdir}/small_platform.xml --cfg=cpu/model:
 
 p Testing the surf network constant model
 
-$ ${bindir:=.}/s4u-comm-pingpong ${platfdir}/small_platform_routing_none.xml "--cfg=host/model:compound cpu/model:Cas01 network/model:Constant" "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ${bindir:=.}/s4u-comm-pingpong ${platfdir}/small_platform_routing_none.xml "--cfg=cpu/model:Cas01 network/model:Constant" "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/model' to 'Cas01'
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'Constant'
 > [  0.000000] (1:pinger@Tremblay) Ping from mailbox Mailbox 1 to mailbox Mailbox 2
index ebc50c3..e1c8b39 100644 (file)
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
 namespace sg4 = simgrid::s4u;
 
-double start_time;
-std::unordered_map<int, std::string> workernames;
-std::unordered_map<int, std::string> masternames;
-
-static void master(std::vector<std::string> args)
+struct MasterWorkerNames {
+  std::string master;
+  std::string worker;
+};
+using MasterWorkerNamesMap = std::unordered_map<int, MasterWorkerNames>;
+
+struct Payload {
+  double msg_size;
+  double start_time;
+};
+
+static void master(MasterWorkerNamesMap& names, const std::vector<std::string>& args)
 {
   xbt_assert(args.size() == 4, "Strange number of arguments expected 3 got %zu", args.size() - 1);
 
@@ -24,23 +31,18 @@ static void master(std::vector<std::string> args)
   double msg_size = std::stod(args[1]);
   int id          = std::stoi(args[3]); // unique id to control statistics
 
-  /* worker name */
-  workernames[id] = args[2];
+  /* master and worker names */
+  names.try_emplace(id, MasterWorkerNames{sg4::Host::current()->get_name(), args[2]});
 
   sg4::Mailbox* mbox = sg4::Mailbox::by_name(args[3]);
 
-  masternames[id] = sg4::Host::current()->get_name();
-
-  auto* payload = new double(msg_size);
-
-  /* time measurement */
-  start_time = sg4::Engine::get_clock();
+  auto* payload = new Payload{msg_size, sg4::Engine::get_clock()};
   mbox->put(payload, static_cast<uint64_t>(msg_size));
 
   XBT_DEBUG("Finished");
 }
 
-static void worker(std::vector<std::string> args)
+static void worker(const MasterWorkerNamesMap& names, const std::vector<std::string>& args)
 {
   xbt_assert(args.size() == 2, "Strange number of arguments expected 1 got %zu", args.size() - 1);
 
@@ -49,12 +51,12 @@ static void worker(std::vector<std::string> args)
 
   XBT_DEBUG("Worker started");
 
-  auto payload = mbox->get_unique<double>();
+  auto payload = mbox->get_unique<Payload>();
 
-  double elapsed_time = sg4::Engine::get_clock() - start_time;
+  double elapsed_time = sg4::Engine::get_clock() - payload->start_time;
 
-  XBT_INFO("FLOW[%d] : Receive %.0f bytes from %s to %s", id, *payload, masternames.at(id).c_str(),
-           workernames.at(id).c_str());
+  XBT_INFO("FLOW[%d] : Receive %.0f bytes from %s to %s", id, payload->msg_size, names.at(id).master.c_str(),
+           names.at(id).worker.c_str());
   XBT_DEBUG("FLOW[%d] : transferred in  %f seconds", id, elapsed_time);
 
   XBT_DEBUG("Finished");
@@ -70,8 +72,9 @@ int main(int argc, char* argv[])
 
   e.load_platform(argv[1]);
 
-  e.register_function("master", master);
-  e.register_function("worker", worker);
+  MasterWorkerNamesMap master_worker_names;
+  e.register_function("master", [&master_worker_names](auto args) { master(master_worker_names, args); });
+  e.register_function("worker", [&master_worker_names](auto args) { worker(master_worker_names, args); });
 
   e.load_deployment(argv[2]);
 
index f07bfa4..0edd2ab 100644 (file)
@@ -9,15 +9,11 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "a sample log category");
 namespace sg4 = simgrid::s4u;
 
-sg4::MutexPtr mtx            = nullptr;
-sg4::ConditionVariablePtr cv = nullptr;
-bool ready = false;
-
-static void competitor(int id)
+static void competitor(int id, sg4::ConditionVariablePtr cv, sg4::MutexPtr mtx, std::shared_ptr<bool> ready)
 {
   XBT_INFO("Entering the race...");
   std::unique_lock lck(*mtx);
-  while (not ready) {
+  while (not *ready) {
     auto now = sg4::Engine::get_clock();
     if (cv->wait_until(lck, now + (id+1)*0.25) == std::cv_status::timeout) {
       XBT_INFO("Out of wait_until (timeout)");
@@ -29,25 +25,26 @@ static void competitor(int id)
   XBT_INFO("Running!");
 }
 
-static void go()
+static void go(sg4::ConditionVariablePtr cv, sg4::MutexPtr mtx, std::shared_ptr<bool> ready)
 {
   XBT_INFO("Are you ready? ...");
   sg4::this_actor::sleep_for(3);
   std::unique_lock lck(*mtx);
   XBT_INFO("Go go go!");
-  ready = true;
+  *ready = true;
   cv->notify_all();
 }
 
 static void main_actor()
 {
-  mtx = sg4::Mutex::create();
-  cv  = sg4::ConditionVariable::create();
+  auto mtx   = sg4::Mutex::create();
+  auto cv    = sg4::ConditionVariable::create();
+  auto ready = std::make_shared<bool>(false);
 
   auto host = sg4::this_actor::get_host();
   for (int i = 0; i < 10; ++i)
-    sg4::Actor::create("competitor", host, competitor, i);
-  sg4::Actor::create("go", host, go);
+    sg4::Actor::create("competitor", host, competitor, i, cv, mtx, ready);
+  sg4::Actor::create("go", host, go, cv, mtx, ready);
 }
 
 int main(int argc, char* argv[])
index a5b0b44..cf1a1db 100644 (file)
@@ -9,10 +9,7 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "a sample log category");
 namespace sg4 = simgrid::s4u;
 
-std::string data;
-bool done = false;
-
-static void worker_fun(sg4::ConditionVariablePtr cv, sg4::MutexPtr mutex)
+static void worker_fun(sg4::ConditionVariablePtr cv, sg4::MutexPtr mutex, std::string& data, bool& done)
 {
   std::unique_lock lock(*mutex);
 
@@ -30,11 +27,14 @@ static void master_fun()
 {
   auto mutex  = sg4::Mutex::create();
   auto cv     = sg4::ConditionVariable::create();
-  data        = "Example data";
-  auto worker = sg4::Actor::create("worker", sg4::Host::by_name("Jupiter"), worker_fun, cv, mutex);
+  std::string data = "Example data";
+  bool done        = false;
+
+  auto worker = sg4::Actor::create("worker", sg4::Host::by_name("Jupiter"), worker_fun, cv, mutex, std::ref(data),
+                                   std::ref(done));
 
   // wait for the worker
-  cv->wait(std::unique_lock<sg4::Mutex>(*mutex), []() { return done; });
+  cv->wait(std::unique_lock<sg4::Mutex>(*mutex), [&done]() { return done; });
   XBT_INFO("data is now '%s'.", data.c_str());
 
   worker->join();
index 0f512f0..b9b5e77 100644 (file)
@@ -14,27 +14,24 @@ namespace sg4 = simgrid::s4u;
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(sem_test, "Simple test of the semaphore");
 
-const char* buffer;                                      /* Where the data is exchanged */
-sg4::SemaphorePtr sem_empty = sg4::Semaphore::create(1); /* indicates whether the buffer is empty */
-sg4::SemaphorePtr sem_full  = sg4::Semaphore::create(0); /* indicates whether the buffer is full */
-
-static void producer(const std::vector<std::string>& args)
+static void producer(std::string* buffer, sg4::SemaphorePtr sem_empty, sg4::SemaphorePtr sem_full,
+                     const std::vector<std::string>& args)
 {
   for (auto const& str : args) {
     sem_empty->acquire();
     XBT_INFO("Pushing '%s'", str.c_str());
-    buffer = str.c_str();
+    *buffer = str;
     sem_full->release();
   }
 
   XBT_INFO("Bye!");
 }
-static void consumer()
+static void consumer(const std::string* buffer, sg4::SemaphorePtr sem_empty, sg4::SemaphorePtr sem_full)
 {
   std::string str;
   do {
     sem_full->acquire();
-    str = buffer;
+    str = *buffer;
     XBT_INFO("Receiving '%s'", str.c_str());
     sem_empty->release();
   } while (str != "");
@@ -47,8 +44,13 @@ int main(int argc, char **argv)
   std::vector<std::string> args({"one", "two", "three", ""});
   sg4::Engine e(&argc, argv);
   e.load_platform(argc > 1 ? argv[1] : "../../platforms/two_hosts.xml");
-  sg4::Actor::create("producer", e.host_by_name("Tremblay"), producer, std::cref(args));
-  sg4::Actor::create("consumer", e.host_by_name("Jupiter"), consumer);
+
+  std::string buffer;                         /* Where the data is exchanged */
+  auto sem_empty = sg4::Semaphore::create(1); /* indicates whether the buffer is empty */
+  auto sem_full  = sg4::Semaphore::create(0); /* indicates whether the buffer is full */
+
+  sg4::Actor::create("producer", e.host_by_name("Tremblay"), producer, &buffer, sem_empty, sem_full, std::cref(args));
+  sg4::Actor::create("consumer", e.host_by_name("Jupiter"), consumer, &buffer, sem_empty, sem_full);
   e.run();
 
   return 0;
index ce1f2f7..b524bf1 100644 (file)
@@ -4,7 +4,6 @@
   <config id="General">
     <prop id="maxmin/precision" value="0.000010"></prop>
     <prop id="cpu/optim" value="TI"></prop>
-    <prop id="host/model" value="compound"></prop>
     <prop id="network/model" value="SMPI"></prop>
     <prop id="path" value="~/"></prop>
     <prop id="network/bandwidth-factor" value="65472:0.940694;15424:0.697866;9376:0.58729"></prop>
index 3b62cab..d6fff83 100644 (file)
@@ -20,12 +20,6 @@ static void action_blah(const simgrid::xbt::ReplayAction& /*args*/)
      args is a strings array containing the blank-separated parameters found in the trace for this event instance. */
 }
 
-action_fun previous_send;
-static void overriding_send(simgrid::xbt::ReplayAction& args)
-{
-  previous_send(args); // Just call the overridden symbol. That's a toy example.
-}
-
 int main(int argc, char* argv[])
 {
   auto properties = simgrid::s4u::Actor::self()->get_properties();
@@ -47,14 +41,17 @@ int main(int argc, char* argv[])
   /* Connect your callback function to the "blah" event in the trace files */
   xbt_replay_action_register("blah", action_blah);
 
-  /* The send action is an override, so we have to first save its previous value in a global */
+  /* The send action is an override, so we could have saved its previous value in a global, or use a lambda capture like
+   * in the following */
   int new_rank;
   MPI_Comm_rank(MPI_COMM_WORLD, &new_rank);
   if (new_rank != rank)
     XBT_WARN("Rank inconsistency. Got %d, expected %d", new_rank, rank);
   if (rank == 0) {
-    previous_send = xbt_replay_action_get("send");
-    xbt_replay_action_register("send", overriding_send);
+    auto previous_send = xbt_replay_action_get("send");
+    xbt_replay_action_register("send", [previous_send](simgrid::xbt::ReplayAction& args) {
+      previous_send(args); // Just call the overridden symbol. That's a toy example.
+    });
   }
   /* The regular run of the replayer */
   if (shared_trace != nullptr)
index fe5a0e0..7707303 100644 (file)
@@ -44,9 +44,6 @@ struct Job {
   int unique_job_number;                     //!< The job unique number in [0, n[.
 };
 
-// ugly globals to avoid creating structures for giving args to processes
-static std::vector<simgrid::s4u::Host*> hosts;
-
 static void smpi_replay_process(Job* job, simgrid::s4u::BarrierPtr barrier, int rank)
 {
   XBT_INFO("Replaying rank %d of job %d (smpi_app '%s')", rank, job->unique_job_number, job->smpi_app_name.c_str());
@@ -74,7 +71,7 @@ static void pop_some_processes(int nb_processes, simgrid::s4u::Host* host)
   }
 }
 
-static int job_executor_process(Job* job)
+static int job_executor_process(const std::vector<simgrid::s4u::Host*>& hosts, Job* job)
 {
   XBT_INFO("Executing job %d (smpi_app '%s')", job->unique_job_number, job->smpi_app_name.c_str());
 
@@ -95,7 +92,8 @@ static int job_executor_process(Job* job)
 }
 
 // Executes a workload of SMPI processes
-static int workload_executor_process(const std::vector<std::unique_ptr<Job>>& workload, int noise_between_jobs)
+static int workload_executor_process(const std::vector<simgrid::s4u::Host*>& hosts,
+                                     const std::vector<std::unique_ptr<Job>>& workload, int noise_between_jobs)
 {
   for (auto const& job : workload) {
     // Let's wait until the job's waiting time if needed
@@ -116,7 +114,8 @@ static int workload_executor_process(const std::vector<std::unique_ptr<Job>>& wo
     // Let's finally run the job executor
     char* str_pname = bprintf("job_%04d", job->unique_job_number);
     XBT_INFO("Launching the job executor of job %d (app '%s')", job->unique_job_number, job->smpi_app_name.c_str());
-    simgrid::s4u::Actor::create(str_pname, hosts[job->allocation[0]], job_executor_process, job.get());
+    simgrid::s4u::Actor::create(str_pname, hosts[job->allocation[0]], job_executor_process, std::cref(hosts),
+                                job.get());
     xbt_free(str_pname);
   }
 
@@ -209,7 +208,7 @@ int main(int argc, char* argv[])
   //  Simulation setting
   simgrid::s4u::Engine e(&argc, argv);
   e.load_platform(argv[1]);
-  hosts = e.get_all_hosts();
+  const auto hosts = e.get_all_hosts();
   xbt_assert(hosts.size() >= 4, "The given platform should contain at least 4 hosts (found %zu).", hosts.size());
 
   // Let's retrieve all SMPI jobs
@@ -234,7 +233,8 @@ int main(int argc, char* argv[])
   }
 
   // Let's execute the workload
-  simgrid::s4u::Actor::create("workload", hosts[0], workload_executor_process, std::cref(jobs), noise_between_jobs);
+  simgrid::s4u::Actor::create("workload", hosts[0], workload_executor_process, std::cref(hosts), std::cref(jobs),
+                              noise_between_jobs);
 
   e.run();
   XBT_INFO("Simulation finished! Final time: %g", simgrid::s4u::Engine::get_clock());
index af744b0..82632b4 100644 (file)
@@ -139,6 +139,7 @@ public:
 class XBT_PUBLIC FileDescriptorHostExt {
 public:
   static simgrid::xbt::Extension<Host, FileDescriptorHostExt> EXTENSION_ID;
+  static int max_file_descriptors;
   FileDescriptorHostExt() = default;
   FileDescriptorHostExt(const FileDescriptorHostExt&) = delete;
   FileDescriptorHostExt& operator=(const FileDescriptorHostExt&) = delete;
index f2a3203..94b0202 100644 (file)
@@ -57,8 +57,31 @@ public:
   static s4u::Engine* get_instance(int* argc, char** argv);
   static bool has_instance() { return instance_ != nullptr; }
 
+  /**
+   * Creates a new platform, including hosts, links, and the routing table.
+   *
+   * @beginrst
+   * See also: :ref:`platform`.
+   * @endrst
+   */
   void load_platform(const std::string& platf) const;
+  /**
+   * @brief Seals the platform, finishing the creation of its resources.
+   *
+   * This method is optional. The seal() is done automatically when you call Engine::run.
+   */
   void seal_platform() const;
+  /** @brief Get a debug output of the platform.
+   *
+   * It looks like a XML platform file, but it may be very different from the input platform file: All netzones are
+   * flatified into a unique zone. This representation is mostly useful to debug your platform configuration and ensure
+   * that your assumptions over your configuration hold. This enables you to verify the exact list of links traversed
+   * between any two hosts, and the characteristics of every host and link. But you should not use the resulting file as
+   * an input platform file: it is very verbose, and thus much less efficient (in parsing time and runtime performance)
+   * than a regular platform file with the sufficient amount of intermediary netzones. Even if you use one zone only,
+   * specialized zones (such as clusters) are more efficient than the one with fully explicit routing used here.
+   */
+  std::string flatify_platform() const;
 
   /** @verbatim embed:rst:inline Bind an actor name that could be found in :ref:`pf_tag_actor` tag to a function taking classical argc/argv parameters. See the :ref:`example <s4u_ex_actors_create>`. @endverbatim */
   void register_function(const std::string& name, const std::function<void(int, char**)>& code);
index b4cda59..2195c69 100644 (file)
@@ -111,6 +111,7 @@ public:
    * @param limit  Number of concurrent flows
    */
   Link* set_concurrency_limit(int limit);
+  int get_concurrency_limit() const;
 
   /** @brief Set the level of communication speed of the given host on this wifi link.
    *
index c2dbd35..49adae5 100644 (file)
@@ -308,8 +308,6 @@ XBT_PUBLIC void _xbt_log_event_log(xbt_log_event_t ev, const char* fmt, ...) XBT
 XBT_PUBLIC int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority);
 
 extern s_xbt_log_category_t _XBT_LOGV(XBT_LOG_ROOT_CAT);
-extern xbt_log_appender_t xbt_log_default_appender;
-extern xbt_log_layout_t xbt_log_default_layout;
 
 /* ********************** */
 /* Public functions again */
index 50178d6..5077da5 100644 (file)
@@ -14,7 +14,6 @@ SG_BEGIN_DECL
 
 /* Modules definitions */
 
-void xbt_log_preinit(void);
 void xbt_log_postexit(void);
 
 void xbt_dict_preinit(void);
index 19d9e9e..c13fdff 100644 (file)
@@ -20,7 +20,7 @@ XBT_LOG_NEW_CATEGORY(instr, "Logging the behavior of the tracing system (used fo
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_config, instr, "Configuration");
 
 std::ofstream tracing_file;
-std::map<const simgrid::instr::Container*, std::ofstream*> tracing_files; // TI specific
+static std::map<const simgrid::instr::Container*, std::ofstream*> tracing_files; // TI specific
 
 constexpr char OPT_TRACING_BASIC[]             = "tracing/basic";
 constexpr char OPT_TRACING_COMMENT_FILE[]      = "tracing/comment-file";
@@ -206,7 +206,7 @@ void TRACE_help()
 namespace simgrid::instr {
 static bool trace_active = false;
 TraceFormat trace_format = TraceFormat::Paje;
-int trace_precision;
+static int trace_precision;
 
 /*************
  * Callbacks *
index 4ff4120..106acd4 100644 (file)
@@ -17,11 +17,11 @@ enum class InstrUserVariable { DECLARE, SET, ADD, SUB };
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_api, instr, "API");
 
-std::set<std::string, std::less<>> created_categories;
-std::set<std::string, std::less<>> declared_marks;
-std::set<std::string, std::less<>> user_host_variables;
-std::set<std::string, std::less<>> user_vm_variables;
-std::set<std::string, std::less<>> user_link_variables;
+static std::set<std::string, std::less<>> created_categories;
+static std::set<std::string, std::less<>> declared_marks;
+static std::set<std::string, std::less<>> user_host_variables;
+static std::set<std::string, std::less<>> user_vm_variables;
+static std::set<std::string, std::less<>> user_link_variables;
 
 static void instr_user_variable(double time, const std::string& resource, const std::string& variable_name,
                                 const std::string& parent_type, double value, InstrUserVariable what,
index c6b35da..091bbcc 100644 (file)
@@ -40,7 +40,6 @@ void dump_header(bool basic, bool display_sizes);
  */
 enum class TraceFormat { Paje, /*TimeIndependent*/ Ti };
 extern TraceFormat trace_format;
-extern int trace_precision;
 extern double last_timestamp_to_dump;
 
 void init();
@@ -233,12 +232,6 @@ public:
 
 XBT_PRIVATE std::string instr_pid(simgrid::s4u::Actor const& proc);
 
-extern XBT_PRIVATE std::set<std::string, std::less<>> created_categories;
-extern XBT_PRIVATE std::set<std::string, std::less<>> declared_marks;
-extern XBT_PRIVATE std::set<std::string, std::less<>> user_host_variables;
-extern XBT_PRIVATE std::set<std::string, std::less<>> user_vm_variables;
-extern XBT_PRIVATE std::set<std::string, std::less<>> user_link_variables;
-
 /* from instr_config.c */
 XBT_PRIVATE bool TRACE_needs_platform();
 XBT_PRIVATE bool TRACE_is_enabled();
index e769b07..c27e814 100644 (file)
@@ -99,7 +99,7 @@ static void segvhandler(int signum, siginfo_t* siginfo, void* /*context*/)
             "If you think you've found a bug in SimGrid, please report it along with a\n"
             "Minimal Working Example (MWE) reproducing your problem and a full backtrace\n"
             "of the fault captured with gdb or valgrind.\n",
-            simgrid::kernel::context::stack_size / 1024);
+            simgrid::kernel::context::Context::stack_size / 1024);
   } else if (siginfo->si_signo == SIGSEGV) {
     fprintf(stderr, "Segmentation fault.\n");
 #if HAVE_SMPI
index 23c3e71..148982f 100644 (file)
@@ -38,7 +38,7 @@ ActorImpl::ActorImpl(const std::string& name, s4u::Host* host, aid_t ppid)
     : ActorIDTrait(name, ppid), host_(host), piface_(this)
 {
   simcall_.issuer_ = this;
-  stacksize_       = context::stack_size;
+  stacksize_       = context::Context::stack_size;
 }
 
 ActorImpl::~ActorImpl()
index 040d783..0229296 100644 (file)
@@ -18,64 +18,21 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_context, kernel, "Context switching mechanis
 
 namespace simgrid::kernel::context {
 
-static e_xbt_parmap_mode_t parallel_synchronization_mode = XBT_PARMAP_DEFAULT;
-static int parallel_contexts                             = 1;
-unsigned stack_size;
-unsigned guard_size;
-
-/** @brief Returns whether some parallel threads are used for the user contexts. */
-bool is_parallel()
-{
-  return parallel_contexts > 1;
-}
-
-/**
- * @brief Returns the number of parallel threads used for the user contexts.
- * @return the number of threads (1 means no parallelism)
- */
-int get_nthreads()
-{
-  return parallel_contexts;
-}
-
-/**
- * @brief Sets the number of parallel threads to use  for the user contexts.
- *
- * This function should be called before initializing SIMIX.
- * A value of 1 means no parallelism (1 thread only).
- * If the value is greater than 1, the thread support must be enabled.
- *
- * @param nb_threads the number of threads to use
- */
-void set_nthreads(int nb_threads)
+void Context::set_nthreads(int nb_threads)
 {
   if (nb_threads <= 0) {
     nb_threads = std::thread::hardware_concurrency();
     XBT_INFO("Auto-setting contexts/nthreads to %d", nb_threads);
   }
-  parallel_contexts = nb_threads;
-}
-
-/**
- * @brief Sets the synchronization mode to use when actors are run in parallel.
- * @param mode how to synchronize threads if actors are run in parallel
- */
-void set_parallel_mode(e_xbt_parmap_mode_t mode)
-{
-  parallel_synchronization_mode = mode;
-}
-
-/**
- * @brief Returns the synchronization mode used when actors are run in parallel.
- * @return how threads are synchronized if actors are run in parallel
- */
-e_xbt_parmap_mode_t get_parallel_mode()
-{
-  return parallel_synchronization_mode;
+  Context::parallel_contexts = nb_threads;
 }
 
 ContextFactory::~ContextFactory() = default;
 
+e_xbt_parmap_mode_t Context::parallel_mode = XBT_PARMAP_DEFAULT;
+int Context::parallel_contexts             = 1;
+unsigned Context::stack_size;
+unsigned Context::guard_size;
 thread_local Context* Context::current_context_ = nullptr;
 
 /* Install or disable alternate signal stack, for SIGSEGV handler. */
index 25d8113..1961399 100644 (file)
@@ -15,8 +15,6 @@
 #include <functional>
 
 namespace simgrid::kernel::context {
-extern unsigned stack_size;
-extern unsigned guard_size;
 
 class XBT_PUBLIC ContextFactory {
 public:
@@ -45,6 +43,7 @@ protected:
 class XBT_PUBLIC Context {
   friend ContextFactory;
 
+  static int parallel_contexts;
   static thread_local Context* current_context_;
 
   std::function<void()> code_;
@@ -53,6 +52,10 @@ class XBT_PUBLIC Context {
   void declare_context(std::size_t size);
 
 public:
+  static e_xbt_parmap_mode_t parallel_mode;
+  static unsigned stack_size;
+  static unsigned guard_size;
+
   static int install_sigsegv_stack(bool enable);
 
   Context(std::function<void()>&& code, actor::ActorImpl* actor, bool maestro);
@@ -65,6 +68,22 @@ public:
   bool has_code() const { return static_cast<bool>(code_); }
   actor::ActorImpl* get_actor() const { return this->actor_; }
 
+  /** @brief Returns whether some parallel threads are used for the user contexts. */
+  static bool is_parallel() { return parallel_contexts > 1; }
+  /** @brief Returns the number of parallel threads used for the user contexts (1 means no parallelism). */
+  static int get_nthreads() { return parallel_contexts; }
+  /**
+   * @brief Sets the number of parallel threads to use  for the user contexts.
+   *
+   * This function should be called before initializing SIMIX.
+   * A value of 1 means no parallelism (1 thread only).
+   * If the value is greater than 1, the thread support must be enabled.
+   * If the value is less than 1, the optimal number of threads is chosen automatically.
+   *
+   * @param nb_threads the number of threads to use
+   */
+  static void set_nthreads(int nb_threads);
+
   // Scheduling methods
   virtual void stop();
   virtual void suspend() = 0;
@@ -98,11 +117,6 @@ XBT_PRIVATE ContextFactory* sysv_factory();
 XBT_PRIVATE ContextFactory* raw_factory();
 XBT_PRIVATE ContextFactory* boost_factory();
 
-XBT_PUBLIC bool is_parallel();
-XBT_PUBLIC int get_nthreads();
-XBT_PUBLIC void set_nthreads(int nb_threads);
-XBT_PUBLIC void set_parallel_mode(e_xbt_parmap_mode_t mode);
-XBT_PUBLIC e_xbt_parmap_mode_t get_parallel_mode();
 } // namespace simgrid::kernel::context
 
 #endif
index 350b686..a197791 100644 (file)
@@ -191,10 +191,11 @@ void SwappedContextFactory::run_all(std::vector<actor::ActorImpl*> const& actors
    * stuff It is much easier to understand what happens if you see the working threads as bodies that swap their soul
    * for the ones of the simulated processes that must run.
    */
-  if (is_parallel()) {
+  if (Context::is_parallel()) {
     // We lazily create the parmap so that all options are actually processed when doing so.
     if (parmap_ == nullptr)
-      parmap_ = std::make_unique<simgrid::xbt::Parmap<actor::ActorImpl*>>(get_nthreads(), get_parallel_mode());
+      parmap_ =
+          std::make_unique<simgrid::xbt::Parmap<actor::ActorImpl*>>(Context::get_nthreads(), Context::parallel_mode);
 
     // Usually, Parmap::apply() executes the provided function on all elements of the array.
     // Here, the executed function does not return the control to the parmap before all the array is processed:
index c6901c9..9106a3c 100644 (file)
@@ -24,21 +24,21 @@ namespace simgrid::kernel::context {
 
 ThreadContextFactory::ThreadContextFactory() : ContextFactory()
 {
-  if (stack_size != 8 * 1024 * 1024)
+  if (Context::stack_size != 8 * 1024 * 1024)
     XBT_INFO("Stack size modifications are ignored by thread factory.");
-  if (is_parallel())
+  if (Context::is_parallel())
     ParallelThreadContext::initialize();
 }
 
 ThreadContextFactory::~ThreadContextFactory()
 {
-  if (is_parallel())
+  if (Context::is_parallel())
     ParallelThreadContext::finalize();
 }
 
 ThreadContext* ThreadContextFactory::create_context(std::function<void()>&& code, actor::ActorImpl* actor, bool maestro)
 {
-  if (is_parallel())
+  if (Context::is_parallel())
     return this->new_context<ParallelThreadContext>(std::move(code), actor, maestro);
   else
     return this->new_context<SerialThreadContext>(std::move(code), actor, maestro);
@@ -46,7 +46,7 @@ ThreadContext* ThreadContextFactory::create_context(std::function<void()>&& code
 
 void ThreadContextFactory::run_all(std::vector<actor::ActorImpl*> const& actors_list)
 {
-  if (is_parallel())
+  if (Context::is_parallel())
     ParallelThreadContext::run_all(actors_list);
 
   else
index e9b43c5..f7f269f 100644 (file)
@@ -40,6 +40,8 @@ public:
   virtual void set_latency_profile(kernel::profile::Profile* profile) = 0;
   /** @brief Set the concurrency limit for this link */
   virtual void set_concurrency_limit(int limit) const = 0;
+  /** @brief Get the concurrency limit of this link */
+  virtual int get_concurrency_limit() const = 0;
 };
 
 } // namespace simgrid::kernel::resource
index ffd1b69..06ea79c 100644 (file)
@@ -5,7 +5,6 @@
 
 #include "src/kernel/resource/NetworkModelFactors.hpp"
 #include "simgrid/sg_config.hpp"
-#include "src/kernel/resource/FactorSet.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
 
@@ -14,9 +13,6 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
  *********/
 
 namespace simgrid::kernel::resource {
-static FactorSet cfg_latency_factor("network/latency-factor");
-static FactorSet cfg_bandwidth_factor("network/bandwidth-factor");
-
 config::Flag<std::string> cfg_latency_factor_str(
     "network/latency-factor", std::initializer_list<const char*>{"smpi/lat-factor"},
     "Correction factor to apply to the provided latency (default value overridden by network model)", "1.0");
@@ -24,6 +20,9 @@ static config::Flag<std::string> cfg_bandwidth_factor_str(
     "network/bandwidth-factor", std::initializer_list<const char*>{"smpi/bw-factor"},
     "Correction factor to apply to the provided bandwidth (default value overridden by network model)", "1.0");
 
+FactorSet NetworkModelFactors::cfg_latency_factor("network/latency-factor");
+FactorSet NetworkModelFactors::cfg_bandwidth_factor("network/bandwidth-factor");
+
 double NetworkModelFactors::get_bandwidth_factor() const
 {
   xbt_assert(not bw_factor_cb_,
index e9e4ee6..40a4fae 100644 (file)
@@ -7,6 +7,7 @@
 #define SIMGRID_KERNEL_RESOURCE_NETWORKMODELFACTORS_HPP
 
 #include "simgrid/sg_config.hpp"
+#include "src/kernel/resource/FactorSet.hpp"
 #include "xbt/asserts.h"
 #include <simgrid/forward.h>
 
@@ -18,6 +19,9 @@ namespace simgrid::kernel::resource {
 /** This Trait of NetworkModel is in charge of handling the network factors (bw and lat) */
 
 class XBT_PUBLIC NetworkModelFactors {
+  static FactorSet cfg_latency_factor;
+  static FactorSet cfg_bandwidth_factor;
+
   using NetworkFactorCb = double(double size, const s4u::Host* src, const s4u::Host* dst,
                                  const std::vector<s4u::Link*>& links,
                                  const std::unordered_set<s4u::NetZone*>& netzones);
index cf8c031..d5b08c9 100644 (file)
@@ -85,6 +85,11 @@ void SplitDuplexLinkImpl::set_latency_profile(profile::Profile* profile)
   link_down_->set_latency_profile(profile);
 }
 
+int SplitDuplexLinkImpl::get_concurrency_limit() const
+{
+  return link_up_->get_concurrency_limit();
+}
+
 void SplitDuplexLinkImpl::set_concurrency_limit(int limit) const
 {
   link_up_->set_concurrency_limit(limit);
index fe81c42..8708018 100644 (file)
@@ -66,6 +66,7 @@ public:
    * Profile must contain absolute values */
   void set_latency_profile(kernel::profile::Profile* profile) override;
   void set_concurrency_limit(int limit) const override;
+  int get_concurrency_limit() const override;
 };
 
 } // namespace simgrid::kernel::resource
index 40932ef..30471d0 100644 (file)
@@ -140,5 +140,9 @@ void StandardLinkImpl::set_concurrency_limit(int limit) const
   }
   get_constraint()->set_concurrency_limit(limit);
 }
+int StandardLinkImpl::get_concurrency_limit() const
+{
+  return get_constraint()->get_concurrency_limit();
+}
 
 } // namespace simgrid::kernel::resource
index 1c5c8b7..4a10210 100644 (file)
@@ -72,6 +72,7 @@ public:
   void set_latency_profile(kernel::profile::Profile* profile) override;
 
   void set_concurrency_limit(int limit) const override;
+  int get_concurrency_limit() const override;
 };
 
 } // namespace simgrid::kernel::resource
index 8a3365a..5bff857 100644 (file)
@@ -19,8 +19,9 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_vm, ker_resource, "Virtual Machines, containing actors and mobile across hosts");
 
-void surf_vm_model_init_HL13(simgrid::kernel::resource::CpuModel* cpu_pm_model)
+void surf_vm_model_init_HL13()
 {
+  auto* cpu_pm_model = simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->get_cpu_pm_model().get();
   auto vm_model = std::make_shared<simgrid::kernel::resource::VMModel>("VM_HL13");
   auto* engine  = simgrid::kernel::EngineImpl::get_instance();
 
index bb269eb..72f6dca 100644 (file)
@@ -7,7 +7,7 @@
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include "src/kernel/resource/StandardLinkImpl.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_cluster, ker_routing, "Kernel Cluster Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_cluster, ker_platform, "Kernel Cluster Routing");
 
 /* This routing is specifically setup to represent clusters, aka homogeneous sets of machines
  * Note that a router is created, easing the interconnection with the rest of the world. */
index 06a7d19..2169610 100644 (file)
@@ -13,7 +13,7 @@
 #include <queue>
 #include <vector>
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_dijkstra, ker_routing, "Kernel Dijkstra Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_dijkstra, ker_platform, "Kernel Dijkstra Routing");
 
 namespace simgrid {
 namespace kernel::routing {
index e8e4b9a..7afec19 100644 (file)
@@ -12,7 +12,7 @@
 #include <numeric>
 #include <string>
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_dragonfly, ker_routing, "Kernel Dragonfly Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_dragonfly, ker_platform, "Kernel Dragonfly Routing");
 
 namespace simgrid {
 namespace kernel::routing {
index 26fc80c..fc89682 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "simgrid/kernel/routing/EmptyZone.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_none, ker_routing, "Kernel No Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_none, ker_platform, "Kernel No Routing");
 
 namespace simgrid {
 namespace kernel::routing {
index d537bb6..0c33475 100644 (file)
@@ -17,7 +17,7 @@
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_fat_tree, ker_routing, "Kernel Fat-Tree Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_fat_tree, ker_platform, "Kernel Fat-Tree Routing");
 
 namespace simgrid {
 namespace kernel::routing {
index 85ae467..350ce04 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <climits>
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_floyd, ker_routing, "Kernel Floyd Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_floyd, ker_platform, "Kernel Floyd Routing");
 
 namespace simgrid {
 namespace kernel::routing {
index 4e862cc..1ae50c5 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/kernel/resource/NetworkModel.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_full, ker_routing, "Kernel Full Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_full, ker_platform, "Kernel Full Routing");
 
 namespace simgrid {
 namespace kernel::routing {
index d3d72aa..ee3d0da 100644 (file)
@@ -9,7 +9,7 @@
 #include "simgrid/s4u/Host.hpp"
 #include "xbt/log.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_netpoint, ker_routing, "Kernel implementation of netpoints");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_netpoint, ker_platform, "Kernel implementation of netpoints");
 
 namespace simgrid {
 
index f8db982..57db71f 100644 (file)
 #include "src/kernel/resource/VirtualMachineImpl.hpp"
 #include "src/surf/HostImpl.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing, kernel, "Kernel routing-related information");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_platform, kernel, "Kernel platform-related information");
 
 namespace simgrid::kernel::routing {
 
-/* Pick the right models for CPU, net and host, and call their model_init_preparse */
-static void surf_config_models_setup()
-{
-  std::string host_model_name    = simgrid::config::get_value<std::string>("host/model");
-  std::string network_model_name = simgrid::config::get_value<std::string>("network/model");
-  std::string cpu_model_name     = simgrid::config::get_value<std::string>("cpu/model");
-  std::string disk_model_name    = simgrid::config::get_value<std::string>("disk/model");
-
-  /* The compound host model is needed when using non-default net/cpu models */
-  if ((not simgrid::config::is_default("network/model") || not simgrid::config::is_default("cpu/model") ||
-       not simgrid::config::is_default("disk/model")) && simgrid::config::is_default("host/model")) {
-    host_model_name = "compound";
-    simgrid::config::set_value("host/model", host_model_name);
-  }
-
-  XBT_DEBUG("host model: %s", host_model_name.c_str());
-  if (host_model_name == "compound") {
-    xbt_enforce(not cpu_model_name.empty(), "Set a cpu model to use with the 'compound' host model");
-    xbt_enforce(not disk_model_name.empty(), "Set a disk model to use with the 'compound' host model");
-    xbt_enforce(not network_model_name.empty(), "Set a network model to use with the 'compound' host model");
-
-    const auto* cpu_model = find_model_description(surf_cpu_model_description, cpu_model_name);
-    cpu_model->model_init_preparse();
-
-    const auto* disk_model = find_model_description(surf_disk_model_description, disk_model_name);
-    disk_model->model_init_preparse();
-
-    const auto* network_model = find_model_description(surf_network_model_description, network_model_name);
-    network_model->model_init_preparse();
-  }
-
-  XBT_DEBUG("Call host_model_init");
-  const auto* host_model = find_model_description(surf_host_model_description, host_model_name);
-  host_model->model_init_preparse();
-
-  XBT_DEBUG("Call vm_model_init");
-  /* ideally we should get back the pointer to CpuModel from model_init_preparse(), but this
-   * requires changing the declaration of surf_cpu_model_description.
-   * To be reviewed in the future */
-  surf_vm_model_init_HL13(
-      simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->get_cpu_pm_model().get());
-}
-
 xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                  kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
                  std::vector<kernel::resource::StandardLinkImpl*> const& link_list)>
@@ -91,7 +48,8 @@ NetZoneImpl::NetZoneImpl(const std::string& name) : piface_(this), name_(name)
      * (FIXME: check it out by creating a file beginning with one of these tags)
      * but cluster and peer come down to zone creations, so putting this verification here is correct.
      */
-    surf_config_models_setup();
+    simgrid_host_models().init_from_flag_value();
+    surf_vm_model_init_HL13();
   }
 
   xbt_enforce(nullptr == engine->netpoint_by_name_or_null(get_name()),
index d5790d7..8457254 100644 (file)
@@ -12,7 +12,7 @@
 #include "xbt/sysdep.h"
 #include "xbt/asserts.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_generic, ker_routing, "Kernel Generic Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_generic, ker_platform, "Kernel Generic Routing");
 
 /* ***************************************************************** */
 /* *********************** GENERIC METHODS ************************* */
index ada9bb6..3ccb888 100644 (file)
@@ -8,7 +8,7 @@
 #include "src/kernel/resource/NetworkModel.hpp"
 #include "xbt/string.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_star, ker_routing, "Kernel Star Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_star, ker_platform, "Kernel Star Routing");
 
 namespace simgrid {
 namespace kernel::routing {
index 4f3652f..11fd3b4 100644 (file)
@@ -14,7 +14,7 @@
 #include <string>
 #include <vector>
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_torus, ker_routing, "Kernel Torus Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_torus, ker_platform, "Kernel Torus Routing");
 
 namespace simgrid {
 namespace kernel ::routing {
index e9c2ccb..e7429d8 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <boost/algorithm/string.hpp>
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_vivaldi, ker_routing, "Kernel Vivaldi Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_vivaldi, ker_platform, "Kernel Vivaldi Routing");
 
 namespace simgrid {
 namespace kernel::routing {
index d6cb94f..b6d4083 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/kernel/resource/NetworkModel.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_wifi, ker_routing, "Kernel Wifi Routing");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_wifi, ker_platform, "Kernel Wifi Routing");
 
 namespace simgrid {
 namespace kernel::routing {
index 0e0938f..45f4df6 100644 (file)
@@ -10,7 +10,7 @@
 #include <simgrid/s4u/Host.hpp>
 #include <xbt/config.hpp>
 
-#include "src/surf/surf_interface.hpp" // SIMGRID_REGISTER_PLUGIN
+#include "src/simgrid/module.hpp" // SIMGRID_REGISTER_PLUGIN
 
 namespace sg4 = simgrid::s4u;
 static simgrid::config::Flag<bool> cfg_tell{"cmonkey/tell", "Request the Chaos Monkey to display all timestamps",
index 4d6db1a..929cf17 100644 (file)
@@ -23,7 +23,6 @@
 #include <numeric>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_file, s4u, "S4U files");
-int sg_storage_max_file_descriptors = 1024;
 
 /** @defgroup plugin_filesystem Plugin FileSystem
  *
@@ -38,6 +37,7 @@ template class xbt::Extendable<s4u::File>;
 namespace s4u {
 simgrid::xbt::Extension<Disk, FileSystemDiskExt> FileSystemDiskExt::EXTENSION_ID;
 simgrid::xbt::Extension<Host, FileDescriptorHostExt> FileDescriptorHostExt::EXTENSION_ID;
+int FileDescriptorHostExt::max_file_descriptors;
 
 const Disk* File::find_local_disk_on(const Host* host)
 {
@@ -78,9 +78,9 @@ File::File(const std::string& fullpath, const_sg_host_t host, void* userdata) :
     local_disk_ = find_local_disk_on(host);
 
     // assign a file descriptor id to the newly opened File
-    auto* ext = host->extension<simgrid::s4u::FileDescriptorHostExt>();
+    auto* ext = host->extension<FileDescriptorHostExt>();
     if (ext->file_descriptor_table == nullptr) {
-      ext->file_descriptor_table = std::make_unique<std::vector<int>>(sg_storage_max_file_descriptors);
+      ext->file_descriptor_table = std::make_unique<std::vector<int>>(FileDescriptorHostExt::max_file_descriptors);
       std::iota(ext->file_descriptor_table->rbegin(), ext->file_descriptor_table->rend(), 0); // Fill with ..., 1, 0.
     }
     xbt_assert(not ext->file_descriptor_table->empty(), "Too much files are opened! Some have to be closed.");
@@ -119,8 +119,7 @@ File* File::open(const std::string& fullpath, const_sg_host_t host, void* userda
 
 void File::close()
 {
-  std::vector<int>* desc_table =
-      Host::current()->extension<simgrid::s4u::FileDescriptorHostExt>()->file_descriptor_table.get();
+  std::vector<int>* desc_table = Host::current()->extension<FileDescriptorHostExt>()->file_descriptor_table.get();
   kernel::actor::simcall_answered([this, desc_table] { desc_table->push_back(this->desc_id); });
   delete this;
 }
@@ -248,7 +247,7 @@ sg_size_t File::tell() const
 void File::move(const std::string& fullpath) const
 {
   /* Check if the new full path is on the same mount point */
-  if (fullpath.compare(0, mount_point_.length(), mount_point_) == 0) {
+  if (fullpath.rfind(mount_point_, 0) == 0) {
     std::map<std::string, sg_size_t, std::less<>>* content = nullptr;
     content = local_disk_->extension<FileSystemDiskExt>()->get_content();
     if (content) {
@@ -470,8 +469,8 @@ static void on_simulation_end()
  */
 void sg_storage_file_system_init()
 {
-  sg_storage_max_file_descriptors = 1024;
-  simgrid::config::bind_flag(sg_storage_max_file_descriptors, "storage/max_file_descriptors",
+  FileDescriptorHostExt::max_file_descriptors = 1024;
+  simgrid::config::bind_flag(FileDescriptorHostExt::max_file_descriptors, "storage/max_file_descriptors",
                              "Maximum number of concurrently opened files per host. Default is 1024");
 
   if (not FileSystemDiskExt::EXTENSION_ID.valid()) {
index 6c926ad..2ea7c47 100644 (file)
@@ -10,7 +10,7 @@
 #include <simgrid/s4u/VirtualMachine.hpp>
 
 #include "src/kernel/activity/ExecImpl.hpp"
-#include "src/surf/surf_interface.hpp"
+#include "src/simgrid/module.hpp" // SIMGRID_REGISTER_PLUGIN
 
 // 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)
@@ -32,7 +32,7 @@ It attaches an extension to each host to store some data, and places callbacks i
   @endrst
 */
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(host_load, kernel, "Logging specific to the HostLoad plugin");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(host_load, plugin, "Logging specific to the HostLoad plugin");
 
 namespace simgrid::plugin {
 
index 025c83f..1afdd6e 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/kernel/resource/NetworkModel.hpp"
+#include "src/simgrid/module.hpp" // SIMGRID_REGISTER_PLUGIN
 
 #include <limits>
 
index e808263..d994ec0 100644 (file)
@@ -107,28 +107,154 @@ const std::vector<simgrid::kernel::resource::Model*>& Engine::get_all_models() c
   return pimpl->get_all_models();
 }
 
-/**
- * Creates a new platform, including hosts, links, and the routing table.
- *
- * @beginrst
- * See also: :ref:`platform`.
- * @endrst
- */
 void Engine::load_platform(const std::string& platf) const
 {
   pimpl->load_platform(platf);
 }
 
-/**
- * @brief Seals the platform, finishing the creation of its resources.
- *
- * This method is optional. The seal() is done automatically when you call Engine::run.
- */
 void Engine::seal_platform() const
 {
   pimpl->seal_platform();
 }
 
+static void flatify_hosts(Engine const& engine, std::stringstream& ss)
+{
+  // Regular hosts
+  std::vector<Host*> hosts = engine.get_all_hosts();
+
+  for (auto const* h : hosts) {
+    ss << "  <host id=\"" << h->get_name() << "\" speed=\"" << h->get_speed() << "\"";
+    const std::unordered_map<std::string, std::string>* props = h->get_properties();
+    if (h->get_core_count() > 1)
+      ss << " core=\"" << h->get_core_count() << "\"";
+
+    // Sort the properties before displaying them, so that the tests are perfectly reproducible
+    std::vector<std::string> keys;
+    for (auto const& [key, _] : *props)
+      keys.push_back(key);
+    if (not keys.empty()) {
+      ss << ">\n";
+      std::sort(keys.begin(), keys.end());
+      for (const std::string& key : keys)
+        ss << "    <prop id=\"" << key << "\" value=\"" << props->at(key) << "\"/>\n";
+      ss << "  </host>\n";
+    } else {
+      ss << "/>\n";
+    }
+  }
+
+  // Routers
+  std::vector<simgrid::kernel::routing::NetPoint*> netpoints = engine.get_all_netpoints();
+  std::sort(netpoints.begin(), netpoints.end(),
+            [](const simgrid::kernel::routing::NetPoint* a, const simgrid::kernel::routing::NetPoint* b) {
+              return a->get_name() < b->get_name();
+            });
+
+  for (auto const& src : netpoints)
+    if (src->is_router())
+      ss << "  <router id=\"" << src->get_name() << "\"/>\n";
+}
+
+static void flatify_links(Engine const& engine, std::stringstream& ss)
+{
+  std::vector<Link*> links = engine.get_all_links();
+
+  std::sort(links.begin(), links.end(), [](const Link* a, const Link* b) { return a->get_name() < b->get_name(); });
+
+  for (auto const* link : links) {
+    ss << "  <link id=\"" << link->get_name() << "\"";
+    ss << " bandwidth=\"" << link->get_bandwidth() << "\"";
+    ss << " latency=\"" << link->get_latency() << "\"";
+    if (link->get_concurrency_limit() != -1)
+      ss << " concurrency=\"" << link->get_concurrency_limit() << "\"";
+    if (link->is_shared()) {
+      ss << "/>\n";
+    } else {
+      ss << " sharing_policy=\"FATPIPE\"/>\n";
+    }
+  }
+}
+
+static void flatify_routes(Engine const& engine, std::stringstream& ss)
+{
+  auto hosts     = engine.get_all_hosts();
+  auto netpoints = engine.get_all_netpoints();
+  std::sort(netpoints.begin(), netpoints.end(),
+            [](const simgrid::kernel::routing::NetPoint* a, const simgrid::kernel::routing::NetPoint* b) {
+              return a->get_name() < b->get_name();
+            });
+
+  for (auto const* src_host : hosts) { // Routes from host
+    const simgrid::kernel::routing::NetPoint* src = src_host->get_netpoint();
+    for (auto const* dst_host : hosts) { // Routes to host
+      std::vector<simgrid::kernel::resource::StandardLinkImpl*> route;
+      const simgrid::kernel::routing::NetPoint* dst = dst_host->get_netpoint();
+      simgrid::kernel::routing::NetZoneImpl::get_global_route(src, dst, route, nullptr);
+      if (route.empty())
+        continue;
+      ss << "  <route src=\"" << src_host->get_name() << "\" dst=\"" << dst_host->get_name() << "\">\n  ";
+      for (auto const& link : route)
+        ss << "<link_ctn id=\"" << link->get_name() << "\"/>";
+      ss << "\n  </route>\n";
+    }
+
+    for (auto const& dst : netpoints) { // to router
+      if (not dst->is_router())
+        continue;
+      ss << "  <route src=\"" << src_host->get_name() << "\" dst=\"" << dst->get_name() << "\">\n  ";
+      std::vector<simgrid::kernel::resource::StandardLinkImpl*> route;
+      simgrid::kernel::routing::NetZoneImpl::get_global_route(src, dst, route, nullptr);
+      for (auto const& link : route)
+        ss << "<link_ctn id=\"" << link->get_name() << "\"/>";
+      ss << "\n  </route>\n";
+    }
+  }
+
+  for (auto const& value1 : netpoints) { // Routes from router
+    if (not value1->is_router())
+      continue;
+    for (auto const& value2 : netpoints) { // to router
+      if (not value2->is_router())
+        continue;
+      std::vector<simgrid::kernel::resource::StandardLinkImpl*> route;
+      simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, value2, route, nullptr);
+      if (route.empty())
+        continue;
+      ss << "  <route src=\"" << value1->get_name() << "\" dst=\"" << value2->get_name() << "\">\n  ";
+      for (auto const& link : route)
+        ss << "<link_ctn id=\"" << link->get_name() << "\"/>";
+      ss << "\n  </route>\n";
+    }
+    for (auto const* dst_host : hosts) { // Routes to host
+      ss << "  <route src=\"" << value1->get_name() << "\" dst=\"" << dst_host->get_name() << "\">\n  ";
+      std::vector<simgrid::kernel::resource::StandardLinkImpl*> route;
+      const simgrid::kernel::routing::NetPoint* netcardDst = dst_host->get_netpoint();
+      simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, netcardDst, route, nullptr);
+      for (auto const& link : route)
+        ss << "<link_ctn id=\"" << link->get_name() << "\"/>";
+      ss << "\n  </route>\n";
+    }
+  }
+}
+std::string Engine::flatify_platform() const
+{
+  std::string version = "4.1";
+  std::stringstream ss;
+
+  ss << "<?xml version='1.0'?>\n";
+  ss << "<!DOCTYPE platform SYSTEM \"https://simgrid.org/simgrid.dtd\">\n";
+  ss << "<platform version=\"" << version << "\">\n";
+  ss << "<AS id=\"" << get_netzone_root()->get_name() << "\" routing=\"Full\">\n";
+
+  flatify_hosts(*this, ss);
+  flatify_links(*this, ss);
+  flatify_routes(*this, ss);
+
+  ss << "</AS>\n";
+  ss << "</platform>\n";
+  return ss.str();
+}
+
 /** Registers the main function of an actor that will be launched from the deployment file */
 void Engine::register_function(const std::string& name, const std::function<void(int, char**)>& code)
 {
index b762e63..bfd02d9 100644 (file)
@@ -21,7 +21,7 @@
 #include <string>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_host, s4u, "Logging specific to the S4U hosts");
-XBT_LOG_EXTERNAL_CATEGORY(ker_routing);
+XBT_LOG_EXTERNAL_CATEGORY(ker_platform);
 
 namespace simgrid {
 
@@ -169,11 +169,11 @@ void Host::route_to(const Host* dest, std::vector<Link*>& links, double* latency
 void Host::route_to(const Host* dest, std::vector<kernel::resource::StandardLinkImpl*>& links, double* latency) const
 {
   kernel::routing::NetZoneImpl::get_global_route(pimpl_netpoint_, dest->get_netpoint(), links, latency);
-  if (XBT_LOG_ISENABLED(ker_routing, xbt_log_priority_debug)) {
-    XBT_CDEBUG(ker_routing, "Route from '%s' to '%s' (latency: %f):", get_cname(), dest->get_cname(),
+  if (XBT_LOG_ISENABLED(ker_platform, xbt_log_priority_debug)) {
+    XBT_CDEBUG(ker_platform, "Route from '%s' to '%s' (latency: %f):", get_cname(), dest->get_cname(),
                (latency == nullptr ? -1 : *latency));
     for (auto const* link : links)
-      XBT_CDEBUG(ker_routing, "  Link '%s'", link->get_cname());
+      XBT_CDEBUG(ker_platform, "  Link '%s'", link->get_cname());
   }
 }
 
index 5243121..8d41270 100644 (file)
@@ -119,6 +119,11 @@ void Link::set_host_wifi_rate(const s4u::Host* host, int level) const
   wlink->set_host_rate(host, level);
 }
 
+int Link::get_concurrency_limit() const
+{
+  return pimpl_->get_concurrency_limit();
+}
+
 Link* Link::set_concurrency_limit(int limit)
 {
   kernel::actor::simcall_object_access(pimpl_, [this, limit] { pimpl_->set_concurrency_limit(limit); });
diff --git a/src/simgrid/module.cpp b/src/simgrid/module.cpp
new file mode 100644 (file)
index 0000000..2ed2f70
--- /dev/null
@@ -0,0 +1,81 @@
+/* Copyright (c) 2004-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 <xbt/asserts.h>
+#include <xbt/log.h>
+
+#include "simgrid/sg_config.hpp"
+#include "src/simgrid/module.hpp"
+#include "src/surf/surf_interface.hpp"
+
+#include <sstream>
+
+XBT_LOG_NEW_CATEGORY(plugin, "Common category for the logging of all plugins");
+XBT_LOG_EXTERNAL_CATEGORY(xbt_help);
+
+using namespace simgrid;
+
+void ModuleGroup::create_flag(const std::string& opt_name, const std::string& descr, const std::string& default_value,
+                              bool init_now)
+{
+  opt_name_               = opt_name;
+  std::string description = descr + ". Possible values (other compilation flags may activate more " + get_kind() +
+                            "s): " + existing_values() +
+                            ".\n       (use 'help' as a value to see the long description of each one)";
+
+  simgrid::config::declare_flag<std::string>(
+      opt_name, description, default_value, [this, default_value, init_now](const std::string& value) {
+        xbt_assert(_sg_cfg_init_status < 2, "Cannot load a %s after the initialization", kind_.c_str());
+
+        if (value == default_value)
+          return;
+
+        if (value == "help") {
+          help();
+          exit(0);
+        }
+
+        if (init_now)
+          by_name(value).init();
+        else
+          by_name(value); // Simply ensure that this value exists, it will be picked up later
+      });
+}
+void ModuleGroup::init_from_flag_value()
+{
+  by_name(simgrid::config::get_value<std::string>(opt_name_)).init();
+}
+
+ModuleGroup& ModuleGroup::add(const char* id, const char* desc, std::function<void()> init)
+{
+  table_.emplace_back(Module(id, desc, init));
+  return *this;
+}
+
+Module const& ModuleGroup::by_name(const std::string& name) const
+{
+  if (auto pos = std::find_if(table_.begin(), table_.end(), [&name](const Module& item) { return item.name_ == name; });
+      pos != table_.end())
+    return *pos;
+
+  xbt_die("Unable to find %s '%s'. Valid values are: %s.", kind_.c_str(), name.c_str(), existing_values().c_str());
+}
+/** Displays the long description of all registered models, and quit */
+void ModuleGroup::help() const
+{
+  XBT_HELP("Long description of the %s accepted by this simulator:", kind_.c_str());
+  for (auto const& item : table_)
+    XBT_HELP("  %s: %s", item.name_, item.description_);
+}
+std::string ModuleGroup::existing_values() const
+{
+  std::stringstream ss;
+  std::string sep;
+  for (auto const& item : table_) {
+    ss << sep + item.name_;
+    sep = ", ";
+  }
+  return ss.str();
+}
diff --git a/src/simgrid/module.hpp b/src/simgrid/module.hpp
new file mode 100644 (file)
index 0000000..ab175ad
--- /dev/null
@@ -0,0 +1,107 @@
+/* Copyright (c) 2004-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. */
+
+#ifndef SIMGRID_MODULE_HPP
+#define SIMGRID_MODULE_HPP
+
+#include <xbt/base.h>
+
+#include <functional>
+#include <string>
+#include <vector>
+
+namespace simgrid {
+
+struct Module {
+  const char* name_;
+  const char* description_;
+  std::function<void()> init;
+  Module(const char* id, const char* desc, std::function<void()> init_fun)
+      : name_(id), description_(desc), init(init_fun)
+  {
+  }
+};
+
+class ModuleGroup {
+  std::vector<Module> table_;
+  const std::string kind_; // either 'plugin' or 'CPU model' or whatever. Used in error messages only
+  std::string opt_name_;
+
+public:
+  ModuleGroup(const std::string& kind) : kind_(kind) {}
+
+  ModuleGroup& add(const char* id, const char* desc, std::function<void()> init);
+  Module const& by_name(const std::string& name) const;
+  void help() const;
+  const std::string get_kind() const { return kind_; }
+  std::string existing_values() const;
+  void create_flag(const std::string& opt_name, const std::string& descr, const std::string& default_value,
+                   bool init_now);
+  void init_from_flag_value();
+};
+
+}; // namespace simgrid
+
+#define SIMGRID_REGISTER_PLUGIN(id, desc, init)                                                                        \
+  static void XBT_ATTRIB_CONSTRUCTOR(800) _XBT_CONCAT3(simgrid_, id, _plugin_register)()                               \
+  {                                                                                                                    \
+    simgrid_plugins().add(_XBT_STRINGIFY(id), (desc), (init));                                                         \
+  }
+/** @brief The list of all available plugins */
+inline auto& simgrid_plugins() // Function to avoid static initialization order fiasco
+{
+  static simgrid::ModuleGroup plugins("plugin");
+  return plugins;
+}
+
+#define SIMGRID_REGISTER_NETWORK_MODEL(id, desc, init)                                                                 \
+  static void XBT_ATTRIB_CONSTRUCTOR(800) _XBT_CONCAT3(simgrid_, id, _network_model_register)()                        \
+  {                                                                                                                    \
+    simgrid_network_models().add(_XBT_STRINGIFY(id), (desc), (init));                                                  \
+  }
+/** @brief The list of all available network models (pick one with --cfg=network/model) */
+inline auto& simgrid_network_models() // Function to avoid static initialization order fiasco
+{
+  static simgrid::ModuleGroup models("network model");
+  return models;
+}
+
+#define SIMGRID_REGISTER_CPU_MODEL(id, desc, init)                                                                     \
+  static void XBT_ATTRIB_CONSTRUCTOR(800) _XBT_CONCAT3(simgrid_, id, _cpu_model_register)()                            \
+  {                                                                                                                    \
+    simgrid_cpu_models().add(_XBT_STRINGIFY(id), (desc), (init));                                                      \
+  }
+/** @brief The list of all available CPU models (pick one with --cfg=cpu/model) */
+inline auto& simgrid_cpu_models() // Function to avoid static initialization order fiasco
+{
+  static simgrid::ModuleGroup models("CPU model");
+  return models;
+}
+
+#define SIMGRID_REGISTER_DISK_MODEL(id, desc, init)                                                                    \
+  static void XBT_ATTRIB_CONSTRUCTOR(800) _XBT_CONCAT3(simgrid_, id, _disk_model_register)()                           \
+  {                                                                                                                    \
+    simgrid_disk_models().add(_XBT_STRINGIFY(id), (desc), (init));                                                     \
+  }
+/** @brief The list of all available disk models (pick one with --cfg=disk/model) */
+inline auto& simgrid_disk_models() // Function to avoid static initialization order fiasco
+{
+  static simgrid::ModuleGroup models("disk model");
+  return models;
+}
+
+#define SIMGRID_REGISTER_HOST_MODEL(id, desc, init)                                                                    \
+  static void XBT_ATTRIB_CONSTRUCTOR(800) _XBT_CONCAT3(simgrid_, id, _host_model_register)()                           \
+  {                                                                                                                    \
+    simgrid_host_models().add(_XBT_STRINGIFY(id), (desc), (init));                                                     \
+  }
+/** @brief The list of all available host models (pick one with --cfg=host/model) */
+inline auto& simgrid_host_models() // Function to avoid static initialization order fiasco
+{
+  static simgrid::ModuleGroup models("host model");
+  return models;
+}
+
+#endif
index 1e25468..ed9b59a 100644 (file)
 #include "src/kernel/resource/NetworkModel.hpp"
 #include "src/mc/mc_config.hpp"
 #include "src/mc/mc_replay.hpp"
+#include "src/simgrid/module.hpp"
 #include "src/smpi/include/smpi_config.hpp"
 #include "src/surf/surf_interface.hpp"
 
 #include <string_view>
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf, "About the configuration of SimGrid");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(config, kernel, "About the configuration of SimGrid");
 
 static simgrid::config::Flag<bool> cfg_continue_after_help
   {"help-nostop", "Do not stop the execution when --help is found", false};
@@ -94,15 +95,11 @@ static void sg_config_cmd_line(int *argc, char **argv)
       XBT_HELP("Please consider using the recent names");
       shall_exit = true;
     } else if (parse_args && not strcmp(argv[i], "--help-models")) {
-      model_help("host", surf_host_model_description);
+      simgrid_host_models().help();
       XBT_HELP("%s", "");
-      model_help("CPU", surf_cpu_model_description);
+      simgrid_cpu_models().help();
       XBT_HELP("%s", "");
-      model_help("network", surf_network_model_description);
-      XBT_HELP("\nLong description of all optimization levels accepted by the models of this simulator:");
-      for (auto const& item : surf_optimization_mode_description)
-        XBT_HELP("  %s: %s", item.name, item.description);
-      XBT_HELP("Both network and CPU models have 'Lazy' as default optimization level\n");
+      simgrid_network_models().help();
       shall_exit = true;
     } else if (parse_args && not strcmp(argv[i], "--help-tracing")) {
       TRACE_help();
@@ -119,121 +116,20 @@ static void sg_config_cmd_line(int *argc, char **argv)
     exit(0);
 }
 
-/* callback of the plugin variable */
-static void _sg_cfg_cb__plugin(const std::string& value)
-{
-  xbt_assert(_sg_cfg_init_status < 2, "Cannot load a plugin after the initialization");
-
-  if (value.empty())
-    return;
-
-  if (value == "help") {
-    model_help("plugin", surf_plugin_description());
-    exit(0);
-  }
-
-  const auto* plugin = find_model_description(surf_plugin_description(), value);
-  plugin->model_init_preparse();
-}
-
-/* callback of the host/model variable */
-static void _sg_cfg_cb__host_model(const std::string& value)
-{
-  xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
-
-  if (value == "help") {
-    model_help("host", surf_host_model_description);
-    exit(0);
-  }
-
-  /* Make sure that the model exists */
-  find_model_description(surf_host_model_description, value);
-}
-
-/* callback of the cpu/model variable */
-static void _sg_cfg_cb__cpu_model(const std::string& value)
-{
-  xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
-
-  if (value == "help") {
-    model_help("CPU", surf_cpu_model_description);
-    exit(0);
-  }
-
-  /* New Module missing */
-  find_model_description(surf_cpu_model_description, value);
-}
-
-/* callback of the cpu/model variable */
-static void _sg_cfg_cb__optimization_mode(const std::string& value)
-{
-  xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
-
-  if (value == "help") {
-    model_help("optimization", surf_optimization_mode_description);
-    exit(0);
-  }
-
-  /* New Module missing */
-  find_model_description(surf_optimization_mode_description, value);
-}
-
-static void _sg_cfg_cb__disk_model(const std::string& value)
-{
-  xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
-
-  if (value == "help") {
-    model_help("disk", surf_disk_model_description);
-    exit(0);
-  }
-
-  find_model_description(surf_disk_model_description, value);
-}
-
-/* callback of the network_model variable */
-static void _sg_cfg_cb__network_model(const std::string& value)
-{
-  xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
-
-  if (value == "help") {
-    model_help("network", surf_network_model_description);
-    exit(0);
-  }
-
-  /* New Module missing */
-  find_model_description(surf_network_model_description, value);
-}
-
 static void _sg_cfg_cb_contexts_parallel_mode(std::string_view mode_name)
 {
   if (mode_name == "posix") {
-    simgrid::kernel::context::set_parallel_mode(XBT_PARMAP_POSIX);
+    simgrid::kernel::context::Context::parallel_mode = XBT_PARMAP_POSIX;
   } else if (mode_name == "futex") {
-    simgrid::kernel::context::set_parallel_mode(XBT_PARMAP_FUTEX);
+    simgrid::kernel::context::Context::parallel_mode = XBT_PARMAP_FUTEX;
   } else if (mode_name == "busy_wait") {
-    simgrid::kernel::context::set_parallel_mode(XBT_PARMAP_BUSY_WAIT);
+    simgrid::kernel::context::Context::parallel_mode = XBT_PARMAP_BUSY_WAIT;
   } else {
     xbt_die("Command line setting of the parallel synchronization mode should "
             "be one of \"posix\", \"futex\" or \"busy_wait\"");
   }
 }
 
-/* build description line with possible values */
-static void declare_model_flag(const std::string& name, const std::string& value,
-                               const std::function<void(std::string const&)>& callback,
-                               const std::vector<surf_model_description_t>& model_description, const std::string& type,
-                               const std::string& descr)
-{
-  std::string description = descr + ". Possible values: ";
-  std::string sep         = "";
-  for (auto const& item : model_description) {
-    description += sep + item.name;
-    sep = ", ";
-  }
-  description += ".\n       (use 'help' as a value to see the long description of each " + type + ")";
-  simgrid::config::declare_flag<std::string>(name, description, value, callback);
-}
-
 /* create the config set, register what should be and parse the command line*/
 void sg_config_init(int *argc, char **argv)
 {
@@ -244,22 +140,11 @@ void sg_config_init(int *argc, char **argv)
   }
 
   /* Plugins configuration */
-  declare_model_flag("plugin", "", &_sg_cfg_cb__plugin, surf_plugin_description(), "plugin", "The plugins");
-
-  declare_model_flag("cpu/model", "Cas01", &_sg_cfg_cb__cpu_model, surf_cpu_model_description, "model",
-                     "The model to use for the CPU");
-
-  declare_model_flag("disk/model", "S19", &_sg_cfg_cb__disk_model, surf_disk_model_description, "model",
-                     "The model to use for the disk");
-
-  declare_model_flag("network/model", "LV08", &_sg_cfg_cb__network_model, surf_network_model_description, "model",
-                     "The model to use for the network");
-
-  declare_model_flag("network/optim", "Lazy", &_sg_cfg_cb__optimization_mode, surf_optimization_mode_description,
-                     "optimization mode", "The optimization modes to use for the network");
-
-  declare_model_flag("host/model", "default", &_sg_cfg_cb__host_model, surf_host_model_description, "model",
-                     "The model to use for the host");
+  simgrid_plugins().create_flag("plugin", "The plugins", "", true);
+  simgrid_cpu_models().create_flag("cpu/model", "The model to use for the CPU", "Cas01", false);
+  simgrid_network_models().create_flag("network/model", "The model to use for the network", "LV08", false);
+  simgrid_host_models().create_flag("host/model", "The model to use for the host", "default", false);
+  simgrid_disk_models().create_flag("disk/model", "The model to use for the disk", "S19", false);
 
   simgrid::config::bind_flag(sg_surf_precision, "surf/precision",
                              "Numerical precision used when updating simulation times (in seconds)");
@@ -304,7 +189,7 @@ void sg_config_init(int *argc, char **argv)
 
   static simgrid::config::Flag<int> cfg_context_stack_size{
       "contexts/stack-size", "Stack size of contexts in KiB (not with threads)", 8 * 1024,
-      [](int value) { simgrid::kernel::context::stack_size = value * 1024; }};
+      [](int value) { simgrid::kernel::context::Context::stack_size = value * 1024; }};
 
   /* guard size for contexts stacks in memory pages */
 #if (PTH_STACKGROWTH != -1)
@@ -314,7 +199,7 @@ void sg_config_init(int *argc, char **argv)
 #endif
   static simgrid::config::Flag<int> cfg_context_guard_size{
       "contexts/guard-size", "Guard size for contexts stacks in memory pages", default_guard_size,
-      [](int value) { simgrid::kernel::context::guard_size = value * xbt_pagesize; }};
+      [](int value) { simgrid::kernel::context::Context::guard_size = value * xbt_pagesize; }};
 
   static simgrid::config::Flag<int> cfg_context_nthreads{
       "contexts/nthreads", "Number of parallel threads used to execute user contexts", 1, [](int nthreads) {
@@ -324,7 +209,7 @@ void sg_config_init(int *argc, char **argv)
             "Parallel simulation is forbidden in the verified program, as there is no protection against race "
             "conditions in mmalloc itself. Please don't be so greedy and show some mercy for our implementation.");
 #endif
-        simgrid::kernel::context::set_nthreads(nthreads);
+        simgrid::kernel::context::Context::set_nthreads(nthreads);
       }};
 
   /* synchronization mode for parallel user contexts */
@@ -354,7 +239,7 @@ void sg_config_init(int *argc, char **argv)
 
   sg_config_cmd_line(argc, argv);
 
-  xbt_mallocator_initialization_is_done(simgrid::kernel::context::is_parallel());
+  xbt_mallocator_initialization_is_done(simgrid::kernel::context::Context::is_parallel());
 }
 
 void sg_config_finalize()
index 5435290..3452c3b 100644 (file)
@@ -9,8 +9,6 @@
 #include "xbt/misc.h"
 #include "xbt/sysdep.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sg_version, surf, "About the versioning of SimGrid");
-
 void sg_version_check(int lib_version_major, int lib_version_minor, int lib_version_patch)
 {
   if ((lib_version_major != SIMGRID_VERSION_MAJOR) || (lib_version_minor != SIMGRID_VERSION_MINOR)) {
index 8840045..febed11 100644 (file)
@@ -175,7 +175,7 @@ void simcall_run_object_access(std::function<void()> const& code, simgrid::kerne
   // We only need a simcall if the order of the setters is important (parallel run or MC execution).
   // Otherwise, just call the function with no simcall
 
-  if (simgrid::kernel::context::is_parallel()
+  if (simgrid::kernel::context::Context::is_parallel()
 #if SIMGRID_HAVE_MC
       || MC_is_active() || MC_record_replay_is_active()
 #endif
index 7174872..2133849 100644 (file)
@@ -54,14 +54,12 @@ constexpr int SMPI_RMA_TAG            = -6666;
 #define MPI_REQUEST_IGNORED ((MPI_Request*)-100)
 
 /* Bindings for MPI special values */
-extern XBT_PUBLIC int mpi_in_place_;
-extern XBT_PUBLIC int mpi_bottom_;
-extern XBT_PUBLIC int mpi_status_ignore_;
-extern XBT_PUBLIC int mpi_statuses_ignore_;
+extern XBT_PUBLIC const int mpi_in_place_;
+extern XBT_PUBLIC const int mpi_bottom_;
+extern XBT_PUBLIC const int mpi_status_ignore_;
+extern XBT_PUBLIC const int mpi_statuses_ignore_;
 /* Convert between Fortran and C */
-#define FORT_ADDR(addr, val, val2)                                         \
-  (((void *)(addr) == (void*) &(val2))                  \
-   ? (val) : (void *)(addr))
+#define FORT_ADDR(addr, val, val2) (((const void*)(addr) == (const void*)&(val2)) ? (val) : (void*)(addr))
 #define FORT_BOTTOM(addr) FORT_ADDR((addr), MPI_BOTTOM, mpi_bottom_)
 #define FORT_IN_PLACE(addr) FORT_ADDR((addr), MPI_IN_PLACE, mpi_in_place_)
 #define FORT_STATUS_IGNORE(addr) static_cast<MPI_Status*>(FORT_ADDR((addr), MPI_STATUS_IGNORE, mpi_status_ignore_))
@@ -120,9 +118,6 @@ XBT_PRIVATE bool smpi_cfg_display_alloc();
 // utilities
 XBT_PRIVATE void smpi_init_options_internal(bool called_by_smpi_main);
 
-extern XBT_PRIVATE char* smpi_data_exe_start; // start of the data+bss segment of the executable
-extern XBT_PRIVATE size_t smpi_data_exe_size; // size of the data+bss segment of the executable
-
 XBT_PRIVATE bool smpi_switch_data_segment(simgrid::s4u::ActorPtr actor, const void* addr = nullptr);
 
 XBT_PRIVATE void smpi_prepare_global_memory_segment();
index 13e44ca..fce781e 100644 (file)
@@ -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
index b9b81f6..d2d121e 100644 (file)
@@ -26,9 +26,9 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_memory, smpi, "Memory layout support for SMPI");
 
-char* smpi_data_exe_start = nullptr;
-size_t smpi_data_exe_size = 0;
-SmpiPrivStrategies smpi_privatize_global_variables;
+static char* smpi_data_exe_start = nullptr; // start of the data+bss segment of the executable
+static size_t smpi_data_exe_size = 0;       // size of the data+bss segment of the executable
+static SmpiPrivStrategies smpi_privatize_global_variables;
 static void* smpi_data_exe_copy;
 
 // Initialized by smpi_prepare_global_memory_segment().
index 95067dd..10ab0ad 100644 (file)
@@ -58,7 +58,7 @@
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_shared, smpi, "Logging specific to SMPI (shared memory macros)");
 
-namespace{
+namespace {
 /** Some location in the source code
  *
  *  This information is used by SMPI_SHARED_MALLOC to allocate  some shared memory for all simulated processes.
@@ -94,7 +94,7 @@ std::map<std::string, void*, std::less<>> calls;
 int smpi_shared_malloc_bogusfile           = -1;
 int smpi_shared_malloc_bogusfile_huge_page = -1;
 unsigned long smpi_shared_malloc_blocksize = 1UL << 20;
-}
+} // namespace
 
 void smpi_shared_destroy()
 {
index 94060e9..4624971 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_utils, smpi, "Logging specific to SMPI (utils)");
 
-extern std::string surf_parsed_filename;
-extern int surf_parse_lineno;
-
-namespace simgrid::smpi::utils {
+namespace {
 
 double total_benched_time=0;
 unsigned long total_malloc_size=0;
@@ -41,7 +38,7 @@ struct current_buffer_metadata_t {
 };
 
 alloc_metadata_t max_malloc;
-F2C* current_handle = nullptr;
+simgrid::smpi::F2C* current_handle = nullptr;
 current_buffer_metadata_t current_buffer1;
 current_buffer_metadata_t current_buffer2;
 
@@ -49,6 +46,10 @@ std::unordered_map<const void*, alloc_metadata_t> allocs;
 
 std::unordered_map<int, std::vector<std::string>> collective_calls;
 
+} // namespace
+
+namespace simgrid::smpi::utils {
+
 void add_benched_time(double time){
   total_benched_time += time;
 }
index dc4c5f5..bdec55b 100644 (file)
@@ -8,10 +8,10 @@
 #include "src/smpi/include/smpi_actor.hpp"
 #include "src/instr/instr_smpi.hpp"
 
-int mpi_in_place_;
-int mpi_bottom_;
-int mpi_status_ignore_;
-int mpi_statuses_ignore_;
+const int mpi_in_place_        = -222;
+const int mpi_bottom_          = -111;
+const int mpi_status_ignore_   = 0;
+const int mpi_statuses_ignore_ = 0;
 
 namespace simgrid::smpi {
 
index 8f3925b..f07e935 100644 (file)
@@ -207,6 +207,8 @@ s4u::Disk* HostImpl::create_disk(const std::string& name, double read_bandwidth,
 {
   auto disk = piface_.get_netpoint()->get_englobing_zone()->get_disk_model()->create_disk(name, read_bandwidth,
                                                                                           write_bandwidth);
+  if (sealed_)
+    disk->seal();
   return disk->set_host(&piface_)->get_iface();
 }
 
index 13f499c..83aa5f9 100644 (file)
@@ -40,8 +40,7 @@ static simgrid::config::Flag<std::string> cfg_cpu_solver("cpu/solver", "Set line
 /*********
  * Model *
  *********/
-void surf_cpu_model_init_Cas01()
-{
+SIMGRID_REGISTER_CPU_MODEL(Cas01, "Simplistic CPU model (time=size/speed)", []() {
   if (cpu_optim_opt == "TI") {
     simgrid::kernel::resource::CpuTiModel::create_pm_models();
     return;
@@ -51,7 +50,7 @@ void surf_cpu_model_init_Cas01()
   auto* engine      = simgrid::kernel::EngineImpl::get_instance();
   engine->add_model(cpu_model_pm);
   engine->get_netzone_root()->set_cpu_pm_model(cpu_model_pm);
-}
+});
 
 namespace simgrid::kernel::resource {
 
index 8fb36e6..35ad4fd 100644 (file)
@@ -26,13 +26,12 @@ static simgrid::config::Flag<std::string> cfg_disk_solver("disk/solver",
  * Model *
  *********/
 
-void surf_disk_model_init_S19()
-{
+SIMGRID_REGISTER_DISK_MODEL(S19, "Simplistic disk model.", []() {
   auto disk_model = std::make_shared<simgrid::kernel::resource::DiskS19Model>("Disk");
   auto* engine    = simgrid::kernel::EngineImpl::get_instance();
   engine->add_model(disk_model);
   engine->get_netzone_root()->set_disk_model(disk_model);
-}
+});
 
 namespace simgrid::kernel::resource {
 /*********
index 27deae6..5fc1594 100644 (file)
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_host);
 
-void surf_host_model_init_current_default()
-{
-  simgrid::config::set_default<bool>("network/crosstraffic", true);
-  auto host_model = std::make_shared<simgrid::kernel::resource::HostCLM03Model>("Host_CLM03");
-  auto* engine    = simgrid::kernel::EngineImpl::get_instance();
-  engine->add_model(host_model);
-  engine->get_netzone_root()->set_host_model(host_model);
-  surf_cpu_model_init_Cas01();
-  surf_disk_model_init_S19();
-  surf_network_model_init_LegrandVelho();
-}
-
-void surf_host_model_init_compound()
-{
-  auto host_model = std::make_shared<simgrid::kernel::resource::HostCLM03Model>("Host_CLM03");
-  auto* engine    = simgrid::kernel::EngineImpl::get_instance();
-  engine->add_model(host_model);
-  engine->get_netzone_root()->set_host_model(host_model);
-}
+SIMGRID_REGISTER_HOST_MODEL(
+    default, "Default host model. Currently, CPU:Cas01, network:LV08 (with cross traffic enabled), and disk:S19", []() {
+      simgrid::config::set_default<bool>("network/crosstraffic", true);
+      auto host_model = std::make_shared<simgrid::kernel::resource::HostCLM03Model>("Host_CLM03");
+      auto* engine    = simgrid::kernel::EngineImpl::get_instance();
+      engine->add_model(host_model);
+      engine->get_netzone_root()->set_host_model(host_model);
+
+      simgrid_cpu_models().init_from_flag_value();
+      simgrid_disk_models().init_from_flag_value();
+      simgrid_network_models().init_from_flag_value();
+    });
 
 namespace simgrid::kernel::resource {
 
index 5cc26f4..54e369e 100644 (file)
@@ -26,9 +26,9 @@ static simgrid::config::Flag<std::string> cfg_network_solver("network/solver",
                                                              "Set linear equations solver used by network model",
                                                              "maxmin", &simgrid::kernel::lmm::System::validate_solver);
 
-/************************************************************************/
-/* New model based on optimizations discussed during Pedro Velho's thesis*/
-/************************************************************************/
+/******************************************************************************/
+/* Network model based on optimizations discussed during Pedro Velho's thesis */
+/******************************************************************************/
 /* @techreport{VELHO:2011:HAL-00646896:1, */
 /*      url = {http://hal.inria.fr/hal-00646896/en/}, */
 /*      title = {{Flow-level network models: have we reached the limits?}}, */
@@ -40,21 +40,24 @@ static simgrid::config::Flag<std::string> cfg_network_solver("network/solver",
 /*      month = Nov, */
 /*      pdf = {http://hal.inria.fr/hal-00646896/PDF/rr-validity.pdf}, */
 /*  } */
-void surf_network_model_init_LegrandVelho()
-{
-  auto net_model = std::make_shared<simgrid::kernel::resource::NetworkCm02Model>("Network_LegrandVelho");
-  auto* engine   = simgrid::kernel::EngineImpl::get_instance();
-  engine->add_model(net_model);
-  engine->get_netzone_root()->set_network_model(net_model);
-
-  simgrid::config::set_default<std::string>("network/latency-factor", "13.01");
-  simgrid::config::set_default<std::string>("network/bandwidth-factor", "0.97");
-  simgrid::config::set_default<double>("network/weight-S", 20537);
-}
-
-/***************************************************************************/
-/* The nice TCP sharing model designed by Loris Marchal and Henri Casanova */
-/***************************************************************************/
+SIMGRID_REGISTER_NETWORK_MODEL(
+    LV08,
+    "Realistic network analytic model (slow-start modeled by multiplying latency by 13.01, bandwidth by .97; "
+    "bottleneck sharing uses a payload of S=20537 for evaluating RTT). ",
+    []() {
+      auto net_model = std::make_shared<simgrid::kernel::resource::NetworkCm02Model>("Network_LegrandVelho");
+      auto* engine   = simgrid::kernel::EngineImpl::get_instance();
+      engine->add_model(net_model);
+      engine->get_netzone_root()->set_network_model(net_model);
+
+      simgrid::config::set_default<std::string>("network/latency-factor", "13.01");
+      simgrid::config::set_default<std::string>("network/bandwidth-factor", "0.97");
+      simgrid::config::set_default<double>("network/weight-S", 20537);
+    });
+
+/****************************************************************************/
+/* The older TCP sharing model designed by Loris Marchal and Henri Casanova */
+/****************************************************************************/
 /* @TechReport{      rr-lip2002-40, */
 /*   author        = {Henri Casanova and Loris Marchal}, */
 /*   institution   = {LIP}, */
@@ -63,17 +66,20 @@ void surf_network_model_init_LegrandVelho()
 /*   month         = {oct}, */
 /*   year          = {2002} */
 /* } */
-void surf_network_model_init_CM02()
-{
-  simgrid::config::set_default<std::string>("network/latency-factor", "1.0");
-  simgrid::config::set_default<std::string>("network/bandwidth-factor", "1.0");
-  simgrid::config::set_default<double>("network/weight-S", 0.0);
-
-  auto net_model = std::make_shared<simgrid::kernel::resource::NetworkCm02Model>("Network_CM02");
-  auto* engine   = simgrid::kernel::EngineImpl::get_instance();
-  engine->add_model(net_model);
-  engine->get_netzone_root()->set_network_model(net_model);
-}
+SIMGRID_REGISTER_NETWORK_MODEL(
+    CM02,
+    "Legacy network analytic model (Very similar to LV08, but without corrective factors. The timings of "
+    "small messages are thus poorly modeled).",
+    []() {
+      simgrid::config::set_default<std::string>("network/latency-factor", "1.0");
+      simgrid::config::set_default<std::string>("network/bandwidth-factor", "1.0");
+      simgrid::config::set_default<double>("network/weight-S", 0.0);
+
+      auto net_model = std::make_shared<simgrid::kernel::resource::NetworkCm02Model>("Network_CM02");
+      auto* engine   = simgrid::kernel::EngineImpl::get_instance();
+      engine->add_model(net_model);
+      engine->get_netzone_root()->set_network_model(net_model);
+    });
 
 /********************************************************************/
 /* Model based on LV08 and experimental results of MPI ping-pongs   */
@@ -87,30 +93,44 @@ void surf_network_model_init_CM02()
 /*  month=may, */
 /*  year={2011} */
 /*  } */
-void surf_network_model_init_SMPI()
-{
-  auto net_model = std::make_shared<simgrid::kernel::resource::NetworkCm02Model>("Network_SMPI");
-  auto* engine   = simgrid::kernel::EngineImpl::get_instance();
-  engine->add_model(net_model);
-  engine->get_netzone_root()->set_network_model(net_model);
-
-  simgrid::config::set_default<double>("network/weight-S", 8775);
-  simgrid::config::set_default<std::string>("network/bandwidth-factor",
-                                            "65472:0.940694;15424:0.697866;9376:0.58729;5776:1.08739;3484:0.77493;"
-                                            "1426:0.608902;732:0.341987;257:0.338112;0:0.812084");
-  simgrid::config::set_default<std::string>("network/latency-factor",
-                                            "65472:11.6436;15424:3.48845;9376:2.59299;5776:2.18796;3484:1.88101;"
-                                            "1426:1.61075;732:1.9503;257:1.95341;0:2.01467");
-}
+SIMGRID_REGISTER_NETWORK_MODEL(
+    SMPI,
+    "Realistic network model specifically tailored for HPC settings (accurate modeling of slow start with "
+    "correction factors on three intervals: < 1KiB, < 64 KiB, >= 64 KiB)",
+    []() {
+      auto net_model = std::make_shared<simgrid::kernel::resource::NetworkCm02Model>("Network_SMPI");
+      auto* engine   = simgrid::kernel::EngineImpl::get_instance();
+      engine->add_model(net_model);
+      engine->get_netzone_root()->set_network_model(net_model);
+
+      simgrid::config::set_default<double>("network/weight-S", 8775);
+      simgrid::config::set_default<std::string>("network/bandwidth-factor",
+                                                "65472:0.940694;15424:0.697866;9376:0.58729;5776:1.08739;3484:0.77493;"
+                                                "1426:0.608902;732:0.341987;257:0.338112;0:0.812084");
+      simgrid::config::set_default<std::string>("network/latency-factor",
+                                                "65472:11.6436;15424:3.48845;9376:2.59299;5776:2.18796;3484:1.88101;"
+                                                "1426:1.61075;732:1.9503;257:1.95341;0:2.01467");
+    });
 
 namespace simgrid::kernel::resource {
+static simgrid::config::Flag<std::string>
+    network_optim_opt("network/optim", "Optimization algorithm to use for network resources. ", "Lazy",
+
+                      std::map<std::string, std::string, std::less<>>({
+                          {"Lazy", "Lazy action management (partial invalidation in lmm + heap in action remaining)."},
+                          {"Full", "Full update of remaining and variables. Slow but may be useful when debugging."},
+                      }),
+
+                      [](std::string const&) {
+                        xbt_assert(_sg_cfg_init_status < 2,
+                                   "Cannot change the optimization algorithm after the initialization");
+                      });
 
 NetworkCm02Model::NetworkCm02Model(const std::string& name) : NetworkModel(name)
 {
-  std::string optim = config::get_value<std::string>("network/optim");
-  bool select       = config::get_value<bool>("network/maxmin-selective-update");
+  bool select = config::get_value<bool>("network/maxmin-selective-update");
 
-  if (optim == "Lazy") {
+  if (network_optim_opt == "Lazy") {
     set_update_algorithm(Model::UpdateAlgo::LAZY);
     xbt_assert(select || config::is_default("network/maxmin-selective-update"),
                "You cannot disable network selective update when using the lazy update mechanism");
index 2fc1acd..6183b2d 100644 (file)
@@ -15,13 +15,17 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
 /*********
  * Model *
  *********/
-void surf_network_model_init_Constant()
-{
-  auto net_model = std::make_shared<simgrid::kernel::resource::NetworkConstantModel>("Network_Constant");
-  auto* engine   = simgrid::kernel::EngineImpl::get_instance();
-  engine->add_model(net_model);
-  engine->get_netzone_root()->set_network_model(net_model);
-}
+SIMGRID_REGISTER_NETWORK_MODEL(
+    Constant,
+    "Simplistic network model where all communication take a constant time (one second). This model "
+    "provides the lowest realism, but is (marginally) faster. It is mostly useful when studying theoretical "
+    "distributed algorithms where the network is usually abstracted away.",
+    []() {
+      auto net_model = std::make_shared<simgrid::kernel::resource::NetworkConstantModel>("Network_Constant");
+      auto* engine   = simgrid::kernel::EngineImpl::get_instance();
+      engine->add_model(net_model);
+      engine->get_netzone_root()->set_network_model(net_model);
+    });
 
 namespace simgrid::kernel::resource {
 
index 5d80bd8..04fba51 100644 (file)
@@ -30,20 +30,23 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
 /*  month=june, */
 /*  year={2010} */
 /*  } */
-void surf_network_model_init_IB()
-{
-  using simgrid::kernel::resource::NetworkIBModel;
-
-  auto net_model = std::make_shared<NetworkIBModel>("Network_IB");
-  auto* engine   = simgrid::kernel::EngineImpl::get_instance();
-  engine->add_model(net_model);
-  engine->get_netzone_root()->set_network_model(net_model);
-
-  simgrid::s4u::Link::on_communication_state_change_cb(NetworkIBModel::IB_action_state_changed_callback);
-  simgrid::kernel::activity::CommImpl::on_start.connect(NetworkIBModel::IB_comm_start_callback);
-  simgrid::s4u::Host::on_creation_cb(NetworkIBModel::IB_create_host_callback);
-  simgrid::config::set_default<double>("network/weight-S", 8775);
-}
+SIMGRID_REGISTER_NETWORK_MODEL(
+    IB,
+    "Realistic network model specifically tailored for HPC settings, with Infiniband contention model as described in "
+    "http://mescal.imag.fr/membres/jean-marc.vincent/index.html/PhD/Vienne.pdf",
+    []() {
+      using simgrid::kernel::resource::NetworkIBModel;
+
+      auto net_model = std::make_shared<NetworkIBModel>("Network_IB");
+      auto* engine   = simgrid::kernel::EngineImpl::get_instance();
+      engine->add_model(net_model);
+      engine->get_netzone_root()->set_network_model(net_model);
+
+      simgrid::s4u::Link::on_communication_state_change_cb(NetworkIBModel::IB_action_state_changed_callback);
+      simgrid::kernel::activity::CommImpl::on_start.connect(NetworkIBModel::IB_comm_start_callback);
+      simgrid::s4u::Host::on_creation_cb(NetworkIBModel::IB_create_host_callback);
+      simgrid::config::set_default<double>("network/weight-S", 8775);
+    });
 
 namespace simgrid::kernel::resource {
 
index 5ab5965..aaa77ed 100644 (file)
@@ -51,8 +51,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_ns3, res_network, "Network model based on ns
 extern std::map<std::string, SgFlow*, std::less<>> flow_from_sock;
 extern std::map<std::string, ns3::ApplicationContainer, std::less<>> sink_from_sock;
 
-static ns3::InternetStackHelper stack;
-
 static int number_of_links    = 1;
 static int number_of_networks = 1;
 
@@ -67,6 +65,7 @@ static std::string transformIpv4Address(ns3::Ipv4Address from)
 
 NetPointNs3::NetPointNs3()
 {
+  static ns3::InternetStackHelper stack;
   stack.Install(ns3_node_);
 }
 
@@ -276,12 +275,16 @@ static void routeCreation_cb(bool symmetrical, const simgrid::kernel::routing::N
 /*********
  * Model *
  *********/
-void surf_network_model_init_NS3()
+// We can't use SIMGRID_REGISTER_NETWORK_MODEL here because ns-3 has a dash in its name
+static void XBT_ATTRIB_CONSTRUCTOR(800) simgrid_ns3_network_model_register()
 {
-  auto net_model = std::make_shared<simgrid::kernel::resource::NetworkNS3Model>("NS3 network model");
-  auto* engine   = simgrid::kernel::EngineImpl::get_instance();
-  engine->add_model(net_model);
-  engine->get_netzone_root()->set_network_model(net_model);
+  simgrid_network_models().add(
+      "ns-3", "Network pseudo-model using the real ns-3 simulator instead of an analytic model", []() {
+        auto net_model = std::make_shared<simgrid::kernel::resource::NetworkNS3Model>("NS3 network model");
+        auto* engine   = simgrid::kernel::EngineImpl::get_instance();
+        engine->add_model(net_model);
+        engine->get_netzone_root()->set_network_model(net_model);
+      });
 }
 
 static simgrid::config::Flag<std::string>
index ac76b6c..564a2be 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <simgrid/kernel/routing/NetZoneImpl.hpp>
 #include <simgrid/s4u/Engine.hpp>
+#include <xbt/asserts.hpp>
 #include <xbt/config.hpp>
 
 #include "simgrid/config.h"
@@ -31,17 +32,20 @@ static simgrid::config::Flag<std::string> cfg_ptask_solver("host/solver",
 /**************************************/
 /*** Resource Creation & Destruction **/
 /**************************************/
-void surf_host_model_init_ptask_L07()
-{
-  XBT_CINFO(xbt_cfg, "Switching to the L07 model to handle parallel tasks.");
-  xbt_assert(cfg_ptask_solver != "maxmin", "Invalid configuration. Cannot use maxmin solver with parallel tasks.");
-
-  auto* system    = simgrid::kernel::lmm::System::build(cfg_ptask_solver.get(), true /* selective update */);
-  auto host_model = std::make_shared<simgrid::kernel::resource::HostL07Model>("Host_Ptask", system);
-  auto* engine    = simgrid::kernel::EngineImpl::get_instance();
-  engine->add_model(host_model);
-  engine->get_netzone_root()->set_host_model(host_model);
-}
+SIMGRID_REGISTER_HOST_MODEL(
+    ptask_L07, "Host model somehow similar to Cas01+CM02+S19 but allowing parallel tasks", []() {
+      XBT_CINFO(xbt_cfg, "Switching to the L07 model to handle parallel tasks.");
+      xbt_assert(cfg_ptask_solver != "maxmin", "Invalid configuration. Cannot use maxmin solver with parallel tasks.");
+
+      xbt_assert(simgrid::config::is_default("network/model") && simgrid::config::is_default("cpu/model"),
+                 "Changing the network or CPU model is not allowed when using the ptasks host model.");
+
+      auto* system    = simgrid::kernel::lmm::System::build(cfg_ptask_solver.get(), true /* selective update */);
+      auto host_model = std::make_shared<simgrid::kernel::resource::HostL07Model>("Host_Ptask", system);
+      auto* engine    = simgrid::kernel::EngineImpl::get_instance();
+      engine->add_model(host_model);
+      engine->get_netzone_root()->set_host_model(host_model);
+    });
 
 namespace simgrid::kernel::resource {
 
@@ -58,7 +62,7 @@ HostL07Model::HostL07Model(const std::string& name, lmm::System* sys) : HostMode
   engine->add_model(cpu_model);
   engine->get_netzone_root()->set_cpu_pm_model(cpu_model);
 
-  surf_disk_model_init_S19();
+  simgrid_disk_models().by_name("S19").init();
 }
 
 CpuL07Model::CpuL07Model(const std::string& name, HostL07Model* hmodel, lmm::System* sys)
index 59c6007..9f2a198 100644 (file)
@@ -29,7 +29,7 @@
 #include <algorithm>
 #include <string>
 
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(platf_parse);
 
 namespace simgrid::kernel::routing {
 xbt::signal<void(ClusterCreationArgs const&)> on_cluster_creation;
diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp
deleted file mode 100644 (file)
index b0721c7..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Copyright (c) 2004-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 <simgrid/s4u/Engine.hpp>
-#include <xbt/module.h>
-
-#include "mc/mc.h"
-#include "simgrid/sg_config.hpp"
-#include "src/kernel/resource/profile/FutureEvtSet.hpp"
-#include "src/kernel/resource/profile/Profile.hpp"
-#include "src/surf/HostImpl.hpp"
-#include "src/surf/surf_interface.hpp"
-
-#include <fstream>
-#include <string>
-
-XBT_LOG_NEW_CATEGORY(surf, "All SURF categories");
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf, "Logging specific to SURF (kernel)");
-
-/*********
- * Utils *
- *********/
-
-simgrid::kernel::profile::FutureEvtSet future_evt_set;
-std::vector<std::string> surf_path;
-
-const std::vector<surf_model_description_t> surf_network_model_description = {
-    {"LV08",
-     "Realistic network analytic model (slow-start modeled by multiplying latency by 13.01, bandwidth by .97; "
-     "bottleneck sharing uses a payload of S=20537 for evaluating RTT). ",
-     &surf_network_model_init_LegrandVelho},
-    {"Constant",
-     "Simplistic network model where all communication take a constant time (one second). This model "
-     "provides the lowest realism, but is (marginally) faster.",
-     &surf_network_model_init_Constant},
-    {"SMPI",
-     "Realistic network model specifically tailored for HPC settings (accurate modeling of slow start with "
-     "correction factors on three intervals: < 1KiB, < 64 KiB, >= 64 KiB)",
-     &surf_network_model_init_SMPI},
-    {"IB", "Realistic network model specifically tailored for HPC settings, with Infiniband contention model",
-     &surf_network_model_init_IB},
-    {"CM02",
-     "Legacy network analytic model (Very similar to LV08, but without corrective factors. The timings of "
-     "small messages are thus poorly modeled).",
-     &surf_network_model_init_CM02},
-    {"ns-3", "Network pseudo-model using the ns-3 tcp model instead of an analytic model",
-     &surf_network_model_init_NS3},
-};
-
-#if !HAVE_SMPI
-void surf_network_model_init_IB()
-{
-  xbt_die("Please activate SMPI support in cmake to use the IB network model.");
-}
-#endif
-#if !SIMGRID_HAVE_NS3
-void surf_network_model_init_NS3()
-{
-  xbt_die("Please activate ns-3 support in cmake and install the dependencies to use the NS3 network model.");
-}
-#endif
-
-const std::vector<surf_model_description_t> surf_cpu_model_description = {
-    {"Cas01", "Simplistic CPU model (time=size/speed).", &surf_cpu_model_init_Cas01},
-};
-
-const std::vector<surf_model_description_t> surf_disk_model_description = {
-    {"S19", "Simplistic disk model.", &surf_disk_model_init_S19},
-};
-
-const std::vector<surf_model_description_t> surf_host_model_description = {
-    {"default", "Default host model. Currently, CPU:Cas01, network:LV08 (with cross traffic enabled), and disk:S19",
-     &surf_host_model_init_current_default},
-    {"compound", "Host model that is automatically chosen if you change the CPU, network, and disk models",
-     &surf_host_model_init_compound},
-    {"ptask_L07", "Host model somehow similar to Cas01+CM02+S19 but allowing parallel tasks",
-     &surf_host_model_init_ptask_L07},
-};
-
-const std::vector<surf_model_description_t> surf_optimization_mode_description = {
-    {"Lazy", "Lazy action management (partial invalidation in lmm + heap in action remaining).", nullptr},
-    {"TI",
-     "Trace integration. Highly optimized mode when using availability traces (only available for the Cas01 CPU "
-     "model for now).",
-     nullptr},
-    {"Full", "Full update of remaining and variables. Slow but may be useful when debugging.", nullptr},
-};
-
-/** Displays the long description of all registered models, and quit */
-void model_help(const char* category, const std::vector<surf_model_description_t>& table)
-{
-  XBT_HELP("Long description of the %s models accepted by this simulator:", category);
-  for (auto const& item : table)
-    XBT_HELP("  %s: %s", item.name, item.description);
-}
-
-const surf_model_description_t* find_model_description(const std::vector<surf_model_description_t>& table,
-                                                       const std::string& name)
-{
-  if (auto pos = std::find_if(table.begin(), table.end(),
-                              [&name](const surf_model_description_t& item) { return item.name == name; });
-      pos != table.end())
-    return &*pos;
-
-  std::string sep;
-  std::string name_list;
-  for (auto const& item : table) {
-    name_list += sep + item.name;
-    sep = ", ";
-  }
-  xbt_die("Model '%s' is invalid! Valid models are: %s.", name.c_str(), name_list.c_str());
-}
index 7907a68..23bf1e7 100644 (file)
@@ -6,10 +6,12 @@
 #ifndef SURF_MODEL_H_
 #define SURF_MODEL_H_
 
+#include "src/simgrid/module.hpp"
 #include <xbt/asserts.h>
 #include <xbt/function_types.h>
 
 #include "src/internal_config.h"
+#include "src/kernel/resource/profile/Profile.hpp"
 
 #include <cfloat>
 #include <cmath>
@@ -61,156 +63,6 @@ static inline int double_equals(double value1, double value2, double precision)
   return (fabs(value1 - value2) < precision);
 }
 
-/** @ingroup SURF_models
- *  @brief Initializes the CPU model with the model Cas01
- *
- *  By default, this model uses the lazy optimization mechanism that relies on partial invalidation in LMM and a heap
- *  for lazy action update.
- *  You can change this behavior by setting the cpu/optim configuration variable to a different value.
- *
- *  You shouldn't have to call it by yourself.
- */
-XBT_PUBLIC void surf_cpu_model_init_Cas01();
-
-XBT_PUBLIC void surf_disk_model_init_S19();
-
-/** @ingroup SURF_models
- *  @brief Same as network model 'LagrangeVelho', only with different correction factors.
- *
- * This model is proposed by Pierre-Nicolas Clauss and Martin Quinson and Stéphane Génaud based on the model 'LV08' and
- * different correction factors depending on the communication size (< 1KiB, < 64KiB, >= 64KiB).
- * See comments in the code for more information.
- *
- *  @see surf_host_model_init_SMPI()
- */
-XBT_PUBLIC void surf_network_model_init_SMPI();
-
-/** @ingroup SURF_models
- *  @brief Same as network model 'LagrangeVelho', only with different correction factors.
- *
- * This model implements a variant of the contention model on Infiniband networks based on
- * the works of Jérôme Vienne : http://mescal.imag.fr/membres/jean-marc.vincent/index.html/PhD/Vienne.pdf
- *
- *  @see surf_host_model_init_IB()
- */
-#if !HAVE_SMPI
-XBT_ATTRIB_NORETURN
-#endif
-XBT_PUBLIC void surf_network_model_init_IB();
-
-/** @ingroup SURF_models
- *  @brief Initializes the platform with the network model 'LegrandVelho'
- *
- * This model is proposed by Arnaud Legrand and Pedro Velho based on the results obtained with the GTNets simulator for
- * onelink and dogbone sharing scenarios. See comments in the code for more information.
- *
- *  @see surf_host_model_init_LegrandVelho()
- */
-XBT_PUBLIC void surf_network_model_init_LegrandVelho();
-
-/** @ingroup SURF_models
- *  @brief Initializes the platform with the network model 'Constant'
- *
- *  In this model, the communication time between two network cards is constant, hence no need for a routing table.
- *  This is particularly useful when simulating huge distributed algorithms where scalability is really an issue. This
- *  function is called in conjunction with surf_host_model_init_compound.
- *
- *  @see surf_host_model_init_compound()
- */
-XBT_PUBLIC void surf_network_model_init_Constant();
-
-/** @ingroup SURF_models
- *  @brief Initializes the platform with the network model CM02
- *
- *  You should call this function by yourself only if you plan using surf_host_model_init_compound.
- *  See comments in the code for more information.
- */
-XBT_PUBLIC void surf_network_model_init_CM02();
-
-/** @ingroup SURF_models
- *  @brief Initializes the platform with the network model NS3
- *
- *  This function is called by surf_host_model_init_NS3 or by yourself only if you plan using
- *  surf_host_model_init_compound
- *
- *  @see surf_host_model_init_NS3()
- */
-#if !SIMGRID_HAVE_NS3
-XBT_ATTRIB_NORETURN
-#endif
-XBT_PUBLIC void surf_network_model_init_NS3();
-
-/** @ingroup SURF_models
- *  @brief Initializes the VM model used in the platform
- *
- *  A VM model depends on the physical CPU model to share the resources inside the VM
- *  It will also creates the CPU model for actions running inside the VM
- *
- *  Such model is subject to modification with warning in the ChangeLog so monitor it!
- */
-XBT_PUBLIC void surf_vm_model_init_HL13(simgrid::kernel::resource::CpuModel* cpu_pm_model);
-
-/** @ingroup SURF_models
- *  @brief Initializes the platform with a compound host model
- *
- *  This function should be called after a cpu_model and a network_model have been set up.
- */
-XBT_PUBLIC void surf_host_model_init_compound();
-
-/** @ingroup SURF_models
- *  @brief Initializes the platform with the current best network and cpu models at hand
- *
- *  This platform model separates the host model and the network model.
- *  The host model will be initialized with the model compound, the network model with the model LV08 (with cross
- *  traffic support) and the CPU model with the model Cas01.
- *  Such model is subject to modification with warning in the ChangeLog so monitor it!
- */
-XBT_PUBLIC void surf_host_model_init_current_default();
-
-/** @ingroup SURF_models
- *  @brief Initializes the platform with the model L07
- *
- *  With this model, only parallel tasks can be used. Resource sharing is done by identifying bottlenecks and giving an
- *  equal share of the model to each action.
- */
-XBT_PUBLIC void surf_host_model_init_ptask_L07();
-
-/* --------------------
- *  Model Descriptions
- * -------------------- */
-/** @brief Resource model description */
-struct surf_model_description_t {
-  const char* name;
-  const char* description;
-  std::function<void()> model_init_preparse;
-};
-
-XBT_PUBLIC const surf_model_description_t* find_model_description(const std::vector<surf_model_description_t>& table,
-                                                                  const std::string& name);
-XBT_PUBLIC void model_help(const char* category, const std::vector<surf_model_description_t>& table);
-
-#define SIMGRID_REGISTER_PLUGIN(id, desc, init)                                                                        \
-  static void XBT_ATTRIB_CONSTRUCTOR(800) _XBT_CONCAT3(simgrid_, id, _plugin_register)()                               \
-  {                                                                                                                    \
-    surf_plugin_description().emplace_back(surf_model_description_t{_XBT_STRINGIFY(id), (desc), (init)});              \
-  }
-
-/** @brief The list of all available plugins */
-inline auto& surf_plugin_description() // Function to avoid static initialization order fiasco
-{
-  static std::vector<surf_model_description_t> plugin_description_table;
-  return plugin_description_table;
-}
-/** @brief The list of all available optimization modes (both for cpu and networks).
- *  These optimization modes can be set using --cfg=cpu/optim:... and --cfg=network/optim:... */
-XBT_PUBLIC_DATA const std::vector<surf_model_description_t> surf_optimization_mode_description;
-/** @brief The list of all cpu models (pick one with --cfg=cpu/model) */
-XBT_PUBLIC_DATA const std::vector<surf_model_description_t> surf_cpu_model_description;
-/** @brief The list of all network models (pick one with --cfg=network/model) */
-XBT_PUBLIC_DATA const std::vector<surf_model_description_t> surf_network_model_description;
-/** @brief The list of all disk models (pick one with --cfg=disk/model) */
-XBT_PUBLIC_DATA const std::vector<surf_model_description_t> surf_disk_model_description;
-/** @brief The list of all host models (pick one with --cfg=host/model:) */
-XBT_PUBLIC_DATA const std::vector<surf_model_description_t> surf_host_model_description;
+XBT_PUBLIC void surf_vm_model_init_HL13();
 
 #endif /* SURF_MODEL_H_ */
index 5cfc7f2..951b12a 100644 (file)
 
 #include <vector>
 
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
-
 /* Trace related stuff */
 XBT_PRIVATE std::unordered_map<std::string, simgrid::kernel::profile::Profile*> traces_set_list;
-XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_host_avail;
-XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_host_speed;
-XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_avail;
-XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_bw;
-XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_lat;
+static std::unordered_map<std::string, std::string> trace_connect_list_host_avail;
+static std::unordered_map<std::string, std::string> trace_connect_list_host_speed;
+static std::unordered_map<std::string, std::string> trace_connect_list_link_avail;
+static std::unordered_map<std::string, std::string> trace_connect_list_link_bw;
+static std::unordered_map<std::string, std::string> trace_connect_list_link_lat;
 
 void sg_platf_trace_connect(simgrid::kernel::routing::TraceConnectCreationArgs* trace_connect)
 {
index 567a2b2..ad0431a 100644 (file)
 
 #include "simgrid_dtd.c"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF parsing module");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(platf_parse, ker_platform, "Logging specific to the parsing of platform files");
 
 std::string surf_parsed_filename; // Currently parsed file (for the error messages)
-std::vector<simgrid::s4u::LinkInRoute> parsed_link_list; /* temporary store of current link list of a route */
+static std::vector<simgrid::s4u::LinkInRoute> parsed_link_list; /* temporary store of current link list of a route */
 
 /* Helping functions */
 void surf_parse_assert(bool cond, const std::string& msg)
@@ -127,9 +127,9 @@ static void explodesRadical(const std::string& radicals, std::vector<int>* explo
 
 /* make sure these symbols are defined as strong ones in this file so that the linker can resolve them */
 
-std::vector<std::unordered_map<std::string, std::string>> property_sets;
+static std::vector<std::unordered_map<std::string, std::string>> property_sets;
 
-FILE *surf_file_to_parse = nullptr;
+static FILE* surf_file_to_parse = nullptr;
 
 /* Stuff relative to storage */
 void STag_surfxml_storage()
@@ -826,7 +826,7 @@ void ETag_surfxml_argument(){/* Nothing to do */}
 void ETag_surfxml_model___prop(){/* Nothing to do */}
 
 /* Open and Close parse file */
-YY_BUFFER_STATE surf_input_buffer;
+static YY_BUFFER_STATE surf_input_buffer;
 
 void surf_parse_open(const std::string& file)
 {
index 642fe2a..88726a9 100644 (file)
 #include <vector>
 
 int xbt_log_no_loc = 0; /* if set to true (with --log=no_loc), file localization will be omitted (for tesh tests) */
-static std::recursive_mutex* log_cat_init_mutex = nullptr;
-
-xbt_log_appender_t xbt_log_default_appender = nullptr; /* set in log_init */
-xbt_log_layout_t xbt_log_default_layout     = nullptr; /* set in log_init */
 
 struct xbt_log_setting_t {
   std::string catname;
@@ -58,17 +54,6 @@ s_xbt_log_category_t _XBT_LOGV(XBT_LOG_ROOT_CAT) = {
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(log, xbt, "Loggings from the logging mechanism itself");
 
-/* create the default appender and install it in the root category,
-   which were already created (damnit. Too slow little beetle) */
-void xbt_log_preinit(void)
-{
-  xbt_log_default_appender             = xbt_log_appender_stream(stderr);
-  xbt_log_default_layout               = xbt_log_layout_simple_new(nullptr);
-  _XBT_LOGV(XBT_LOG_ROOT_CAT).appender = xbt_log_default_appender;
-  _XBT_LOGV(XBT_LOG_ROOT_CAT).layout = xbt_log_default_layout;
-  log_cat_init_mutex                   = new std::recursive_mutex();
-}
-
 static void xbt_log_help();
 static void xbt_log_help_categories();
 
@@ -132,7 +117,6 @@ static void log_cat_exit(const s_xbt_log_category_t* cat)
 void xbt_log_postexit(void)
 {
   XBT_VERB("Exiting log");
-  delete log_cat_init_mutex;
   log_cat_exit(&_XBT_LOGV(XBT_LOG_ROOT_CAT));
 }
 
@@ -246,8 +230,8 @@ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority
   if (category->initialized)
     return priority >= category->threshold;
 
-  if (log_cat_init_mutex != nullptr)
-    log_cat_init_mutex->lock();
+  static std::recursive_mutex log_cat_init_mutex;
+  log_cat_init_mutex.lock();
 
   XBT_DEBUG("Initializing category '%s' (firstChild=%s, nextSibling=%s)", category->name,
          (category->firstChild ? category->firstChild->name : "none"),
@@ -255,8 +239,8 @@ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority
 
   if (category == &_XBT_LOGV(XBT_LOG_ROOT_CAT)) {
     category->threshold = xbt_log_priority_info;
-    category->appender = xbt_log_default_appender;
-    category->layout = xbt_log_default_layout;
+    category->appender  = xbt_log_appender_stream(stderr);
+    category->layout    = xbt_log_layout_simple_new(nullptr);
   } else {
     if (not category->parent)
       category->parent = &_XBT_LOGV(XBT_LOG_ROOT_CAT);
@@ -291,8 +275,7 @@ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority
   }
 
   category->initialized = 1;
-  if (log_cat_init_mutex != nullptr)
-    log_cat_init_mutex->unlock();
+  log_cat_init_mutex.unlock();
   return priority >= category->threshold;
 }
 
index 0717605..5cd89d5 100644 (file)
@@ -15,7 +15,6 @@
 /* ***** Whether to use `mmalloc` of the underlying malloc ***** */
 
 static int __malloc_use_mmalloc;
-int mmalloc_pagesize = 0;
 
 int malloc_use_mmalloc(void)
 {
@@ -127,7 +126,6 @@ XBT_ATTRIB_CONSTRUCTOR(101) static void mm_legacy_constructor()
     mm_real_calloc   = dlsym(RTLD_NEXT, "calloc");
 #endif
   }
-  mmalloc_pagesize = getpagesize();
 
   mm_initializing = 0;
   mm_initialized = 1;
index 5e9b940..f4bd97a 100644 (file)
@@ -141,9 +141,8 @@ void *xbt_mheap_destroy(xbt_mheap_t mdp)
 xbt_mheap_t mmalloc_preinit(void)
 {
   if (__mmalloc_default_mdp == NULL) {
-    if (!mmalloc_pagesize)
-      mmalloc_pagesize = getpagesize();
-    unsigned long mask    = ~((unsigned long)mmalloc_pagesize - 1);
+    unsigned long mmalloc_pagesize = (unsigned long)sysconf(_SC_PAGESIZE);
+    unsigned long mask             = ~(mmalloc_pagesize - 1);
     void* addr            = (void*)(((unsigned long)sbrk(0) + HEAP_OFFSET) & mask);
     __mmalloc_default_mdp = xbt_mheap_new(addr, XBT_MHEAP_OPTION_MEMSET);
   }
index 3601a79..a5f9ff5 100644 (file)
@@ -22,7 +22,7 @@
 #define MAP_ANONYMOUS MAP_ANON
 #endif
 
-#define PAGE_ALIGN(addr) (void*)(((long)(addr) + mmalloc_pagesize - 1) & ~((long)mmalloc_pagesize - 1))
+#define PAGE_ALIGN(addr) (void*)(((unsigned long)(addr) + mmalloc_pagesize - 1) & ~(mmalloc_pagesize - 1))
 
 /** @brief Add memory to this heap
  *
@@ -47,9 +47,9 @@ void *mmorecore(struct mdesc *mdp, ssize_t size)
     return mdp->breakval;
   }
 
-  if (mmalloc_pagesize == 0) { // Not initialized yet
-    mmalloc_pagesize = (int)sysconf(_SC_PAGESIZE);
-  }
+  static unsigned long mmalloc_pagesize = 0;
+  if (!mmalloc_pagesize)
+    mmalloc_pagesize = (unsigned long)sysconf(_SC_PAGESIZE);
 
   if (size < 0) {
     /* We are deallocating memory.  If the amount requested would cause us to try to deallocate back past the base of
@@ -78,7 +78,7 @@ void *mmorecore(struct mdesc *mdp, ssize_t size)
 
     if (mapto == MAP_FAILED) {
       char buff[1024];
-      fprintf(stderr, "Internal error: mmap returned MAP_FAILED! pagesize:%d error: %s\n", mmalloc_pagesize,
+      fprintf(stderr, "Internal error: mmap returned MAP_FAILED! pagesize:%lu error: %s\n", mmalloc_pagesize,
               strerror(errno));
       snprintf(buff, 1024, "cat /proc/%d/maps", getpid());
       int status = system(buff);
index 76b459c..216e5eb 100644 (file)
@@ -31,7 +31,6 @@
     }                                                                                                                  \
   } while (0)
 
-XBT_PUBLIC_DATA int mmalloc_pagesize;
 XBT_PRIVATE xbt_mheap_t mmalloc_preinit(void);
 
 #define MMALLOC_MAGIC    "mmalloc"       /* Mapped file magic number */
index 4d41e07..8e70ab9 100644 (file)
@@ -64,7 +64,6 @@ XBT_ATTRIB_NOINLINE void sthread_disable()
 
 static void xbt_preinit()
 {
-  xbt_log_preinit();
   xbt_dict_preinit();
   atexit(xbt_postexit);
 }
index 987887b..d58bab1 100644 (file)
@@ -128,7 +128,7 @@ int replay_runner(const char* actor_name, const char* trace_filename)
     simgrid::xbt::ReplayAction evt;
     simgrid::xbt::ReplayReader reader(trace_filename);
     while (reader.get(&evt)) {
-      if (evt.front().compare(actor_name) == 0) {
+      if (evt.front() == actor_name) {
         simgrid::xbt::handle_action(evt);
       } else {
         XBT_WARN("Ignore trace element not for me (target='%s', I am '%s')", evt.front().c_str(), actor_name);
@@ -150,7 +150,7 @@ int replay_runner(const char* actor_name, const char* trace_filename)
  * The argument of the function is the line describing the action, fields separated by spaces.
  *
  * @param action_name the reference name of the action.
- * @param function prototype given by the type: void...(const char** action)
+ * @param function prototype given by the type: void...(simgrid::xbt::ReplayAction& action)
  */
 void xbt_replay_action_register(const char* action_name, const action_fun& function)
 {
index 6141996..bce6303 100644 (file)
 
 #include <algorithm>
 #include <cstring>
+#include <sstream>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(flatifier, "Logging specific to this platform parsing tool");
 
 namespace sg4 = simgrid::s4u;
 
-static bool parse_cmdline(int* timings, char** platformFile, int argc, char** argv)
+static bool parse_cmdline(bool* timings, char** platformFile, int argc, char** argv)
 {
   bool parse_ok = true;
   for (int i = 1; i < argc; i++) {
     if (std::strlen(argv[i]) > 1 && argv[i][0] == '-' && argv[i][1] == '-') {
       if (not std::strcmp(argv[i], "--timings")) {
-        *timings = 1;
+        *timings = true;
       } else {
         parse_ok = false;
         break;
@@ -33,184 +34,31 @@ static bool parse_cmdline(int* timings, char** platformFile, int argc, char** ar
       *platformFile = argv[i];
     }
   }
-  return parse_ok;
-}
-
-static void create_environment(xbt_os_timer_t parse_time, const std::string& platformFile)
-{
-  xbt_os_cputimer_start(parse_time);
-  sg4::Engine::get_instance()->load_platform(platformFile);
-  sg4::Engine::get_instance()->seal_platform();
-  xbt_os_cputimer_stop(parse_time);
-}
-
-static void dump_hosts()
-{
-  std::vector<sg4::Host*> hosts = sg4::Engine::get_instance()->get_all_hosts();
-
-  for (auto const* h : hosts) {
-    std::printf("  <host id=\"%s\" speed=\"%.0f\"", h->get_cname(), h->get_speed());
-    const std::unordered_map<std::string, std::string>* props = h->get_properties();
-    if (h->get_core_count() > 1) {
-      std::printf(" core=\"%d\"", h->get_core_count());
-    }
-    // Sort the properties before displaying them, so that the tests are perfectly reproducible
-    std::vector<std::string> keys;
-    for (auto const& [key, _] : *props)
-      keys.push_back(key);
-    if (not keys.empty()) {
-      std::printf(">\n");
-      std::sort(keys.begin(), keys.end());
-      for (const std::string& key : keys)
-        std::printf("    <prop id=\"%s\" value=\"%s\"/>\n", key.c_str(), props->at(key).c_str());
-      std::printf("  </host>\n");
-    } else {
-      std::printf("/>\n");
-    }
-  }
-}
-
-static void dump_links()
-{
-  std::vector<sg4::Link*> links = sg4::Engine::get_instance()->get_all_links();
-
-  std::sort(links.begin(), links.end(),
-            [](const sg4::Link* a, const sg4::Link* b) { return a->get_name() < b->get_name(); });
-
-  for (auto const* link : links) {
-    std::printf("  <link id=\"");
-
-    std::printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"", link->get_cname(), link->get_bandwidth(),
-                link->get_latency());
-    if (link->is_shared()) {
-      std::printf("/>\n");
-    } else {
-      std::printf(" sharing_policy=\"FATPIPE\"/>\n");
-    }
-  }
-}
-
-static void dump_routers()
-{
-  std::vector<simgrid::kernel::routing::NetPoint*> netpoints = sg4::Engine::get_instance()->get_all_netpoints();
-  std::sort(netpoints.begin(), netpoints.end(),
-            [](const simgrid::kernel::routing::NetPoint* a, const simgrid::kernel::routing::NetPoint* b) {
-              return a->get_name() < b->get_name();
-            });
-
-  for (auto const& src : netpoints)
-    if (src->is_router())
-      std::printf("  <router id=\"%s\"/>\n", src->get_cname());
-}
-
-static void dump_routes()
-{
-  std::vector<sg4::Host*> hosts = sg4::Engine::get_instance()->get_all_hosts();
-  std::vector<simgrid::kernel::routing::NetPoint*> netpoints = sg4::Engine::get_instance()->get_all_netpoints();
-  std::sort(netpoints.begin(), netpoints.end(),
-            [](const simgrid::kernel::routing::NetPoint* a, const simgrid::kernel::routing::NetPoint* b) {
-              return a->get_name() < b->get_name();
-            });
-
-  for (auto const* src_host : hosts) { // Routes from host
-    const simgrid::kernel::routing::NetPoint* src = src_host->get_netpoint();
-    for (auto const* dst_host : hosts) { // Routes to host
-      std::vector<simgrid::kernel::resource::StandardLinkImpl*> route;
-      const simgrid::kernel::routing::NetPoint* dst = dst_host->get_netpoint();
-      simgrid::kernel::routing::NetZoneImpl::get_global_route(src, dst, route, nullptr);
-      if (route.empty())
-        continue;
-      std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", src_host->get_cname(), dst_host->get_cname());
-      for (auto const& link : route)
-        std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
-      std::printf("\n  </route>\n");
-    }
-
-    for (auto const& dst : netpoints) { // to router
-      if (not dst->is_router())
-        continue;
-      std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", src_host->get_cname(), dst->get_cname());
-      std::vector<simgrid::kernel::resource::StandardLinkImpl*> route;
-      simgrid::kernel::routing::NetZoneImpl::get_global_route(src, dst, route, nullptr);
-      for (auto const& link : route)
-        std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
-      std::printf("\n  </route>\n");
-    }
-  }
-
-  for (auto const& value1 : netpoints) { // Routes from router
-    if (not value1->is_router())
-      continue;
-    for (auto const& value2 : netpoints) { // to router
-      if (not value2->is_router())
-        continue;
-      std::vector<simgrid::kernel::resource::StandardLinkImpl*> route;
-      simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, value2, route, nullptr);
-      if (route.empty())
-        continue;
-      std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->get_cname(), value2->get_cname());
-      for (auto const& link : route)
-        std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
-      std::printf("\n  </route>\n");
-    }
-    for (auto const* dst_host : hosts) { // Routes to host
-      std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->get_cname(), dst_host->get_cname());
-      std::vector<simgrid::kernel::resource::StandardLinkImpl*> route;
-      const simgrid::kernel::routing::NetPoint* netcardDst = dst_host->get_netpoint();
-      simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, netcardDst, route, nullptr);
-      for (auto const& link : route)
-        std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
-      std::printf("\n  </route>\n");
-    }
-  }
-}
-
-static void dump_platform()
-{
-  int version = 4;
-
-  std::printf("<?xml version='1.0'?>\n");
-  std::printf("<!DOCTYPE platform SYSTEM \"https://simgrid.org/simgrid.dtd\">\n");
-  std::printf("<platform version=\"%d\">\n", version);
-  std::printf("<AS id=\"AS0\" routing=\"Full\">\n");
-
-  // Hosts
-  dump_hosts();
-
-  // Routers
-  dump_routers();
-
-  // Links
-  dump_links();
-
-  // Routes
-  dump_routes();
-
-  std::printf("</AS>\n");
-  std::printf("</platform>\n");
+  return parse_ok && platformFile != nullptr;
 }
 
 int main(int argc, char** argv)
 {
   char* platformFile = nullptr;
-  int timings        = 0;
+  bool timings       = false;
 
   xbt_os_timer_t parse_time = xbt_os_timer_new();
 
   sg4::Engine e(&argc, argv);
 
-  xbt_assert(parse_cmdline(&timings, &platformFile, argc, argv) && platformFile,
+  xbt_assert(parse_cmdline(&timings, &platformFile, argc, argv),
              "Invalid command line arguments: expected [--timings] platformFile");
 
-  XBT_DEBUG("%d,%s", timings, platformFile);
-
-  create_environment(parse_time, platformFile);
+  xbt_os_cputimer_start(parse_time);
+  e.load_platform(platformFile);
+  e.seal_platform();
+  xbt_os_cputimer_stop(parse_time);
 
   if (timings) {
     XBT_INFO("Parsing time: %fs (%zu hosts, %zu links)", xbt_os_timer_elapsed(parse_time), e.get_host_count(),
              e.get_link_count());
   } else {
-    dump_platform();
+    std::printf("%s", e.flatify_platform().c_str());
   }
 
   xbt_os_timer_free(parse_time);
index 8b7373e..75836a0 100644 (file)
@@ -2,26 +2,26 @@
 $ ${bindir:=.}/flatifier ./one_cluster.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
+> <platform version="4.1">
 > <AS id="AS0" routing="Full">
->   <host id="bob0.hamburger.edu" speed="1000000000"/>
->   <host id="bob2.hamburger.edu" speed="1000000000"/>
->   <host id="bob3.hamburger.edu" speed="1000000000"/>
->   <host id="bob4.hamburger.edu" speed="1000000000"/>
->   <host id="bob6.hamburger.edu" speed="1000000000"/>
+>   <host id="bob0.hamburger.edu" speed="1e+09"/>
+>   <host id="bob2.hamburger.edu" speed="1e+09"/>
+>   <host id="bob3.hamburger.edu" speed="1e+09"/>
+>   <host id="bob4.hamburger.edu" speed="1e+09"/>
+>   <host id="bob6.hamburger.edu" speed="1e+09"/>
 >   <router id="bobbob_cluster_router.hamburger.edu"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_backbone" bandwidth="2250000000" latency="0.000500000"/>
->   <link id="bob_cluster_link_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_2_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_2_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_3_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_3_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_4_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_4_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_6_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_6_UP" bandwidth="125000000" latency="0.000050000"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_backbone" bandwidth="2.25e+09" latency="0.0005"/>
+>   <link id="bob_cluster_link_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_2_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_2_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_3_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_3_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_4_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_4_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_6_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_6_UP" bandwidth="1.25e+08" latency="5e-05"/>
 >   <route src="bob0.hamburger.edu" dst="bob0.hamburger.edu">
 >   <link_ctn id="bob_cluster_link_0_UP"/><link_ctn id="bob_cluster_backbone"/><link_ctn id="bob_cluster_link_0_DOWN"/>
 >   </route>
@@ -133,25 +133,25 @@ $ ${bindir:=.}/flatifier ./one_cluster.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%
 $ ${bindir:=.}/flatifier ./one_cluster_multicore.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
+> <platform version="4.1">
 > <AS id="AS0" routing="Full">
->   <host id="bob0.hamburger.edu" speed="1000000000" core="6"/>
->   <host id="bob2.hamburger.edu" speed="1000000000" core="6"/>
->   <host id="bob3.hamburger.edu" speed="1000000000" core="6"/>
->   <host id="bob4.hamburger.edu" speed="1000000000" core="6"/>
->   <host id="bob6.hamburger.edu" speed="1000000000" core="6"/>
+>   <host id="bob0.hamburger.edu" speed="1e+09" core="6"/>
+>   <host id="bob2.hamburger.edu" speed="1e+09" core="6"/>
+>   <host id="bob3.hamburger.edu" speed="1e+09" core="6"/>
+>   <host id="bob4.hamburger.edu" speed="1e+09" core="6"/>
+>   <host id="bob6.hamburger.edu" speed="1e+09" core="6"/>
 >   <router id="bobbob_cluster_router.hamburger.edu"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_2_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_2_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_3_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_3_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_4_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_4_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_6_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_6_UP" bandwidth="125000000" latency="0.000050000"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_2_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_2_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_3_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_3_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_4_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_4_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_6_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_6_UP" bandwidth="1.25e+08" latency="5e-05"/>
 >   <route src="bob0.hamburger.edu" dst="bob0.hamburger.edu">
 >   <link_ctn id="bob_cluster_link_0_UP"/><link_ctn id="bob_cluster_link_0_DOWN"/>
 >   </route>
@@ -263,18 +263,18 @@ $ ${bindir:=.}/flatifier ./one_cluster_multicore.xml "--log=root.fmt:[%10.6r]%e[
 $ ${bindir:=.}/flatifier ./host_attributes.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
+> <platform version="4.1">
 > <AS id="AS0" routing="Full">
->   <host id="alice" speed="1000000000"/>
->   <host id="bob" speed="1000000000"/>
->   <host id="carol" speed="500000000"/>
->   <host id="dave" speed="1000000000">
+>   <host id="alice" speed="1e+09"/>
+>   <host id="bob" speed="1e+09"/>
+>   <host id="carol" speed="5e+08"/>
+>   <host id="dave" speed="1e+09">
 >     <prop id="OS" value="Linux 2.6.22-14"/>
 >     <prop id="disk" value="80E9"/>
 >     <prop id="memory" value="1000000000"/>
 >   </host>
->   <host id="erin" speed="500000000"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
+>   <host id="erin" speed="5e+08"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
 >   <route src="alice" dst="alice">
 >   <link_ctn id="__loopback__"/>
 >   </route>
@@ -296,14 +296,14 @@ $ ${bindir:=.}/flatifier ./host_attributes.xml "--log=root.fmt:[%10.6r]%e[%i:%a@
 $ ${bindir:=.}/flatifier ./link_attributes.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
+> <platform version="4.1">
 > <AS id="AS0" routing="Full">
->   <host id="bob" speed="500000000"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="link1" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link2" bandwidth="125000000" latency="0.000050000" sharing_policy="FATPIPE"/>
->   <link id="link3" bandwidth="80000000" latency="0.000100000"/>
->   <link id="link4" bandwidth="80000000" latency="0.000100000"/>
+>   <host id="bob" speed="5e+08"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="link1" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link2" bandwidth="1.25e+08" latency="5e-05" sharing_policy="FATPIPE"/>
+>   <link id="link3" bandwidth="8e+07" latency="0.0001"/>
+>   <link id="link4" bandwidth="8e+07" latency="0.0001"/>
 >   <route src="bob" dst="bob">
 >   <link_ctn id="__loopback__"/>
 >   </route>
@@ -313,15 +313,15 @@ $ ${bindir:=.}/flatifier ./link_attributes.xml "--log=root.fmt:[%10.6r]%e[%i:%a@
 $ ${bindir:=.}/flatifier ./three_hosts_non_symmetric_route.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
+> <platform version="4.1">
 > <AS id="AS0" routing="Full">
->   <host id="alice" speed="500000000"/>
->   <host id="bob" speed="1000000000"/>
->   <host id="trudy" speed="250000000"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="link1" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link2" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link3" bandwidth="125000000" latency="0.000050000"/>
+>   <host id="alice" speed="5e+08"/>
+>   <host id="bob" speed="1e+09"/>
+>   <host id="trudy" speed="2.5e+08"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="link1" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link2" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link3" bandwidth="1.25e+08" latency="5e-05"/>
 >   <route src="alice" dst="alice">
 >   <link_ctn id="__loopback__"/>
 >   </route>
@@ -355,26 +355,26 @@ $ ${bindir:=.}/flatifier ./three_hosts_non_symmetric_route.xml "--log=root.fmt:[
 $ ${bindir:=.}/flatifier ./two_clusters.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
+> <platform version="4.1">
 > <AS id="AS0" routing="Full">
->   <host id="alice0.crepe.fr" speed="1000000000"/>
->   <host id="alice1.crepe.fr" speed="1000000000"/>
->   <host id="bob0.hamburger.edu" speed="1000000000"/>
->   <host id="bob1.hamburger.edu" speed="1000000000"/>
+>   <host id="alice0.crepe.fr" speed="1e+09"/>
+>   <host id="alice1.crepe.fr" speed="1e+09"/>
+>   <host id="bob0.hamburger.edu" speed="1e+09"/>
+>   <host id="bob1.hamburger.edu" speed="1e+09"/>
 >   <router id="alicealice_cluster_router.crepe.fr"/>
 >   <router id="bobbob_cluster_router.hamburger.edu"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="alice_cluster_backbone" bandwidth="2250000000" latency="0.000500000"/>
->   <link id="alice_cluster_link_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="alice_cluster_link_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="alice_cluster_link_1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="alice_cluster_link_1_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="backbone" bandwidth="1250000000" latency="0.000500000"/>
->   <link id="bob_cluster_backbone" bandwidth="2250000000" latency="0.000500000"/>
->   <link id="bob_cluster_link_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_1_UP" bandwidth="125000000" latency="0.000050000"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="alice_cluster_backbone" bandwidth="2.25e+09" latency="0.0005"/>
+>   <link id="alice_cluster_link_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="alice_cluster_link_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="alice_cluster_link_1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="alice_cluster_link_1_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="backbone" bandwidth="1.25e+09" latency="0.0005"/>
+>   <link id="bob_cluster_backbone" bandwidth="2.25e+09" latency="0.0005"/>
+>   <link id="bob_cluster_link_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_1_UP" bandwidth="1.25e+08" latency="5e-05"/>
 >   <route src="alice0.crepe.fr" dst="alice0.crepe.fr">
 >   <link_ctn id="alice_cluster_link_0_UP"/><link_ctn id="alice_cluster_backbone"/><link_ctn id="alice_cluster_link_0_DOWN"/>
 >   </route>
@@ -483,14 +483,14 @@ $ ${bindir:=.}/flatifier ./two_clusters.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]
 $ ${bindir:=.}/flatifier ./two_hosts_multi_hop.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
+> <platform version="4.1">
 > <AS id="AS0" routing="Full">
->   <host id="alice" speed="500000000"/>
->   <host id="bob" speed="1000000000"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="link_alice" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_bob" bandwidth="125000000" latency="0.000050000"/>
->   <link id="switch" bandwidth="125000000" latency="0.000050000" sharing_policy="FATPIPE"/>
+>   <host id="alice" speed="5e+08"/>
+>   <host id="bob" speed="1e+09"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="link_alice" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_bob" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="switch" bandwidth="1.25e+08" latency="5e-05" sharing_policy="FATPIPE"/>
 >   <route src="alice" dst="alice">
 >   <link_ctn id="__loopback__"/>
 >   </route>
@@ -509,12 +509,12 @@ $ ${bindir:=.}/flatifier ./two_hosts_multi_hop.xml "--log=root.fmt:[%10.6r]%e[%i
 $ ${bindir:=.}/flatifier ./two_hosts_one_link.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
+> <platform version="4.1">
 > <AS id="AS0" routing="Full">
->   <host id="alice" speed="500000000"/>
->   <host id="bob" speed="1000000000"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="link1" bandwidth="125000000" latency="0.000050000"/>
+>   <host id="alice" speed="5e+08"/>
+>   <host id="bob" speed="1e+09"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="link1" bandwidth="1.25e+08" latency="5e-05"/>
 >   <route src="alice" dst="alice">
 >   <link_ctn id="__loopback__"/>
 >   </route>
@@ -533,25 +533,25 @@ $ ${bindir:=.}/flatifier ./two_hosts_one_link.xml "--log=root.fmt:[%10.6r]%e[%i:
 $ ${bindir:=.}/flatifier ${srcdir:=.}/examples/platforms/bypassZoneRoute.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
+> <platform version="4.1">
 > <AS id="AS0" routing="Full">
->   <host id="1" speed="1000000000"/>
->   <host id="2" speed="1000000000"/>
->   <host id="3" speed="1000000000"/>
+>   <host id="1" speed="1e+09"/>
+>   <host id="2" speed="1e+09"/>
+>   <host id="3" speed="1e+09"/>
 >   <router id="my_cluster_1_router"/>
 >   <router id="my_cluster_2_router"/>
 >   <router id="my_cluster_3_router"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="link1" bandwidth="1250000000" latency="0.000500000"/>
->   <link id="link2" bandwidth="1250000000" latency="0.000500000"/>
->   <link id="link3" bandwidth="1250000000" latency="0.000500000"/>
->   <link id="link_tmp" bandwidth="1250000000" latency="0.000500000"/>
->   <link id="my_cluster_1_link_1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="my_cluster_1_link_1_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="my_cluster_2_link_2_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="my_cluster_2_link_2_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="my_cluster_3_link_3_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="my_cluster_3_link_3_UP" bandwidth="125000000" latency="0.000050000"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="link1" bandwidth="1.25e+09" latency="0.0005"/>
+>   <link id="link2" bandwidth="1.25e+09" latency="0.0005"/>
+>   <link id="link3" bandwidth="1.25e+09" latency="0.0005"/>
+>   <link id="link_tmp" bandwidth="1.25e+09" latency="0.0005"/>
+>   <link id="my_cluster_1_link_1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="my_cluster_1_link_1_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="my_cluster_2_link_2_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="my_cluster_2_link_2_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="my_cluster_3_link_3_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="my_cluster_3_link_3_UP" bandwidth="1.25e+08" latency="5e-05"/>
 >   <route src="1" dst="1">
 >   <link_ctn id="my_cluster_1_link_1_UP"/><link_ctn id="my_cluster_1_link_1_DOWN"/>
 >   </route>
@@ -657,105 +657,105 @@ $ ${bindir:=.}/flatifier ${srcdir:=.}/examples/platforms/bypassZoneRoute.xml "--
 $ ${bindir:=.}/flatifier ${srcdir:=.}/examples/platforms/cluster_torus.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
-> <AS id="AS0" routing="Full">
->   <host id="node-0.simgrid.org" speed="1000000000"/>
->   <host id="node-1.simgrid.org" speed="1000000000"/>
->   <host id="node-10.simgrid.org" speed="1000000000"/>
->   <host id="node-11.simgrid.org" speed="1000000000"/>
->   <host id="node-2.simgrid.org" speed="1000000000"/>
->   <host id="node-3.simgrid.org" speed="1000000000"/>
->   <host id="node-4.simgrid.org" speed="1000000000"/>
->   <host id="node-5.simgrid.org" speed="1000000000"/>
->   <host id="node-6.simgrid.org" speed="1000000000"/>
->   <host id="node-7.simgrid.org" speed="1000000000"/>
->   <host id="node-8.simgrid.org" speed="1000000000"/>
->   <host id="node-9.simgrid.org" speed="1000000000"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_0_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_10_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_11_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_1_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_2_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_3_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_4_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_5_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_6_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_7_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_8_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_9_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_from_0_to_1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_0_to_1_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_0_to_3_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_0_to_3_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_0_to_6_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_0_to_6_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_10_to_11_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_10_to_11_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_10_to_4_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_10_to_4_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_10_to_7_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_10_to_7_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_11_to_5_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_11_to_5_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_11_to_8_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_11_to_8_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_11_to_9_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_11_to_9_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_2_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_2_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_4_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_4_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_7_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_7_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_5_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_5_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_8_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_8_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_4_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_4_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_9_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_9_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_4_to_10_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_4_to_10_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_4_to_1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_4_to_1_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_4_to_5_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_4_to_5_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_5_to_11_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_5_to_11_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_5_to_2_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_5_to_2_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_5_to_3_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_5_to_3_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_6_to_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_6_to_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_6_to_7_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_6_to_7_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_6_to_9_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_6_to_9_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_7_to_10_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_7_to_10_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_7_to_1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_7_to_1_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_7_to_8_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_7_to_8_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_8_to_11_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_8_to_11_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_8_to_2_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_8_to_2_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_8_to_6_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_8_to_6_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_9_to_10_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_9_to_10_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_9_to_3_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_9_to_3_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_9_to_6_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_9_to_6_UP" bandwidth="125000000" latency="0.000050000"/>
+> <platform version="4.1">
+> <AS id="world" routing="Full">
+>   <host id="node-0.simgrid.org" speed="1e+09"/>
+>   <host id="node-1.simgrid.org" speed="1e+09"/>
+>   <host id="node-10.simgrid.org" speed="1e+09"/>
+>   <host id="node-11.simgrid.org" speed="1e+09"/>
+>   <host id="node-2.simgrid.org" speed="1e+09"/>
+>   <host id="node-3.simgrid.org" speed="1e+09"/>
+>   <host id="node-4.simgrid.org" speed="1e+09"/>
+>   <host id="node-5.simgrid.org" speed="1e+09"/>
+>   <host id="node-6.simgrid.org" speed="1e+09"/>
+>   <host id="node-7.simgrid.org" speed="1e+09"/>
+>   <host id="node-8.simgrid.org" speed="1e+09"/>
+>   <host id="node-9.simgrid.org" speed="1e+09"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_0_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_10_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_11_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_1_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_2_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_3_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_4_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_5_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_6_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_7_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_8_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_9_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_from_0_to_1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_0_to_1_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_0_to_3_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_0_to_3_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_0_to_6_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_0_to_6_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_10_to_11_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_10_to_11_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_10_to_4_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_10_to_4_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_10_to_7_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_10_to_7_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_11_to_5_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_11_to_5_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_11_to_8_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_11_to_8_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_11_to_9_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_11_to_9_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_2_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_2_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_4_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_4_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_7_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_7_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_5_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_5_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_8_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_8_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_4_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_4_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_9_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_9_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_4_to_10_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_4_to_10_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_4_to_1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_4_to_1_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_4_to_5_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_4_to_5_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_5_to_11_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_5_to_11_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_5_to_2_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_5_to_2_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_5_to_3_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_5_to_3_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_6_to_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_6_to_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_6_to_7_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_6_to_7_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_6_to_9_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_6_to_9_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_7_to_10_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_7_to_10_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_7_to_1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_7_to_1_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_7_to_8_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_7_to_8_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_8_to_11_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_8_to_11_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_8_to_2_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_8_to_2_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_8_to_6_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_8_to_6_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_9_to_10_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_9_to_10_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_9_to_3_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_9_to_3_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_9_to_6_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_9_to_6_UP" bandwidth="1.25e+08" latency="5e-05"/>
 >   <route src="node-0.simgrid.org" dst="node-0.simgrid.org">
 >   <link_ctn id="bob_cluster_link_0_loopback"/>
 >   </route>
@@ -1194,41 +1194,41 @@ $ ${bindir:=.}/flatifier ${srcdir:=.}/examples/platforms/cluster_torus.xml "--lo
 $ ${bindir:=.}/flatifier ./cluster_dragonfly_noncontiguous_rad.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
-> <AS id="AS0" routing="Full">
->   <host id="node-0.simgrid.org" speed="1000000000"/>
->   <host id="node-1002.simgrid.org" speed="1000000000"/>
->   <host id="node-1003.simgrid.org" speed="1000000000"/>
->   <host id="node-1004.simgrid.org" speed="1000000000"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_DOWN" bandwidth="375000000" latency="0.000050000"/>
->   <link id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_UP" bandwidth="375000000" latency="0.000050000"/>
->   <link id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_DOWN" bandwidth="375000000" latency="0.000050000"/>
->   <link id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_UP" bandwidth="375000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_0_limiter" bandwidth="150000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_0_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_1002_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_1003_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_1004_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_1_limiter" bandwidth="150000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_2_limiter" bandwidth="150000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_3_limiter" bandwidth="150000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_4_limiter" bandwidth="150000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_5_limiter" bandwidth="150000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_6_limiter" bandwidth="150000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_7_limiter" bandwidth="150000000" latency="0.000000000"/>
->   <link id="green_link_in_chassis_0_between_routers_0_and_1_4_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="green_link_in_chassis_0_between_routers_0_and_1_4_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="green_link_in_chassis_1_between_routers_0_and_1_5_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="green_link_in_chassis_1_between_routers_0_and_1_5_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="local_link_from_router_0_to_node_0_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="local_link_from_router_0_to_node_0_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="local_link_from_router_1_to_node_0_1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="local_link_from_router_1_to_node_0_1_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="local_link_from_router_2_to_node_0_2_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="local_link_from_router_2_to_node_0_2_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="local_link_from_router_3_to_node_0_3_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="local_link_from_router_3_to_node_0_3_UP" bandwidth="125000000" latency="0.000050000"/>
+> <platform version="4.1">
+> <AS id="world" routing="Full">
+>   <host id="node-0.simgrid.org" speed="1e+09"/>
+>   <host id="node-1002.simgrid.org" speed="1e+09"/>
+>   <host id="node-1003.simgrid.org" speed="1e+09"/>
+>   <host id="node-1004.simgrid.org" speed="1e+09"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_DOWN" bandwidth="3.75e+08" latency="5e-05"/>
+>   <link id="black_link_in_group_0_between_chassis_0_and_1_blade_0_6_UP" bandwidth="3.75e+08" latency="5e-05"/>
+>   <link id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_DOWN" bandwidth="3.75e+08" latency="5e-05"/>
+>   <link id="black_link_in_group_0_between_chassis_0_and_1_blade_1_7_UP" bandwidth="3.75e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_0_limiter" bandwidth="1.5e+08" latency="0"/>
+>   <link id="bob_cluster_link_0_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_1002_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_1003_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_1004_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_1_limiter" bandwidth="1.5e+08" latency="0"/>
+>   <link id="bob_cluster_link_2_limiter" bandwidth="1.5e+08" latency="0"/>
+>   <link id="bob_cluster_link_3_limiter" bandwidth="1.5e+08" latency="0"/>
+>   <link id="bob_cluster_link_4_limiter" bandwidth="1.5e+08" latency="0"/>
+>   <link id="bob_cluster_link_5_limiter" bandwidth="1.5e+08" latency="0"/>
+>   <link id="bob_cluster_link_6_limiter" bandwidth="1.5e+08" latency="0"/>
+>   <link id="bob_cluster_link_7_limiter" bandwidth="1.5e+08" latency="0"/>
+>   <link id="green_link_in_chassis_0_between_routers_0_and_1_4_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="green_link_in_chassis_0_between_routers_0_and_1_4_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="green_link_in_chassis_1_between_routers_0_and_1_5_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="green_link_in_chassis_1_between_routers_0_and_1_5_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="local_link_from_router_0_to_node_0_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="local_link_from_router_0_to_node_0_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="local_link_from_router_1_to_node_0_1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="local_link_from_router_1_to_node_0_1_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="local_link_from_router_2_to_node_0_2_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="local_link_from_router_2_to_node_0_2_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="local_link_from_router_3_to_node_0_3_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="local_link_from_router_3_to_node_0_3_UP" bandwidth="1.25e+08" latency="5e-05"/>
 >   <route src="node-0.simgrid.org" dst="node-0.simgrid.org">
 >   <link_ctn id="bob_cluster_link_0_loopback"/>
 >   </route>
@@ -1283,49 +1283,49 @@ $ ${bindir:=.}/flatifier ./cluster_dragonfly_noncontiguous_rad.xml "--log=root.f
 $ ${bindir:=.}/flatifier ./cluster_fat_tree_noncontiguous_rad.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
-> <AS id="AS0" routing="Full">
->   <host id="node-100.simgrid.org" speed="1000000000"/>
->   <host id="node-101.simgrid.org" speed="1000000000"/>
->   <host id="node-119.simgrid.org" speed="1000000000"/>
->   <host id="node-120.simgrid.org" speed="1000000000"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_0_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_100_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_101_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_119_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_120_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_1_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_2_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_3_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_4_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_5_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_6_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_7_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="link_from_0_7_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_0_7_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_1_7_1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_1_7_1_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_2_6_2_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_2_6_2_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_3_6_3_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_3_6_3_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_6_4_10_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_6_4_10_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_6_4_11_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_6_4_11_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_6_5_8_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_6_5_8_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_6_5_9_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_6_5_9_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_7_4_6_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_7_4_6_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_7_4_7_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_7_4_7_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_7_5_4_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_7_5_4_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_7_5_5_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link_from_7_5_5_UP" bandwidth="125000000" latency="0.000050000"/>
+> <platform version="4.1">
+> <AS id="world" routing="Full">
+>   <host id="node-100.simgrid.org" speed="1e+09"/>
+>   <host id="node-101.simgrid.org" speed="1e+09"/>
+>   <host id="node-119.simgrid.org" speed="1e+09"/>
+>   <host id="node-120.simgrid.org" speed="1e+09"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_0_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="bob_cluster_link_100_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_101_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_119_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_120_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_1_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="bob_cluster_link_2_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="bob_cluster_link_3_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="bob_cluster_link_4_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="bob_cluster_link_5_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="bob_cluster_link_6_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="bob_cluster_link_7_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="link_from_0_7_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_0_7_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_1_7_1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_1_7_1_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_2_6_2_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_2_6_2_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_3_6_3_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_3_6_3_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_6_4_10_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_6_4_10_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_6_4_11_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_6_4_11_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_6_5_8_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_6_5_8_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_6_5_9_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_6_5_9_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_7_4_6_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_7_4_6_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_7_4_7_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_7_4_7_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_7_5_4_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_7_5_4_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_7_5_5_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link_from_7_5_5_UP" bandwidth="1.25e+08" latency="5e-05"/>
 >   <route src="node-100.simgrid.org" dst="node-100.simgrid.org">
 >   <link_ctn id="bob_cluster_link_100_loopback"/>
 >   </route>
@@ -1380,45 +1380,45 @@ $ ${bindir:=.}/flatifier ./cluster_fat_tree_noncontiguous_rad.xml "--log=root.fm
 $ ${bindir:=.}/flatifier ./cluster_torus_noncontiguous_rad.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
-> <AS id="AS0" routing="Full">
->   <host id="node-0.simgrid.org" speed="1000000000"/>
->   <host id="node-1.simgrid.org" speed="1000000000"/>
->   <host id="node-102.simgrid.org" speed="1000000000"/>
->   <host id="node-103.simgrid.org" speed="1000000000"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_0_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_0_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_102_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_103_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_1_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_1_loopback" bandwidth="100000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="bob_cluster_link_2_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_3_limiter" bandwidth="50000000" latency="0.000000000"/>
->   <link id="bob_cluster_link_from_0_to_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_0_to_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_0_to_1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_0_to_1_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_0_to_2_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_0_to_2_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_1_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_3_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_1_to_3_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_0_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_0_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_2_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_2_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_3_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_2_to_3_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_1_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_2_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_2_UP" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_3_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="bob_cluster_link_from_3_to_3_UP" bandwidth="125000000" latency="0.000050000"/>
+> <platform version="4.1">
+> <AS id="world" routing="Full">
+>   <host id="node-0.simgrid.org" speed="1e+09"/>
+>   <host id="node-1.simgrid.org" speed="1e+09"/>
+>   <host id="node-102.simgrid.org" speed="1e+09"/>
+>   <host id="node-103.simgrid.org" speed="1e+09"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_0_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="bob_cluster_link_0_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_102_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_103_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_1_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="bob_cluster_link_1_loopback" bandwidth="1e+08" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="bob_cluster_link_2_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="bob_cluster_link_3_limiter" bandwidth="5e+07" latency="0"/>
+>   <link id="bob_cluster_link_from_0_to_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_0_to_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_0_to_1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_0_to_1_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_0_to_2_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_0_to_2_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_1_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_3_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_1_to_3_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_0_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_0_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_2_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_2_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_3_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_2_to_3_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_1_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_2_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_2_UP" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_3_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="bob_cluster_link_from_3_to_3_UP" bandwidth="1.25e+08" latency="5e-05"/>
 >   <route src="node-0.simgrid.org" dst="node-0.simgrid.org">
 >   <link_ctn id="bob_cluster_link_0_loopback"/>
 >   </route>
@@ -1473,13 +1473,13 @@ $ ${bindir:=.}/flatifier ./cluster_torus_noncontiguous_rad.xml "--log=root.fmt:[
 $ ${bindir:=.}/flatifier ./two_hosts_one_link_splitduplex.xml "--log=root.fmt:[%10.6r]%e[%i:%a@%h]%e%m%n"
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-> <platform version="4">
+> <platform version="4.1">
 > <AS id="AS0" routing="Full">
->   <host id="alice" speed="500000000"/>
->   <host id="bob" speed="1000000000"/>
->   <link id="__loopback__" bandwidth="10000000000" latency="0.000000000" sharing_policy="FATPIPE"/>
->   <link id="link1_DOWN" bandwidth="125000000" latency="0.000050000"/>
->   <link id="link1_UP" bandwidth="125000000" latency="0.000050000"/>
+>   <host id="alice" speed="5e+08"/>
+>   <host id="bob" speed="1e+09"/>
+>   <link id="__loopback__" bandwidth="1e+10" latency="0" sharing_policy="FATPIPE"/>
+>   <link id="link1_DOWN" bandwidth="1.25e+08" latency="5e-05"/>
+>   <link id="link1_UP" bandwidth="1.25e+08" latency="5e-05"/>
 >   <route src="alice" dst="alice">
 >   <link_ctn id="__loopback__"/>
 >   </route>
index 50de5a4..fd238af 100644 (file)
@@ -4,7 +4,6 @@
   <config id="General">
     <prop id="maxmin/precision" value="0.000010"/>
     <prop id="cpu/optim" value="TI"/>
-    <prop id="host/model" value="compound"/>
     <prop id="path" value="~/"/>
   </config>
   <zone  id="AS0"  routing="Full">
index ddcabb8..66e38a4 100644 (file)
@@ -37,13 +37,11 @@ $ ${bindir:=.}/basic-parsing-test ${platfdir:=.}/cloud.xml --log=root.fmt=%m%n
 
 $ ${bindir:=.}/basic-parsing-test ${srcdir:=.}/../../platforms/properties.xml --log=root.fmt=%m%n
 > Configuration change: Set 'cpu/optim' to 'TI'
-> Configuration change: Set 'host/model' to 'compound'
 > Configuration change: Set 'maxmin/precision' to '0.000010'
 > Workstation number: 1, link number: 1
 
 $ ${bindir:=.}/basic-parsing-test ${srcdir:=.}/../../platforms/properties.xml --cfg=cpu/optim:TI --log=root.fmt=%m%n
 > Configuration change: Set 'cpu/optim' to 'TI'
 > The custom configuration 'cpu/optim' is already defined by user!
-> Configuration change: Set 'host/model' to 'compound'
 > Configuration change: Set 'maxmin/precision' to '0.000010'
 > Workstation number: 1, link number: 1
index 6899622..41e6267 100644 (file)
@@ -4,8 +4,7 @@ p c=cycle s=step p=priority h=host
 p Testing trace integration using trace_B.txt and test-hbp1-c0s0-c0s1.xml, test_trace:start == trace_cycle_0_step_0, test_trace:end < trace_cycle_0_step_1
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s0-c0s1.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s0-c0s1.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [  0.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -16,8 +15,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1
 p Testing trace integration using trace_B.txt and test-hbp1-c0s1-c0s2.xml, test_trace:start == trace_cycle_0_step_1, test_trace:end < trace_cycle_0_step_2
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s1-c0s2.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s1-c0s2.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -28,8 +26,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1
 p Testing trace integration using trace_B.txt and test-hbp1-c0s2-c1s0.xml, test_trace:start == trace_cycle_0_step_2, test_trace:end < trace_cycle_1_step_0
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s2-c1s0.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s2-c1s0.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 20.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -40,8 +37,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1
 p Testing trace integration using trace_B.txt and test-hbp1-c0s0-c1s0.xml, test_trace:start == trace_cycle_0_step_0, test_trace:end < trace_cycle_1_step_0
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s0-c1s0.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s0-c1s0.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [  0.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -52,8 +48,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1
 p Testing trace integration using trace_B.txt and test-hbp1-c0s2-c1s1.xml, test_trace:start == trace_cycle_0_step_2, test_trace:end < trace_cycle_1_step_1
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s2-c1s1.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s2-c1s1.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 20.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -64,8 +59,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1
 p Testing trace integration using trace_B.txt and test-hbp1-c0s1-c2s2.xml, test_trace:start == trace_cycle_0_step_1, test_trace:end < trace_cycle_2_step_2
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s1-c2s2.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c0s1-c2s2.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -76,8 +70,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1
 p Testing trace integration using trace_B.txt and test-hbp1-c1s1-c1s2.xml, test_trace:start == trace_cycle_1_step_1, test_trace:end < trace_cycle_1_step_2
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c1s1-c1s2.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c1s1-c1s2.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 40.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -88,8 +81,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1
 p Testing trace integration using trace_B.txt and test-hbp1-c1s1-c3s2.xml, test_trace:start == trace_cycle_1_step_1, test_trace:end < trace_cycle_3_step_2
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c1s1-c3s2.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1-c1s1-c3s2.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 40.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -100,8 +92,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1
 p Testing trace integration using trace_B.txt and test-hbp1.5-hbp1.5.xml, two process with same priority
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1.5-hbp1.5.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1.5-hbp1.5.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -116,8 +107,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1
 p Testing trace integration using trace_B.txt and test-hbp2.5-hbp1.5.xml, two process with different priority
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp2.5-hbp1.5.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp2.5-hbp1.5.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -132,8 +122,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp2
 p Testing trace integration using trace_B.txt and test-hbp2.5-hbp1.5.xml, two process with different priority (included)
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_platform_with_availability_included.xml  ${srcdir:=.}/test-hbp2.5-hbp1.5.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_platform_with_availability_included.xml  ${srcdir:=.}/test-hbp2.5-hbp1.5.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -148,8 +137,7 @@ $ ./trace-integration ${platfdir}/two_hosts_platform_with_availability_included.
 p Testing trace integration using trace_B.txt and test-hbp1.0-hbp1.0-hbp1.0.xml, three process with same priority
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1.0-hbp1.0-hbp1.0.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1.0-hbp1.0-hbp1.0.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [  0.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -168,8 +156,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1
 p Testing trace integration using trace_B.txt and test-hbp1.0-hbp3.0-hbp4.0.xml, three process with different priority
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1.0-hbp3.0-hbp4.0.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1.0-hbp3.0-hbp4.0.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
@@ -188,8 +175,7 @@ $ ./trace-integration ${platfdir}/two_hosts_profiles.xml  ${srcdir:=.}/test-hbp1
 p Testing trace integration using trace_B.txt and test-hbp1.0-hbp3.0-hbp4.0.xml, three process with different priority (included)
 
 ! output sort
-$ ./trace-integration ${platfdir}/two_hosts_platform_with_availability_included.xml  ${srcdir:=.}/test-hbp1.0-hbp3.0-hbp4.0.xml --cfg=host/model:compound --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'compound'
+$ ./trace-integration ${platfdir}/two_hosts_platform_with_availability_included.xml  ${srcdir:=.}/test-hbp1.0-hbp3.0-hbp4.0.xml --cfg=network/model:CM02 --cfg=cpu/optim:TI  "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
 > [  0.000000] (0:maestro@) Configuration change: Set 'cpu/optim' to 'TI'
 > [ 10.000000] (1:test_trace@Cpu B) Testing the trace integration cpu model: CpuTI
index 09a186e..ccab38b 100644 (file)
@@ -133,7 +133,7 @@ int main(int argc, char* argv[])
   XBT_INFO("Parmap benchmark with %d workers (modes = %#x)...", nthreads, modes);
   XBT_INFO("%s", "");
 
-  simgrid::kernel::context::set_nthreads(nthreads);
+  simgrid::kernel::context::Context::set_nthreads(nthreads);
 
   XBT_INFO("Benchmark for parmap create+apply+destroy (small comp):");
   bench_all_modes(nthreads, timeout, modes, true, &fun_small_comp);
index c7558c9..e79cb39 100644 (file)
@@ -88,7 +88,7 @@ int main(int argc, char** argv)
   int status = 0;
   xbt_log_control_set("parmap_test.fmt:[%c/%p]%e%m%n");
   simgrid::s4u::Engine e(&argc, argv);
-  simgrid::kernel::context::set_nthreads(16); // dummy value > 1
+  simgrid::kernel::context::Context::set_nthreads(16); // dummy value > 1
 
   XBT_INFO("Basic testing posix");
   status += test_parmap_basic(XBT_PARMAP_POSIX);
index 3711fbd..8bb7958 100644 (file)
@@ -359,7 +359,6 @@ set(SURF_SRC
   src/surf/network_constant.cpp
   src/surf/ptask_L07.cpp
   src/surf/sg_platf.cpp
-  src/surf/surf_interface.cpp
   src/surf/xml/platf.hpp
   src/surf/xml/platf_private.hpp
   src/surf/xml/surfxml_parseplatf.cpp
@@ -469,6 +468,8 @@ set(S4U_SRC
 
 set(SIMGRID_SRC
   src/simgrid/Exception.cpp
+  src/simgrid/module.cpp
+  src/simgrid/module.hpp
   src/simgrid/sg_config.cpp
   src/simgrid/sg_version.cpp
   src/simgrid/util.hpp