X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5185459eab2702b1ad78f481149ef411809336f5..512273b5dab057e0f93aaed9c09c79d0e4960b61:/docs/source/Platform_cpp.rst
diff --git a/docs/source/Platform_cpp.rst b/docs/source/Platform_cpp.rst
index 965b344800..e0aad1210a 100644
--- a/docs/source/Platform_cpp.rst
+++ b/docs/source/Platform_cpp.rst
@@ -11,7 +11,7 @@
.. _platform_cpp:
-
+
C++ Platforms
#############
@@ -65,15 +65,19 @@ under the hood, SimGrid creates 2 links in this case: the *1_UP*
link and the *1_DOWN* link. As you can see, the selection of link to use
in the tag is done by the ``direction=`` parameter.
-Using the C++ interface, you should describe both links separately and use them
-in the route description.
+Using the C++ interface, you can use the specific function to create these 2 links. Note
+that you need to define the direction in the add_route function when adding a route containing
+a split-duplex link. Otherwise, SimGrid cannot know which link (UP/DOWN) to use.
.. code-block:: cpp
- Link* l_up = zone->create_link("1_UP", "125MBps")->set_latency("24us")->seal();
- Link* l_down = zone->create_link("1_DOWN", "125MBps")->set_latency("24us")->seal();
-
- zone->add_route(S1, C1, nullptr, nullptr, {link_down});
+ auto* link = zone->create_split_duplex_link("1", "125MBps")->set_latency("24us")->seal();
+
+ zone->add_route(S1, C1, nullptr, nullptr, {{link, LinkInRoute::Direction::UP}});
+
+.. note::
+ Do not use set_sharing_policy(SharingPolicy::SPLITDUPLEX).
+ SimGrid will complain since set_sharing_policy should be used only with (SHARED and FATPIPE)
Loading the platform
@@ -87,7 +91,7 @@ function, having a predefined function implemented. When loading the platform, t
Engine will look for a function with this signature: "**void load_platform(const sg4::Engine& e)**", and
execute it. It could be an easy way to make the transition between XML and C++ if necessary.
-For more details, please refer to the cpp and CMakeLists.txt files in
+For more details, please refer to the cpp and CMakeLists.txt files in
`examples/platform `_.
@@ -111,7 +115,7 @@ connected through a shared link.
.. _platform_cpp_beyond:
Beyond the XML: the power of C++ platforms
-**************
+******************************************
This section describes one of the advantages of using C++ code to write your platforms.
@@ -151,7 +155,7 @@ Note that the leaves and loopback links are defined through callbacks, as follow
/* create each leaf in the Fat-Tree, return a pair composed of: