X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7e6874f7ac80c48117279575b0b0bf70dad67756..85f2d2b7075a3104ccf23b83f926c0513cac9600:/examples/README.rst diff --git a/examples/README.rst b/examples/README.rst index 240f554ba6..cbe1f7e252 100644 --- a/examples/README.rst +++ b/examples/README.rst @@ -395,7 +395,7 @@ The ``suspend()`` and ``resume()`` functions block the progression of a given co .. example-tab:: examples/python/comm-suspend/comm-suspend.py - See also :py:func:`simgrid.Comm::suspend()` and + See also :py:func:`simgrid.Comm.suspend()` and :py:func:`simgrid.Comm.resume()`. Waiting for all communications in a set @@ -717,16 +717,44 @@ result in short reads and short writes, as in reality. .. _s4u_ex_dag: -DAG of activities -================= +Dependencies between activities +=============================== + +SimGrid makes it easy to express dependencies between activities, where a given activity cannot start until the completion of +all its predecessors. You can even have simulation not involving any actors, where the main thread (called maestro) creates and +schedules activities itself. + +Simple dependencies +------------------- + +When you declare dependencies between two activities, the depedent will not actually start until all its dependencies complete, +as shown in the following examples. The first one declare dependencies between executions while the second one declare +dependencies between communications. You could declare such dependencies between arbitrary activities. + +.. tabs:: + + .. example-tab:: examples/cpp/exec-dependent/s4u-exec-dependent.cpp + +.. tabs:: + + .. example-tab:: examples/cpp/comm-dependent/s4u-comm-dependent.cpp + +Assigning activities +-------------------- + +To actually start, an activity needs to be assigned to a given resource. This examples illustrates how an execution that is not +assigned will not actually start until being assigned. In some sense, activities' assignment can be seen as a specific +dependency that can withdraw their execution. -SimGrid makes it easy to express dependencies between activities, where a given activity cannot start until the completion of all its predecessors. -You can even have simulation not involving any actors, where the main thread (called maestro) creates and schedules activities itself. +.. tabs:: + + .. example-tab:: examples/cpp/exec-unassigned/s4u-exec-unassigned.cpp Simple DAG of activities ------------------------ -This example shows how to create activities organized as a DAG (direct acyclic graph), and start them. +This example shows how to create activities from the maestro directly without relying on an actor, organize the dependencies of +activities as a DAG (direct acyclic graph), and start them. Each activity will start as soon as its dependencies are fullfiled. .. tabs:: @@ -750,15 +778,6 @@ This is a little example showing how add I/O activities to your DAG, representin .. example-tab:: examples/cpp/dag-io/s4u-dag-io.cpp -Assigning activities --------------------- - -To actually start, an activity needs to be assigned to a given resource. This examples illustrates how an execution that is not assigned will not actually start until being assigned. - -.. tabs:: - - .. example-tab:: examples/cpp/exec-unassigned/s4u-exec-unassigned.cpp - Scheduling activities --------------------- @@ -812,21 +831,6 @@ This example shows how to deal with host or network failures while scheduling DA .. example-tab:: examples/cpp/dag-failure/s4u-dag-failure.cpp -DAGs and actors ---------------- - -You can also declare dependencies to regular activities that are executed by actors, as shown in the following examples. -The first one declare dependencies between executions while the second one declare dependencies between communications. -You could declare such dependencies between arbitrary activities. - -.. tabs:: - - .. example-tab:: examples/cpp/exec-dependent/s4u-exec-dependent.cpp - -.. tabs:: - - .. example-tab:: examples/cpp/comm-dependent/s4u-comm-dependent.cpp - .. _s4u_ex_IPC: Classical synchronization objects