Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #188 from Takishipp/clean_events
[simgrid.git] / examples / s4u / README.doc
1 S4U (Simgrid for you) is the next interface of SimGrid, expected to be released with SimGrid 4.0.
2
3 Even if it's in a very preliminary state so far, you are welcome to
4 try it and report any interface glitches that you see. Be however
5 warned that the interface will be modified until its final release. 
6 You will have to adapt your code on the way.
7
8 This file follows the Doxygen syntax to be included in the
9 documentation, but it should remain readable directly.
10
11 /** 
12  @defgroup s4u_examples S4U examples
13  @ingroup s4u_api
14  @brief Find the S4U example fitting your needs in the archive.
15
16   - @ref s4u_ex_basics
17   - @ref s4u_ex_actors
18   - @ref s4u_ex_synchro
19   - @ref s4u_ex_actions
20
21 @section s4u_ex_basics Basics of SimGrid simulation
22
23   - <b>Creating actors:</b> @ref examples/s4u/actor-create/s4u_actor-create.cpp and 
24     @ref examples/s4u/actor-create/s4u_actor-create_d.xml \n
25     Shows how to start your actors to populate your simulation.
26
27   - <b>Token ring:</b> @ref examples/s4u/app-token-ring/s4u_app-token-ring.cpp \n
28     Shows how to implement a classical communication pattern, where a token is exchanged along a ring to reach every
29     participant.
30
31   - <b>Master Workers:</b> @ref examples/s4u/app-masterworker/s4u_app-masterworker.cpp \n
32     Another good old example, where one Master process has a bunch of task to dispatch to a set of several Worker 
33     processes. 
34
35 @section s4u_ex_actors Acting on Actors
36
37   - <b>Creating actors</b>. 
38     @ref examples/s4u/actor-create/s4u_actor-create.cpp \n
39     Most actors are started from the deployment XML file, but they exist other methods.
40
41   - <b>Suspend and Resume actors</b>.
42     @ref examples/s4u/actor-suspend/s4u_actor-suspend.cpp \n
43     Actors can be suspended and resumed during their executions
44     thanks to the @ref suspend and @ref resume methods.
45
46   - <b>Kill actors</b>.
47     @ref examples/s4u/actor-kill/s4u_actor-kill.cpp \n
48     Actors can forcefully stop other actors with the @ref kill method.
49
50   - <b>Migrating Actors</b>.
51     @ref examples/s4u/actor-migration/s4u_actor-migration.cpp \n
52     Actors can move or be moved from a host to another with the @ref migrate method.
53
54 @section s4u_ex_synchro Inter-Actor Synchronization 
55
56  - <b>Mutex: </b> @ref examples/s4u/mutex/s4u_mutex.cpp \n
57    Shows how to use simgrid::s4u::Mutex synchronization objects.
58
59 @section s4u_ex_actions Following Workload Traces
60
61 This section details how to run trace-driven simulations. It is very
62 handy when you want to test an algorithm or protocol that only react
63 to external events. For example, many P2P protocols react to user
64 requests, but do nothing if there is no such event.
65
66 In such situations, you should write your protocol in C++, and separate
67 the workload that you want to play onto your protocol in a separate
68 text file. Declare a function handling each type of the events in your
69 trace, register them using @ref xbt_replay_action_register in your
70 main, and then run the simulation.
71
72 Then, you can either have one trace file containing all your events,
73 or a file per simulated process: the former may be easier to work
74 with, but the second is more efficient on very large traces. Check
75 also the tesh files in the example directories for details.
76
77   - <b>Communication replay</b>.
78     @ref examples/s4u/actions-comm/s4u_actions-comm.cpp \n
79     Presents a set of event handlers reproducing classical communication
80     primitives (asynchronous send/receive at the moment).
81
82   - <b>I/O replay</b>.
83     @ref examples/s4u/actions-storage/s4u_actions-storage.cpp \n
84     Presents a set of event handlers reproducing classical I/O
85     primitives (open, read, close).
86
87 */
88
89 /**
90 @example examples/s4u/actions-comm/s4u_actions-comm.cpp
91 @example examples/s4u/actions-storage/s4u_actions-storage.cpp
92 @example examples/s4u/actor-create/s4u_actor-create.cpp
93 @example examples/s4u/actor-create/s4u_actor-create_d.xml
94 @example examples/s4u/actor-kill/s4u_actor-kill.cpp
95 @example examples/s4u/actor-migration/s4u_actor-migration.cpp
96 @example examples/s4u/actor-suspend/s4u_actor-suspend.cpp
97 @example examples/s4u/app-token-ring/s4u_app-token-ring.cpp
98 @example examples/s4u/app-masterworker/s4u_app-masterworker.cpp
99
100 @example examples/s4u/mutex/s4u_mutex.cpp
101
102 */