Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 8 Feb 2019 11:55:52 +0000 (12:55 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 8 Feb 2019 11:55:52 +0000 (12:55 +0100)
32 files changed:
docs/source/platform_howtos.rst
examples/platforms/faulty_host.xml
examples/platforms/profiles/bourassa_state.profile [moved from examples/platforms/trace/bourassa_state.trace with 100% similarity]
examples/platforms/profiles/fafard_state.profile [moved from examples/platforms/trace/fafard_state.trace with 100% similarity]
examples/platforms/profiles/faulty_host.profile [moved from examples/platforms/trace/faulty_host.trace with 100% similarity]
examples/platforms/profiles/ginette_state.profile [moved from examples/platforms/trace/ginette_state.trace with 100% similarity]
examples/platforms/profiles/jupiter_speed.profile [new file with mode: 0644]
examples/platforms/profiles/jupiter_state.profile [moved from examples/platforms/trace/jupiter_state.trace with 100% similarity]
examples/platforms/profiles/link1_bandwidth.profile [new file with mode: 0644]
examples/platforms/profiles/link1_latency.profile [new file with mode: 0644]
examples/platforms/profiles/link3_state.profile [moved from examples/platforms/trace/link3_state.trace with 100% similarity]
examples/platforms/profiles/link4_state.profile [moved from examples/platforms/trace/link4_state.trace with 100% similarity]
examples/platforms/profiles/linkBandwidth7.bw [moved from examples/platforms/trace/linkBandwidth7.bw with 100% similarity]
examples/platforms/profiles/trace_A.txt [moved from examples/platforms/trace/trace_A.txt with 100% similarity]
examples/platforms/profiles/trace_A_failure.txt [moved from examples/platforms/trace/trace_A_failure.txt with 100% similarity]
examples/platforms/profiles/trace_B.txt [moved from examples/platforms/trace/trace_B.txt with 100% similarity]
examples/platforms/simulacrum_7_hosts.xml
examples/platforms/small_platform_failures.xml [moved from examples/platforms/small_platform_with_failures.xml with 79% similarity]
examples/platforms/small_platform_profile.xml [new file with mode: 0644]
examples/platforms/trace/jupiter_speed.trace [deleted file]
examples/platforms/trace/link1_avail.trace [deleted file]
examples/platforms/two_hosts_platform_with_availability.xml
examples/s4u/CMakeLists.txt
examples/s4u/README.rst
examples/s4u/platform-failures/s4u-platform-failures.cpp
examples/s4u/platform-profile/s4u-platform-profile.cpp [new file with mode: 0644]
examples/s4u/platform-profile/s4u-platform-profile.tesh [new file with mode: 0644]
include/simgrid/s4u/Host.hpp
include/simgrid/s4u/Link.hpp
src/s4u/s4u_Host.cpp
src/s4u/s4u_Link.cpp
tools/cmake/DefinePackages.cmake

index e96ffd0..5c68aca 100644 (file)
@@ -60,8 +60,8 @@ freely available, though.
 
 .. _howto_churn:
 
-Modeling Churn in P2P
-*********************
+Modeling Churn (e.g. in P2P)
+****************************
 
 One of the biggest challenges in P2P settings is to cope with the
 churn, meaning that resources keep appearing and disappearing. In
@@ -70,12 +70,10 @@ eg :cpp:func:`simgrid::s4u::Host::turn_on`. To reduce the burden when
 the churn is high, you can also attach a **state profile** to the host
 directly.
 
-This is not possible from S4U yet (TODO), and you should use the
-``state_file`` attribute of :ref:`pf_tag_host`, :ref:`pf_tag_cluster`
-or :ref:`pf_tag_link`.
-
-Every lines (but the last) of such files describe timed events with
-the form "date value". Example:
+This can be done through the XML file, using the ``state_file``
+attribute of :ref:`pf_tag_host`, :ref:`pf_tag_cluster` or
+:ref:`pf_tag_link`. Every lines (but the last) of such files describe
+timed events with the form "date value". Example:
 
 .. code-block:: python
                
@@ -91,6 +89,12 @@ the form "date value". Example:
 If your trace does not contain a LOOPAFTER line, then your profile is
 only executed once and not repetitively.
 
+Another possibility is to use the
+:cpp:func:`simgrid::s4u::Host::set_state_profile()` or 
+:cpp:func:`simgrid::s4u::Link::set_state_profile()` functions. These
+functions take a profile, that can be an fixed profile exhaustively
+listing the events, or something else if you wish.
+
 .. _howto_multicore:
 
 Modeling Multicore Machines
index 1aedb3a..f6b94c3 100644 (file)
@@ -2,7 +2,7 @@
 <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
 <platform version="4.1">
   <zone  id="AS0"  routing="Full">
-    <host id="Faulty Host" speed="1Gf" state_file="trace/faulty_host.trace"/>
+    <host id="Faulty Host" speed="1Gf" state_file="profiles/faulty_host.profile"/>
     <host id="Safe Host" speed="500Mf"/>
   </zone>
 </platform>
diff --git a/examples/platforms/profiles/jupiter_speed.profile b/examples/platforms/profiles/jupiter_speed.profile
new file mode 100644 (file)
index 0000000..4b0a723
--- /dev/null
@@ -0,0 +1,6 @@
+0 0.5
+2 1.0
+4 0.7
+6 0.1
+8 4
+LOOPAFTER 10
\ No newline at end of file
diff --git a/examples/platforms/profiles/link1_bandwidth.profile b/examples/platforms/profiles/link1_bandwidth.profile
new file mode 100644 (file)
index 0000000..46b3c52
--- /dev/null
@@ -0,0 +1,3 @@
+2 2000000
+4 3000000
+LOOPAFTER 6
diff --git a/examples/platforms/profiles/link1_latency.profile b/examples/platforms/profiles/link1_latency.profile
new file mode 100644 (file)
index 0000000..c56791b
--- /dev/null
@@ -0,0 +1,3 @@
+1 0.003
+3 0.015
+LOOPAFTER 6
index c2357c3..248e616 100644 (file)
@@ -20,7 +20,7 @@
     <link id="l155" bandwidth="125MBps" latency="100us"/>
     <link id="l156" bandwidth="125MBps" latency="100us"/>
     <link id="l157" bandwidth="125MBps" latency="100us"/>
-    <link id="l159" bandwidth="125MBps" latency="100us" bandwidth_file="trace/linkBandwidth7.bw"/>
+    <link id="l159" bandwidth="125MBps" latency="100us" bandwidth_file="profiles/linkBandwidth7.bw"/>
     <link id="l160" bandwidth="125MBps" latency="100us"/>
     <link id="l161" bandwidth="125MBps" latency="100us"/>
     <link id="l162" bandwidth="125MBps" latency="100us"/>
@@ -3,15 +3,15 @@
 <platform version="4.1">
   <zone  id="AS0"  routing="Full">
     <host id="Tremblay" speed="25Mf"/>
-    <host id="Jupiter"  speed="25Mf" state_file="trace/jupiter_state.trace"/>
-    <host id="Fafard"   speed="25Mf" state_file="trace/fafard_state.trace" />
-    <host id="Ginette"  speed="25Mf" state_file="trace/ginette_state.trace"/>
-    <host id="Bourassa" speed="25Mf" state_file="trace/bourassa_state.trace"/>
+    <host id="Jupiter"  speed="25Mf" state_file="profiles/jupiter_state.profile"/>
+    <host id="Fafard"   speed="25Mf" state_file="profiles/fafard_state.profile" />
+    <host id="Ginette"  speed="25Mf" state_file="profiles/ginette_state.profile"/>
+    <host id="Bourassa" speed="25Mf" state_file="profiles/bourassa_state.profile"/>
 
     <link id="1" bandwidth="1MBps" latency="0"/>
     <link id="2" bandwidth="1MBps" latency="0"/>
-    <link id="3" bandwidth="1MBps" latency="0" state_file="trace/link3_state.trace" />
-    <link id="4" bandwidth="1MBps" latency="0" state_file="trace/link4_state.trace" />
+    <link id="3" bandwidth="1MBps" latency="0" state_file="profiles/link3_state.profile" />
+    <link id="4" bandwidth="1MBps" latency="0" state_file="profiles/link4_state.profile" />
     <link id="5" bandwidth="1MBps" latency="0"/>
     <link id="6" bandwidth="1MBps" latency="0"/>
     <link id="7" bandwidth="1MBps" latency="0"/>
diff --git a/examples/platforms/small_platform_profile.xml b/examples/platforms/small_platform_profile.xml
new file mode 100644 (file)
index 0000000..064d459
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
+<platform version="4.1">
+  <zone  id="AS0"  routing="Full">
+    <host id="Tremblay" speed="25Mf"/>
+    <host id="Jupiter"  speed="25Mf" availability_file="profiles/jupiter_speed.profile" />
+    <host id="Fafard"   speed="25Mf"/>
+    <host id="Ginette"  speed="25Mf"/>
+    <host id="Bourassa" speed="25Mf"/>
+
+    <link id="1" bandwidth="1MBps" latency="10ms" bandwidth_file="profiles/link1_bandwidth.profile" latency_file="profiles/link1_latency.profile" />
+    <link id="2" bandwidth="1MBps" latency="10ms"/>
+    <link id="3" bandwidth="1MBps" latency="10ms"/>
+    <link id="4" bandwidth="1MBps" latency="10ms"/>
+    <link id="5" bandwidth="1MBps" latency="10ms"/>
+    <link id="6" bandwidth="1MBps" latency="10ms"/>
+    <link id="7" bandwidth="1MBps" latency="10ms"/>
+    <link id="8" bandwidth="1MBps" latency="10ms"/>
+    <link id="9" bandwidth="1MBps" latency="10ms"/>
+    <link id="10" bandwidth="1MBps" latency="10ms"/>
+    <link id="loopback_FATPIPE" bandwidth="10MBps" latency="0" sharing_policy="FATPIPE"/>
+    <link id="loopback" bandwidth="100MBps" latency="0"/>
+
+    <route src="Tremblay" dst="Tremblay">
+      <link_ctn id="loopback"/>
+    </route>
+    <route src="Jupiter" dst="Jupiter">
+      <link_ctn id="loopback"/>
+    </route>
+    <route src="Fafard" dst="Fafard">
+      <link_ctn id="loopback"/>
+    </route>
+    <route src="Ginette" dst="Ginette">
+      <link_ctn id="loopback"/>
+    </route>
+    <route src="Bourassa" dst="Bourassa">
+      <link_ctn id="loopback"/>
+    </route>
+    <route src="Tremblay" dst="Jupiter">
+      <link_ctn id="1"/>
+    </route>
+    <route src="Tremblay" dst="Fafard">
+      <link_ctn id="2"/>
+    </route>
+    <route src="Tremblay" dst="Ginette">
+      <link_ctn id="3"/>
+    </route>
+    <route src="Tremblay" dst="Bourassa">
+      <link_ctn id="4"/>
+    </route>
+    <route src="Jupiter" dst="Fafard">
+      <link_ctn id="5"/>
+    </route>
+    <route src="Jupiter" dst="Ginette">
+      <link_ctn id="6"/>
+    </route>
+    <route src="Jupiter" dst="Bourassa">
+      <link_ctn id="7"/>
+    </route>
+    <route src="Fafard" dst="Ginette">
+      <link_ctn id="8"/>
+    </route>
+    <route src="Fafard" dst="Bourassa">
+      <link_ctn id="9"/>
+    </route>
+    <route src="Ginette" dst="Bourassa">
+      <link_ctn id="10"/>
+    </route>
+  </zone>
+</platform>
diff --git a/examples/platforms/trace/jupiter_speed.trace b/examples/platforms/trace/jupiter_speed.trace
deleted file mode 100644 (file)
index 33719c8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-0 0.5
-2 1.0
\ No newline at end of file
diff --git a/examples/platforms/trace/link1_avail.trace b/examples/platforms/trace/link1_avail.trace
deleted file mode 100644 (file)
index fd47a86..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-2 62500000
-4 31250000
-LOOPAFTER 6
index a8f4023..5648fe8 100644 (file)
@@ -2,8 +2,8 @@
 <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
 <platform version="4.1">
   <zone  id="AS0"  routing="Full">
-    <host id="Cpu A" speed="10f" availability_file="trace/trace_A.txt" state_file="trace/trace_A_failure.txt"/>
-    <host id="Cpu B" speed="10f" availability_file="trace/trace_B.txt"/>
+    <host id="Cpu A" speed="10f" availability_file="profiles/trace_A.txt" state_file="profiles/trace_A_failure.txt"/>
+    <host id="Cpu B" speed="10f" availability_file="profiles/trace_B.txt"/>
     <link id="LinkA" bandwidth="10MBps" latency="200ms"/>
     <route src="Cpu A" dst="Cpu B">
       <link_ctn id="LinkA"/>
index 6b476fa..ec13f74 100644 (file)
@@ -11,7 +11,8 @@ foreach (example actor-create actor-daemon actor-exiting actor-join actor-kill
                  engine-filtering
                  exec-async exec-basic exec-dvfs exec-monitor exec-ptask exec-remote
                  io-async io-file-system io-file-remote io-storage-raw
-                 platform-failures platform-properties plugin-hostload 
+                 platform-failures platform-profile platform-properties
+                 plugin-hostload
                  replay-comm replay-storage
                  routing-get-clusters
                  synchro-barrier synchro-mutex synchro-semaphore)
index a01e332..d7f8291 100644 (file)
@@ -281,6 +281,19 @@ Interacting with the Platform
    |br| `examples/s4u/platform-properties/s4u-platform-properties_d.xml <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/platform-properties/s4u-platform-properties_d.xml>`_
    |br| `examples/platforms/prop.xml <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms/prop.xml>`_
 
+ - **Specifying state profiles:** shows how to specify when the
+   resources must be turned off and on again, and how to react to such
+   failures in your code.
+   
+   |br| `examples/platforms/small_platform_with_failure.xml <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms/small_platform_with_failure.xml>`_
+   |br| The state profiles in `examples/platforms/profiles <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms/profiles>`_
+
+ - **Specifying speed profiles:** shows how to specify an external
+   load to resources, variating their peak speed over time.
+   
+   |br| `examples/platforms/small_platform_profile.xml <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms/small_platform_profile.xml>`_
+   |br| The speed, bandwidth and latency profiles in `examples/platforms/profiles  <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms/profiles>`_
+
 =================
 Energy Simulation
 =================
index facd5db..e4cca6a 100644 (file)
@@ -3,6 +3,19 @@
 /* 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 work with the state profile of an host or a link,
+ * specifying when the resource must be turned on or off.
+ *
+ * To set such a profile, the first way is to use a file in the XML, while the second is to use the programmatic
+ * interface. Once this profile is in place, the resource will automatically be turned on and off.
+ *
+ * The actors running on an host that is turned off will receive a simgrid::HostFailureException. Since we specified
+ * on_failure="RESTART" for each actors in the XML file, they will be automatically restarted when the host starts
+ * again.
+ *
+ * Communications using failed links will .. fail.
+ */
+
 #include "simgrid/s4u.hpp"
 #include "xbt/str.h"
 
@@ -36,7 +49,7 @@ static int master(int argc, char* argv[])
     } catch (xbt_ex& e) {
       if (e.category != network_error)
         xbt_die("Unexpected behavior");
-      XBT_INFO("Mmh. Something went wrong with '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
+      XBT_INFO("Mmh. The communication with '%s' failed. Nevermind. Let's keep going!", mailbox->get_cname());
       delete payload;
     }
   }
