Logo AND Algorithmique Numérique Distribuée

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