Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
authormlaurent <mathieu.laurent@ens-rennes.fr>
Thu, 16 Feb 2023 09:09:38 +0000 (10:09 +0100)
committermlaurent <mathieu.laurent@ens-rennes.fr>
Thu, 16 Feb 2023 09:09:38 +0000 (10:09 +0100)
32 files changed:
ChangeLog
MANIFEST.in
docs/source/Configuring_SimGrid.rst
docs/source/Installing_SimGrid.rst
examples/c/comm-pingpong/comm-pingpong.tesh
examples/cpp/comm-pingpong/s4u-comm-pingpong.tesh
examples/platforms/config.xml
include/xbt/utility.hpp
src/kernel/resource/VirtualMachineImpl.cpp
src/kernel/routing/NetZoneImpl.cpp
src/mc/api/ActorState.hpp
src/mc/api/RemoteApp.cpp
src/mc/api/State.cpp
src/mc/api/State.hpp
src/mc/remote/AppSide.cpp
src/mc/remote/Channel.cpp
src/mc/remote/mc_protocol.h
src/simgrid/module.cpp
src/simgrid/module.hpp
src/simgrid/sg_config.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/ptask_L07.cpp
src/surf/surf_interface.cpp [deleted file]
src/surf/surf_interface.hpp
teshsuite/platforms/properties.xml
teshsuite/s4u/basic-parsing-test/basic-parsing-test.tesh
teshsuite/s4u/trace-integration/trace-integration.tesh
tools/cmake/DefinePackages.cmake

index 99a7e6a..a70a5dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,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.
@@ -48,7 +50,8 @@ 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 3800775..4ca7368 100644 (file)
@@ -2435,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 dd985e2..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.
index 86d9a60..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:
 
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 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 34dc34e..bb599d6 100644 (file)
     constexpr std::array<const char*, _XBT_COUNT_ARGS(__VA_ARGS__)> names{{_XBT_STRINGIFY_ARGS(__VA_ARGS__)}};         \
     return names.at(static_cast<int>(value));                                                                          \
   }                                                                                                                    \
+  static constexpr bool is_valid_##EnumType(int raw_value)                                                             \
+  {                                                                                                                    \
+    return raw_value >= 0 && raw_value < _XBT_COUNT_ARGS(__VA_ARGS__);                                                 \
+  }                                                                                                                    \
   enum class EnumType { __VA_ARGS__ } /* defined here to handle trailing semicolon */
 
 namespace simgrid {
@@ -76,6 +80,6 @@ template <class List, class Elem> inline void intrusive_erase(List& list, Elem&
   list.erase(list.iterator_to(elem));
 }
 
-}
-}
+} // namespace xbt
+} // namespace simgrid
 #endif
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 fa210c3..57db71f 100644 (file)
@@ -24,41 +24,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_platform, kernel, "Kernel platform-related i
 
 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");
-
-    surf_cpu_model_description.by_name(cpu_model_name).init();
-    surf_disk_model_description.by_name(disk_model_name).init();
-    simgrid_network_models().by_name(network_model_name).init();
-  }
-
-  surf_host_model_description.by_name(host_model_name).init();
-
-  XBT_DEBUG("Call vm_model_init");
-  /* TODO: ideally we should get back the pointer to CpuModel from init(), but this
-   * requires changing the declaration of surf_cpu_model_description. */
-  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)>
@@ -83,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 b71ccbd..e6be7ed 100644 (file)
@@ -9,15 +9,56 @@
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/mc/remote/RemotePtr.hpp"
 
+#include <exception>
+#include <vector>
+
 namespace simgrid::mc {
 
 /* On every state, each actor has an entry of the following type.
- * This represents both the actor and its transition because
- *   an actor cannot have more than one enabled transition at a given time.
+ * This usually represents both the actor and its transition because
+ * most of the time an actor cannot have more than one enabled transition
+ * at a given time. However, certain transitions have multiple "paths"
+ * that can be followed, which means that a given actor may be able
+ * to do more than one thing at a time.
+ *
+ * Formally, at this state multiple transitions would exist all of
+ * which happened to be executed by the same actor. This distinction
+ * is important in cases
  */
 class ActorState {
+
+  /**
+   * @brief The transitions that the actor is allowed to execute from this
+   * state, viz. those that are enabled for this actor
+   *
+   * Most actors can take only a single action from any given state.
+   * However, when an actor executes a transition with multiple
+   * possible variations (e.g. an MC_Random() [see class: RandomTransition]
+   * for more details]), multiple enabled actions are defined
+   *
+   * @invariant The transitions are arranged such that an actor
+   * with multiple possible paths of execution will contain all
+   * such transitions such that `pending_transitions_[i]` represents
+   * the variation of the transition with `times_considered = i`.
+   *
+   * TODO: If only a subset of transitions of an actor that can
+   * take multiple transitions in some state are truly enabled,
+   * we would instead need to map `times_considered` to a transition,
+   * as the map is currently implicit in the ordering of the transitions
+   * in the vector
+   *
+   * TODO: If a single transition is taken at a time in a concurrent system,
+   * then nearly all of the transitions from in a state `s'` after taking
+   * an action `t` from state `s`  (i.e. s -- t --> s') are the same
+   * sans for the new transition of the actor which just executed t.
+   * This means there may be a way to store the list once and apply differences
+   * rather than repeating elements frequently.
+   */
+  std::vector<std::unique_ptr<Transition>> pending_transitions_;
+
   /* Possible exploration status of an actor transition in a state.
-   * Either the checker did not consider the transition, or it was considered and still to do, or considered and done.
+   * Either the checker did not consider the transition, or it was considered and still to do, or considered and
+   * done.
    */
   enum class InterleavingType {
     /** This actor transition is not considered by the checker (yet?) */
@@ -44,8 +85,10 @@ class ActorState {
   bool enabled_;
 
 public:
-  ActorState(aid_t aid, bool enabled, unsigned int max_consider)
-      : aid_(aid), max_consider_(max_consider), enabled_(enabled)
+  ActorState(aid_t aid, bool enabled, unsigned int max_consider) : ActorState(aid, enabled, max_consider, {}) {}
+
+  ActorState(aid_t aid, bool enabled, unsigned int max_consider, std::vector<std::unique_ptr<Transition>> transitions)
+      : pending_transitions_(std::move(transitions)), aid_(aid), max_consider_(max_consider), enabled_(enabled)
   {
   }
 
@@ -71,6 +114,24 @@ public:
     this->times_considered_ = 0;
   }
   void mark_done() { this->state_ = InterleavingType::done; }
+
+  inline Transition* get_transition(unsigned times_considered)
+  {
+    xbt_assert(times_considered < this->pending_transitions_.size(),
+               "Actor %lu does not have a state available transition with `times_considered = %d`,\n"
+               "yet one was asked for",
+               aid_, times_considered);
+    return this->pending_transitions_[times_considered].get();
+  }
+
+  inline void set_transition(std::unique_ptr<Transition> t, unsigned times_considered)
+  {
+    xbt_assert(times_considered < this->pending_transitions_.size(),
+               "Actor %lu does not have a state available transition with `times_considered = %d`, "
+               "yet one was attempted to be set",
+               aid_, times_considered);
+    this->pending_transitions_[times_considered] = std::move(t);
+  }
 };
 
 } // namespace simgrid::mc
index d9f5782..0850297 100644 (file)
 #include "xbt/log.h"
 #include "xbt/system_error.hpp"
 
+#include <algorithm>
 #include <array>
 #include <boost/tokenizer.hpp>
 #include <memory>
+#include <numeric>
 #include <string>
 
 #include <fcntl.h>
@@ -159,6 +161,13 @@ unsigned long RemoteApp::get_maxpid() const
 
 void RemoteApp::get_actors_status(std::map<aid_t, ActorState>& whereto) const
 {
+  // The messaging happens as follows:
+  //
+  // CheckerSide                  AppSide
+  // send ACTORS_STATUS ---->
+  //                    <----- send ACTORS_STATUS_REPLY
+  //                    <----- send `N` `s_mc_message_actors_status_one_t` structs
+  //                    <----- send `M` `s_mc_message_simcall_probe_one_t` structs
   s_mc_message_t msg;
   memset(&msg, 0, sizeof msg);
   msg.type = simgrid::mc::MessageType::ACTORS_STATUS;
@@ -180,9 +189,42 @@ void RemoteApp::get_actors_status(std::map<aid_t, ActorState>& whereto) const
     xbt_assert(static_cast<size_t>(received) == size);
   }
 
+  std::vector<s_mc_message_simcall_probe_one_t> action_pool(answer.transition_count);
+  if (answer.transition_count > 0) {
+    size_t size = action_pool.size() * sizeof(s_mc_message_simcall_probe_one_t);
+    received    = model_checker_->channel().receive(action_pool.data(), size);
+    xbt_assert(static_cast<size_t>(received) == size);
+  }
+
+  // Ensures that each actor sends precisely `actor.max_considered` transitions. While technically
+  // this doesn't catch the edge case where actor A sends 3 instead of 2 and actor B sends 2 instead
+  // of 3 transitions, that is ignored here since that invariant needs to be enforced on the AppSide
+  const auto expected_transitions = std::accumulate(
+      status.begin(), status.end(), 0, [](int total, const auto& actor) { return total + actor.n_transitions; });
+  xbt_assert(expected_transitions == static_cast<int>(action_pool.size()),
+             "Expected to receive %d transition(s) but was only notified of %lu by the app side", expected_transitions,
+             action_pool.size());
+
   whereto.clear();
-  for (auto const& actor : status)
-    whereto.try_emplace(actor.aid, actor.aid, actor.enabled, actor.max_considered);
+  auto action_pool_iter = std::move_iterator(action_pool.begin());
+
+  for (const auto& actor : status) {
+    xbt_assert(actor.n_transitions == 0 || actor.n_transitions == actor.max_considered,
+               "If any transitions are serialized for an actor, it must match the "
+               "total number of transitions that can be considered for the actor "
+               "(currently %d), but only %d transition(s) was/were said to be encoded",
+               actor.max_considered, actor.n_transitions);
+
+    auto actor_transitions = std::vector<std::unique_ptr<Transition>>(actor.n_transitions);
+    for (int times_considered = 0; times_considered < actor.n_transitions; times_considered++, action_pool_iter++) {
+      std::stringstream stream((*action_pool_iter).buffer.data());
+      auto transition = std::unique_ptr<Transition>(deserialize_transition(actor.aid, times_considered, stream));
+      actor_transitions[times_considered] = std::move(transition);
+    }
+
+    XBT_DEBUG("Received %d transitions for actor %ld", actor.n_transitions, actor.aid);
+    whereto.try_emplace(actor.aid, actor.aid, actor.enabled, actor.max_considered, std::move(actor_transitions));
+  }
 }
 
 void RemoteApp::check_deadlock() const
