Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add doc about parallel tasks. fix some warning in plugins doc
authorAdrien Gougeon <adrien.gougeon@ens-rennes.fr>
Thu, 21 Sep 2023 13:30:29 +0000 (15:30 +0200)
committerAdrien Gougeon <adrien.gougeon@ens-rennes.fr>
Thu, 21 Sep 2023 13:30:29 +0000 (15:30 +0200)
docs/source/Plugins.rst
docs/source/app_s4u.rst
include/simgrid/s4u/Task.hpp
src/plugins/battery.cpp
src/plugins/chiller.cpp
src/s4u/s4u_Task.cpp

index 87ba3a8..5212c9c 100644 (file)
@@ -220,7 +220,7 @@ File System
 .. _plugin_battery:
 
 Battery
 .. _plugin_battery:
 
 Battery
-===========
+=======
 
 .. doxygengroup:: plugin_battery
 
 
 .. doxygengroup:: plugin_battery
 
@@ -232,8 +232,10 @@ Photovoltaic
 .. doxygengroup:: plugin_photovoltaic
 
 Chiller
 .. doxygengroup:: plugin_photovoltaic
 
 Chiller
-===========
+=======
 
 .. doxygengroup:: plugin_chiller
 
 
 .. doxygengroup:: plugin_chiller
 
+   .. doxygentypedef:: ChillerPtr
+
 ..  LocalWords:  SimGrid
 ..  LocalWords:  SimGrid
index 4a0f3fe..23e0e04 100644 (file)
@@ -206,9 +206,17 @@ concept of |API_s4u_Tasks|, that can be seen as repeatable activities. A Dataflo
 is defined as a graph of |API_s4u_Tasks| through which circulate Tokens. Tokens
 can carry any user-defined data, using the same internal mechanisms as for the
 other simulated objects. Each Task has to receive a token from each of its
 is defined as a graph of |API_s4u_Tasks| through which circulate Tokens. Tokens
 can carry any user-defined data, using the same internal mechanisms as for the
 other simulated objects. Each Task has to receive a token from each of its
-predecessor to fire a new instance of a |API_s4u_Comm|, |API_s4u_Exec|, or
-|API_s4u_Io| activity. On completion of this activity, the Task propagates tokens
+predecessor to fire a new instance of a :ref:`Communication <API_s4u_Comm>`,
+:ref:`Execution <API_s4u_Exec>`, or :ref:`I/O <API_s4u_Io>` activity.
+On completion of this activity, the Task propagates tokens
 to its successors, and waits for the next set of tokens to arrive.
 to its successors, and waits for the next set of tokens to arrive.
+Multiple instances of the same Task can run in parallel by adjusting its
+horizontal scaling with
+:cpp:func:`s4u::Task::set_parallelism_degree() <simgrid::s4u::Task::set_parallelism_degree>`.
+
+:ref:`Communications <API_s4u_Comm>` (started on Mailboxes and consuming links),
+:ref:`Executions <API_s4u_Exec>` (started on Host and consuming CPU resources)
+:ref:`I/O <API_s4u_Io>` (started on and consuming disks).
 
 To initiate the execution of a Dataflow, it is possible to some make
 |API_s4u_Tasks| fire one or more activities without waiting for any token with the
 
 To initiate the execution of a Dataflow, it is possible to some make
 |API_s4u_Tasks| fire one or more activities without waiting for any token with the
@@ -2583,7 +2591,7 @@ class Task
 **Known subclasses:**
 :ref:`Communication Tasks <API_s4u_CommTask>`,
 :ref:`Executions Tasks <API_s4u_ExecTask>`,
 **Known subclasses:**
 :ref:`Communication Tasks <API_s4u_CommTask>`,
 :ref:`Executions Tasks <API_s4u_ExecTask>`,
-:ref:`I/O Tasks <API_s4u_Task>`.
+:ref:`I/O Tasks <API_s4u_IoTask>`.
 See also the :ref:`section on activities <s4u_Tasks>` above.
 
 Basic management
 See also the :ref:`section on activities <s4u_Tasks>` above.
 
 Basic management
@@ -2610,7 +2618,10 @@ Querying info
       .. doxygenfunction:: simgrid::s4u::Task::get_name() const
       .. doxygenfunction:: simgrid::s4u::Task::get_count() const
       .. doxygenfunction:: simgrid::s4u::Task::get_amount() const
       .. doxygenfunction:: simgrid::s4u::Task::get_name() const
       .. doxygenfunction:: simgrid::s4u::Task::get_count() const
       .. doxygenfunction:: simgrid::s4u::Task::get_amount() const
+      .. doxygenfunction:: simgrid::s4u::Task::get_parallelism_degree() const
+      .. doxygenfunction:: simgrid::s4u::Task::set_name(std::string name)
       .. doxygenfunction:: simgrid::s4u::Task::set_amount(double amount)
       .. doxygenfunction:: simgrid::s4u::Task::set_amount(double amount)
