SimGrid  3.16
Versatile Simulation of Distributed Systems

Find the MSG example fitting your needs from the extensive set provided in the archive.

Basic examples and features

Asynchronous communications

In addition to the fully documented example of Asynchronous communications, there are several other examples shipped in the archive:

Acting on Processes

Tracing and visualization features

Tracing can be activated by various configuration options which are illustrated in these example. See also the full list of options related to tracing.

It is interesting to run the process-create example with the following options to see the task executions:

TODO: These tracing examples should be integrated in the examples to not duplicate the C files. A full command line to see the result in the right tool (viva/vite/FrameSoc) should be given along with some screenshots.

Tracing user variables

You can also attach your own variables to a any resource described in the platform file. The following examples illustrate this feature. They have to be run with the following options:

--cfg=tracing:yes --cfg=tracing/platform:yes

Models-related examples

NS3 as a SimGrid Network Model

This example demonstrates how to use the bindings to the Network Simulator, as explained in ns-3 as a SimGrid model. The most interesting is probably not the C files since they are unchanged from the other simulations, but the associated files, such as the platform file to see how to declare a platform to be used with the ns-3 bindings of SimGrid and the tesh file to see how to actually start a simulation in these settings.

TODO: merge the C files

TODO: show the XML files instead if it's what is interesting. On a "XML example files" page that does not exist yet.

Simulating disks and files

The examples of this section demonstrate how to interact with the simulated storages.

Following Workload Traces

This section details how to run trace-driven simulations. It is very handy when you want to test an algorithm or protocol that only react to external events. For example, many P2P protocols react to user requests, but do nothing if there is no such event.

In such situations, you should write your protocol in C, and separate the workload that you want to play onto your protocol in a separate text file. Declare a function handling each type of the events in your trace, register them using xbt_replay_action_register in your main, and then use MSG_action_trace_run to launch the simulation.

Then, you can either have one trace file containing all your events, or a file per simulated process: the former may be easier to work with, but the second is more efficient on very large traces. Check also the tesh files in the example directories for details.

Examples of Full Applications

Miscellaneous

TODO: Document the many other examples that we have