Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
00970c1c1810e282d7a942a31428709de3bda84a
[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_io
16   - @ref msg_ex_apps
17   - @ref msg_ex_misc
18
19 @section msg_ex_basics Basic examples and features
20
21  - <b>Ping Pong</b>: @ref examples/msg/app-pingpong/app-pingpong.c\n
22    It's hard to think of a simpler example: it is just sending one
23    message back and forth.  
24    The tesh file laying in the directory show how to start the
25    simulator binary, highlighting how to pass options to the simulators
26    (as detailed in Section \ref options). 
27
28  - <b>Token Ring</b>.
29    @ref examples/msg/app-token-ring/app-token-ring.c\n
30    Classical communication pattern, where a token is exchanged
31    along a ring to reach every participant. 
32    The tesh file laying in the directory shows how to run the same
33    example on different virtual platforms.
34
35  - <b>Master Workers</b>.
36    @ref examples/msg/app-masterworker/app-masterworker.c\n
37    Another good old example, where one Master process has a bunch of
38    task to dispatch to a set of several Worker processes. It is fully
39    commented in @ref msg_ex_master_worker.
40
41 @section msg_ex_process Acting on Processes
42
43   - <b>Creating processes</b>. 
44     @ref examples/msg/process-create/process-create.c \n
45     Most processes are started from the deployment XML file, but they
46     can also be used with the @ref MSG_process_create() function.
47
48   - <b>Controling the process life cycle from the XML</b>.
49     @ref examples/msg/process-startkilltime/process-startkilltime.c \n
50     You can specify a start time and a kill time in the deployment
51     file. See all *_d.xml files in this directory.
52
53 @section msg_ex_tracing Tracing and visualization features
54
55 Tracing can be activated by various configuration options which
56 are illustrated in these example. See also the 
57 @ref tracing_tracing_options "full list of options related to tracing".
58
59 It is interesting to run the process-create example with the following
60 options to see the task executions:
61
62   - <b>Platform tracing</b>.
63     @ref examples/msg/trace-platform/trace-platform.c \n
64     This program is a toy example just loading the platform, so that
65     you can play with the platform visualization. Recommanded options:
66     @verbatim --cfg=tracing:yes --cfg=tracing/categorized:yes
67     @endverbatim
68
69   - <b>Setting Categories</b>.
70     @ref examples/msg/trace-categories/trace-categories.c \n
71     This example declares several tracing categories
72     to that are used to classify its tasks. When the program is executed,
73     the tracing mechanism registers the resource utilization of hosts
74     and links according to these categories. Recommanded options:
75     @verbatim --cfg=tracing:yes --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes
76     @endverbatim
77     
78   - <b>Master Workers tracing</b>.
79     @ref examples/msg/trace-masterworker/trace-masterworker.c \n
80     This is an augmented version of our basic master/worker example
81     using several tracing features. It traces resource usage, sorted
82     out in several categories; Trace marks and user variables are also
83     used. Recommanded options:
84     @verbatim --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes
85     @endverbatim
86     
87   - <b>Process migration tracing</b>.
88     @ref examples/msg/trace-process-migration/trace-process-migration.c \n
89     This version is enhanced so that the process migrations can be
90     displayed as arrows in a Gantt-chart visualization. Recommanded
91     options to that extend:
92     @verbatim -cfg=tracing:yes --cfg=tracing/msg/process:yes
93     @endverbatim 
94     
95 TODO: These tracing examples should be integrated in the examples to
96 not duplicate the C files. A full command line to see the result in
97 the right tool (vite/FrameSoc) should be given along with some
98 screenshots.
99
100 @subsection msg_ex_tracing_user_variables Tracing user variables
101
102 You can also attach your own variables to a any resource described in
103 the platform file. The following examples illustrate this feature.
104 They have to be run with the following options:
105 @verbatim --cfg=tracing:yes --cfg=tracing/platform:yes
106 @endverbatim
107
108   - <b>Attaching variables to Hosts</b>.
109     @ref examples/msg/trace-host-user-variables/trace-host-user-variables.c 
110
111   - <b>Attaching variables to Links</b>.
112     @ref examples/msg/trace-link-user-variables/trace-link-user-variables.c \n
113     The tricky part is that you have to know the name of the link you
114     want to enhance with a variable.
115
116   - <b>Attaching variables to network Routes</b>
117     @ref examples/msg/trace-route-user-variables/trace-route-user-variables.c \n
118     It is often easier to update a given variable for all links of a
119     given network path (identified by its source and destination
120     hosts) instead of knowing the name of each specific link.
121
122 @section msg_ex_models Models-related examples
123
124 @subsection msg_ex_ns3 NS3 as a SimGrid Network Model
125
126 This example demonstrates how to use the bindings to the Network
127 Simulator, as explained in @ref pls_ns3. The most
128 interesting is probably not the C files since they are unchanged from
129 the other simulations, but the associated files, such as the platform
130 file to see how to declare a platform to be used with the ns-3 bindings
131 of SimGrid and the tesh file to see how to actually start a simulation
132 in these settings.
133   
134   - @ref examples/msg/network-ns3/network-ns3.c. Simple ping-pong using
135     ns-3 instead of the SimGrid network models.
136
137 TODO: merge the C files
138
139 TODO: show the XML files instead if it's what is interesting. On a "XML example files" page that does not exist yet.
140
141 @subsection msg_ex_io Simulating disks and files
142
143 The examples of this section demonstrate how to interact with the
144 simulated storages.
145
146   - <b>File Management</b>. @ref examples/msg/io-file/io-file.c \n
147     This example illustrates the use of operations on file
148     (@ref MSG_file_open, @ref MSG_file_read, @ref MSG_file_write,
149     or @ref MSG_file_close).
150     
151   - <b>Remote I/O</b>. @ref examples/msg/io-remote/io-remote.c \n
152     I/O operations can also be done in a remote, i.e. when the
153     accessed disk is not mounted on the caller's host.
154
155 @section msg_ex_misc Miscellaneous
156
157  - <b>Task priorities</b>.
158    @ref examples/msg/task-priority/task-priority.c \n
159    Demonstrates the use of @ref MSG_task_set_priority to change the
160    computation priority of  a given task.
161
162  - <b>User-defined properties</b>.
163    @ref examples/msg/platform-properties/platform-properties.c \n
164    Attaching arbitrary information to host, processes and
165    such, and retrieving them with @ref MSG_host_get_properties,
166    @ref MSG_host_get_property_value, @ref MSG_process_get_properties, and 
167    @ref MSG_process_get_property_value. Also make sure to read the
168    platform and deployment XML files to see how to declare these data.
169  
170 TODO: Document the many other examples that we have 
171 */
172
173 As a human, you can stop reading at this point. The rest is garbage:
174
175 Every example must be listed in the following, but it's not possible
176 to move this content upper as each @example directive seems to eat
177 everything until the next */ marker (and the content is placed at the
178 top of the example file). 
179
180
181 /**
182 @example examples/msg/app-pingpong/app-pingpong.c
183 @example examples/msg/app-token-ring/app-token-ring.c
184 @example examples/msg/app-masterworker/app-masterworker.c
185
186 @example examples/msg/process-create/process-create.c
187 @example examples/msg/process-startkilltime/process-startkilltime.c
188
189 @example examples/msg/trace-platform/trace-platform.c
190 @example examples/msg/trace-categories/trace-categories.c
191 @example examples/msg/trace-masterworker/trace-masterworker.c
192 @example examples/msg/trace-process-migration/trace-process-migration.c
193 @example examples/msg/trace-host-user-variables/trace-host-user-variables.c
194 @example examples/msg/trace-link-user-variables/trace-link-user-variables.c
195 @example examples/msg/trace-route-user-variables/trace-route-user-variables.c
196
197 @example examples/msg/network-ns3/network-ns3.c
198
199 @example examples/msg/io-storage/io-storage.c
200 @example examples/msg/io-file/io-file.c
201 @example examples/msg/io-remote/io-remote.c
202
203 @example examples/msg/task-priority/task-priority.c
204 @example examples/msg/platform-properties/platform-properties.c
205
206 */
207