X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/96cedde3cdbc0b8ffc3f096a1b65d021b0226f99..096bef11ea84253450578d54bfa97f36c1d5984e:/examples/s4u/README.rst?ds=sidebyside diff --git a/examples/s4u/README.rst b/examples/s4u/README.rst index 571632bff9..8610665eb2 100644 --- a/examples/s4u/README.rst +++ b/examples/s4u/README.rst @@ -38,15 +38,31 @@ Starting and Stoping Actors - **Creating actors:** Most actors are started from the deployment XML file, but there is other methods. This example show them all. + `examples/python/actor-create/actor-create_d.xml `_ - |cpp| `examples/s4u/actor-create/s4u-actor-create.cpp `_ - |py| `examples/python/actor-create/actor-create.py `_ - + + - **React to the end of actors:** + You can attach a callback to the end of actors. There is two ways + of doing so, depending of whether you want your callback to be + executed when a specific actor ends (with ```this_actor::on_exit()```) + or whether it should be executed when any actor ends (with + ```Actor::on_destruction()```) + + - |cpp| `examples/s4u/actor-exiting/s4u-actor-exiting.cpp `_ + - **Kill actors:** - Actors can forcefully stop other actors with the - :cpp:func:`void simgrid::s4u::Actor::kill(void)` or the - :cpp:func:`void simgrid::s4u::Actor::kill(aid_t)` methods. - |br| `examples/s4u/actor-kill/s4u-actor-kill.cpp `_ + Actors can forcefully stop other actors. + + - |cpp| `examples/s4u/actor-kill/s4u-actor-kill.cpp `_ + :cpp:func:`void simgrid::s4u::Actor::kill(void)`, + :cpp:func:`void simgrid::s4u::Actor::kill_all()`, + :cpp:func:`simgrid::s4u::this_actor::exit`. + - |py| `examples/python/actor-kill/actor-kill.py `_ + :py:func:`simgrid.Actor.kill`, + :py:func:`simgrid.Actor.kill_all`, + :py:func:`simgrid.this_actor.exit`. - **Controling the actor life cycle from the XML:** You can specify a start time and a kill time in the deployment @@ -139,24 +155,33 @@ Communications on the Network - **Basic asynchronous communications:** Illustrates how to have non-blocking communications, that are communications running in the background leaving the process free - to do something else during their completion. The main functions - involved are :cpp:func:`simgrid::s4u::Mailbox::put_async()` and - :cpp:func:`simgrid::s4u::Comm::wait()`. - |br| `examples/s4u/async-wait/s4u-async-wait.cpp `_ + to do something else during their completion. + + - |cpp| `examples/s4u/async-wait/s4u-async-wait.cpp `_ + :cpp:func:`simgrid::s4u::Mailbox::put_async()` and :cpp:func:`simgrid::s4u::Comm::wait()` + - |py| `examples/python/async-wait/async-wait.py `_ + :py:func:`simgrid.Mailbox.put_async()` :py:func:`simgrid.Comm.wait()` - **Waiting for all communications in a set:** - The :cpp:func:`simgrid::s4u::Comm::wait_all()` function is useful - when you want to block until all activities in a given set have - completed. - |br| `examples/s4u/async-waitall/s4u-async-waitall.cpp `_ + The `wait_all()` function is useful when you want to block until + all activities in a given set have completed. + + - |cpp| `examples/s4u/async-waitall/s4u-async-waitall.cpp `_ + :cpp:func:`simgrid::s4u::Comm::wait_all()` + - |py| `examples/python/async-waitall/async-waitall.py `_ + :py:func:`simgrid.Comm.wait_all()` - **Waiting for the first completed communication in a set:** - The :cpp:func:`simgrid::s4u::Comm::wait_any()` function is useful + The `wait_any()` function is useful when you want to block until one activity of the set completes, no - matter which terminates first. - |br| `examples/s4u/async-waitany/s4u-async-waitany.cpp `_ - -.. todo:: add the `ready` example here + matter which terminates first. + + - |cpp| `examples/s4u/async-waitany/s4u-async-waitany.cpp `_ + :cpp:func:`simgrid::s4u::Comm::wait_any()` + - |py| `examples/python/async-waitany/async-waitany.py `_ + :py:func:`simgrid.Comm.wait_any()` + +.. todo:: review the `ready` and `waituntil` examples and add them here. .. _s4u_ex_execution: @@ -178,27 +203,24 @@ Executions on the CPU background threads. |br| `examples/s4u/exec-async/s4u-exec-async.cpp `_ - - **Monitoring asynchronous executions:** - This example shows how to start an asynchronous execution, and - monitor its status. - |br| `examples/s4u/exec-monitor/s4u-exec-monitor.cpp `_ - - **Remote execution:** - Before its start, you can change the host on which a given execution will occur. + You can start executions on remote hosts, or even change the host + on which they occur during their execution. |br| `examples/s4u/exec-remote/s4u-exec-remote.cpp `_ + - **Parallel executions:** + These objects are convenient abstractions of parallel + computational kernels that span over several machines, such as a + PDGEM and the other ScaLAPACK routines. Note that this only works + with the "ptask_L07" host model (`--cfg=host/model:ptask_L07`). + |br| `examples/s4u/exec-ptask/s4u-exec-ptask.cpp `_ + - **Using Pstates on a host:** Shows how define a set of pstatesfor a host in the XML, and how the current pstate can be accessed/changed with :cpp:func:`simgrid::s4u::Host::get_pstate_speed` and :cpp:func:`simgrid::s4u::Host::set_pstate`. |br| `examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp `_ |br| `examples/platforms/energy_platform.xml `_ - - **Parallel executions:** - These objects are convenient abstractions of parallel - computational kernels that span over several machines, such as a - PDGEM and the other ScaLAPACK routines. - |br| `examples/s4u/exec-ptask/s4u-exec-ptask.cpp `_ - I/O on Disks and Files ---------------------- @@ -265,6 +287,19 @@ Interacting with the Platform |br| `examples/s4u/platform-properties/s4u-platform-properties_d.xml `_ |br| `examples/platforms/prop.xml `_ + - **Specifying state profiles:** shows how to specify when the + resources must be turned off and on again, and how to react to such + failures in your code. + + |br| `examples/platforms/small_platform_with_failure.xml `_ + |br| The state profiles in `examples/platforms/profiles `_ + + - **Specifying speed profiles:** shows how to specify an external + load to resources, variating their peak speed over time. + + |br| `examples/platforms/small_platform_profile.xml `_ + |br| The speed, bandwidth and latency profiles in `examples/platforms/profiles `_ + ================= Energy Simulation =================