diff --git a/examples/s4u/platform-profile/s4u-platform-profile.cpp b/examples/s4u/platform-profile/s4u-platform-profile.cpp
new file mode 100644 (file)
index 0000000..0da24ff
--- /dev/null
@@ -0,0 +1,45 @@
+/* Copyright (c) 2017-2019. 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 attach a profile to an host or a link,
+ * to specify external changes to the resource speed. The first way to do
+ * so is to use a file in the XML, while the second is to use the programmatic interface.
+ */
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_platform_profile, "Messages specific for this s4u example");
+
+/* Main function of the Yielder process */
+static void watcher()
+{
+  simgrid::s4u::Host* jupiter = simgrid::s4u::Host::by_name("Jupiter");
+  simgrid::s4u::Host* fafard  = simgrid::s4u::Host::by_name("Fafard");
+  simgrid::s4u::Link* link1   = simgrid::s4u::Link::by_name("1");
+  simgrid::s4u::Link* link2   = simgrid::s4u::Link::by_name("2");
+
+  for (int i = 0; i < 10; i++) {
+    XBT_INFO("Fafard: %.0fGflops, Jupiter: % 3.0fGflops, Link1: (%.2fMB/s %.0fms), Link2: (%.2fMB/s %.0fms)",
+             fafard->get_speed() * fafard->get_available_speed() / 1000000,
+             jupiter->get_speed() * jupiter->get_available_speed() / 1000000, link1->get_bandwidth() / 1000,
+             link1->get_latency() * 1000, link2->get_bandwidth() / 1000, link2->get_latency() * 1000);
+    simgrid::s4u::this_actor::sleep_for(1);
+  }
+};
+
+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]);
+
+  simgrid::s4u::Actor::create("watcher", simgrid::s4u::Host::by_name("Tremblay"), watcher);
+
+  e.run(); /* - Run the simulation */
+
+  return 0;
+}
diff --git a/examples/s4u/platform-profile/s4u-platform-profile.tesh b/examples/s4u/platform-profile/s4u-platform-profile.tesh
new file mode 100644 (file)
index 0000000..11b0d00
--- /dev/null
@@ -0,0 +1,13 @@
+#!/usr/bin/env tesh
+
+$ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-profile ${platfdir}/small_platform_profile.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:  12Gflops, Link1: (1000.00MB/s 10ms), Link2: (1000.00MB/s 10ms)
+> [  1.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:  12Gflops, Link1: (1000.00MB/s 3ms), Link2: (1000.00MB/s 10ms)
+> [  2.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:  25Gflops, Link1: (2000.00MB/s 3ms), Link2: (1000.00MB/s 10ms)
+> [  3.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:  25Gflops, Link1: (2000.00MB/s 15ms), Link2: (1000.00MB/s 10ms)
+> [  4.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:  18Gflops, Link1: (3000.00MB/s 15ms), Link2: (1000.00MB/s 10ms)
+> [  5.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:  18Gflops, Link1: (3000.00MB/s 15ms), Link2: (1000.00MB/s 10ms)
+> [  6.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:   2Gflops, Link1: (3000.00MB/s 15ms), Link2: (1000.00MB/s 10ms)
+> [  7.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:   2Gflops, Link1: (3000.00MB/s 15ms), Link2: (1000.00MB/s 10ms)
+> [  8.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:  100Gflops, Link1: (3000.00MB/s 15ms), Link2: (1000.00MB/s 10ms)
+> [  9.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:  100Gflops, Link1: (3000.00MB/s 15ms), Link2: (1000.00MB/s 10ms)
index b3736c6..45bfeb1 100644 (file)
@@ -101,6 +101,9 @@ public:
   void set_property(std::string key, std::string value);
   std::unordered_map<std::string, std::string>* get_properties();
 
+  void set_state_profile(kernel::profile::Profile* p);
+  void set_speed_profile(kernel::profile::Profile* p);
+
 #ifndef DOXYGEN
   /** @deprecated See Host::get_properties() */
   XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_properties()") std::map<std::string, std::string>* getProperties()
index 735321a..f713c35 100644 (file)
@@ -60,7 +60,9 @@ public:
   bool is_used();
 
   void turn_on();
+  bool is_on();
   void turn_off();
+  bool is_off();
 
   void* get_data(); /** Should be used only from the C interface. Prefer extensions in C++ */
   void set_data(void* d);
@@ -83,9 +85,9 @@ public:
   }
 #endif
 
-  /** Setup the profile file with states events (ON or OFF). The profile must contain boolean values. */
+  /** Setup the profile with states events (ON or OFF). The profile must contain boolean values. */
   void set_state_profile(kernel::profile::Profile* profile);
-  /** Setup the profile file with bandwidth events (peak speed changes due to external load).
+  /** Setup the profile with bandwidth events (peak speed changes due to external load).
    * The profile must contain percentages (value between 0 and 1). */
   void set_bandwidth_profile(kernel::profile::Profile* profile);
   /** Setup the profile file with latency events (peak latency changes due to external load).
index 8000060..3c5e613 100644 (file)
@@ -196,6 +196,22 @@ void Host::set_property(std::string key, std::string value)
 {
   simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); });
 }
+/** Specify a profile turning the host on and off according to a exhaustive list or a stochastic law.
+ * The profile must contain boolean values. */
+void Host::set_state_profile(kernel::profile::Profile* p)
+{
+  return simgrid::simix::simcall([this, p] { pimpl_cpu->set_state_profile(p); });
+}
+/** Specify a profile modeling the external load according to a exhaustive list or a stochastic law.
+ *
+ * Each event of the profile represent a peak speed change that is due to external load. The values are given as a rate
+ * of the initial value. This means that the actual value is obtained by multiplying the initial value (the peek speed
+ * at this pstate level) by the rate coming from the profile.
+ */
+void Host::set_speed_profile(kernel::profile::Profile* p)
+{
+  return simgrid::simix::simcall([this, p] { pimpl_cpu->set_speed_profile(p); });
+}
 
 /** @brief Get the peak processor speed (in flops/s), at the specified pstate  */
 double Host::get_pstate_speed(int pstate_index) const
@@ -203,13 +219,13 @@ double Host::get_pstate_speed(int pstate_index) const
   return simgrid::simix::simcall([this, pstate_index] { return this->pimpl_cpu->get_pstate_peak_speed(pstate_index); });
 }
 
-/** @brief Get the peak computing speed in flops/s at the current pstate, taking the external load into account.
+/** @brief Get the peak computing speed in flops/s at the current pstate, NOT taking the external load into account.
  *
  *  The amount of flops per second available for computing depends on several things:
  *    - The current pstate determines the maximal peak computing speed (use @ref get_pstate_speed() to retrieve the
  *      computing speed you would get at another pstate)
- *    - If you declared an external load, then this reduces the available computing speed
- *      (see @ref simgrid::surf::Cpu::set_speed_trace())
+ *    - If you declared an external load (with @ref simgrid::surf::Cpu::set_speed_profile()), you must multiply the
+ * result of get_speed() by get_available_speed() to retrieve what a new computation would get.
  *
  *  The remaining speed is then shared between the executions located on this host.
  *  You can retrieve the amount of tasks currently running on this host with @ref get_load().
@@ -233,7 +249,7 @@ double Host::get_load() const
 }
 /** @brief Get the available speed ratio, between 0 and 1.
  *
- * This accounts for external load (see @ref simgrid::surf::Cpu::set_speed_trace()).
+ * This accounts for external load (see @ref simgrid::surf::Cpu::set_speed_profile()).
  */
 double Host::get_available_speed() const
 {
index 2019f74..20cf1d1 100644 (file)
@@ -78,6 +78,15 @@ void Link::turn_off()
   simgrid::simix::simcall([this]() { this->pimpl_->turn_off(); });
 }
 
+bool Link::is_on()
+{
+  return this->pimpl_->is_on();
+}
+bool Link::is_off()
+{
+  return this->pimpl_->is_off();
+}
+
 void* Link::get_data()
 {
   return this->pimpl_->get_data();
index c6b9e8f..3c83780 100644 (file)
@@ -1109,19 +1109,20 @@ set(PLATFORMS_EXAMPLES
   examples/platforms/optorsim/transform_optorsim_platform.pl
   examples/platforms/config.xml
   examples/platforms/config_tracing.xml
-  examples/platforms/trace/bourassa_state.trace
-  examples/platforms/trace/fafard_state.trace
-  examples/platforms/trace/faulty_host.trace
-  examples/platforms/trace/ginette_state.trace
-  examples/platforms/trace/jupiter_speed.trace
-  examples/platforms/trace/jupiter_state.trace
-  examples/platforms/trace/link1_avail.trace
-  examples/platforms/trace/link3_state.trace
-  examples/platforms/trace/link4_state.trace
-  examples/platforms/trace/linkBandwidth7.bw
-  examples/platforms/trace/trace_A_failure.txt
-  examples/platforms/trace/trace_A.txt
-  examples/platforms/trace/trace_B.txt
+  examples/platforms/profiles/bourassa_state.profile
+  examples/platforms/profiles/fafard_state.profile
+  examples/platforms/profiles/faulty_host.profile
+  examples/platforms/profiles/ginette_state.profile
+  examples/platforms/profiles/jupiter_speed.profile
+  examples/platforms/profiles/jupiter_state.profile
+  examples/platforms/profiles/link1_bandwidth.profile
+  examples/platforms/profiles/link1_latency.profile
+  examples/platforms/profiles/link3_state.profile
+  examples/platforms/profiles/link4_state.profile
+  examples/platforms/profiles/linkBandwidth7.bw
+  examples/platforms/profiles/trace_A_failure.txt
+  examples/platforms/profiles/trace_A.txt
+  examples/platforms/profiles/trace_B.txt
   examples/platforms/data_center.xml
   examples/platforms/dogbone.xml
   examples/platforms/energy_platform.xml
@@ -1145,9 +1146,10 @@ set(PLATFORMS_EXAMPLES
   examples/platforms/small_platform.xml
   examples/platforms/small_platform.lua
   examples/platforms/small_platform_constant.xml
+  examples/platforms/small_platform_failures.xml
   examples/platforms/small_platform_fatpipe.xml
   examples/platforms/small_platform_one_link_routes.xml
-  examples/platforms/small_platform_with_failures.xml
+  examples/platforms/small_platform_profile.xml
   examples/platforms/small_platform_with_routers.xml
   examples/platforms/syscoord/generate_peer_platform.pl
   examples/platforms/syscoord/median_harvard.syscoord