index 1e676d4..1b94dcb 100644 (file)
@@ -18,7 +18,6 @@ State::State(const RemoteApp& remote_app) : num_(++expended_states_)
 {
   remote_app.get_actors_status(actors_to_run_);
 
-  transition_.reset(new Transition());
   /* Stateful model checking */
   if ((_sg_mc_checkpoint > 0 && (num_ % _sg_mc_checkpoint == 0)) || _sg_mc_termination) {
     system_state_ = std::make_shared<simgrid::mc::Snapshot>(num_);
@@ -74,7 +73,7 @@ void State::mark_all_todo()
     
 Transition* State::get_transition() const
 {
-  return transition_.get();
+    return transition_;
 }
 
 aid_t State::next_transition() const
@@ -103,16 +102,42 @@ aid_t State::next_transition() const
   }
   return -1;
 }
+
 void State::execute_next(aid_t next)
 {
-  /* This actor is ready to be executed. Prepare its execution when simcall_handle will be called on it */
-  const unsigned times_considered = actors_to_run_.at(next).do_consider();
+  // This actor is ready to be executed. Execution involves three phases:
+
+  // 1. Identify the appropriate ActorState to prepare for execution
+  // when simcall_handle will be called on it
+  auto& actor_state                        = actors_to_run_.at(next);
+  const unsigned times_considered          = actor_state.do_consider();
+  const auto* expected_executed_transition = actor_state.get_transition(times_considered);
+  xbt_assert(expected_executed_transition != nullptr,
+             "Expected a transition with %d times considered to be noted in actor %lu", times_considered, next);
 
   XBT_DEBUG("Let's run actor %ld (times_considered = %u)", next, times_considered);
 
+  // 2. Execute the actor according to the preparation above
   Transition::executed_transitions_++;
+  auto* just_executed = mc_model_checker->handle_simcall(next, times_considered, true);
+  xbt_assert(just_executed->type_ == expected_executed_transition->type_,
+             "The transition that was just executed by actor %lu, viz:\n"
+             "%s\n"
+             "is not what was purportedly scheduled to execute, which was:\n"
+             "%s\n",
+             next, just_executed->to_string().c_str(), expected_executed_transition->to_string().c_str());
+
+  // 3. Update the state with the newest information. This means recording
+  // both
+  //  1. what action was last taken from this state (viz. `executed_transition`)
+  //  2. what action actor `next` was able to take given `times_considered`
+  // The latter update is important as *more* information is potentially available
+  // about a transition AFTER it has executed.
+  transition_ = just_executed;
+
+  auto executed_transition = std::unique_ptr<Transition>(just_executed);
+  actor_state.set_transition(std::move(executed_transition), times_considered);
 
-  transition_.reset(mc_model_checker->handle_simcall(next, times_considered, true));
   mc_model_checker->wait_for_requests();
 }
 } // namespace simgrid::mc
index 71670d3..7fc6510 100644 (file)
@@ -17,13 +17,20 @@ namespace simgrid::mc {
 class XBT_PRIVATE State : public xbt::Extendable<State> {
   static long expended_states_; /* Count total amount of states, for stats */
 
-  /* Outgoing transition: what was the last transition that we took to leave this state? */
-  std::unique_ptr<Transition> transition_;
+  /**
+   * @brief The outgoing transition: what was the last transition that
+   * we took to leave this state?
+   *
+   * The owner of the transition is the `ActorState` instance which exists in this state,
+   * or nullptr if the state represents the root
+   */
+  Transition* transition_ = nullptr;
 
   /** Sequential state ID (used for debugging) */
   long num_ = 0;
 
-  /** State's exploration status by actor. Not all the actors are there, only the ones that are ready-to-run in this state */
+  /** State's exploration status by actor. Not all the actors are there, only the ones that are ready-to-run in this
+   * state */
   std::map<aid_t, ActorState> actors_to_run_;
 
   /** Snapshot of system state (if needed) */
@@ -50,7 +57,7 @@ public:
   void mark_all_todo();
   bool is_done(aid_t actor) const { return actors_to_run_.at(actor).is_done(); }
   Transition* get_transition() const;
-  void set_transition(Transition* t) { transition_.reset(t); }
+  void set_transition(Transition* t) { transition_ = t; }
   std::map<aid_t, ActorState> const& get_actors_list() const { return actors_to_run_; }
 
   unsigned long get_actor_count() const { return actors_to_run_.size(); }
index bad0c1c..80e4c52 100644 (file)
@@ -26,6 +26,7 @@
 #include <cstdlib>
 #include <cstring>
 #include <memory>
+#include <numeric>
 #include <sys/ptrace.h>
 #include <sys/socket.h>
 #include <sys/types.h>
@@ -154,25 +155,72 @@ void AppSide::handle_finalize(const s_mc_message_int_t* msg) const
 void AppSide::handle_actors_status() const
 {
   auto const& actor_list = kernel::EngineImpl::get_instance()->get_actor_list();
-  int count              = actor_list.size();
-  XBT_DEBUG("Serialize the actors to answer ACTORS_STATUS from the checker. %d actors to go.", count);
+  const int num_actors   = actor_list.size();
+  XBT_DEBUG("Serialize the actors to answer ACTORS_STATUS from the checker. %d actors to go.", num_actors);
+
+  std::vector<s_mc_message_actors_status_one_t> status(num_actors);
+  int i                 = 0;
+  int total_transitions = 0;
 
-  struct s_mc_message_actors_status_answer_t answer {
-    MessageType::ACTORS_STATUS_REPLY, count
-  };
-  std::vector<s_mc_message_actors_status_one_t> status(count);
-  int i = 0;
   for (auto const& [aid, actor] : actor_list) {
     status[i].aid            = aid;
     status[i].enabled        = mc::actor_is_enabled(actor);
     status[i].max_considered = actor->simcall_.observer_->get_max_consider();
+    status[i].n_transitions  = mc::actor_is_enabled(actor) ? status[i].max_considered : 0;
+    total_transitions += status[i].n_transitions;
     i++;
   }
+
+  struct s_mc_message_actors_status_answer_t answer {
+    MessageType::ACTORS_STATUS_REPLY, num_actors, total_transitions
+  };
+
   xbt_assert(channel_.send(answer) == 0, "Could not send ACTORS_STATUS_REPLY msg");
   if (answer.count > 0) {
     size_t size = status.size() * sizeof(s_mc_message_actors_status_one_t);
     xbt_assert(channel_.send(status.data(), size) == 0, "Could not send ACTORS_STATUS_REPLY data");
   }
+
+  // Serialize each transition to describe what each actor is doing
+  if (total_transitions > 0) {
+    std::vector<s_mc_message_simcall_probe_one_t> probes(total_transitions);
+    auto probes_iter = probes.begin();
+
+    for (const auto& actor_status : status) {
+      if (not actor_status.enabled)
+        continue;
+
+      const auto& actor        = actor_list.at(actor_status.aid);
+      const int max_considered = actor_status.max_considered;
+
+      for (int times_considered = 0; times_considered < max_considered; times_considered++, probes_iter++) {
+        std::stringstream stream;
+        s_mc_message_simcall_probe_one_t& probe = *probes_iter;
+
+        if (actor->simcall_.observer_ != nullptr) {
+          actor->simcall_.observer_->prepare(times_considered);
+          actor->simcall_.observer_->serialize(stream);
+        } else {
+          stream << (short)mc::Transition::Type::UNKNOWN;
+        }
+
+        std::string str = stream.str();
+        xbt_assert(str.size() + 1 <= probe.buffer.size(),
+                   "The serialized transition is too large for the buffer. Please fix the code.");
+        strncpy(probe.buffer.data(), str.c_str(), probe.buffer.size() - 1);
+        probe.buffer.back() = '\0';
+      }
+      // NOTE: We do NOT need to reset `times_considered` for each actor's
+      // simcall observer here to the "original" value (i.e. the value BEFORE
+      // multiple prepare() calls were made for serialization purposes) since
+      // each SIMCALL_EXECUTE provides a `times_considered` to be used to prepare
+      // the transition before execution.
+    }
+
+    size_t size = probes.size() * sizeof(s_mc_message_simcall_probe_one_t);
+    XBT_DEBUG("Deliver ACTOR_TRANSITION_PROBE payload");
+    xbt_assert(channel_.send(probes.data(), size) == 0, "Could not send ACTOR_TRANSITION_PROBE payload");
+  }
 }
 
 #define assert_msg_size(_name_, _type_)                                                                                \
index ef234a8..60d5989 100644 (file)
@@ -26,23 +26,34 @@ Channel::~Channel()
 /** @brief Send a message; returns 0 on success or errno on failure */
 int Channel::send(const void* message, size_t size) const
 {
-  XBT_DEBUG("Send %s", to_c_str(*(MessageType*)message));
   while (::send(this->socket_, message, size, 0) == -1) {
     if (errno != EINTR) {
       XBT_ERROR("Channel::send failure: %s", strerror(errno));
       return errno;
     }
   }
+
+  if (is_valid_MessageType(*(int*)message)) {
+    XBT_DEBUG("Sending %s (%lu bytes sent)", to_c_str(*(MessageType*)message), size);
+  } else {
+    XBT_DEBUG("Sending bytes directly (from address %p) (%lu bytes sent)", message, size);
+  }
+
   return 0;
 }
 
 ssize_t Channel::receive(void* message, size_t size, bool block) const
 {
   ssize_t res = recv(this->socket_, message, size, block ? 0 : MSG_DONTWAIT);
-  if (res != -1)
-    XBT_DEBUG("Receive %s", to_c_str(*(MessageType*)message));
-  else
+  if (res != -1) {
+    if (is_valid_MessageType(*(int*)message)) {
+      XBT_DEBUG("Receive %s (requested %lu; received %lu)", to_c_str(*(MessageType*)message), size, res);
+    } else {
+      XBT_DEBUG("Receive %lu bytes", res);
+    }
+  } else {
     XBT_ERROR("Channel::receive failure: %s", strerror(errno));
+  }
   return res;
 }
 } // namespace simgrid::mc
index 2f8e34b..156e3c7 100644 (file)
@@ -29,7 +29,7 @@ XBT_DECLARE_ENUM_CLASS(MessageType, NONE, INITIAL_ADDRESSES, CONTINUE, IGNORE_HE
                        FINALIZE_REPLY);
 } // namespace simgrid::mc
 
