X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3f756b051175054c62c4741fdab2a6b934828262..f16ce13525c4b4e00ef8e1f578dc92794fa10506:/docs/source/app_s4u.rst diff --git a/docs/source/app_s4u.rst b/docs/source/app_s4u.rst index 4a0f3fe0a5..8695720ee5 100644 --- a/docs/source/app_s4u.rst +++ b/docs/source/app_s4u.rst @@ -203,24 +203,33 @@ Repeatable Activities In order to simulate the execution of Dataflow applications, we introduced the concept of |API_s4u_Tasks|, that can be seen as repeatable activities. A Dataflow -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 -to its successors, and waits for the next set of tokens to arrive. +is defined as a graph of |API_s4u_Tasks|, where each |API_s4u_Tasks| has a set of +successors and predecessors. When a |API_s4u_Tasks| ends it sends a token to each +of its successors. Each |API_s4u_Tasks| has to receive a token from each of its +predecessor to start. Tokens can carry any user-defined data. + +|API_s4u_Tasks| are composed of several instances: a dispatcher, a collector, and +instance_0 to instance_n. The dispatcher rely on a load balancing function to select +the next instance to fire. Once this instance finishes it fires the collector. + +Each instance of an |API_s4u_ExecTask| can be placed on a different host. +|API_s4u_Comm| activities are automatically created when an instance triggers +another instance on a different host. Each instance has its own parallelism degree +to scale horizontally on several cores. 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 :cpp:func:`s4u::Task::enqueue_firings() ` function. -The parameters and successors of a Task can be redefined at runtime by attaching +The parameters of Tasks can be redefined at runtime by attaching callbacks to the :cpp:func:`s4u::Task::on_this_start ` and :cpp:func:`s4u::Task::on_this_completion ` -signals. +signals. The former is triggered by instances others than the dispatcher and the collector, +and the latter is triggered by the collector. + .. _s4u_mailbox: @@ -2583,7 +2592,7 @@ class Task **Known subclasses:** :ref:`Communication Tasks `, :ref:`Executions Tasks `, -:ref:`I/O Tasks `. +:ref:`I/O Tasks `. See also the :ref:`section on activities ` above. Basic management @@ -2610,7 +2619,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_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_parallelism_degree(int n) Life cycle ---------- @@ -2637,8 +2649,8 @@ Managing Tokens .. tabs:: .. group-tab:: C++ - .. doxygenfunction:: simgrid::s4u::Task::set_token(std::shared_ptr token) .. doxygenfunction:: simgrid::s4u::Task::get_next_token_from(TaskPtr t) + .. doxygenfunction:: simgrid::s4u::Task::set_token(std::shared_ptr token) Signals ------- @@ -2653,9 +2665,9 @@ Signals .. _API_s4u_CommTask: -================ +================= ⁣  class CommTask -================ +================= .. tabs:: .. group-tab:: C++ @@ -2682,19 +2694,19 @@ Querying info .. 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: -================ +================= ⁣  class ExecTask -================ +================= .. tabs:: .. group-tab:: C++ @@ -2721,10 +2733,10 @@ Querying info .. 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: @@ -2757,12 +2769,12 @@ Querying info .. 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: