Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
deprecate Engine::shutdown()
[simgrid.git] / examples / README.rst
index 8b45393..dc43b35 100644 (file)
@@ -32,6 +32,8 @@ Actors: the Active Entities
 Starting and Stopping Actors
 ----------------------------
 
+.. _s4u_ex_actors_create:
+
 Creating actors
 ^^^^^^^^^^^^^^^
 
@@ -84,8 +86,8 @@ actors.
       This example shows how to attach a callback to:
 
       - the end of a specific actor: :cpp:func:`simgrid::s4u::Actor::on_exit()`
-      - the end of any actor: :cpp:member:`simgrid::s4u::Actor::on_termination()`
-      - the destruction of any actor: :cpp:member:`simgrid::s4u::Actor::on_destruction()`
+      - the end of any actor: :cpp:func:`simgrid::s4u::Actor::on_termination_cb`
+      - the destruction of any actor: :cpp:func:`simgrid::s4u::Actor::on_destruction_cb`
 
    .. example-tab:: examples/c/actor-exiting/actor-exiting.c
 
@@ -106,7 +108,7 @@ Actors can forcefully stop other actors.
 
    .. example-tab:: examples/python/actor-kill/actor-kill.py
 
-      See also :py:func:`simgrid.Actor.kill`, :py:func:`simgrid.Actor.kill_all`, :py:func:`simgrid.this_actor.exit`,
+      See also :py:func:`simgrid.Actor.kill()`, :py:func:`simgrid.Actor.kill_all()`, :py:func:`simgrid.this_actor.exit()`,
       :py:func:`simgrid.this_actor.on_exit`.
 
    .. example-tab:: examples/c/actor-kill/actor-kill.c
@@ -214,7 +216,7 @@ Actors can move or be moved from a host to another very easily. It amounts to se
 
    .. example-tab:: examples/python/actor-migrate/actor-migrate.py
 
-      See also :py:func:`simgrid.this_actor.set_host()` and :py:func:`simgrid.Actor.set_host()`.
+      See also :py:attr:`simgrid.Actor.host`.
 
    .. example-tab:: examples/c/actor-migrate/actor-migrate.c
 
@@ -387,7 +389,7 @@ The ``wait_all()`` function is useful when you want to block until all activitie
 Waiting for the first completed communication in a set
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-The ``wait_any()`` function is useful when you want to block until one activity of the set completes, no matter which terminates first.
+The ``wait_any()`` blocks until one activity of the set completes, no matter which terminates first.
 
 .. tabs::
 
@@ -403,6 +405,18 @@ The ``wait_any()`` function is useful when you want to block until one activity
 
       See also :cpp:func:`sg_comm_wait_any`.
 
+Testing whether at least one communication completed
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The ``test_any()`` returns whether at least one activity of the set has completed, or -1.
+
+.. tabs::
+
+   .. example-tab:: examples/cpp/comm-testany/s4u-comm-testany.cpp
+
+      See also :cpp:func:`simgrid::s4u::Comm::test_any()`.
+
+
 .. _s4u_ex_execution:
 
 Executions on the CPU
@@ -455,8 +469,8 @@ You can start asynchronous executions, just like you would fire background threa
       See also :py:func:`simgrid.this_actor.exec_init()`,
       :py:func:`simgrid.Activity.start()`,
       :py:func:`simgrid.Activity.wait()`,
-      :py:func:`simgrid.Activity.get_remaining()`,
-      :py:func:`simgrid.Exec.get_remaining_ratio()`,
+      :py:attr:`simgrid.Exec.remaining`,
+      :py:attr:`simgrid.Exec.remaining_ratio`,
       :py:func:`simgrid.this_actor.exec_async()` and
       :py:func:`simgrid.Activity.cancel()`.
 
@@ -483,7 +497,7 @@ You can start executions on remote hosts, or even change the host on which they
 
    .. example-tab:: examples/python/exec-remote/exec-remote.py
 
-      See also :py:func:`simgrid.Exec.set_host()`.
+      See also :py:attr:`simgrid.Exec.host`.
 
    .. example-tab:: examples/c/exec-remote/exec-remote.c
 
@@ -528,7 +542,7 @@ of a host can then be accessed and changed from the program.
 
    .. example-tab:: examples/python/exec-dvfs/exec-dvfs.py
 
-      See also :py:func:`Host.get_pstate_speed` and :py:func:`Host.set_pstate`.
+      See also :py:attr:`Host.pstate_speed` and :py:func:`Host.set_pstate()`.
 
    .. example-tab:: examples/platforms/energy_platform.xml
 
@@ -721,6 +735,8 @@ Shows how to specify an external load to resources, variating their peak speed o
 
       .. example-tab:: examples/cpp/platform-profile/s4u-platform-profile.cpp
 
+      .. example-tab:: examples/python/platform-profile/platform-profile.py
+
       .. group-tab:: XML
 
          .. showfile:: examples/platforms/small_platform_profile.xml
@@ -770,6 +786,17 @@ This example shows how to retrieve the amount of energy consumed by the CPU duri
 
    .. example-tab:: examples/c/energy-exec/energy-exec.c
 
+Virtual machines consumption
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This example is very similar to the previous one, adding VMs to the picture.
+
+.. tabs::
+
+   .. example-tab:: examples/cpp/energy-vm/s4u-energy-vm.cpp
+
+   .. example-tab:: examples/c/energy-vm/energy-vm.c
+
 Wired network energy consumption
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -1050,6 +1077,15 @@ Another well-known DHT protocol.
       .. showfile:: examples/c/dht-kademlia/node.c
          :language: cpp
 
+Pastry
+^^^^^^
+
+Yet another well-known DHT protocol.
+
+.. tabs::
+
+   .. example-tab:: examples/c/dht-pastry/dht-pastry.c
+
 .. _s4u_ex_clouds:
 
 Simulating Clouds
@@ -1170,7 +1206,7 @@ The model-checker can be used to exhaustively search for issues in the tested ap
 mode is rather experimental in SimGrid (as of v3.25). We are working on it :)
 
 Failing assert
-^^^^^^^^^^^^^^
+--------------
 
 In this example, two actors send some data to a central server, which asserts that the messages are always received in the same order.
 This is wrong, and the model-checker correctly finds a counter-example to that assertion.