Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar: kill dead code
[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 is not completely rock stable yet, it may well already fit
4 your needs. You are welcome to try it and report any interface
5 glitches that you see. Be however warned that the interface may change
6 until its final release.  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>Ping Pong</b>: @ref examples/s4u/app-pingpong/s4u_app-pingpong.c\n
28    It's hard to think of a simpler example: it is just sending one message back and forth.
29    The tesh file laying in the directory show how to start the simulator binary, highlighting how to pass options to 
30    the simulators (as detailed in Section \ref options). 
31
32   - <b>Token ring:</b> @ref examples/s4u/app-token-ring/s4u_app-token-ring.cpp \n
33     Shows how to implement a classical communication pattern, where a token is exchanged along a ring to reach every
34     participant.
35
36   - <b>Master Workers:</b> @ref examples/s4u/app-masterworker/s4u_app-masterworker.cpp \n
37     Another good old example, where one Master process has a bunch of task to dispatch to a set of several Worker 
38     processes. 
39
40 @section s4u_ex_actors Acting on Actors
41
42   - <b>Creating actors</b>. 
43     @ref examples/s4u/actor-create/s4u_actor-create.cpp \n
44     Most actors are started from the deployment XML file, but they exist other methods.
45
46   - <b>Daemonize actors</b>
47     @ref examples/s4u/actor-daemon/s4u_actor-daemon.cpp \n
48     Some actors may be intended to simulate daemons that run in background. This example show how to transform a regular
49     actor into a daemon that will be automatically killed once the simulation is over. 
50
51   - <b>Suspend and Resume actors</b>.
52     @ref examples/s4u/actor-suspend/s4u_actor-suspend.cpp \n
53     Actors can be suspended and resumed during their executions
54     thanks to the @ref suspend and @ref resume methods.
55
56   - <b>Kill actors</b>.
57     @ref examples/s4u/actor-kill/s4u_actor-kill.cpp \n
58     Actors can forcefully stop other actors with the @ref kill method.
59
60   - <b>Migrating Actors</b>.
61     @ref examples/s4u/actor-migration/s4u_actor-migration.cpp \n
62     Actors can move or be moved from a host to another with the @ref migrate method.
63
64 @section s4u_ex_synchro Inter-Actor Synchronization 
65
66  - <b>Mutex: </b> @ref examples/s4u/mutex/s4u_mutex.cpp \n
67    Shows how to use simgrid::s4u::Mutex synchronization objects.
68
69 @section s4u_ex_actions Following Workload Traces
70
71 This section details how to run trace-driven simulations. It is very
72 handy when you want to test an algorithm or protocol that only react
73 to external events. For example, many P2P protocols react to user
74 requests, but do nothing if there is no such event.
75
76 In such situations, you should write your protocol in C++, and separate
77 the workload that you want to play onto your protocol in a separate
78 text file. Declare a function handling each type of the events in your
79 trace, register them using @ref xbt_replay_action_register in your
80 main, and then run the simulation.
81
82 Then, you can either have one trace file containing all your events,
83 or a file per simulated process: the former may be easier to work
84 with, but the second is more efficient on very large traces. Check
85 also the tesh files in the example directories for details.
86
87   - <b>Communication replay</b>.
88     @ref examples/s4u/actions-comm/s4u_actions-comm.cpp \n
89     Presents a set of event handlers reproducing classical communication
90     primitives (asynchronous send/receive at the moment).
91
92   - <b>I/O replay</b>.
93     @ref examples/s4u/actions-storage/s4u_actions-storage.cpp \n
94     Presents a set of event handlers reproducing classical I/O
95     primitives (open, read, close).
96
97 */
98
99 /**
100 @example examples/s4u/actions-comm/s4u_actions-comm.cpp
101 @example examples/s4u/actions-storage/s4u_actions-storage.cpp
102 @example examples/s4u/actor-create/s4u_actor-create.cpp
103 @example examples/s4u/actor-create/s4u_actor-create_d.xml
104 @example examples/s4u/actor-daemon/s4u_actor-daemon.cpp
105 @example examples/s4u/actor-kill/s4u_actor-kill.cpp
106 @example examples/s4u/actor-migration/s4u_actor-migration.cpp
107 @example examples/s4u/actor-suspend/s4u_actor-suspend.cpp
108 @example examples/s4u/app-token-ring/s4u_app-token-ring.cpp
109 @example examples/s4u/app-masterworker/s4u_app-masterworker.cpp
110 @example examples/s4u/app-pingpong/s4u_app-pingpong.cpp
111
112 @example examples/s4u/mutex/s4u_mutex.cpp
113
114 */