Logo AND Algorithmique Numérique Distribuée

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