Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
s4u: implement Engine::setConfig()
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 6 Jul 2017 10:06:54 +0000 (12:06 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 6 Jul 2017 11:17:48 +0000 (13:17 +0200)
doc/doxygen/options.doc
include/simgrid/s4u/Engine.hpp
src/s4u/s4u_engine.cpp

index 1e11522..879a1bf 100644 (file)
@@ -42,7 +42,7 @@ file:
 
 A last solution is to pass your configuration directly using the C
 interface. If you happen to use the MSG interface, this is very easy
-with the MSG_config() function. If you do not use MSG, that's a bit
+with the simgrid::s4u::Engine::setConfig() or MSG_config() functions. If you do not use MSG, that's a bit
 more complex, as you have to mess with the internal configuration set
 directly as follows. Check the \ref XBT_config "relevant page" for
 details on all the functions you can use in this context, \c
index feef402..a42beca 100644 (file)
@@ -100,6 +100,15 @@ public:
   /** Returns whether SimGrid was initialized yet -- mostly for internal use */
   static bool isInitialized();
 
+  /** @brief set a configuration variable
+   *
+   * Do --help on any simgrid binary to see the list of currently existing configuration variables (see @ref options).
+   *
+   * Example:
+   * e->setConfig("host/model","ptask_L07");
+   */
+  void setConfig(std::string str);
+
   simgrid::kernel::EngineImpl* pimpl;
 
 private:
index 2e7de0a..0e983e8 100644 (file)
@@ -158,5 +158,9 @@ bool Engine::isInitialized()
 {
   return Engine::instance_ != nullptr;
 }
+void Engine::setConfig(std::string str)
+{
+  xbt_cfg_set_parse(str.c_str());
+}
 }
 } // namespace