+      .. doxygenfunction:: simgrid::s4u::Task::set_parallelism_degree(int n)
 
 Life cycle
 ----------
 
 Life cycle
 ----------
@@ -2637,8 +2648,8 @@ Managing Tokens
 .. tabs::
 
    .. group-tab:: C++
 .. tabs::
 
    .. group-tab:: C++
-      .. doxygenfunction:: simgrid::s4u::Task::set_token(std::shared_ptr<Token> token)
       .. doxygenfunction:: simgrid::s4u::Task::get_next_token_from(TaskPtr t)
       .. doxygenfunction:: simgrid::s4u::Task::get_next_token_from(TaskPtr t)
+      .. doxygenfunction:: simgrid::s4u::Task::set_token(std::shared_ptr<Token> token)
 
 Signals
 -------
 
 Signals
 -------
@@ -2653,9 +2664,9 @@ Signals
 
 .. _API_s4u_CommTask:
 
 
 .. _API_s4u_CommTask:
 
-================
+=================
 ⁣  class CommTask
 ⁣  class CommTask
-================
+=================
 .. tabs::
 
    .. group-tab:: C++
 .. tabs::
 
    .. group-tab:: C++
@@ -2682,19 +2693,19 @@ Querying info
 
    .. group-tab:: C++
 
 
    .. group-tab:: C++
 
-      .. doxygenfunction:: simgrid::s4u::Task::get_source() const
-      .. doxygenfunction:: simgrid::s4u::Task::get_destination() const
-      .. doxygenfunction:: simgrid::s4u::Task::get_bytes() const
-      .. doxygenfunction:: simgrid::s4u::Task::set_source(simgrid::s4u::Host* source);
-      .. doxygenfunction:: simgrid::s4u::Task::set_destination(simgrid::s4u::Host* destination);
-      .. doxygenfunction:: simgrid::s4u::Task::set_bytes(double bytes)
+      .. doxygenfunction:: simgrid::s4u::CommTask::get_source() const
+      .. doxygenfunction:: simgrid::s4u::CommTask::get_destination() const
+      .. doxygenfunction:: simgrid::s4u::CommTask::get_bytes() const
+      .. doxygenfunction:: simgrid::s4u::CommTask::set_source(Host* source);
+      .. doxygenfunction:: simgrid::s4u::CommTask::set_destination(Host* destination);
+      .. doxygenfunction:: simgrid::s4u::CommTask::set_bytes(double bytes)
 
 
 .. _API_s4u_ExecTask:
 
 
 
 .. _API_s4u_ExecTask:
 
-================
+=================
 ⁣  class ExecTask
 ⁣  class ExecTask
-================
+=================
 .. tabs::
 
    .. group-tab:: C++
 .. tabs::
 
    .. group-tab:: C++
@@ -2721,10 +2732,10 @@ Querying info
 
    .. group-tab:: C++
 
 
    .. group-tab:: C++
 
-      .. doxygenfunction:: simgrid::s4u::Task::get_host() const
-      .. doxygenfunction:: simgrid::s4u::Task::get_flops() const
-      .. doxygenfunction:: simgrid::s4u::Task::set_host(simgrid::s4u::Host* host);
-      .. doxygenfunction:: simgrid::s4u::Task::set_flops(double flops);
+      .. doxygenfunction:: simgrid::s4u::ExecTask::get_host() const
+      .. doxygenfunction:: simgrid::s4u::ExecTask::get_flops() const
+      .. doxygenfunction:: simgrid::s4u::ExecTask::set_host(Host* host);
+      .. doxygenfunction:: simgrid::s4u::ExecTask::set_flops(double flops);
 
 .. _API_s4u_IoTask:
 
 
 .. _API_s4u_IoTask:
 
@@ -2757,12 +2768,12 @@ Querying info
 
    .. group-tab:: C++
 
 
    .. group-tab:: C++
 
-     .. doxygenfunction:: simgrid::s4u::Task::get_disk() const
-     .. doxygenfunction:: simgrid::s4u::Task::get_bytes() const
-     .. doxygenfunction:: simgrid::s4u::Task::get_op_type() const
-     .. doxygenfunction:: simgrid::s4u::Task::set_disk(simgrid::s4u::Disk* disk);
-     .. doxygenfunction:: simgrid::s4u::Task::set_bytes(simgrid::double bytes);
-     .. doxygenfunction:: simgrid::s4u::Task::set_op_type(simgrid::s4u::Io::OpType type);
+     .. doxygenfunction:: simgrid::s4u::IoTask::get_disk() const
+     .. doxygenfunction:: simgrid::s4u::IoTask::get_bytes() const
+     .. doxygenfunction:: simgrid::s4u::IoTask::get_op_type() const
+     .. doxygenfunction:: simgrid::s4u::IoTask::set_disk(Disk* disk);
+     .. doxygenfunction:: simgrid::s4u::IoTask::set_bytes(double bytes);
+     .. doxygenfunction:: simgrid::s4u::IoTask::set_op_type(Io::OpType type);
 
 .. _API_s4u_Synchronizations:
 
 
 .. _API_s4u_Synchronizations:
 
index 36e6e0d..f2b6eb6 100644 (file)
@@ -67,7 +67,7 @@ public:
   double get_amount() const { return amount_; }
   int get_count() const { return count_; }
   void set_parallelism_degree(int n);
   double get_amount() const { return amount_; }
   int get_count() const { return count_; }
   void set_parallelism_degree(int n);
-  int get_parallelism_degree() { return parallelism_degree_; }
+  int get_parallelism_degree() const { return parallelism_degree_; }
 
   void set_token(std::shared_ptr<Token> token);
   std::shared_ptr<Token> get_next_token_from(TaskPtr t);
 
   void set_token(std::shared_ptr<Token> token);
   std::shared_ptr<Token> get_next_token_from(TaskPtr t);
index 73da963..412b69e 100644 (file)
@@ -71,14 +71,14 @@ continuous use of the battery alternating between charge and discharge:
 The natural depletion of batteries over time is not taken into account.
 
 Loads & Hosts
 The natural depletion of batteries over time is not taken into account.
 
 Loads & Hosts
-..............
+.............
 
 You can add named loads to a battery. Those loads may be positive and consume energy from the battery, or negative and
 provide energy to the battery. You can also connect hosts to a battery. Theses hosts will consume their energy from the
 battery until the battery is empty or until the connection between the hosts and the battery is set inactive.
 
 Handlers
 
 You can add named loads to a battery. Those loads may be positive and consume energy from the battery, or negative and
 provide energy to the battery. You can also connect hosts to a battery. Theses hosts will consume their energy from the
 battery until the battery is empty or until the connection between the hosts and the battery is set inactive.
 
 Handlers
-......
+........
 
 You can schedule handlers that will happen at specific SoC of the battery and trigger a callback.
 Theses handlers may be recurrent, for instance you may want to always set all loads to zero and deactivate all hosts
 
 You can schedule handlers that will happen at specific SoC of the battery and trigger a callback.
 Theses handlers may be recurrent, for instance you may want to always set all loads to zero and deactivate all hosts
@@ -389,7 +389,7 @@ double Battery::get_energy_stored(std::string unit)
  *  @param state_of_charge The state of charge at which the Handler will happen.
  *  @param flow The flow in which the Handler will happen, either when the Battery is charging or discharging.
  *  @param callback The callable to trigger when the Handler happen.
  *  @param state_of_charge The state of charge at which the Handler will happen.
  *  @param flow The flow in which the Handler will happen, either when the Battery is charging or discharging.
  *  @param callback The callable to trigger when the Handler happen.
- *  @param Persistancy If the Handler is recurrent or unique.
+ *  @param p If the Handler is recurrent or unique.
  *  @return A shared pointer of the new Handler.
  */
 std::shared_ptr<Battery::Handler> Battery::schedule_handler(double state_of_charge, Flow flow, Handler::Persistancy p,
  *  @return A shared pointer of the new Handler.
  */
 std::shared_ptr<Battery::Handler> Battery::schedule_handler(double state_of_charge, Flow flow, Handler::Persistancy p,
index 8000377..501f155 100644 (file)
@@ -21,7 +21,7 @@ SIMGRID_REGISTER_PLUGIN(chiller, "Chiller management", nullptr)
 This is the chiller plugin, enabling management of chillers.
 
 Chiller
 This is the chiller plugin, enabling management of chillers.
 
 Chiller
-....................
+.......
 
 A chiller is placed inside a room with several machines. The role of the chiller is to keep the temperature of the room
 below a threshold. This plugin and its equations are based on the paper "Co-simulation of FMUs and Distributed
 
 A chiller is placed inside a room with several machines. The role of the chiller is to keep the temperature of the room
 below a threshold. This plugin and its equations are based on the paper "Co-simulation of FMUs and Distributed
index d84357f..7b04687 100644 (file)
@@ -19,6 +19,8 @@ Tasks can only be instancied using either
 An ExecTask is an Execution Task. Its underlying Activity is an :ref:`Exec <API_s4u_Exec>`.
 A CommTask is a Communication Task. Its underlying Activity is a :ref:`Comm <API_s4u_Comm>`.
 
 An ExecTask is an Execution Task. Its underlying Activity is an :ref:`Exec <API_s4u_Exec>`.
 A CommTask is a Communication Task. Its underlying Activity is a :ref:`Comm <API_s4u_Comm>`.
 
+
+
   @endrst
  */
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(Task, kernel, "Logging specific to the task plugin");
   @endrst
  */
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(Task, kernel, "Logging specific to the task plugin");