between communicating actors.
.. |Actors| replace:: **Actors**
-.. _Actors: api/classsimgrid_1_1s4u_1_1Actor.html
+.. _Actors: app_s4u.html#s4u-actor
.. |Activities| replace:: **Activities**
-.. _Activities: api/classsimgrid_1_1s4u_1_1Activity.html
+.. _Activities: app_s4u.html#s4u-activity
.. |Hosts| replace:: **Hosts**
-.. _Hosts: api/classsimgrid_1_1s4u_1_1Host.html
+.. _Hosts: app_s4u.html#s4u-host
.. |Links| replace:: **Links**
-.. _Links: api/classsimgrid_1_1s4u_1_1Link.html
+.. _Links: app_s4u.html#s4u-link
.. |Storages| replace:: **Storages**
-.. _Storages: api/classsimgrid_1_1s4u_1_1Storage.html
+.. _Storages: app_s4u.html#s4u-storage
.. |VirtualMachines| replace:: **VirtualMachines**
-.. _VirtualMachines: api/classsimgrid_1_1s4u_1_1VirtualMachine.html
+.. _VirtualMachines: app_s4u.html#s4u-virtualmachine
.. |Host| replace:: **Host**
-.. _Host: api/classsimgrid_1_1s4u_1_1Host.html
+.. _Host: app_s4u.html#s4u-host
.. |Link| replace:: **Link**
-.. _Link: api/classsimgrid_1_1s4u_1_1Link.html
+.. _Link: app_s4u.html#s4u-link
.. |Mailbox| replace:: **Mailbox**
-.. _Mailbox: api/classsimgrid_1_1s4u_1_1Mailbox.html
+.. _Mailbox: app_s4u.html#s4u-mailbox
.. |Barrier| replace:: **Barrier**
-.. _Barrier: api/classsimgrid_1_1s4u_1_1Barrier.html
+.. _Barrier: app_s4u.html#s4u-barrier
.. |ConditionVariable| replace:: **ConditionVariable**
-.. _ConditionVariable: api/classsimgrid_1_1s4u_1_1ConditionVariable.html
+.. _ConditionVariable: app_s4u.html#s4u-conditionvariable
.. |Mutex| replace:: **Mutex**
-.. _Mutex: api/classsimgrid_1_1s4u_1_1Mutex.html
-
+.. _Mutex: app_s4u.html#s4u-mutex
**In the remainder of this tutorial**, you will discover a simple yet
fully functioning example of SimGrid simulation: the Master/Workers
.. |api_s4u_NetZone| image:: /img/extlink.png
:align: middle
:width: 12
-.. _api_s4u_NetZone: api/classsimgrid_1_1s4u_1_1NetZone.html#class-documentation
+.. _api_s4u_NetZone: app_s4u.html#s4u-netzone
.. |api_s4u_Link| image:: /img/extlink.png
:align: middle
:width: 12
-.. _api_s4u_Link: api/classsimgrid_1_1s4u_1_1Link.html#class-documentation
+.. _api_s4u_Link: app_s4u.html#s4u-link
.. literalinclude:: ../../examples/platforms/small_platform.xml
:language: xml
execute it as follows. Note how the XBT_INFO() requests turned into
informative messages.
+.. "WARNING: Over dedent has detected" is expected here as we remove the $ marker this way
+
.. literalinclude:: ../../examples/s4u/app-masterworkers/s4u-app-masterworkers.tesh
:language: shell
:start-after: s4u-app-masterworkers-fun
optional in this tutorial, it is not installed to reduce the image
size.
-The code template is available under ``/source/simgrid-template-s4u.git``
+The code template is available under ``/source/simgrid-template-s4u.git``
in the image. You should copy it to your working directory and
-recompile it when you first log in:
+recompile it when you first log in:
.. code-block:: shell
Using your Computer Natively
............................
-To take the tutorial on your machine, you first need to :ref:`install
-SimGrid <install>`, a C++ compiler and also ``pajeng`` to visualize
-the traces. You may want to install `Vite
-<http://vite.gforge.inria.fr/>`_ to get a first glance at the
-traces. The provided code template requires cmake to compile. On
-Debian and Ubuntu for example, you can get them as follows:
+To take the tutorial on your machine, you first need to :ref:`install
+a recent version of SimGrid <install>`, a C++ compiler and also
+``pajeng`` to visualize the traces. You may want to install `Vite
+<http://vite.gforge.inria.fr/>`_ to get a first glance at the traces.
+The provided code template requires cmake to compile. On Debian and
+Ubuntu for example, you can get them as follows:
.. code-block:: shell
sudo apt install simgrid pajeng cmake g++ vite
+For R analysis of the produced traces, you may want to install R,
+and the `pajengr <https://github.com/schnorr/pajengr#installation/>`_ package.
+
+.. code-block:: shell
+
+ sudo apt install r-base r-cran-devtools cmake flex bison
+ Rscript -e "library(devtools); install_github('schnorr/pajengr');"
+
An initial version of the source code is provided on framagit. This
template compiles with cmake. If SimGrid is correctly installed, you
should be able to clone the `repository
.. code-block:: shell
- git clone git@framagit.org:simgrid/simgrid-template-s4u.git
+ # (exporting SimGrid_PATH is only needed if SimGrid is installed in a non-standard path)
+ export SimGrid_PATH=/where/to/simgrid
+
+ git clone https://framagit.org/simgrid/simgrid-template-s4u.git
cd simgrid-template-s4u/
- SimGrid_PATH=/where/to/simgrid cmake .
- # (SimGrid_PATH is only needed if SimGrid is installed in a non-standard path)
+ cmake .
make
If you struggle with the compilation, then you should double check
.. code-block:: shell
./master-workers small_platform.xml master-workers_d.xml --cfg=tracing:yes --cfg=tracing/msg/process:yes
- pj_dump --ignore-incomplete-links simgrid.trace | grep STATE > gantt.csv
- Rscript draw_gantt.R gantt.csv
+ Rscript draw_gantt.R simgrid.trace
It produces a ``Rplots.pdf`` with the following content:
for (int i = 0; i < tasks_count; i++) {
std::string worker_rank = std::to_string(i % workers_count);
std::string mailbox_name = std::string("worker-") + worker_rank;
- simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::by_name(mailbox_name);
+ simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name(mailbox_name);
mailbox->put(...);
initiators' location and then the real communication occures between
the involved parties.
-Please refer to the full `API of Mailboxes
-<api/classsimgrid_1_1s4u_1_1Mailbox.html#class-documentation>`_ for
-more details.
+Please refer to the full `Mailboxes' documentation
+<app_s4u.html#s4u-mailbox>`_ for more details.
Lab 2: Using the Whole Platform
vite is not enough to understand the situation, because it does not
deal with categorization. This time, you absolutely must switch to R,
as explained on `this page
-<http://simgrid.gforge.inria.fr/contrib/R_visualization.php>`_.
+<https://simgrid.org/contrib/R_visualization.html>`_.
.. todo::