Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make Engine::set_config(...) static functions.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 2 Jul 2020 13:17:04 +0000 (15:17 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 2 Jul 2020 13:55:57 +0000 (15:55 +0200)
docs/source/Configuring_SimGrid.rst
examples/s4u/actor-stacksize/s4u-actor-stacksize.cpp
examples/s4u/energy-exec-ptask/s4u-energy-exec-ptask.cpp
include/simgrid/s4u/Engine.hpp

index a419959..e7a9685 100644 (file)
@@ -67,7 +67,7 @@ with :cpp:func:`simgrid::s4u::Engine::set_config` or :cpp:func:`MSG_config`.
    int main(int argc, char *argv[]) {
      simgrid::s4u::Engine e(&argc, argv);
 
-     e.set_config("Item:Value");
+     simgrid::s4u::Engine::set_config("Item:Value");
 
      // Rest of your code
    }
index 3d9a77e..e38cb2b 100644 (file)
@@ -24,12 +24,12 @@ int main(int argc, char* argv[])
 
   // You can use set_config(string) to pass a size that will be parsed. That value will be used for any subsequent
   // actors
-  e.set_config("contexts/stack-size:16384");
+  simgrid::s4u::Engine::set_config("contexts/stack-size:16384");
   simgrid::s4u::Actor::create("actor", simgrid::s4u::Host::by_name("Tremblay"), actor);
   simgrid::s4u::Actor::create("actor", simgrid::s4u::Host::by_name("Tremblay"), actor);
 
   // You can use set_config(key, value) for the same effect.
-  e.set_config("contexts/stack-size", 32 * 1024);
+  simgrid::s4u::Engine::set_config("contexts/stack-size", 32 * 1024);
   simgrid::s4u::Actor::create("actor", simgrid::s4u::Host::by_name("Tremblay"), actor);
   simgrid::s4u::Actor::create("actor", simgrid::s4u::Host::by_name("Tremblay"), actor);
 
index db14d38..1fe84f2 100644 (file)
@@ -134,7 +134,7 @@ int main(int argc, char* argv[])
 {
   sg_host_energy_plugin_init();
   simgrid::s4u::Engine e(&argc, argv);
-  e.set_config("host/model:ptask_L07");
+  simgrid::s4u::Engine::set_config("host/model:ptask_L07");
 
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/energy_platform.xml\n", argv[0], argv[0]);
 
index 58e0e8f..8903b10 100644 (file)
@@ -159,13 +159,13 @@ public:
    * @endrst
    *
    * Example:
-   * e->set_config("host/model:ptask_L07");
+   * simgrid::s4u::Engine::set_config("host/model:ptask_L07");
    */
-  void set_config(const std::string& str);
-  void set_config(const std::string& name, int value);
-  void set_config(const std::string& name, bool value);
-  void set_config(const std::string& name, double value);
-  void set_config(const std::string& name, const std::string& value);
+  static void set_config(const std::string& str);
+  static void set_config(const std::string& name, int value);
+  static void set_config(const std::string& name, bool value);
+  static void set_config(const std::string& name, double value);
+  static void set_config(const std::string& name, const std::string& value);
 
   /** Callback fired when the platform is created (ie, the xml file parsed),
    * right before the actual simulation starts. */