-constexpr unsigned MC_MESSAGE_LENGTH = 512;
+constexpr unsigned MC_MESSAGE_LENGTH                 = 512;
 constexpr unsigned SIMCALL_SERIALIZATION_BUFFER_SIZE = 2048;
 
 /** Basic structure for a MC message
@@ -104,12 +104,23 @@ struct s_mc_message_restore_t {
 struct s_mc_message_actors_status_answer_t {
   simgrid::mc::MessageType type;
   int count;
+  int transition_count; // The total number of transitions sent as a payload to the checker
 };
 struct s_mc_message_actors_status_one_t { // an array of `s_mc_message_actors_status_one_t[count]` is sent right after
-                                          // after a s_mc_message_actors_status_answer_t
+                                          // after a `s_mc_message_actors_status_answer_t`
   aid_t aid;
   bool enabled;
   int max_considered;
+
+  // The total number of transitions that are serialized and associated with this actor.
+  // Enforced to be either `0` or the same as `max_considered`
+  int n_transitions;
+};
+
+// Answer from an actor to the question "what are you about to run?"
+struct s_mc_message_simcall_probe_one_t { // an array of `s_mc_message_simcall_probe_one_t[n_transitions]
+                                          // is sent right after a `s_mc_message_actors_status_one_t`
+  std::array<char, SIMCALL_SERIALIZATION_BUFFER_SIZE> buffer;
 };
 
 #endif // __cplusplus
index f4ee704..2ed2f70 100644 (file)
@@ -6,6 +6,7 @@
 #include <xbt/asserts.h>
 #include <xbt/log.h>
 
+#include "simgrid/sg_config.hpp"
 #include "src/simgrid/module.hpp"
 #include "src/surf/surf_interface.hpp"
 
@@ -16,6 +17,37 @@ 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));
@@ -47,32 +79,3 @@ std::string ModuleGroup::existing_values() const
   }
   return ss.str();
 }
-
-/* -------------------------------------------------------------------------------------------------------------- */
-simgrid::ModuleGroup surf_optimization_mode_description("optimization mode");
-simgrid::ModuleGroup surf_cpu_model_description("CPU model");
-simgrid::ModuleGroup surf_disk_model_description("disk model");
-simgrid::ModuleGroup surf_host_model_description("host model");
-
-void simgrid_create_models()
-{
-  surf_cpu_model_description.add("Cas01", "Simplistic CPU model (time=size/speed).", &surf_cpu_model_init_Cas01);
-  surf_disk_model_description.add("S19", "Simplistic disk model.", &surf_disk_model_init_S19);
-
-  surf_host_model_description
-      .add("default",
-           "Default host model. Currently, CPU:Cas01, network:LV08 (with cross traffic enabled), and disk:S19",
-           &surf_host_model_init_current_default)
-      .add("compound", "Host model that is automatically chosen if you change the CPU, network, and disk models",
-           &surf_host_model_init_compound)
-      .add("ptask_L07", "Host model somehow similar to Cas01+CM02+S19 but allowing parallel tasks",
-           &surf_host_model_init_ptask_L07);
-
-  surf_optimization_mode_description
-      .add("Lazy", "Lazy action management (partial invalidation in lmm + heap in action remaining).", nullptr)
-      .add("TI",
-           "Trace integration. Highly optimized mode when using availability traces (only available for the Cas01 CPU "
-           "model for now).",
-           nullptr)
-      .add("Full", "Full update of remaining and variables. Slow but may be useful when debugging.", nullptr);
-}
index 2e83c16..ab175ad 100644 (file)
@@ -27,14 +27,19 @@ struct Module {
 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(std::string kind) : kind_(kind) {}
+  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
@@ -44,7 +49,6 @@ public:
   {                                                                                                                    \
     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
 {
@@ -57,11 +61,47 @@ inline auto& simgrid_plugins() // Function to avoid static initialization order
   {                                                                                                                    \
     simgrid_network_models().add(_XBT_STRINGIFY(id), (desc), (init));                                                  \
   }
-/** @brief The list of all available network model (pick one with --cfg=network/model) */
+/** @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 plugins("network model");
-  return plugins;
+  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
\ No newline at end of file
+#endif
index fa7446e..ed9b59a 100644 (file)
@@ -95,14 +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")) {
-      surf_host_model_description.help();
+      simgrid_host_models().help();
       XBT_HELP("%s", "");
-      surf_cpu_model_description.help();
+      simgrid_cpu_models().help();
       XBT_HELP("%s", "");
       simgrid_network_models().help();
-      XBT_HELP("\nLong description of all optimization levels accepted by the models of this simulator:");
-      surf_optimization_mode_description.help();
-      XBT_HELP("Both network and CPU models have 'Lazy' as default optimization level\n");
       shall_exit = true;
     } else if (parse_args && not strcmp(argv[i], "--help-tracing")) {
       TRACE_help();
@@ -119,89 +116,6 @@ 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") {
-    simgrid_plugins().help();
-    exit(0);
-  }
-
-  simgrid_plugins().by_name(value).init();
-}
-
-/* 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") {
-    surf_host_model_description.help();
-    exit(0);
-  }
-
-  /* Make sure that the model exists */
-  surf_host_model_description.by_name(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") {
-    surf_cpu_model_description.help();
-    exit(0);
-  }
-
-  /* Make sure that the model exists */
-  surf_cpu_model_description.by_name(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") {
-    surf_optimization_mode_description.help();
-    exit(0);
-  }
-
-  /* Make sure that the model exists */
-  surf_optimization_mode_description.by_name(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") {
-    surf_disk_model_description.help();
-    exit(0);
-  }
-
-  surf_disk_model_description.by_name(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") {
-    simgrid_network_models().help();
-    exit(0);
-  }
-
-  simgrid_network_models().by_name(value); // Simply ensure that it exists
-}
-
 static void _sg_cfg_cb_contexts_parallel_mode(std::string_view mode_name)
 {
   if (mode_name == "posix") {
@@ -216,18 +130,6 @@ static void _sg_cfg_cb_contexts_parallel_mode(std::string_view mode_name)
   }
 }
 
-/* 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 simgrid::ModuleGroup& model_description, const std::string& type,
-                               const std::string& descr)
-{
-  std::string description = descr + ". Possible values (other compilation flags may activate more " +
-                            model_description.get_kind() + "): " + model_description.existing_values();
-  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)
 {
@@ -236,24 +138,13 @@ void sg_config_init(int *argc, char **argv)
     XBT_WARN("Call to sg_config_init() after initialization ignored");
     return;
   }
-  simgrid_create_models();
-  /* Plugins configuration */
-  declare_model_flag("plugin", "", &_sg_cfg_cb__plugin, simgrid_plugins(), "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, simgrid_network_models(), "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");
+  /* Plugins configuration */
+  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)");
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 acac620..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();
-  simgrid_network_models().by_name("LV08").init();
-}
-
-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 57a7efd..54e369e 100644 (file)
@@ -113,13 +113,24 @@ SIMGRID_REGISTER_NETWORK_MODEL(
     });
 
 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 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)
diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp
deleted file mode 100644 (file)
index b22836e..0000000
+++ /dev/null
@@ -1,23 +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>
-
-/*********
- * Utils *
- *********/
-
-std::vector<std::string> surf_path;
index 0a48400..23bf1e7 100644 (file)
@@ -63,67 +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 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
- *
- */
-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 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 simgrid::ModuleGroup surf_optimization_mode_description;
-/** @brief The list of all cpu models (pick one with --cfg=cpu/model) */
-XBT_PUBLIC_DATA simgrid::ModuleGroup surf_cpu_model_description;
-/** @brief The list of all disk models (pick one with --cfg=disk/model) */
-XBT_PUBLIC_DATA simgrid::ModuleGroup surf_disk_model_description;
-/** @brief The list of all host models (pick one with --cfg=host/model:) */
-XBT_PUBLIC_DATA simgrid::ModuleGroup surf_host_model_description;
-
-void simgrid_create_models();
+XBT_PUBLIC void surf_vm_model_init_HL13();
 
 #endif /* SURF_MODEL_H_ */
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 4310792..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