include examples/cpp/comm-pingpong/s4u-comm-pingpong.tesh
include examples/cpp/comm-ready/s4u-comm-ready.cpp
include examples/cpp/comm-ready/s4u-comm-ready.tesh
-include examples/cpp/comm-serialize/s4u-comm-serialize.cpp
-include examples/cpp/comm-serialize/s4u-comm-serialize.tesh
include examples/cpp/comm-suspend/s4u-comm-suspend.cpp
include examples/cpp/comm-suspend/s4u-comm-suspend.tesh
include examples/cpp/comm-testany/s4u-comm-testany.cpp
include examples/cpp/network-ns3/s4u-network-ns3.tesh
include examples/cpp/network-wifi/s4u-network-wifi.cpp
include examples/cpp/network-wifi/s4u-network-wifi.tesh
+include examples/cpp/platform-comm-serialize/s4u-platform-comm-serialize.cpp
+include examples/cpp/platform-comm-serialize/s4u-platform-comm-serialize.tesh
include examples/cpp/platform-failures/s4u-platform-failures.cpp
include examples/cpp/platform-failures/s4u-platform-failures.tesh
include examples/cpp/platform-failures/s4u-platform-failures_d.xml
include examples/python/comm-pingpong/comm-pingpong.tesh
include examples/python/comm-ready/comm-ready.py
include examples/python/comm-ready/comm-ready.tesh
-include examples/python/comm-serialize/comm-serialize.py
-include examples/python/comm-serialize/comm-serialize.tesh
include examples/python/comm-suspend/comm-suspend.py
include examples/python/comm-suspend/comm-suspend.tesh
include examples/python/comm-testany/comm-testany.py
include examples/python/io-degradation/io-degradation.tesh
include examples/python/network-nonlinear/network-nonlinear.py
include examples/python/network-nonlinear/network-nonlinear.tesh
+include examples/python/platform-comm-serialize/platform-comm-serialize.py
+include examples/python/platform-comm-serialize/platform-comm-serialize.tesh
include examples/python/platform-failures/platform-failures.py
include examples/python/platform-failures/platform-failures.tesh
include examples/python/platform-profile/platform-profile.py
.. example-tab:: examples/c/comm-pingpong/comm-pingpong.c
-
Basic asynchronous communications
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
See also :py:func:`simgrid.Comm.test_any()`.
+.. _s4u_ex_comm_host2host:
+
+Direct host-to-host communication
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This example demonstrates the direct communication mechanism, that allows to send data from one host to another without
+relying on the mailbox mechanism.
+
+.. tabs::
+
+ .. example-tab:: examples/cpp/comm-host2host/s4u-comm-host2host.cpp
+
+ See also :cpp:func:`simgrid::s4u::Comm::sendto_init()` and :cpp:func:`simgrid::s4u::Comm::sendto_async()`.
+
+ .. example-tab:: examples/python/comm-host2host/comm-host2host.py
+
+ See also :py:func:`simgrid.Comm.sendto_init()` and :py:func:`simgrid.Comm.sendto_async()`.
+
.. _s4u_ex_execution:
Executions on the CPU
See also :ref:`simgrid.this_actor.parallel_execute()`
+.. _s4u_ex_dvfs:
+
DVFS and pstates
^^^^^^^^^^^^^^^^
.. example-tab:: examples/platforms/energy_platform.xml
+ The important parts are in the :ref:`pf_tag_host` tag. The ``pstate`` attribute is the initial pstate while the ``speed`` attribute must
+ be a comma-separated list of values: the speed at each pstate. This platform file also describes the ``wattage_per_state`` and
+ ``wattage_off`` properties, that are used by the :ref:`plugin_host_energy` plugin.
+
.. _s4u_ex_disk_io:
I/O on Disks and Files
.. showfile:: examples/platforms/profiles/link1_latency.profile
+Modifying the platform
+----------------------
+
+Serializing communications
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This example shows how to limit the amount of communications going through a given link.
+It is very similar to the other asynchronous communication examples, but messages get serialized by the platform.
+Without this call to ``Link::set_concurrency_limit(2)``, all messages would be received at the exact same timestamp since
+they are initiated at the same instant and are of the same size. But with this extra configuration to the link, at most 2
+messages can travel through the link at the same time.
+
+.. tabs::
+
+ .. example-tab:: examples/cpp/platform-comm-serialize/s4u-platform-comm-serialize.cpp
+
+ See also :cpp:func:`simgrid::s4u::Link::set_concurrency_limit()`.
+
+ .. example-tab:: examples/python/platform-comm-serialize/platform-comm-serialize.py
+
+ See also :py:func:`simgrid.Link.set_concurrency_limit()`.
+
=================
Energy Simulation
=================
actor-create actor-daemon actor-exiting actor-join actor-kill
actor-lifetime actor-migrate actor-suspend actor-yield actor-stacksize
app-bittorrent app-chainsend app-token-ring
- comm-pingpong comm-ready comm-serialize comm-suspend comm-testany comm-wait comm-waitany comm-waitall comm-waituntil
+ comm-pingpong comm-ready comm-suspend comm-testany comm-wait comm-waitany comm-waitall comm-waituntil
comm-dependent comm-host2host comm-failure comm-throttling
cloud-capping cloud-migration cloud-simple
dag-comm dag-from-dax dag-from-dot dag-failure dag-io dag-scheduling dag-simple
mc-bugged1 mc-bugged1-liveness mc-bugged2 mc-bugged2-liveness mc-centralized-mutex mc-electric-fence mc-failing-assert
network-ns3 network-ns3-wifi network-wifi
io-async io-priority io-degradation io-file-system io-file-remote io-disk-raw io-dependent
- platform-failures platform-profile platform-properties
+ platform-comm-serialize platform-failures platform-profile platform-properties
plugin-host-load plugin-link-load plugin-prodcons
replay-comm replay-io
routing-get-clusters
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-/* This example shows how to serialize a set of communications going through a link
+/* This example shows how to serialize a set of communications going through a link using Link::set_concurrency_limit()
*
- * As for the other asynchronous examples, the sender initiates all the messages it wants to send and
- * pack the resulting simgrid::s4u::CommPtr objects in a vector.
- * At the same time, the receiver starts receiving all messages asynchronously. Without serialization,
- * all messages would be received at the same timestamp in the receiver.
- *
- * However, as they will be serialized in a link of the platform, the messages arrive 2 by 2.
- *
- * The sender then blocks until all ongoing communication terminate, using simgrid::s4u::Comm::wait_all()
+ * This example is very similar to the other asynchronous communication examples, but messages get serialized by the platform.
+ * Without this call to Link::set_concurrency_limit(2) in main, all messages would be received at the exact same timestamp since
+ * they are initiated at the same instant and are of the same size. But with this extra configuration to the link, at most 2
+ * messages can travel through the link at the same time.
*/
#include "simgrid/s4u.hpp"
#!/usr/bin/env tesh
-$ ${bindir:=.}/s4u-comm-serialize "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
+$ ${bindir:=.}/s4u-platform-comm-serialize "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
> [ 0.000000] (1:receiver@receiver) Wait for 10 messages asynchronously
> [ 0.000000] (2:sender@sender) Send 'Message 0' to 'receiver'
> [ 0.000000] (2:sender@sender) Send 'Message 1' to 'receiver'
foreach(example actor-create actor-daemon actor-join actor-kill actor-migrate actor-suspend actor-yield actor-lifetime
app-masterworkers
comm-wait comm-waitall comm-waitallfor comm-waitany comm-waitfor comm-failure comm-host2host comm-pingpong
- comm-ready comm-serialize comm-suspend comm-testany comm-throttling comm-waitallfor comm-waituntil
+ comm-ready comm-suspend comm-testany comm-throttling comm-waitallfor comm-waituntil
exec-async exec-basic exec-dvfs exec-remote exec-ptask
- platform-profile platform-failures
+ platform-comm-serialize platform-profile platform-failures
network-nonlinear clusters-multicpu io-degradation exec-cpu-nonlinear
synchro-barrier synchro-mutex synchro-semaphore)
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.tesh)
#!/usr/bin/env tesh
-$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/comm-serialize.py "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
+$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/platform-comm-serialize.py "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
>[ 0.000000] (1:receiver@receiver) Wait for 10 messages asynchronously
>[ 0.000000] (2:sender@sender) Send 'Message 0' to 'receiver'
>[ 0.000000] (2:sender@sender) Send 'Message 1' to 'receiver'