Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into klement
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 9 Jul 2020 22:06:14 +0000 (00:06 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 9 Jul 2020 22:06:14 +0000 (00:06 +0200)
82 files changed:
ChangeLog
MANIFEST.in
docs/source/app_s4u.rst
docs/source/ns3.rst
examples/README.rst
examples/c/CMakeLists.txt
examples/c/comm-wait/comm-wait.c [moved from examples/c/async-wait/async-wait.c with 98% similarity]
examples/c/comm-wait/comm-wait.tesh [moved from examples/c/async-wait/async-wait.tesh with 84% similarity]
examples/c/comm-wait/comm-wait2_d.xml [moved from examples/c/async-wait/async-wait2_d.xml with 100% similarity]
examples/c/comm-wait/comm-wait3_d.xml [moved from examples/c/async-wait/async-wait3_d.xml with 100% similarity]
examples/c/comm-wait/comm-wait4_d.xml [moved from examples/c/async-wait/async-wait4_d.xml with 100% similarity]
examples/c/comm-wait/comm-wait_d.xml [moved from examples/c/async-wait/async-wait_d.xml with 100% similarity]
examples/c/comm-waitall/comm-waitall.c [moved from examples/c/async-waitall/async-waitall.c with 97% similarity]
examples/c/comm-waitall/comm-waitall.tesh [moved from examples/c/async-waitall/async-waitall.tesh with 88% similarity]
examples/c/comm-waitall/comm-waitall_d.xml [moved from examples/c/async-waitall/async-waitall_d.xml with 100% similarity]
examples/c/comm-waitany/comm-waitany.c [moved from examples/c/async-waitany/async-waitany.c with 98% similarity]
examples/c/comm-waitany/comm-waitany.tesh [moved from examples/c/async-waitany/async-waitany.tesh with 88% similarity]
examples/c/comm-waitany/comm-waitany_d.xml [moved from examples/c/async-waitany/async-waitany_d.xml with 100% similarity]
examples/platforms/wifi.xml
examples/platforms/wifi_decay_2STA.xml [deleted file]
examples/python/CMakeLists.txt
examples/python/comm-wait/comm-wait.py [moved from examples/python/async-wait/async-wait.py with 100% similarity]
examples/python/comm-wait/comm-wait.tesh [moved from examples/python/async-wait/async-wait.tesh with 80% similarity]
examples/python/comm-wait/comm-wait_d.xml [moved from examples/python/async-wait/async-wait_d.xml with 100% similarity]
examples/python/comm-waitall/comm-waitall.py [moved from examples/python/async-waitall/async-waitall.py with 100% similarity]
examples/python/comm-waitall/comm-waitall.tesh [moved from examples/python/async-waitall/async-waitall.tesh with 86% similarity]
examples/python/comm-waitall/comm-waitall_d.xml [moved from examples/python/async-waitall/async-waitall_d.xml with 100% similarity]
examples/python/comm-waitany/comm-waitany.py [moved from examples/python/async-waitany/async-waitany.py with 100% similarity]
examples/python/comm-waitany/comm-waitany.tesh [moved from examples/python/async-waitany/async-waitany.tesh with 89% similarity]
examples/python/comm-waitany/comm-waitany_d.xml [moved from examples/python/async-waitany/async-waitany_d.xml with 100% similarity]
examples/s4u/CMakeLists.txt
examples/s4u/comm-ready/s4u-comm-ready.cpp [moved from examples/s4u/async-ready/s4u-async-ready.cpp with 77% similarity]
examples/s4u/comm-ready/s4u-comm-ready.tesh [moved from examples/s4u/async-ready/s4u-async-ready.tesh with 97% similarity]
examples/s4u/comm-ready/s4u-comm-ready_d.xml [moved from examples/s4u/async-ready/s4u-async-ready_d.xml with 100% similarity]
examples/s4u/comm-suspend/s4u-comm-suspend.cpp [new file with mode: 0644]
examples/s4u/comm-suspend/s4u-comm-suspend.tesh [new file with mode: 0644]
examples/s4u/comm-suspend/s4u-comm-suspend_d.xml [new file with mode: 0644]
examples/s4u/comm-wait/s4u-comm-wait.cpp [moved from examples/s4u/async-wait/s4u-async-wait.cpp with 96% similarity]
examples/s4u/comm-wait/s4u-comm-wait.tesh [moved from examples/s4u/async-wait/s4u-async-wait.tesh with 85% similarity]
examples/s4u/comm-wait/s4u-comm-wait_d.xml [moved from examples/s4u/async-wait/s4u-async-wait_d.xml with 100% similarity]
examples/s4u/comm-waitall/s4u-comm-waitall.cpp [moved from examples/s4u/async-waitall/s4u-async-waitall.cpp with 99% similarity]
examples/s4u/comm-waitall/s4u-comm-waitall.tesh [moved from examples/s4u/async-waitall/s4u-async-waitall.tesh with 88% similarity]
examples/s4u/comm-waitall/s4u-comm-waitall_d.xml [moved from examples/s4u/async-waitall/s4u-async-waitall_d.xml with 100% similarity]
examples/s4u/comm-waitany/s4u-comm-waitany.cpp [moved from examples/s4u/async-waitany/s4u-async-waitany.cpp with 97% similarity]
examples/s4u/comm-waitany/s4u-comm-waitany.tesh [moved from examples/s4u/async-waitany/s4u-async-waitany.tesh with 91% similarity]
examples/s4u/comm-waitany/s4u-comm-waitany_d.xml [moved from examples/s4u/async-waitany/s4u-async-waitany_d.xml with 100% similarity]
examples/s4u/comm-waituntil/s4u-comm-waituntil.cpp [moved from examples/s4u/async-waituntil/s4u-async-waituntil.cpp with 79% similarity]
examples/s4u/comm-waituntil/s4u-comm-waituntil.tesh [moved from examples/s4u/async-waituntil/s4u-async-waituntil.tesh with 77% similarity]
examples/s4u/comm-waituntil/s4u-comm-waituntil_d.xml [moved from examples/s4u/async-waituntil/s4u-async-waituntil_d.xml with 100% similarity]
examples/s4u/network-wifi/s4u-network-wifi.cpp [new file with mode: 0644]
examples/s4u/network-wifi/s4u-network-wifi.tesh [new file with mode: 0644]
include/simgrid/actor.h
include/simgrid/msg.h
include/simgrid/plugins/file_system.h
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Link.hpp
src/mc/remote/AppSide.cpp
src/mc/remote/AppSide.hpp
src/msg/msg_legacy.cpp
src/plugins/dirty_page_tracking.cpp
src/plugins/file_system/s4u_FileSystem.cpp
src/s4u/s4u_Activity.cpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Comm.cpp
src/s4u/s4u_Exec.cpp
src/s4u/s4u_Io.cpp
src/s4u/s4u_Link.cpp
src/smpi/internals/smpi_shared.cpp
src/surf/network_wifi.cpp
src/xbt/automaton/automaton.c
src/xbt/mmalloc/mmalloc.c
src/xbt/mmalloc/mrealloc.c
src/xbt/xbt_os_time.c
src/xbt/xbt_parse_units.cpp
teshsuite/simdag/availability/availability.c
teshsuite/simdag/basic-parsing-test/basic-parsing-test.c
teshsuite/smpi/bug-17132/bug-17132.c
teshsuite/smpi/macro-partial-shared-communication/macro-partial-shared-communication.c
teshsuite/smpi/macro-partial-shared/macro-partial-shared.c
teshsuite/surf/wifi_usage/wifi_usage.cpp
tools/cmake/DefinePackages.cmake

index e1df82b..5543b35 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,8 +21,13 @@ Important user-visible changes:
    src/dest, and communicator information). This may change simulation times
    for very small message sizes, but should be more realistic.
 
+Documentation:
+ - New examples: wifi networks, and communication suspend
+
 S4U:
  - the on_exit() of each actor is also executed when the simulation deadlocks.
+ - New functions: s4u::Activity:: suspend(), resume() and is_suspended()
+   An example is provided for s4u::Comm but it should work with Exec and Io.
 
 SMPI:
  - Update proxy apps coverage of new ECP apps: 60+ apps now tested nightly on 
@@ -60,12 +65,14 @@ Fixed bugs (FG#.. -> FramaGit bugs; FG!.. -> FG merge requests)
  - FG!24: Documentation and fix for xbt/random
  - FG!35: Add a modeling hint for parallel links in doc
  - FG!36: [xbt/random] Read/Write the state of the RNG
+ - FG#54: How to suspend a comm?
  - GF#18137: Allow different stack sizes?
  - GH#128: Parallelization of simulation with --cfg=contexts/nthreads
  - GH#139: Allow pthread creation in SMPI
  - GH#336: Packet-level simulation using SMPI?
  - GH!337: Fix link_energy plugin for wifi platforms
  - GH!339: Add Mailbox set_receiver method to python binding
+ - GH!344: Cast hugepages macros parameters to int64
 
 ----------------------------------------------------------------------------
 
index 21c5e3b..d1763be 100644 (file)
@@ -66,18 +66,6 @@ include examples/c/app-pingpong/app-pingpong.tesh
 include examples/c/app-pingpong/app-pingpong_d.xml
 include examples/c/app-token-ring/app-token-ring.c
 include examples/c/app-token-ring/app-token-ring.tesh
-include examples/c/async-wait/async-wait.c
-include examples/c/async-wait/async-wait.tesh
-include examples/c/async-wait/async-wait2_d.xml
-include examples/c/async-wait/async-wait3_d.xml
-include examples/c/async-wait/async-wait4_d.xml
-include examples/c/async-wait/async-wait_d.xml
-include examples/c/async-waitall/async-waitall.c
-include examples/c/async-waitall/async-waitall.tesh
-include examples/c/async-waitall/async-waitall_d.xml
-include examples/c/async-waitany/async-waitany.c
-include examples/c/async-waitany/async-waitany.tesh
-include examples/c/async-waitany/async-waitany_d.xml
 include examples/c/cloud-capping/cloud-capping.c
 include examples/c/cloud-capping/cloud-capping.tesh
 include examples/c/cloud-masterworker/cloud-masterworker.c
@@ -86,6 +74,18 @@ include examples/c/cloud-migration/cloud-migration.c
 include examples/c/cloud-migration/cloud-migration.tesh
 include examples/c/cloud-simple/cloud-simple.c
 include examples/c/cloud-simple/cloud-simple.tesh
+include examples/c/comm-wait/comm-wait.c
+include examples/c/comm-wait/comm-wait.tesh
+include examples/c/comm-wait/comm-wait2_d.xml
+include examples/c/comm-wait/comm-wait3_d.xml
+include examples/c/comm-wait/comm-wait4_d.xml
+include examples/c/comm-wait/comm-wait_d.xml
+include examples/c/comm-waitall/comm-waitall.c
+include examples/c/comm-waitall/comm-waitall.tesh
+include examples/c/comm-waitall/comm-waitall_d.xml
+include examples/c/comm-waitany/comm-waitany.c
+include examples/c/comm-waitany/comm-waitany.tesh
+include examples/c/comm-waitany/comm-waitany_d.xml
 include examples/c/dht-kademlia/answer.c
 include examples/c/dht-kademlia/answer.h
 include examples/c/dht-kademlia/common.h
@@ -317,12 +317,12 @@ include examples/python/actor-suspend/actor-suspend.py
 include examples/python/actor-suspend/actor-suspend.tesh
 include examples/python/actor-yield/actor-yield.py
 include examples/python/actor-yield/actor-yield.tesh
-include examples/python/async-wait/async-wait.py
-include examples/python/async-wait/async-wait.tesh
-include examples/python/async-waitall/async-waitall.py
-include examples/python/async-waitall/async-waitall.tesh
-include examples/python/async-waitany/async-waitany.py
-include examples/python/async-waitany/async-waitany.tesh
+include examples/python/comm-wait/comm-wait.py
+include examples/python/comm-wait/comm-wait.tesh
+include examples/python/comm-waitall/comm-waitall.py
+include examples/python/comm-waitall/comm-waitall.tesh
+include examples/python/comm-waitany/comm-waitany.py
+include examples/python/comm-waitany/comm-waitany.tesh
 include examples/python/exec-async/exec-async.py
 include examples/python/exec-async/exec-async.tesh
 include examples/python/exec-basic/exec-basic.py
@@ -373,21 +373,6 @@ include examples/s4u/app-pingpong/s4u-app-pingpong.tesh
 include examples/s4u/app-pingpong/simix-breakpoint.tesh
 include examples/s4u/app-token-ring/s4u-app-token-ring.cpp
 include examples/s4u/app-token-ring/s4u-app-token-ring.tesh
-include examples/s4u/async-ready/s4u-async-ready.cpp
-include examples/s4u/async-ready/s4u-async-ready.tesh
-include examples/s4u/async-ready/s4u-async-ready_d.xml
-include examples/s4u/async-wait/s4u-async-wait.cpp
-include examples/s4u/async-wait/s4u-async-wait.tesh
-include examples/s4u/async-wait/s4u-async-wait_d.xml
-include examples/s4u/async-waitall/s4u-async-waitall.cpp
-include examples/s4u/async-waitall/s4u-async-waitall.tesh
-include examples/s4u/async-waitall/s4u-async-waitall_d.xml
-include examples/s4u/async-waitany/s4u-async-waitany.cpp
-include examples/s4u/async-waitany/s4u-async-waitany.tesh
-include examples/s4u/async-waitany/s4u-async-waitany_d.xml
-include examples/s4u/async-waituntil/s4u-async-waituntil.cpp
-include examples/s4u/async-waituntil/s4u-async-waituntil.tesh
-include examples/s4u/async-waituntil/s4u-async-waituntil_d.xml
 include examples/s4u/cloud-capping/s4u-cloud-capping.cpp
 include examples/s4u/cloud-capping/s4u-cloud-capping.tesh
 include examples/s4u/cloud-migration/s4u-cloud-migration.cpp
@@ -396,6 +381,24 @@ include examples/s4u/cloud-simple/s4u-cloud-simple.cpp
 include examples/s4u/cloud-simple/s4u-cloud-simple.tesh
 include examples/s4u/comm-dependent/s4u-comm-dependent.cpp
 include examples/s4u/comm-dependent/s4u-comm-dependent.tesh
+include examples/s4u/comm-ready/s4u-comm-ready.cpp
+include examples/s4u/comm-ready/s4u-comm-ready.tesh
+include examples/s4u/comm-ready/s4u-comm-ready_d.xml
+include examples/s4u/comm-suspend/s4u-comm-suspend.cpp
+include examples/s4u/comm-suspend/s4u-comm-suspend.tesh
+include examples/s4u/comm-suspend/s4u-comm-suspend_d.xml
+include examples/s4u/comm-wait/s4u-comm-wait.cpp
+include examples/s4u/comm-wait/s4u-comm-wait.tesh
+include examples/s4u/comm-wait/s4u-comm-wait_d.xml
+include examples/s4u/comm-waitall/s4u-comm-waitall.cpp
+include examples/s4u/comm-waitall/s4u-comm-waitall.tesh
+include examples/s4u/comm-waitall/s4u-comm-waitall_d.xml
+include examples/s4u/comm-waitany/s4u-comm-waitany.cpp
+include examples/s4u/comm-waitany/s4u-comm-waitany.tesh
+include examples/s4u/comm-waitany/s4u-comm-waitany_d.xml
+include examples/s4u/comm-waituntil/s4u-comm-waituntil.cpp
+include examples/s4u/comm-waituntil/s4u-comm-waituntil.tesh
+include examples/s4u/comm-waituntil/s4u-comm-waituntil_d.xml
 include examples/s4u/dht-chord/s4u-dht-chord-node.cpp
 include examples/s4u/dht-chord/s4u-dht-chord.cpp
 include examples/s4u/dht-chord/s4u-dht-chord.hpp
@@ -477,6 +480,8 @@ include examples/s4u/network-ns3/one_cluster_d.xml
 include examples/s4u/network-ns3/onelink_d.xml
 include examples/s4u/network-ns3/s4u-network-ns3.cpp
 include examples/s4u/network-ns3/s4u-network-ns3.tesh
+include examples/s4u/network-wifi/s4u-network-wifi.cpp
+include examples/s4u/network-wifi/s4u-network-wifi.tesh
 include examples/s4u/platform-failures/s4u-platform-failures.cpp
 include examples/s4u/platform-failures/s4u-platform-failures.tesh
 include examples/s4u/platform-failures/s4u-platform-failures_d.xml
@@ -1940,13 +1945,12 @@ include examples/platforms/two_hosts_profiles.xml
 include examples/platforms/two_peers.xml
 include examples/platforms/vivaldi.xml
 include examples/platforms/wifi.xml
-include examples/platforms/wifi_decay_2STA.xml
 include examples/python/CMakeLists.txt
 include examples/python/actor-create/actor-create_d.xml
 include examples/python/actor-lifetime/actor-lifetime_d.xml
-include examples/python/async-wait/async-wait_d.xml
-include examples/python/async-waitall/async-waitall_d.xml
-include examples/python/async-waitany/async-waitany_d.xml
+include examples/python/comm-wait/comm-wait_d.xml
+include examples/python/comm-waitall/comm-waitall_d.xml
+include examples/python/comm-waitany/comm-waitany_d.xml
 include examples/s4u/CMakeLists.txt
 include examples/smpi/CMakeLists.txt
 include examples/smpi/NAS/CMakeLists.txt
index fdb8c90..96ee46d 100644 (file)
@@ -1404,6 +1404,15 @@ Dynamic profiles
       .. autodoxymethod:: simgrid::s4u::Link::set_latency_profile(kernel::profile::Profile *profile)
       .. autodoxymethod:: simgrid::s4u::Link::set_state_profile(kernel::profile::Profile *profile)
 
+WIFI links
+----------
+
+.. tabs::
+
+   .. group-tab:: C++
+
+      .. autodoxymethod:: simgrid::s4u::Link::set_host_wifi_rate(s4u::Host* host, int level)
+
 Signals
 -------
 
@@ -1708,6 +1717,17 @@ Activities life cycle
       .. autodoxymethod:: simgrid::s4u::Activity::wait_until(double time_limit)
       .. autodoxymethod:: simgrid::s4u::Activity::vetoable_start()
 
+Suspending and resuming an activity
+-----------------------------------
+
+.. tabs::
+
+   .. group-tab:: C++
+
+      .. autodoxymethod:: simgrid::s4u::Activity::suspend
+      .. autodoxymethod:: simgrid::s4u::Activity::resume
+      .. autodoxymethod:: simgrid::s4u::Activity::is_suspended
+
 .. _API_s4u_Comm:
 
 =============
index c4e27ea..969ca7d 100644 (file)
@@ -18,27 +18,14 @@ SimGrid requires ns-3 version 3.26 or higher, and you probably want the most
 recent version of both SimGrid and ns-3. While the Debian package of SimGrid
 don't have the ns-3 bindings activated, you can still use the packaged version
 of ns-3 by grabbing the ``libns3-dev ns3`` packages. Alternatively, you can
-install ns-3 from scratch as follows:
-
-.. code-block:: shell
-
-  # Download the source
-  wget http://www.nsnam.org/release/ns-allinone-3.29.tar.bz2
-  tar -xf ns-allinone-3.29.tar.bz2
-  cd ns-allinone-3.29/ns-3.29/
-  # Configure, build and install
-  ./waf configure --prefix="/opt/ns3" # or give another path if you prefer
-  ./waf
-  ./waf install
-
-For more information, please refer to the ns-3 documentation
-(`official website <http://www.nsnam.org>`_).
+install ns-3 from scratch (see the `ns-3 documentation <http://www.nsnam.org>`_).
 
 Enabling ns-3 in SimGrid
 ========================
 
 SimGrid must be recompiled with the ``enable_ns3`` option activated in cmake.
-Optionally, use ``NS3_HINT`` to hint cmake about where to find ns-3.
+Optionally, use ``NS3_HINT`` to tell cmake where ns3 is installed on
+your disk.
 
 .. code-block:: shell
 
@@ -80,21 +67,23 @@ Platform files compatibility
 Any route longer than one will be ignored when using ns-3. They are
 harmless, but you still need to connect your hosts using one-hop routes.
 The best solution is to add routers to split your route. Here is an
-example of invalid platform:
+example of an invalid platform:
 
 .. code-block:: shell
 
    <platform>
-     <host id="alice" speed="1Gf" />
-     <host id="bob"   speed="1Gf" />
+     <zone id="zone0" routing="Full">
+       <host id="alice" speed="1Gf" />
+       <host id="bob"   speed="1Gf" />
   
-     <link id="l1" bw="1Mbps" />
-     <link id="l2" bw="1Mbps" />
-
-     <route src="alice" dst="bob">
-       <link_ctn id="l1"/>            <!-- !!!! INVALID WITH ns-3    !!!! -->
-       <link_ctn id="l2"/>            <!-- !!!! length=2 IS TOO MUCH !!!! -->
-     </route>
+       <link id="l1" bw="1Mbps" />
+       <link id="l2" bw="1Mbps" />
+
+       <route src="alice" dst="bob">
+         <link_ctn id="l1"/>            <!-- !!!! INVALID WITH ns-3    !!!! -->
+         <link_ctn id="l2"/>            <!-- !!!! length=2 IS TOO MUCH !!!! -->
+       </route>
+     </zone>
    </platform>
   
 This can be reformulated as follows to make it usable with the ns-3 binding.
@@ -104,21 +93,23 @@ ns-3 automatically routes from point to point.
 .. code-block:: shell
 
    <platform>
-     <host id="alice" speed="1Gf" />
-     <host id="bob"   speed="1Gf" />
+     <zone id="zone0" routing="Full">
+       <host id="alice" speed="1Gf" />
+       <host id="bob"   speed="1Gf" />
 
-     <router id="r1" /> <!-- routers are compute-less hosts -->
+       <router id="r1" /> <!-- routers are compute-less hosts -->
 
-     <link id="l1" bw="1Mbps" />
-     <link id="l2" bw="1Mbps" />
+       <link id="l1" bw="1Mbps" />
+       <link id="l2" bw="1Mbps" />
 
-     <route src="alice" dst="r1">
-       <link_ctn id="l1"/> 
-     </route>
+       <route src="alice" dst="r1">
+         <link_ctn id="l1"/> 
+       </route>
   
-     <route src="r1" dst="bob">
-       <link_ctn id="l2"/> 
-     </route>
+       <route src="r1" dst="bob">
+         <link_ctn id="l2"/> 
+       </route>
+     </zone>
    </platform>
 
 Once your platform is OK, just change the :ref:`network/model
@@ -131,7 +122,7 @@ is unchanged.
 
 Many other files from the ``examples/platform directory`` are usable with the
 ns-3 model, such as `examples/platforms/dogbone.xml <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms/dogbone.xml>`_.
-Check the file  `examples/deprecated/msg/network-ns3/network-ns3.tesh <https://framagit.org/simgrid/simgrid/tree/master/examples/deprecated/msg/network-ns3/network-ns3.tesh>`_
+Check the file  `examples/s4u/network-ns3/network-ns3.tesh <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/network-ns3/network-ns3.tesh>`_
 to see which ones are used in our regression tests.
 
 Limitations
@@ -151,7 +142,7 @@ platform. However, there are some known caveats:
 Our goal is to keep the ns-3 plugin of SimGrid as easy (and hopefully readable)
 as possible. If the current state does not fit your needs, you should modify
 this plugin, and/or create your own plugin from the existing one. If you come up
-with interesting improvements, please contribute them back
+with interesting improvements, please contribute them back.
 
 Troubleshooting
 ===============
index 0ae9e50..7a4d9fd 100644 (file)
@@ -289,33 +289,48 @@ Communications on the Network
 
    .. tabs::
 
-      .. example-tab:: examples/s4u/async-wait/s4u-async-wait.cpp
+      .. example-tab:: examples/s4u/comm-wait/s4u-comm-wait.cpp
 
          See also :cpp:func:`simgrid::s4u::Mailbox::put_async()` and :cpp:func:`simgrid::s4u::Comm::wait()`.
 
-      .. example-tab:: examples/python/async-wait/async-wait.py
+      .. example-tab:: examples/python/comm-wait/comm-wait.py
 
          See also :py:func:`simgrid.Mailbox.put_async()` and :py:func:`simgrid.Comm.wait()`.
 
-      .. example-tab:: examples/c/async-wait/async-wait.c
+      .. example-tab:: examples/c/comm-wait/comm-wait.c
 
          See also :cpp:func:`sg_mailbox_put_async()` and :cpp:func:`sg_comm__wait()`.
 
+ - **Suspending communications:**
+   The ``suspend()`` and ``resume()`` functions allow to block the
+   progression of a given communication for a while and then unblock it.
+   ``is_suspended()`` can be used to retrieve whether the activity is
+   currently blocked or not.
+   
+   .. tabs::
+
+      .. example-tab:: examples/s4u/comm-suspend/s4u-comm-suspend.cpp
+
+         See also :cpp:func:`simgrid::s4u::Activity::suspend()`
+        :cpp:func:`simgrid::s4u::Activity::resume()` and
+        :cpp:func:`simgrid::s4u::Activity::is_suspended()`.
+
+        
  - **Waiting for all communications in a set:**
    The ``wait_all()`` function is useful when you want to block until
    all activities in a given set have completed. 
    
    .. tabs::
 
-      .. example-tab:: examples/s4u/async-waitall/s4u-async-waitall.cpp
+      .. example-tab:: examples/s4u/comm-waitall/s4u-comm-waitall.cpp
 
          See also :cpp:func:`simgrid::s4u::Comm::wait_all()`.
 
-      .. example-tab:: examples/python/async-waitall/async-waitall.py
+      .. example-tab:: examples/python/comm-waitall/comm-waitall.py
 
          See also :py:func:`simgrid.Comm.wait_all()`.
 
-      .. example-tab:: examples/c/async-waitall/async-waitall.c
+      .. example-tab:: examples/c/comm-waitall/comm-waitall.c
 
          See also :cpp:func:`sg_comm_wait_all()`.
 
@@ -326,15 +341,15 @@ Communications on the Network
    
    .. tabs::
 
-      .. example-tab:: examples/s4u/async-waitany/s4u-async-waitany.cpp
+      .. example-tab:: examples/s4u/comm-waitany/s4u-comm-waitany.cpp
 
          See also :cpp:func:`simgrid::s4u::Comm::wait_any()`.
 
-      .. example-tab:: examples/python/async-waitany/async-waitany.py
+      .. example-tab:: examples/python/comm-waitany/comm-waitany.py
 
          See also :py:func:`simgrid.Comm.wait_any()`.
         
-      .. example-tab:: examples/c/async-waitany/async-waitany.c
+      .. example-tab:: examples/c/comm-waitany/comm-waitany.c
 
          See also :cpp:func:`sg_comm_wait_any`.
      
@@ -885,6 +900,35 @@ Model-Related Examples
 
          .. showfile:: examples/platforms/small_platform_one_link_routes.xml
             :language: xml
+           
+  - **wifi links**
+  
+    This demonstrates how to declare a wifi link in your platform and
+    how to use it in your simulation. The basics is to have a link
+    which sharing policy is set to `WIFI`. Such links can have more
+    than one bandwidth value (separated by commas), corresponding to
+    the several SNR level of your wifi link.
+    
+    In this case, SimGrid automatically switches to validated
+    performance models of wifi networks, where the time is shared
+    between users instead of the bandwidth for wired links (the
+    corresponding publication is currently being written).
+    
+    If your wifi link provides more than one SNR level, you can switch
+    the level of a given host using
+    :cpp:func:`simgrid::s4u::Link::set_host_wifi_rate`. By default,
+    the first level is used.
+
+    .. tabs::
+
+      .. example-tab:: examples/s4u/network-wifi/s4u-network-wifi.cpp
+
+      .. group-tab:: XML
+
+         **Platform files:**
+
+         .. showfile:: examples/platforms/wifi.xml
+            :language: xml
 
 =======================
 Model-Checking Examples
index 34168e5..ff0d3a4 100644 (file)
@@ -5,7 +5,7 @@ foreach(x
         actor-create actor-daemon actor-exiting actor-join actor-kill actor-lifetime actor-migrate actor-stacksize
         actor-suspend actor-yield
         app-masterworker app-pingpong app-token-ring 
-        async-wait async-waitall async-waitany
+        comm-wait comm-waitall comm-waitany
         cloud-capping cloud-masterworker cloud-migration cloud-simple
         dht-pastry
         exec-async exec-basic exec-dvfs exec-remote exec-waitany
@@ -81,12 +81,12 @@ set(xml_files     ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/actor-cr
                                ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-multicore_d.xml
                                ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworker/app-masterworker-vivaldi_d.xml
                                ${CMAKE_CURRENT_SOURCE_DIR}/app-pingpong/app-pingpong_d.xml
-                               ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait_d.xml
-                               ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait2_d.xml
-                               ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait3_d.xml
-                               ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/async-wait4_d.xml
-                               ${CMAKE_CURRENT_SOURCE_DIR}/async-waitall/async-waitall_d.xml
-                               ${CMAKE_CURRENT_SOURCE_DIR}/async-waitany/async-waitany_d.xml
+                               ${CMAKE_CURRENT_SOURCE_DIR}/comm-wait/comm-wait_d.xml
+                               ${CMAKE_CURRENT_SOURCE_DIR}/comm-wait/comm-wait2_d.xml
+                               ${CMAKE_CURRENT_SOURCE_DIR}/comm-wait/comm-wait3_d.xml
+                               ${CMAKE_CURRENT_SOURCE_DIR}/comm-wait/comm-wait4_d.xml
+                               ${CMAKE_CURRENT_SOURCE_DIR}/comm-waitall/comm-waitall_d.xml
+                               ${CMAKE_CURRENT_SOURCE_DIR}/comm-waitany/comm-waitany_d.xml
                                ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/dht-kademlia_d.xml
                                ${CMAKE_CURRENT_SOURCE_DIR}/dht-pastry/dht-pastry_d.xml
                                ${CMAKE_CURRENT_SOURCE_DIR}/io-file-remote/io-file-remote_d.xml
@@ -97,7 +97,7 @@ foreach(x
         actor-create actor-daemon actor-exiting actor-join actor-kill actor-lifetime actor-migrate actor-stacksize
         actor-suspend actor-yield
         app-bittorrent app-chainsend app-masterworker app-pingpong app-token-ring
-        async-wait async-waitall async-waitany
+        comm-wait comm-waitall comm-waitany
         cloud-capping  cloud-masterworker cloud-migration cloud-simple
         dht-kademlia dht-pastry
         exec-async exec-basic exec-dvfs exec-remote exec-waitany
similarity index 98%
rename from examples/c/async-wait/async-wait.c
rename to examples/c/comm-wait/comm-wait.c
index 64ba4ef..6119863 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <stdio.h>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(async_wait, "Messages specific for this example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(comm_wait, "Messages specific for this example");
 
 /* Main function of the Sender actor */
 static void sender(int argc, char* argv[])
similarity index 84%
rename from examples/c/async-wait/async-wait.tesh
rename to examples/c/comm-wait/comm-wait.tesh
index 72cc48a..9307cd9 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test1 sg_comm_test() with Sleep_sender > Sleep_receiver
 
-$ ${bindir:=.}/c-async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/c-comm-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/comm-wait_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) sleep_start_time : 5.000000 , sleep_test_time : 0.100000
 > [  0.000000] (2:receiver@Ruby) sleep_start_time : 1.000000 , sleep_test_time : 0.100000
 > [  1.000000] (2:receiver@Ruby) Wait for my first message
@@ -17,7 +17,7 @@ $ ${bindir:=.}/c-async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=
 
 p Test2 sg_comm_test() with Sleep_sender < Sleep_receiver
 
-$ ${bindir:=.}/c-async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait2_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/c-comm-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/comm-wait2_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) sleep_start_time : 1.000000 , sleep_test_time : 0.100000
 > [  0.000000] (2:receiver@Ruby) sleep_start_time : 5.000000 , sleep_test_time : 0.100000
 > [  1.000000] (1:sender@Tremblay) Send 'Message 0' to 'receiver'
@@ -32,7 +32,7 @@ $ ${bindir:=.}/c-async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=
 
 p Test1 sg_comm_wait() with Sleep_sender > Sleep_receiver
 
-$ ${bindir:=.}/c-async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait3_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/c-comm-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/comm-wait3_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) sleep_start_time : 5.000000 , sleep_test_time : 0.000000
 > [  0.000000] (2:receiver@Ruby) sleep_start_time : 1.000000 , sleep_test_time : 0.000000
 > [  1.000000] (2:receiver@Ruby) Wait for my first message
@@ -47,7 +47,7 @@ $ ${bindir:=.}/c-async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=
 
 p Test2 sg_comm_wait() with Sleep_sender < Sleep_receiver
 
-$ ${bindir:=.}/c-async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait4_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/c-comm-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/comm-wait4_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) sleep_start_time : 1.000000 , sleep_test_time : 0.000000
 > [  0.000000] (2:receiver@Ruby) sleep_start_time : 5.000000 , sleep_test_time : 0.000000
 > [  1.000000] (1:sender@Tremblay) Send 'Message 0' to 'receiver'
similarity index 97%
rename from examples/c/async-waitall/async-waitall.c
rename to examples/c/comm-waitall/comm-waitall.c
index f0755cf..1992205 100644 (file)
@@ -15,7 +15,7 @@
 
 #include <stdio.h> /* snprintf */
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_waitall, "Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(comm_waitall, "Messages specific for this msg example");
 
 static void sender(int argc, char* argv[])
 {
similarity index 88%
rename from examples/c/async-waitall/async-waitall.tesh
rename to examples/c/comm-waitall/comm-waitall.tesh
index ce51d6d..326f543 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 ! output sort 19
-$ ${bindir:=.}/c-async-waitall ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-waitall_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/c-comm-waitall ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/comm-waitall_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) Send 'Message 0' to 'receiver-0'
 > [  0.000000] (2:receiver@Ruby) Wait for my first message
 > [  0.000000] (3:receiver@Perl) Wait for my first message
similarity index 98%
rename from examples/c/async-waitany/async-waitany.c
rename to examples/c/comm-waitany/comm-waitany.c
index 14a0767..248a219 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <stdio.h> /* snprintf */
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(async_waitany, "Messages specific for this example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(comm_waitany, "Messages specific for this example");
 
 static void sender(int argc, char* argv[])
 {
similarity index 88%
rename from examples/c/async-waitany/async-waitany.tesh
rename to examples/c/comm-waitany/comm-waitany.tesh
index 9ecd947..3d19ecd 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 ! output sort 19
-$ ${bindir:=.}/c-async-waitany ${platfdir:=.}/small_platform.xml ${srcdir:=.}/async-waitany_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/c-comm-waitany ${platfdir:=.}/small_platform.xml ${srcdir:=.}/comm-waitany_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) Send 'Message 0' to 'receiver-0'
 > [  0.000000] (1:sender@Tremblay) Send 'Message 1' to 'receiver-1'
 > [  0.000000] (1:sender@Tremblay) Send 'Message 2' to 'receiver-0'
index fed5614..1cd232e 100755 (executable)
@@ -6,7 +6,7 @@
 
     <zone id="WIFI zone" routing="Cluster">
         <!-- First declare the Access Point (ie, the wifi media) -->
-        <link id="AP1" sharing_policy="WIFI" bandwidth="54Mbps" latency="0ms" />
+        <link id="AP1" sharing_policy="WIFI" bandwidth="54Mbps,36Mbps,24Mbps" latency="0ms" />
 
         <!-- Two stations in the wifi zone -->
         <host id="Station 1" speed="100.0Mf,50.0Mf,20.0Mf" />
diff --git a/examples/platforms/wifi_decay_2STA.xml b/examples/platforms/wifi_decay_2STA.xml
deleted file mode 100755 (executable)
index fed5614..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version='1.0'?>
-
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4.1">
-  <zone id="world" routing="Full">
-
-    <zone id="WIFI zone" routing="Cluster">
-        <!-- First declare the Access Point (ie, the wifi media) -->
-        <link id="AP1" sharing_policy="WIFI" bandwidth="54Mbps" latency="0ms" />
-
-        <!-- Two stations in the wifi zone -->
-        <host id="Station 1" speed="100.0Mf,50.0Mf,20.0Mf" />
-        <host id="Station 2" speed="100.0Mf,50.0Mf,20.0Mf" />
-
-        <!-- Specify that stations use the WIFI link for every communication (incoming or outgoing) -->
-        <host_link id="Station 1" up="AP1" down="AP1"/>
-        <host_link id="Station 2" up="AP1" down="AP1"/>
-
-        <router id="WIFI router"/>
-    </zone>
-
-
-    <!-- NODE1 AS -->
-    <zone id="Wired zone" routing="Full">
-      <host id="NODE1" speed="100.0Mf,50.0Mf,20.0Mf" />
-    </zone>
-    
-
-    <!-- AS Routing -->
-    <link id="Collector" sharing_policy="SHARED" bandwidth="100Mbps" latency="0ms" />
-    <zoneRoute src="WIFI zone" dst="Wired zone" gw_src="WIFI router" gw_dst="NODE1">
-      <link_ctn id="Collector" />
-    </zoneRoute>
-    
-  </zone>
-</platform>
index a62c35e..fa32133 100644 (file)
@@ -1,5 +1,5 @@
 foreach(example actor-create actor-daemon actor-join actor-kill actor-migrate actor-suspend actor-yield actor-lifetime
-                async-wait async-waitall async-waitany
+                comm-wait comm-waitall comm-waitany
                 exec-async exec-basic exec-dvfs exec-remote)
   set(tesh_files    ${tesh_files}   ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.tesh)
   set(examples_src  ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${example}/${example}.py)
@@ -19,6 +19,6 @@ endforeach()
 set(examples_src  ${examples_src}                                                      PARENT_SCOPE)
 set(tesh_files    ${tesh_files}   examples/python/actor-create/actor-create_d.xml
                                   examples/python/actor-lifetime/actor-lifetime_d.xml
-                                  examples/python/async-wait/async-wait_d.xml
-                                  examples/python/async-waitall/async-waitall_d.xml
-                                  examples/python/async-waitany/async-waitany_d.xml    PARENT_SCOPE)
+                                  examples/python/comm-wait/comm-wait_d.xml
+                                  examples/python/comm-waitall/comm-waitall_d.xml
+                                  examples/python/comm-waitany/comm-waitany_d.xml    PARENT_SCOPE)
similarity index 80%
rename from examples/python/async-wait/async-wait.tesh
rename to examples/python/comm-wait/comm-wait.tesh
index d95c005..7d7670f 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/async-wait.py ${platfdir}/small_platform_fatpipe.xml async-wait_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/comm-wait.py ${platfdir}/small_platform_fatpipe.xml comm-wait_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) Send 'Message 0' to 'Mailbox(receiver-0)'
 > [  0.000000] (2:receiver@Ruby) Wait for my first message
 > [  0.000000] (1:sender@Tremblay) Send 'Message 1' to 'Mailbox(receiver-0)'
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/async-waitall.py ${platfdir}/small_platform_fatpipe.xml async-waitall_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/comm-waitall.py ${platfdir}/small_platform_fatpipe.xml comm-waitall_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) Send 'Message 0' to 'Mailbox(receiver-0)'
 > [  0.000000] (2:receiver@Ruby) Wait for my first message
 > [  0.000000] (3:receiver@Perl) Wait for my first message
@@ -3,7 +3,7 @@
 p Testing Comm.wait_any()
 
 ! output sort 19
-$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/async-waitany.py ${platfdir}/small_platform.xml async-waitany_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/comm-waitany.py ${platfdir}/small_platform.xml comm-waitany_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) Send 'Message 0' to 'Mailbox(receiver-0)'
 > [  0.000000] (2:receiver@Fafard) Wait for my first message
 > [  0.000000] (3:receiver@Jupiter) Wait for my first message
index fb66719..21c1aa1 100644 (file)
@@ -62,7 +62,7 @@ endif()
 foreach (example 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-pingpong app-token-ring
-                 async-ready async-wait async-waitany async-waitall async-waituntil
+                 comm-ready comm-suspend comm-wait comm-waitany comm-waitall comm-waituntil
                  comm-dependent
                  cloud-capping cloud-migration cloud-simple
                  dht-chord dht-kademlia
@@ -71,6 +71,7 @@ foreach (example actor-create actor-daemon actor-exiting actor-join actor-kill
                  exec-async exec-basic exec-dvfs exec-ptask exec-remote exec-waitany exec-waitfor exec-dependent
                  maestro-set
                  mc-bugged1 mc-bugged1-liveness mc-bugged2 mc-electric-fence mc-failing-assert
+                network-wifi
                  io-async io-file-system io-file-remote io-disk-raw io-dependent
                  platform-failures platform-profile platform-properties
                  plugin-hostload
@@ -218,11 +219,12 @@ set(xml_files     ${xml_files}    ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/s4u-a
                                   ${CMAKE_CURRENT_SOURCE_DIR}/actor-yield/s4u-actor-yield_d.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/s4u-app-bittorrent_d.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworkers/s4u-app-masterworkers_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/s4u-async-wait_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/async-waitany/s4u-async-waitany_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/async-waitall/s4u-async-waitall_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/async-ready/s4u-async-ready_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/async-waituntil/s4u-async-waituntil_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/comm-suspend/s4u-comm-suspend_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/comm-wait/s4u-comm-wait_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/comm-waitany/s4u-comm-waitany_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/comm-waitall/s4u-comm-waitall_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/comm-ready/s4u-comm-ready_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/comm-waituntil/s4u-comm-waituntil_d.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord_d.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/s4u-dht-kademlia_d.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/energy-boot/platform_boot.xml
similarity index 77%
rename from examples/s4u/async-ready/s4u-async-ready.cpp
rename to examples/s4u/comm-ready/s4u-comm-ready.cpp
index 68f1242..88cfbda 100644 (file)
@@ -33,7 +33,8 @@ static void peer(int argc, char** argv)
   double msg_size     = std::stol(argv[3]); /* - message size in bytes */
   long peers_count    = std::stod(argv[4]); /* - number of peers */
 
-  /* Set myself as the persistent receiver of my mailbox so that messages start flowing to me as soon as they are put into it */
+  /* Set myself as the persistent receiver of my mailbox so that messages start flowing to me as soon as they are put
+   * into it */
   simgrid::s4u::Mailbox* my_mbox = simgrid::s4u::Mailbox::by_name(std::string("peer-") + std::to_string(my_id));
   my_mbox->set_receiver(simgrid::s4u::Actor::self());
 
@@ -43,10 +44,11 @@ static void peer(int argc, char** argv)
   for (int i = 0; i < messages_count; i++) {
     for (int peer_id = 0; peer_id < peers_count; peer_id++) {
       if (peer_id != my_id) {
-        std::string mboxName          = std::string("peer-") + std::to_string(peer_id);
-        simgrid::s4u::Mailbox* mbox   = simgrid::s4u::Mailbox::by_name(mboxName);
-        std::string msgName           = std::string("Message ") + std::to_string(i) + std::string(" from peer ") + std::to_string(my_id);
-        std::string* payload          = new std::string(msgName); // copy the data we send:
+        std::string mboxName        = std::string("peer-") + std::to_string(peer_id);
+        simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name(mboxName);
+        std::string msgName =
+            std::string("Message ") + std::to_string(i) + std::string(" from peer ") + std::to_string(my_id);
+        std::string* payload = new std::string(msgName); // copy the data we send:
         // 'msgName' is not a stable storage location
         XBT_INFO("Send '%s' to '%s'", msgName.c_str(), mboxName.c_str());
         /* Create a communication representing the ongoing communication */
@@ -58,23 +60,27 @@ static void peer(int argc, char** argv)
   /* Start sending messages to let peers know that they should stop */
   for (int peer_id = 0; peer_id < peers_count; peer_id++) {
     if (peer_id != my_id) {
-      std::string mboxName          = std::string("peer-") + std::to_string(peer_id);
-      simgrid::s4u::Mailbox* mbox   = simgrid::s4u::Mailbox::by_name(mboxName);
-      std::string* payload          = new std::string("finalize"); // Make a copy of the data we will send
+      std::string mboxName        = std::string("peer-") + std::to_string(peer_id);
+      simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name(mboxName);
+      std::string* payload        = new std::string("finalize"); // Make a copy of the data we will send
       pending_comms.push_back(mbox->put_async(payload, msg_size));
       XBT_INFO("Send 'finalize' to 'peer-%d'", peer_id);
     }
   }
   XBT_INFO("Done dispatching all messages");
 
-  /* Retrieve all the messages other peers have been sending to me until I receive all the corresponding "Finalize" messages */
+  /* Retrieve all the messages other peers have been sending to me until I receive all the corresponding "Finalize"
+   * messages */
   int pending_finalize_messages = peers_count - 1;
   while (pending_finalize_messages > 0) {
     if (my_mbox->ready()) {
-      double start          = simgrid::s4u::Engine::get_clock();
+      double start                = simgrid::s4u::Engine::get_clock();
       const std::string* received = static_cast<std::string*>(my_mbox->get());
-      double waiting_time   = simgrid::s4u::Engine::get_clock() - start;
-      xbt_assert(waiting_time == 0, "Expecting the waiting time to be 0 because the communication was supposedly ready, but got %f instead", waiting_time);
+      double waiting_time         = simgrid::s4u::Engine::get_clock() - start;
+      xbt_assert(
+          waiting_time == 0,
+          "Expecting the waiting time to be 0 because the communication was supposedly ready, but got %f instead",
+          waiting_time);
       XBT_INFO("I got a '%s'.", received->c_str());
       if (*received == "finalize") {
         pending_finalize_messages--;
@@ -92,8 +98,7 @@ static void peer(int argc, char** argv)
   XBT_INFO("Goodbye now!");
 }
 
-
-int main(int argc, char *argv[])
+int main(int argc, char* argv[])
 {
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n", argv[0]);
 
similarity index 97%
rename from examples/s4u/async-ready/s4u-async-ready.tesh
rename to examples/s4u/comm-ready/s4u-comm-ready.tesh
index 9b6d9a8..96902d9 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test1 Peer sending and receiving
 
-$ ${bindir:=.}/s4u-async-ready ${platfdir}/small_platform_fatpipe.xml s4u-async-ready_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-comm-ready ${platfdir}/small_platform_fatpipe.xml s4u-comm-ready_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:peer@Tremblay) Send 'Message 0 from peer 0' to 'peer-1'
 > [  0.000000] (2:peer@Ruby) Send 'Message 0 from peer 1' to 'peer-0'
 > [  0.000000] (1:peer@Tremblay) Send 'Message 0 from peer 0' to 'peer-2'
diff --git a/examples/s4u/comm-suspend/s4u-comm-suspend.cpp b/examples/s4u/comm-suspend/s4u-comm-suspend.cpp
new file mode 100644 (file)
index 0000000..144a029
--- /dev/null
@@ -0,0 +1,71 @@
+/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved.          */
+
+/* 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 suspend and resume an asynchronous communication. */
+
+#include "simgrid/s4u.hpp"
+#include <cstdlib>
+#include <iostream>
+#include <string>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_comm_wait, "Messages specific for this s4u example");
+
+static void sender(int argc, char**)
+{
+  xbt_assert(argc == 1, "Expecting no parameter from the XML deployment file but got %d", argc - 1);
+
+  simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name("receiver");
+
+  // Copy the data we send: the 'msg_content' variable is not a stable storage location.
+  // It will be destroyed when this actor leaves the loop, ie before the receiver gets the data
+  std::string* payload = new std::string("Sent message");
+
+  /* Create a communication representing the ongoing communication and then */
+  simgrid::s4u::CommPtr comm = mbox->put_init(payload, 13194230);
+  XBT_INFO("Suspend the communication before it starts (remaining: %.0f bytes) and wait a second.",
+           comm->get_remaining());
+  simgrid::s4u::this_actor::sleep_for(1);
+  XBT_INFO("Now, start the communication (remaining: %.0f bytes) and wait another second.", comm->get_remaining());
+  comm->start();
+  simgrid::s4u::this_actor::sleep_for(1);
+
+  XBT_INFO("There is still %.0f bytes to transfer in this communication. Suspend it for one second.",
+           comm->get_remaining());
+  comm->suspend();
+  XBT_INFO("Now there is %.0f bytes to transfer. Resume it and wait for its completion.", comm->get_remaining());
+  comm->resume();
+  comm->wait();
+  XBT_INFO("There is %f bytes to transfer after the communication completion.", comm->get_remaining());
+  XBT_INFO("Suspending a completed activity is a no-op.");
+  comm->suspend();
+}
+
+static void receiver(int, char**)
+{
+  simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name("receiver");
+
+  XBT_INFO("Wait for the message.");
+  void* payload = mbox->get();
+
+  const std::string* received = static_cast<std::string*>(payload);
+  XBT_INFO("I got '%s'.", received->c_str());
+
+  delete received;
+}
+
+int main(int argc, char* argv[])
+{
+  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n", argv[0]);
+
+  simgrid::s4u::Engine e(&argc, argv);
+  e.register_function("sender", &sender);
+  e.register_function("receiver", &receiver);
+
+  e.load_platform(argv[1]);
+  e.load_deployment(argv[2]);
+  e.run();
+
+  return 0;
+}
diff --git a/examples/s4u/comm-suspend/s4u-comm-suspend.tesh b/examples/s4u/comm-suspend/s4u-comm-suspend.tesh
new file mode 100644 (file)
index 0000000..8d05012
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env tesh
+
+$ ${bindir:=.}/s4u-comm-suspend ${platfdir}/small_platform.xml s4u-comm-suspend_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:sender@Tremblay) Suspend the communication before it starts (remaining: 13194230 bytes) and wait a second.
+> [  0.000000] (2:receiver@Jupiter) Wait for the message.
+> [  1.000000] (1:sender@Tremblay) Now, start the communication (remaining: 13194230 bytes) and wait another second.
+> [  2.000000] (1:sender@Tremblay) There is still 6660438 bytes to transfer in this communication. Suspend it for one second.
+> [  2.000000] (1:sender@Tremblay) Now there is 6660438 bytes to transfer. Resume it and wait for its completion.
+> [  3.000000] (2:receiver@Jupiter) I got 'Sent message'.
+> [  3.000000] (1:sender@Tremblay) There is 0.000000 bytes to transfer after the communication completion.
+> [  3.000000] (1:sender@Tremblay) Suspending a completed activity is a no-op.
diff --git a/examples/s4u/comm-suspend/s4u-comm-suspend_d.xml b/examples/s4u/comm-suspend/s4u-comm-suspend_d.xml
new file mode 100644 (file)
index 0000000..3c24900
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
+<platform version="4.1">
+  <actor host="Tremblay" function="sender" />
+  <actor host="Jupiter" function="receiver" />
+</platform>
similarity index 96%
rename from examples/s4u/async-wait/s4u-async-wait.cpp
rename to examples/s4u/comm-wait/s4u-comm-wait.cpp
index 37d6058..4e7ee1a 100644 (file)
@@ -16,7 +16,7 @@
 #include <iostream>
 #include <string>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_async_wait, "Messages specific for this s4u example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_comm_wait, "Messages specific for this s4u example");
 
 static void sender(int argc, char** argv)
 {
@@ -87,7 +87,7 @@ static void receiver(int, char**)
   }
 }
 
-int main(int argc, char *argv[])
+int main(int argc, charargv[])
 {
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n", argv[0]);
 
similarity index 85%
rename from examples/s4u/async-wait/s4u-async-wait.tesh
rename to examples/s4u/comm-wait/s4u-comm-wait.tesh
index 83b5859..d78bf49 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test1 Sleep_sender > Sleep_receiver
 
-$ ${bindir:=.}/s4u-async-wait ${platfdir}/small_platform_fatpipe.xml s4u-async-wait_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-comm-wait ${platfdir}/small_platform_fatpipe.xml s4u-comm-wait_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) sleep_start_time : 5.000000 , sleep_test_time : 0.000000
 > [  0.000000] (2:receiver@Ruby) sleep_start_time : 1.000000 , sleep_test_time : 0.100000
 > [  1.000000] (2:receiver@Ruby) Wait for my first message
@@ -98,7 +98,7 @@ public:
   }
 };
 
-int main(int argc, char *argv[])
+int main(int argc, charargv[])
 {
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n", argv[0]);
 
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ ${bindir:=.}/s4u-async-waitall ${platfdir}/small_platform_fatpipe.xml s4u-async-waitall_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-comm-waitall ${platfdir}/small_platform_fatpipe.xml s4u-comm-waitall_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) Send 'Message 0' to 'receiver-0'
 > [  0.000000] (2:receiver@Ruby) Wait for my first message
 > [  0.000000] (3:receiver@Perl) Wait for my first message
@@ -22,7 +22,7 @@
 #include <iostream>
 #include <string>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_async_waitall, "Messages specific for this s4u example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_comm_waitall, "Messages specific for this s4u example");
 
 class Sender {
   long messages_count;  /* - number of messages */
@@ -111,7 +111,7 @@ public:
   }
 };
 
-int main(int argc, char *argv[])
+int main(int argc, charargv[])
 {
   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n", argv[0]);
 
@@ -3,7 +3,7 @@
 p Testing this_actor->wait_any()
 
 ! output sort 19
-$ ${bindir:=.}/s4u-async-waitany ${platfdir}/small_platform.xml s4u-async-waitany_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-comm-waitany ${platfdir}/small_platform.xml s4u-comm-waitany_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) Send 'Message 0' to 'receiver-0'
 > [  0.000000] (2:receiver@Fafard) Wait for my first message
 > [  0.000000] (3:receiver@Jupiter) Wait for my first message
@@ -6,7 +6,7 @@
 /* This example shows how to use simgrid::s4u::Activity::wait_until() and
  * simgrid::s4u::Activity::wait_for() on a given communication.
  *
- * It is very similar to the async-wait example, but the sender initially
+ * It is very similar to the comm-wait example, but the sender initially
  * does some waits that are too short before doing an infinite wait.
  */
 
@@ -15,7 +15,7 @@
 #include <iostream>
 #include <string>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_async_waituntil, "Messages specific for this s4u example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_comm_waituntil, "Messages specific for this s4u example");
 
 static void sender(int argc, char** argv)
 {
@@ -28,10 +28,10 @@ static void sender(int argc, char** argv)
 
   /* Start dispatching all messages to receivers, in a round robin fashion */
   for (int i = 0; i < messages_count; i++) {
-    std::string mboxName          = std::string("receiver-") + std::to_string(i % receivers_count);
-    simgrid::s4u::Mailbox* mbox   = simgrid::s4u::Mailbox::by_name(mboxName);
-    std::string msgName           = std::string("Message ") + std::to_string(i);
-    std::string* payload          = new std::string(msgName); // copy the data we send:
+    std::string mboxName        = std::string("receiver-") + std::to_string(i % receivers_count);
+    simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name(mboxName);
+    std::string msgName         = std::string("Message ") + std::to_string(i);
+    std::string* payload        = new std::string(msgName); // copy the data we send:
 
     // 'msgName' is not a stable storage location
     XBT_INFO("Send '%s' to '%s'", msgName.c_str(), mboxName.c_str());
@@ -43,9 +43,9 @@ static void sender(int argc, char** argv)
 
   /* Start sending messages to let the workers know that they should stop */
   for (int i = 0; i < receivers_count; i++) {
-    std::string mboxName          = std::string("receiver-") + std::to_string(i % receivers_count);
-    simgrid::s4u::Mailbox* mbox   = simgrid::s4u::Mailbox::by_name(mboxName);
-    std::string* payload          = new std::string("finalize"); // Make a copy of the data we will send
+    std::string mboxName        = std::string("receiver-") + std::to_string(i % receivers_count);
+    simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name(mboxName);
+    std::string* payload        = new std::string("finalize"); // Make a copy of the data we will send
 
     simgrid::s4u::CommPtr comm = mbox->put_async(payload, 0);
     pending_comms.push_back(comm);
@@ -2,7 +2,7 @@
 
 p Test1 Sleep_sender > Sleep_receiver
 
-$ ${bindir:=.}/s4u-async-waituntil ${platfdir}/small_platform_fatpipe.xml s4u-async-waituntil_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-comm-waituntil ${platfdir}/small_platform_fatpipe.xml s4u-comm-waituntil_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) Send 'Message 0' to 'receiver-0'
 > [  0.000000] (2:receiver@Ruby) Wait for my first message
 > [  0.000000] (1:sender@Tremblay) Send 'Message 1' to 'receiver-0'
diff --git a/examples/s4u/network-wifi/s4u-network-wifi.cpp b/examples/s4u/network-wifi/s4u-network-wifi.cpp
new file mode 100644 (file)
index 0000000..57c896a
--- /dev/null
@@ -0,0 +1,49 @@
+/* Copyright (c) 2017-2020. The SimGrid Team. All rights reserved.          */
+
+/* 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. */
+
+#include "simgrid/s4u.hpp"
+
+/* This example demonstrates how to use wifi links in SimGrid. Most of the interesting things happen in the
+ * corresponding XML file.
+ */
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_network_wifi, "Messages specific for this s4u example");
+
+static void sender(simgrid::s4u::Mailbox* mailbox, int data_size)
+{
+  XBT_INFO("Send a message to the other station.");
+  static char message[] = "message";
+  mailbox->put(message, data_size);
+  XBT_INFO("Done.");
+}
+static void receiver(simgrid::s4u::Mailbox* mailbox)
+{
+  XBT_INFO("Wait for a message.");
+  mailbox->get();
+  XBT_INFO("Done.");
+}
+
+int main(int argc, char* argv[])
+{
+  simgrid::s4u::Engine e(&argc, argv);
+
+  xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s platform.xml deployment.xml\n", argv[0], argv[0]);
+
+  e.load_platform(argv[1]);
+
+  auto mailbox  = simgrid::s4u::Mailbox::by_name("mailbox");
+  auto station1 = simgrid::s4u::Host::by_name("Station 1");
+  auto station2 = simgrid::s4u::Host::by_name("Station 2");
+  simgrid::s4u::Actor::create("sender", station1, sender, mailbox, 1e7);
+  simgrid::s4u::Actor::create("receiver", station2, receiver, mailbox);
+
+  auto ap = simgrid::s4u::Link::by_name("AP1");
+  ap->set_host_wifi_rate(station1, 1); // The host "Station 1" uses the second level of bandwidths on that AP
+  ap->set_host_wifi_rate(station2, 0); // This is perfectly useless as level 0 is used by default
+
+  e.run();
+
+  return 0;
+}
diff --git a/examples/s4u/network-wifi/s4u-network-wifi.tesh b/examples/s4u/network-wifi/s4u-network-wifi.tesh
new file mode 100644 (file)
index 0000000..b4e49d1
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/env tesh
+
+$ ${bindir:=.}/s4u-network-wifi ${platfdir}/wifi.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:sender@Station 1) Send a message to the other station.
+> [  0.000000] (2:receiver@Station 2) Wait for a message.
+> [  3.888889] (1:sender@Station 1) Done.
+> [  3.888889] (2:receiver@Station 2) Done.
index 5885acc..3640e26 100644 (file)
@@ -44,7 +44,7 @@ XBT_PUBLIC const char* sg_actor_get_property_value(const_sg_actor_t actor, const
 XBT_PUBLIC xbt_dict_t sg_actor_get_properties(const_sg_actor_t actor);
 XBT_PUBLIC void sg_actor_suspend(sg_actor_t actor);
 XBT_PUBLIC void sg_actor_resume(sg_actor_t actor);
-XBT_PUBLIC int sg_actor_is_suspended(sg_actor_t actor);
+XBT_PUBLIC int sg_actor_is_suspended(const_sg_actor_t actor);
 XBT_PUBLIC sg_actor_t sg_actor_restart(sg_actor_t actor);
 XBT_PUBLIC void sg_actor_set_auto_restart(sg_actor_t actor, int auto_restart);
 XBT_PUBLIC void sg_actor_daemonize(sg_actor_t actor);
index 64cc2cb..33ab45c 100644 (file)
@@ -204,7 +204,7 @@ XBT_PUBLIC const char* MSG_process_get_property_value(const_sg_actor_t process,
 
 XBT_PUBLIC void MSG_process_suspend(msg_process_t process);
 XBT_PUBLIC void MSG_process_resume(msg_process_t process);
-XBT_PUBLIC int MSG_process_is_suspended(msg_process_t process);
+XBT_PUBLIC int MSG_process_is_suspended(const_sg_actor_t process);
 XBT_PUBLIC void MSG_process_restart(msg_process_t process);
 /** @brief Sets the "auto-restart" flag of the process.
  *
index bc36088..73fa2ff 100644 (file)
@@ -31,7 +31,7 @@ XBT_PUBLIC void sg_file_close(const_sg_file_t fd);
 
 XBT_PUBLIC const char* sg_file_get_name(const_sg_file_t fd);
 XBT_PUBLIC sg_size_t sg_file_get_size(const_sg_file_t fd);
-XBT_PUBLIC void sg_file_dump(sg_file_t fd);
+XBT_PUBLIC void sg_file_dump(const_sg_file_t fd);
 XBT_PUBLIC void* sg_file_get_data(const_sg_file_t fd);
 XBT_PUBLIC void sg_file_set_data(sg_file_t fd, void* data);
 XBT_PUBLIC void sg_file_seek(sg_file_t fd, sg_offset_t offset, int origin);
index 2572d61..4a8789a 100644 (file)
@@ -76,12 +76,12 @@ public:
    * This function is optional: you can call wait() even if you didn't call start()
    */
   virtual Activity* start() = 0;
-  /** Blocks until the activity is terminated */
+  /** Blocks the current actor until the activity is terminated */
   virtual Activity* wait() = 0;
-  /** Blocks until the activity is terminated, or until the timeout is elapsed
+  /** Blocks the current actor until the activity is terminated, or until the timeout is elapsed\n
    *  Raises: timeout exception.*/
   virtual Activity* wait_for(double timeout) = 0;
-  /** Blocks until the activity is terminated, or until the time limit is reached
+  /** Blocks the current actor until the activity is terminated, or until the time limit is reached\n
    * Raises: timeout exception. */
   void wait_until(double time_limit);
 
@@ -93,6 +93,13 @@ public:
   /** Tests whether the given activity is terminated yet. */
   virtual bool test();
 
+  /** Blocks the progression of this activity until it gets resumed */
+  virtual Activity* suspend();
+  /** Unblock the progression of this activity if it was suspended previously */
+  virtual Activity* resume();
+  /** Whether or not the progression of this activity is blocked */
+  bool is_suspended() { return suspended_; }
+
   virtual const char* get_cname() const       = 0;
   virtual const std::string& get_name() const = 0;
 
@@ -127,6 +134,7 @@ private:
   kernel::activity::ActivityImplPtr pimpl_ = nullptr;
   Activity::State state_                   = Activity::State::INITED;
   double remains_                          = 0;
+  bool suspended_                          = false;
   std::vector<ActivityPtr> successors_;
   std::set<ActivityPtr> dependencies_;
   std::atomic_int_fast32_t refcount_{0};
index c664c03..1053860 100644 (file)
@@ -178,7 +178,7 @@ public:
   /** Sets the time at which that actor should be killed */
   void set_kill_time(double time);
   /** Retrieves the time at which that actor will be killed (or -1 if not set) */
-  double get_kill_time();
+  double get_kill_time() const;
 
   /** @brief Moves the actor to another host
    *
index 89f4f79..552d57a 100644 (file)
@@ -63,7 +63,20 @@ public:
   /** @brief Describes how the link is shared between flows */
   SharingPolicy get_sharing_policy() const;
 
-  /** @brief Returns the current load (in flops per second) */
+  /** @brief Set the level of communication speed of the given host on this wifi link.
+   *
+   * The bandwidth of a wifi link for a given host depends on its SNR (signal to noise ratio),
+   * which ultimately depends on the distance between the host and the station and the material between them.
+   *
+   * This is modeled in SimGrid by providing several bandwidths to wifi links, one per SNR level (just provide
+   * comma-separated values in the XML file). By default, the first level in the list is used, but you can use the
+   * current function to specify that a given host uses another level of bandwidth. This can be used to take the
+   * location of hosts into account, or even to model mobility in your SimGrid simulation.
+   *
+   * Note that this function asserts that the link is actually a wifi link */
+  void set_host_wifi_rate(s4u::Host* host, int level);
+
+  /** @brief Returns the current load (in bytes per second) */
   double get_usage() const;
 
   /** @brief Check if the Link is used (at least one flow uses the link) */
index 907f73c..21fa56b 100644 (file)
@@ -145,7 +145,7 @@ void AppSide::handle_messages() const
   }
 }
 
-void AppSide::main_loop()
+void AppSide::main_loop() const
 {
   while (true) {
     simgrid::mc::wait_for_requests();
index ccb19fa..d159af9 100644 (file)
@@ -38,7 +38,7 @@ private:
 public:
   Channel const& get_channel() const { return channel_; }
   Channel& get_channel() { return channel_; }
-  XBT_ATTRIB_NORETURN void main_loop();
+  XBT_ATTRIB_NORETURN void main_loop() const;
   void report_assertion_failure() const;
   void ignore_memory(void* addr, std::size_t size) const;
   void ignore_heap(void* addr, std::size_t size) const;
index c76bad3..a255124 100644 (file)
@@ -96,7 +96,7 @@ void MSG_process_resume(sg_actor_t actor)
 {
   sg_actor_resume(actor);
 }
-int MSG_process_is_suspended(sg_actor_t actor)
+int MSG_process_is_suspended(const_sg_actor_t actor)
 {
   return sg_actor_is_suspended(actor);
 }
index daaba85..db04237 100644 (file)
@@ -31,7 +31,7 @@ public:
   double computed_flops_lookup();
   double get_intensity() const { return dp_intensity_; }
   void set_intensity(double intensity) { dp_intensity_ = intensity; }
-  double get_working_set_memory() const { return working_set_memory_; }
+  sg_size_t get_working_set_memory() const { return working_set_memory_; }
   void set_working_set_memory(sg_size_t size) { working_set_memory_ = size; }
   void set_migration_speed(double speed) { mig_speed_ = speed; }
   double get_migration_speed() const { return mig_speed_; }
index 6c37927..2411894 100644 (file)
@@ -716,7 +716,7 @@ sg_size_t sg_file_get_size(const_sg_file_t fd)
   return fd->size();
 }
 
-void sg_file_dump(sg_file_t fd)
+void sg_file_dump(const_sg_file_t fd)
 {
   fd->dump();
 }
index f1a24ae..18d27cf 100644 (file)
@@ -42,9 +42,35 @@ bool Activity::test()
   return false;
 }
 
+Activity* Activity::suspend()
+{
+  if (suspended_)
+    return this; // Already suspended
+  suspended_ = true;
+
+  if (state_ == State::STARTED)
+    pimpl_->suspend();
+
+  return this;
+}
+
+Activity* Activity::resume()
+{
+  if (not suspended_)
+    return this; // nothing to restore when it's not suspended
+
+  if (state_ == State::STARTED)
+    pimpl_->resume();
+
+  return this;
+}
+
 double Activity::get_remaining() const
 {
-  return remains_;
+  if (state_ == State::INITED || state_ == State::STARTING)
+    return remains_;
+  else
+    return pimpl_->get_remaining();
 }
 
 Activity* Activity::set_remaining(double remains)
index da64c24..b9cc222 100644 (file)
@@ -245,7 +245,7 @@ void Actor::set_kill_time(double kill_time)
 }
 
 /** @brief Get the kill time of an actor(or 0 if unset). */
-double Actor::get_kill_time()
+double Actor::get_kill_time() const
 {
   return pimpl_->get_kill_time();
 }
@@ -624,7 +624,7 @@ void sg_actor_resume(sg_actor_t actor)
  *
  * This checks whether an actor is suspended or not by inspecting the task on which it was waiting for the completion.
  */
-int sg_actor_is_suspended(sg_actor_t actor)
+int sg_actor_is_suspended(const_sg_actor_t actor)
 {
   return actor->is_suspended();
 }
index 4d5bb78..9141385 100644 (file)
@@ -138,6 +138,10 @@ Comm* Comm::start()
   } else {
     xbt_die("Cannot start a communication before specifying whether we are the sender or the receiver");
   }
+
+  if (suspended_)
+    pimpl_->suspend();
+
   state_ = State::STARTED;
   return this;
 }
index b0c7175..7908468 100644 (file)
@@ -180,6 +180,10 @@ Exec* Exec::start()
           .set_flops_amount(flops_amounts_.front())
           .start();
     });
+
+  if (suspended_)
+    pimpl_->suspend();
+
   state_ = State::STARTED;
   on_start(*Actor::self(), *this);
   return this;
index cc9794a..4831daf 100644 (file)
@@ -44,6 +44,10 @@ Io* Io::start()
           .start();
     }
   });
+
+  if (suspended_)
+    pimpl_->suspend();
+
   state_ = State::STARTED;
   return this;
 }
index bec2b9e..1b9dfd7 100644 (file)
@@ -11,6 +11,7 @@
 #include "simgrid/simix.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
 #include "src/surf/network_interface.hpp"
+#include "src/surf/network_wifi.hpp"
 #include "xbt/log.h"
 
 namespace simgrid {
@@ -75,6 +76,15 @@ Link::SharingPolicy Link::get_sharing_policy() const
   return this->pimpl_->get_sharing_policy();
 }
 
+void Link::set_host_wifi_rate(s4u::Host* host, int level)
+{
+  xbt_assert(pimpl_->get_sharing_policy() == Link::SharingPolicy::WIFI, "Link %s does not seem to be a wifi link.",
+             get_cname());
+  auto* wlink = dynamic_cast<kernel::resource::NetworkWifiLink*>(pimpl_);
+  xbt_assert(wlink != nullptr, "Cannot convert link %s into a wifi link.", get_cname());
+  wlink->set_host_rate(host, level);
+}
+
 double Link::get_usage() const
 {
   return this->pimpl_->get_constraint()->get_usage();
index c510fc5..6cc7757 100644 (file)
@@ -142,8 +142,8 @@ static void *smpi_shared_malloc_local(size_t size, const char *file, int line)
 }
 
 // Align functions, from http://stackoverflow.com/questions/4840410/how-to-align-a-pointer-in-c
