Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove direct call to simcall
[simgrid.git] / examples / msg / README.doc
1 This file follows the Doxygen syntax to be included in the
2 documentation, but it should remain readable directly.
3
4 /** 
5  @defgroup msg_examples MSG examples
6  @ingroup MSG_API
7  @brief Find the MSG example fitting your needs from the extensive set provided in the archive.
8
9   - @ref msg_ex_basics
10   - @ref msg_ex_process
11   - @ref msg_ex_tracing
12     - @ref msg_ex_tracing_user_variables
13   - @ref msg_ex_models
14     - @ref msg_ex_ns3
15
16 @warning MSG was deprecated in SimGrid v3.18. These examples should be
17          converted to S4U in the next releases. You really should
18          consider using S4U in your next project.
19
20 @section msg_ex_basics Basic examples and features
21
22  - <b>Master Workers</b>.
23    @ref examples/msg/app-masterworker/app-masterworker.c\n
24    Another good old example, where one Master process has a bunch of
25    task to dispatch to a set of several Worker processes.
26
27 @section msg_ex_process Acting on Processes
28
29   - <b>Creating processes</b>. 
30     @ref examples/msg/process-create/process-create.c \n
31     Most processes are started from the deployment XML file, but they
32     can also be used with the @ref MSG_process_create() function.
33
34 @section msg_ex_tracing Tracing and visualization features
35
36 Tracing can be activated by various configuration options which
37 are illustrated in these example. See also the 
38 @ref tracing_tracing_options "full list of options related to tracing".
39
40 It is interesting to run the process-create example with the following
41 options to see the task executions:
42
43   - <b>Setting Categories</b>.
44     @ref examples/msg/trace-categories/trace-categories.c \n
45     This example declares several tracing categories
46     to that are used to classify its tasks. When the program is executed,
47     the tracing mechanism registers the resource utilization of hosts
48     and links according to these categories. Recommanded options:
49     @verbatim --cfg=tracing:yes --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes
50     @endverbatim
51     
52   - <b>Master Workers tracing</b>.
53     @ref examples/msg/trace-masterworker/trace-masterworker.c \n
54     This is an augmented version of our basic master/worker example
55     using several tracing features. It traces resource usage, sorted
56     out in several categories; Trace marks and user variables are also
57     used. Recommanded options:
58     @verbatim --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes
59     @endverbatim
60     
61   - <b>Process migration tracing</b>.
62     @ref examples/msg/trace-process-migration/trace-process-migration.c \n
63     This version is enhanced so that the process migrations can be
64     displayed as arrows in a Gantt-chart visualization. Recommanded
65     options to that extend:
66     @verbatim -cfg=tracing:yes --cfg=tracing/msg/process:yes
67     @endverbatim 
68     
69 TODO: These tracing examples should be integrated in the examples to
70 not duplicate the C files. A full command line to see the result in
71 the right tool (vite/FrameSoc) should be given along with some
72 screenshots.
73
74 @subsection msg_ex_tracing_user_variables Tracing user variables
75
76 You can also attach your own variables to a any resource described in
77 the platform file. The following examples illustrate this feature.
78 They have to be run with the following options:
79 @verbatim --cfg=tracing:yes --cfg=tracing/platform:yes
80 @endverbatim
81
82   - <b>Attaching variables to Hosts</b>.
83     @ref examples/msg/trace-host-user-variables/trace-host-user-variables.c 
84
85   - <b>Attaching variables to Links</b>.
86     @ref examples/msg/trace-link-user-variables/trace-link-user-variables.c \n
87     The tricky part is that you have to know the name of the link you
88     want to enhance with a variable.
89
90   - <b>Attaching variables to network Routes</b>
91     @ref examples/msg/trace-route-user-variables/trace-route-user-variables.c \n
92     It is often easier to update a given variable for all links of a
93     given network path (identified by its source and destination
94     hosts) instead of knowing the name of each specific link.
95
96 @section msg_ex_models Models-related examples
97
98 @subsection msg_ex_ns3 NS3 as a SimGrid Network Model
99
100 This example demonstrates how to use the bindings to the Network
101 Simulator, as explained in @ref pls_ns3. The most
102 interesting is probably not the C files since they are unchanged from
103 the other simulations, but the associated files, such as the platform
104 file to see how to declare a platform to be used with the ns-3 bindings
105 of SimGrid and the tesh file to see how to actually start a simulation
106 in these settings.
107   
108   - @ref examples/msg/network-ns3/network-ns3.c. Simple ping-pong using
109     ns-3 instead of the SimGrid network models.
110
111 TODO: merge the C files
112
113 TODO: show the XML files instead if it's what is interesting. On a "XML example files" page that does not exist yet.
114
115 */
116
117 As a human, you can stop reading at this point. The rest is garbage:
118
119 Every example must be listed in the following, but it's not possible
120 to move this content upper as each @example directive seems to eat
121 everything until the next */ marker (and the content is placed at the
122 top of the example file). 
123
124
125 /**
126 @example examples/msg/app-masterworker/app-masterworker.c
127
128 @example examples/msg/process-create/process-create.c
129
130 @example examples/msg/trace-categories/trace-categories.c
131 @example examples/msg/trace-masterworker/trace-masterworker.c
132 @example examples/msg/trace-process-migration/trace-process-migration.c
133 @example examples/msg/trace-host-user-variables/trace-host-user-variables.c
134 @example examples/msg/trace-link-user-variables/trace-link-user-variables.c
135 @example examples/msg/trace-route-user-variables/trace-route-user-variables.c
136
137 @example examples/msg/network-ns3/network-ns3.c
138
139 */
140