-#define ALIGN_UP(n, align) (((n) + (align)-1) & -(align))
-#define ALIGN_DOWN(n, align) ((n) & -(align))
+#define ALIGN_UP(n, align) ((((int64_t)n) + ((int64_t)align)-1) & -((int64_t)align))
+#define ALIGN_DOWN(n, align) (((int64_t)n) & -((int64_t)align))
 
 constexpr unsigned PAGE_SIZE      = 0x1000;
 constexpr unsigned HUGE_PAGE_SIZE = 1U << 21;
@@ -184,7 +184,7 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
                                 "to allow big allocations.\n",
              size >> 20);
   if(use_huge_page)
-    mem = (void*)ALIGN_UP((int64_t)allocated_ptr, HUGE_PAGE_SIZE);
+    mem = (void*)ALIGN_UP(allocated_ptr, HUGE_PAGE_SIZE);
   else
     mem = allocated_ptr;
 
@@ -235,8 +235,8 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
     if(i_block < nb_shared_blocks-1)
       xbt_assert(stop_offset < shared_block_offsets[2*i_block+2],
               "stop_offset (%zu) should be lower than its successor start offset (%zu)", stop_offset, shared_block_offsets[2*i_block+2]);
-    size_t start_block_offset = ALIGN_UP((int64_t)start_offset, smpi_shared_malloc_blocksize);
-    size_t stop_block_offset = ALIGN_DOWN((int64_t)stop_offset, smpi_shared_malloc_blocksize);
+    size_t start_block_offset = ALIGN_UP(start_offset, smpi_shared_malloc_blocksize);
+    size_t stop_block_offset = ALIGN_DOWN(stop_offset, smpi_shared_malloc_blocksize);
     for (size_t offset = start_block_offset; offset < stop_block_offset; offset += smpi_shared_malloc_blocksize) {
       XBT_DEBUG("\t\tglobal shared allocation, mmap block offset %zx", offset);
       void* pos = (void*)((unsigned long)mem + offset);
@@ -248,8 +248,8 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
                              "and that the directory you are passing is mounted correctly (mount /path/to/huge -t hugetlbfs -o rw,mode=0777).",
                  strerror(errno));
     }
-    size_t low_page_start_offset = ALIGN_UP((int64_t)start_offset, PAGE_SIZE);
-    size_t low_page_stop_offset = (int64_t)start_block_offset < ALIGN_DOWN((int64_t)stop_offset, PAGE_SIZE) ? start_block_offset : ALIGN_DOWN((int64_t)stop_offset, (int64_t)PAGE_SIZE);
+    size_t low_page_start_offset = ALIGN_UP(start_offset, PAGE_SIZE);
+    size_t low_page_stop_offset = (int64_t)start_block_offset < ALIGN_DOWN(stop_offset, PAGE_SIZE) ? start_block_offset : ALIGN_DOWN(stop_offset, PAGE_SIZE);
     if(low_page_start_offset < low_page_stop_offset) {
       XBT_DEBUG("\t\tglobal shared allocation, mmap block start");
       void* pos = (void*)((unsigned long)mem + low_page_start_offset);
@@ -263,7 +263,7 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
     }
     if(low_page_stop_offset <= stop_block_offset) {
       XBT_DEBUG("\t\tglobal shared allocation, mmap block stop");
-      size_t high_page_stop_offset = stop_offset == size ? size : ALIGN_DOWN((int64_t)stop_offset, PAGE_SIZE);
+      size_t high_page_stop_offset = stop_offset == size ? size : ALIGN_DOWN(stop_offset, PAGE_SIZE);
       if(high_page_stop_offset > stop_block_offset) {
         void* pos = (void*)((unsigned long)mem + stop_block_offset);
         const void* res = mmap(pos, high_page_stop_offset - stop_block_offset, PROT_READ | PROT_WRITE,
index 2c062cd..6d90be5 100644 (file)
@@ -46,8 +46,12 @@ double NetworkWifiLink::get_host_rate(const s4u::Host* host)
     return -1;
 
   int rate_id = host_rates_it->second;
-  xbt_assert(rate_id >= 0 && rate_id < (int)bandwidths_.size(), "Host '%s' has an invalid rate '%d' on wifi link '%s'",
-             host->get_name().c_str(), rate_id, this->get_cname());
+  xbt_assert(rate_id >= 0,
+             "Negative host wifi rate levels are invalid but host '%s' uses %d as a rate level on link '%s'",
+             host->get_cname(), rate_id, this->get_cname());
+  xbt_assert(rate_id < (int)bandwidths_.size(),
+             "Link '%s' only has %zu wifi rate levels, so the provided level %d is invalid for host '%s'.",
+             this->get_cname(), bandwidths_.size(), rate_id, host->get_cname());
 
   Metric rate = use_decay_model_ ? decay_bandwidths_[rate_id] : bandwidths_[rate_id];
   return rate.peak * rate.scale;
index 1d6be9f..5fc60df 100644 (file)
@@ -329,9 +329,9 @@ int xbt_automaton_exp_label_compare(const_xbt_automaton_exp_label_t l1, const_xb
 
 int xbt_automaton_propositional_symbols_compare_value(const_xbt_dynar_t s1, const_xbt_dynar_t s2)
 {
-  unsigned int nb_elem = xbt_dynar_length(s1);
+  unsigned long nb_elem = xbt_dynar_length(s1);
 
-  for (unsigned int cursor = 0; cursor < nb_elem; cursor++) {
+  for (unsigned long cursor = 0; cursor < nb_elem; cursor++) {
     const int* iptr1 = xbt_dynar_get_ptr(s1, cursor);
     const int* iptr2 = xbt_dynar_get_ptr(s2, cursor);
     if(*iptr1 != *iptr2)
index d9a44ef..d3c26bb 100644 (file)
@@ -54,7 +54,7 @@ static void initialize_heapinfo_heapinfo(const s_xbt_mheap_t* mdp)
 {
   // Update heapinfo about the heapinfo pages (!):
   xbt_assert((uintptr_t) mdp->heapinfo % BLOCKSIZE == 0);
-  int block = BLOCK(mdp->heapinfo);
+  size_t block   = BLOCK(mdp->heapinfo);
   size_t nblocks = mdp->heapsize * sizeof(malloc_info) / BLOCKSIZE;
   // Mark them as free:
   for (size_t j=0; j!=nblocks; ++j) {
@@ -250,7 +250,7 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
       result = mmalloc(mdp, BLOCKSIZE); // does not return NULL
       block = BLOCK(result);
 
-      mdp->heapinfo[block].type = log;
+      mdp->heapinfo[block].type = (int)log;
       /* Link all fragments but the first as free, and add the block to the swag of blocks containing free frags  */
       size_t i;
       for (i = 1; i < (size_t) (BLOCKSIZE >> log); ++i) {
index 186cc66..4ce18de 100644 (file)
@@ -79,7 +79,7 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
     /* Full blocks -> Full blocks; see if we can hold it in place. */
     blocks = BLOCKIFY(size);
     if (blocks < mdp->heapinfo[block].busy_block.size) {
-      int it;
+      size_t it;
       /* The new size is smaller; return excess memory to the free list. */
       for (it= block+blocks; it< mdp->heapinfo[block].busy_block.size ; it++){
         mdp->heapinfo[it].type = MMALLOC_TYPE_UNFRAGMENTED; // FIXME that should be useless, type should already be 0 here
@@ -134,7 +134,7 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
       /* The new size is the same kind of fragment.  */
 
       result = ptr;
-      int frag_nb = RESIDUAL(result, BLOCKSIZE) >> type;
+      uintptr_t frag_nb                                 = RESIDUAL(result, BLOCKSIZE) >> type;
       mdp->heapinfo[block].busy_frag.frag_size[frag_nb] = requested_size;
       mdp->heapinfo[block].busy_frag.ignore[frag_nb] = 0;
 
index b80030c..1a1c371 100644 (file)
@@ -80,7 +80,7 @@ double xbt_os_time(void)
   return (double) (time(NULL));
 #endif                          /* HAVE_GETTIMEOFDAY? */
 
-  return tv.tv_sec + tv.tv_usec / 1000000.0;
+  return (double)tv.tv_sec + (double)tv.tv_usec / 1e6;
 }
 
 void xbt_os_sleep(double sec)
@@ -91,14 +91,14 @@ void xbt_os_sleep(double sec)
 
 #elif HAVE_NANOSLEEP
   struct timespec ts;
-  ts.tv_sec sec;
-  ts.tv_nsec = (sec - floor(sec)) * 1e9;
+  ts.tv_sec  = (time_t)sec;
+  ts.tv_nsec = (long)((sec - floor(sec)) * 1e9);
   nanosleep (&ts, NULL);
 #else                           /* don't have nanosleep. Use select to sleep less than one second */
   struct timeval timeout;
 
-  timeout.tv_sec = (unsigned long) (sec);
-  timeout.tv_usec = (sec - floor(sec)) * 1000000;
+  timeout.tv_sec  = (long)sec;
+  timeout.tv_usec = (long)(sec - floor(sec)) * 1e6);
 
   select(0, NULL, NULL, NULL, &timeout);
 #endif
index a77b852..7321a37 100644 (file)
@@ -119,7 +119,7 @@ std::vector<double> xbt_parse_get_bandwidths(const std::string& filename, int li
 
   std::vector<double> bandwidths;
   std::vector<std::string> tokens;
-  boost::split(tokens, string, boost::is_any_of(";"));
+  boost::split(tokens, string, boost::is_any_of(";,"));
   for (auto token : tokens) {
     bandwidths.push_back(surf_parse_get_value_with_unit(
         filename, lineno, token.c_str(), units, entity_kind, name,
index 6c30765..16fe88f 100644 (file)
@@ -21,7 +21,7 @@ static void scheduleDAX(const_xbt_dynar_t dax)
   SD_task_t task;
 
   sg_host_t *hosts = sg_host_list();
-  int totalHosts = sg_host_count();
+  size_t totalHosts = sg_host_count();
   qsort((void *) hosts, totalHosts, sizeof(sg_host_t), name_compare_hosts);
 
   xbt_dynar_foreach(dax, cursor, task) {
index 4a075a8..5464341 100644 (file)
@@ -37,11 +37,11 @@ int main(int argc, char **argv)
       xbt_dynar_free_container(&route);
     }
     if (!strcmp(argv[2], "FULL_LINK")) {
-      int list_size = sg_host_count();
-      for (int i = 0; i < list_size; i++) {
+      size_t list_size = sg_host_count();
+      for (size_t i = 0; i < list_size; i++) {
         const_sg_host_t h1 = hosts[i];
         const char *name1 = sg_host_get_name(h1);
-        for (int j = 0; j < list_size; j++) {
+        for (size_t j = 0; j < list_size; j++) {
           const_sg_host_t h2 = hosts[j];
           const char *name2 = sg_host_get_name(h2);
           fprintf(stderr, "Route between %s and %s\n", name1, name2);
index 16c35f2..bb9cd25 100644 (file)
@@ -11,8 +11,8 @@
 
 int main(int argc, char ** argv)
 {
-  size_t M = 8*1024;
-  size_t N = 32*1024;
+  const int M = 8 * 1024;
+  const int N = 32 * 1024;
 
   MPI_Init(&argc, &argv);
 
index a4088a2..03ff5ec 100644 (file)
 // Set the elements between buf[start] and buf[stop-1] to (i+value)%256
 static void set(uint8_t *buf, size_t start, size_t stop, uint8_t value) {
   for(size_t i = start; i < stop; i++) {
-    buf[i] = (i+value)%256;
+    buf[i] = (uint8_t)((i + value) % 256);
   }
 }
 
 // Return the number of times that an element is equal to (i+value)%256 between buf[start] and buf[stop-1].
-static int count_all(const uint8_t* buf, size_t start, size_t stop, uint8_t value)
+static size_t count_all(const uint8_t* buf, size_t start, size_t stop, uint8_t value)
 {
   size_t occ = 0;
   for(size_t i = start ; i < stop ; i++) {
@@ -64,15 +64,15 @@ int main(int argc, char *argv[])
     for(int i = 0; i < nb_blocks-1; i++) {
       size_t start = shared_blocks[2*i+1];
       size_t stop = shared_blocks[2*i+2];
-      set(buf, start, stop, rank);
+      set(buf, start, stop, (uint8_t)rank);
     }
   }
   // Then, even processes send their buffer to their successor
   if(rank%2 == 0) {
-    MPI_Send(buf, mem_size, MPI_UINT8_T, rank+1, 0, MPI_COMM_WORLD);
+    MPI_Send(buf, (int)mem_size, MPI_UINT8_T, rank + 1, 0, MPI_COMM_WORLD);
   }
   else {
-    MPI_Recv(buf, mem_size, MPI_UINT8_T, rank-1, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
+    MPI_Recv(buf, (int)mem_size, MPI_UINT8_T, rank - 1, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
   }
 
 
@@ -81,7 +81,7 @@ int main(int argc, char *argv[])
     for(int i = 0; i < nb_blocks-1; i++) {
       size_t start = shared_blocks[2*i+1];
       size_t stop = shared_blocks[2*i+2];
-      int comm = check_all(buf, start, stop, rank-1);
+      int comm     = check_all(buf, start, stop, (uint8_t)(rank - 1));
       printf("[%d] The result of the (normal) communication check for block (0x%zx, 0x%zx) is: %d\n", rank, start, stop, comm);
     }
     memset(buf, rank, mem_size);
@@ -92,10 +92,10 @@ int main(int argc, char *argv[])
   // Then, even processes send a sub-part of their buffer their successor
   // Note that the last block should not be copied entirely
   if(rank%2 == 0) {
-    MPI_Send(buf+0x10000, mem_size-0xa00000, MPI_UINT8_T, rank+1, 0, MPI_COMM_WORLD);
+    MPI_Send(buf + 0x10000, (int)(mem_size - 0xa00000), MPI_UINT8_T, rank + 1, 0, MPI_COMM_WORLD);
   }
   else {
-    MPI_Recv(buf+0x10000, mem_size-0xa00000, MPI_UINT8_T, rank-1, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
+    MPI_Recv(buf + 0x10000, (int)(mem_size - 0xa00000), MPI_UINT8_T, rank - 1, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
   }
 
 
@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
     for(int i = 0; i < nb_blocks-1; i++) {
       size_t start = shared_blocks[2*i+1];
       size_t stop = shared_blocks[2*i+2];
-      int comm = check_all(buf, start, stop, rank-1);
+      int comm     = check_all(buf, start, stop, (uint8_t)(rank - 1));
       printf("[%d] The result of the (shifted) communication check for block (0x%zx, 0x%zx) is: %d\n", rank, start, stop, comm);
     }
   }
index 1a255df..29168cc 100644 (file)
 // Set the elements between buf[start] and buf[stop-1] to (i+value)%256
 static void set(uint8_t *buf, size_t start, size_t stop, uint8_t value) {
   for(size_t i = start; i < stop; i++) {
-    buf[i] = (i+value)%256;
+    buf[i] = (uint8_t)((i + value) % 256);
   }
 }
 
 // Return the number of times that an element is equal to (i+value)%256 between buf[start] and buf[stop-1].
-static int count_all(const uint8_t* buf, size_t start, size_t stop, uint8_t value)
+static size_t count_all(const uint8_t* buf, size_t start, size_t stop, uint8_t value)
 {
   size_t occ = 0;
   for(size_t i = start ; i < stop ; i++) {
index b510cd2..6265626 100644 (file)
@@ -7,7 +7,7 @@
 #include "xbt/config.hpp"
 #include "xbt/log.h"
 
-#include "src/surf/network_wifi.hpp"
+#include "src/surf/network_interface.hpp"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(simulator, "[usage] wifi_usage <platform-file>");
 
@@ -72,9 +72,9 @@ void run_ping_test(const char* src, const char* dest, int data_size)
              simgrid::s4u::this_actor::get_host()->get_cname(), dest, end_time - start_time);
   });
   simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name(dest), [mailbox]() { mailbox->get(); });
-  auto* l = (simgrid::kernel::resource::NetworkWifiLink*)simgrid::s4u::Link::by_name("AP1")->get_impl();
-  l->set_host_rate(simgrid::s4u::Host::by_name(src), 0);
-  l->set_host_rate(simgrid::s4u::Host::by_name(dest), 0);
+  auto* ap1 = simgrid::s4u::Link::by_name("AP1");
+  ap1->set_host_wifi_rate(simgrid::s4u::Host::by_name(src), 0);
+  ap1->set_host_wifi_rate(simgrid::s4u::Host::by_name(dest), 0);
   simgrid::s4u::this_actor::sleep_for(10);
   XBT_INFO("\n");
 }
index f97b443..687ce0d 100644 (file)
@@ -1195,7 +1195,6 @@ set(PLATFORMS_EXAMPLES
   examples/platforms/two_hosts_platform_with_availability_included.xml
   examples/platforms/two_peers.xml
   examples/platforms/vivaldi.xml
-  examples/platforms/wifi_decay_2STA.xml
   examples/platforms/wifi.xml
   )