Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
b5b7ce87795d66850c78273be6359e94ffea715d
[simgrid.git] / doc / modules.doc
1 /** 
2   \defgroup SimGrid_API  SimGrid modules */
3
4 /** \defgroup XBT_API      XBT
5     \ingroup SimGrid_API
6     \brief The core toolbox of SimGrid, containing usefull datatypes,
7            portability support and so on.
8
9 */
10
11 /** \defgroup MSG_API      MSG
12     \ingroup SimGrid_API
13     \brief Simple programming environment 
14   
15       MSG was the first distributed programming environment provided within
16       SimGrid. While almost realistic, it remains quite simple (simplistic?).
17
18       \section MSG_who Who should use this (and who shouldn't)
19       
20       You should use this module if you want to study some heuristics for a
21       given problem you don't really want to implement.
22       If you want to use DAGs, have a look at the \ref SD_API programming
23       environment.
24       If you want to get a real (but experimental) implementation of your solution, have a look
25       at the \ref GRAS_API one. If you want to study an existing MPI program,
26       have a look at the \ref SMPI_API one. If none of those programming
27       environments fits your needs, you may consider implementing your own 
28       directly on top of \ref SURF_API (but you probably want to contact us
29       before). 
30 */
31
32
33 /** \defgroup GRAS_API      GRAS
34     \ingroup SimGrid_API
35     \brief Realistic programming environment (Grid Reality And Simulation)
36   
37     GRAS provides a complete API to implement distributed application on top
38     of heterogeneous plateforms. In addition to the SimGrid implementation
39     of this interface (allowing you to work on your application within the
40     comfort of the simulator), an implementation suited to real platforms is
41     also provided (allowing you to really use your application once you're
42     done with developing it). It may still contain rought corners as
43     GRAS is not the most used part of SimGrid, however.
44   
45     GRAS thus constitute a complete grid application developement framework,
46     encompassing both developer helping tools (the simulator and associated
47     tools) and an efficient while portable execution runtime.
48   
49     \section GRAS_who Who should use this (and who shouldn't)
50     
51     You should use this programming environment if you want to develop real
52     applications, ie if the final result of your work is a program which 
53     may eventually be distributed. Rember however that GRAS is
54     considered as experimental at this point. Help would be welcomed
55     to improve this sorry situation...
56     
57     If you just want to study some heuristics for a given problem you don't
58     want to implement really (ie, if your result would be a theorem), have a
59     look at the \ref MSG_API one, or the \ref SD_API one if you need to use DAGs.
60     If you want to study an existing MPI program, have a look at the 
61     \ref SMPI_API one. 
62     If none of those programming environments fits your needs, you may
63     consider implementing your own directly on top of \ref SURF_API (but you
64     probably want to contact us before).
65 */
66
67 /** \defgroup AMOK_API AMOK
68     \ingroup SimGrid_API
69     \brief Distributed toolkit built over \ref GRAS_API (Advanced Metacomputing Overlay Kit)
70
71     AMOK provides several tools useful to most applications built on top of GRAS, 
72     but yet not belonging to GRAS itself. It is planned that those modules will be 
73     changed to real plugins one day, allowing users to load only the needed parts at
74     run time. For now, they live in another library against which you should link your 
75     programs explicitly.
76 */
77
78 /** \defgroup SMPI_API      SMPI
79     \ingroup SimGrid_API
80     \brief Programming environment for the simulation of MPI applications
81   
82 This programming environment permits to study existing MPI application
83 by emulating them on top of the SimGrid simulator. In other words, it
84 will constitute an emulation solution for parallel codes. You don't
85 even have to modify your code for that, although that may help, as
86 detailed below.
87     
88 \section SMPI_who Who should use SMPI (and who shouldn't)
89     
90 You should use this programming environment of the SimGrid suite if
91 you want to study existing MPI applications. If you want to create a
92 distributed application, you may be interested in the \ref GRAS_API
93 environment instead (but note that GRAS is not very actively
94 maintained nowadays). If you want to study some heuristics for a given
95 problem (and if your goal is to produce theorems and publications, not
96 code), have a look at the \ref MSG_API environment, or the \ref SD_API
97 one if you need to use DAGs. If none of those programming environments
98 fits your needs, you may consider implementing your own directly on
99 top of \ref SURF_API (but you probably want to contact us before).
100   
101 \section SMPI_what What can run within SMPI?
102
103 You can run unmodified MPI applications (both C and Fortran) within
104 SMPI, provided you only use MPI calls that we implemented in MPI. Our
105 coverage of the interface is not bad, but will probably never be
106 complete. One sided communications and I/O primitives are not targeted
107 for now. The full list of not yet implemented functions is available
108 in file <tt>include/smpi/smpi.h</tt> of the archive, between two lines
109 containing the <tt>FIXME</tt> marker. If you really need a missing
110 feature, please get in touch with us: we can guide you though the
111 SimGrid code to help you implementing it, and we'd glad to integrate
112 it in the main project afterward if you contribute them back.
113
114 \section SMPI_adapting Adapting your MPI code to the use of SMPI
115
116 As detailed in the reference article (available at
117 http://hal.inria.fr/inria-00527150), you may want to adapt your code
118 to improve the simulation performance. But these tricks may seriously
119 hinder the result qualtity (or even prevent the app to run) if used
120 wrongly. We assume that if you want to simulate an HPC application,
121 you know what you are doing. Don't prove us wrong!
122
123 If you get short on memory (the whole app is executed on a single node
124 when simulated), you should have a look at the SMPI_SHARED_MALLOC and
125 SMPI_SHARED_FREE macros. It allows to share memory areas between
126 processes. For example, matrix multiplication code may want to store
127 the blocks on the same area. Of course, the resulting computations
128 will useless, but you can still study the application behavior this
129 way. Of course, if your code is data-dependent, this won't work.
130
131 If your application is too slow, try using SMPI_SAMPLE_LOCAL,
132 SMPI_SAMPLE_GLOBAL and friends to indicate which computation loops can
133 be sampled. Some of the loop iterations will be executed to measure
134 their duration, and this duration will be used for the subsequent
135 iterations. These samples are done per processor with
136 SMPI_SAMPLE_LOCAL, and shared between all processors with
137 SMPI_SAMPLE_GLOBAL. Of course, none of this will work if the execution
138 time of your loop iteration are not stable.
139
140 Yes, that's right, these macros are not documented yet, but we'll fix
141 it as soon as time permits. Sorry about that -- patch welcomed! 
142
143 \section SMPI_compiling Compiling your code
144
145 This is very simply done with the <tt>smpicc</tt> script. If you
146 already compiled any MPI code before, you already know how to use it.
147 If not, you should try to get your MPI code running on top of MPI
148 before giving SMPI a spin. Actually, that's very simple even if it's
149 the first time you use MPI code: just use smpicc as a compiler (in
150 replacement of gcc or your usual compiler), and you're set.
151
152 \section SMPI_executing Executing your code on top of the simulator
153
154 This is done though the <tt>smpirun</tt> script as follows.
155 <tt>my_hostfile.txt</tt> is a classical MPI hostfile (that is, this
156 file lists the machines on which the processes must be dispatched, one
157 per line)  <tt>my_platform.xml</tt> is a classical SimGrid platform
158 file. Of course, the hosts of the hostfile must exist in the provided
159 platform. <tt>./program</tt> is the MPI program that you want to
160 simulate (must be compiled by <tt>smpicc</tt>) while <tt>-arg</tt> is
161 a command-line parameter passed to this program.
162
163 \verbatim
164 smpirun -hostfile my_hostfile.txt -platform my_platform.xml ./program -arg
165 \endverbatim
166
167 smpirun accepts other parameters, such as <tt>-np</tt> if you don't
168 want to use all the hosts defined in the hostfile, <tt>-map</tt> to
169 display on which host each rank gets mapped of <tt>-trace</tt> to
170 activate the tracing during the simulation. You can get the full list
171 by running 
172 \verbatim 
173 smpirun -help
174 \endverbatim
175
176
177 */
178
179
180 /** \defgroup SD_API      SimDag
181     \ingroup SimGrid_API
182     \brief Programming environment for DAG applications
183    
184     SimDag provides some functionnalities to simulate parallel task scheduling
185     with DAGs models (Direct Acyclic Graphs).
186     The old versions of SimGrid were based on DAGs. But the DAG part (named SG)
187     was removed in SimGrid 3 because the new kernel (\ref SURF_API) was implemented. \ref SURF_API
188     was much faster and more flexible than SG and did not use DAGs.
189     SimDag is a new implementation of DAGs handling and it is built on top of \ref SURF_API.
190     
191     \section SD_who Who should use this (and who shouldn't)
192     
193     You should use this programming environment of the SimGrid suite if you want
194     to study algorithms and heuristics with DAGs of parallel tasks.
195     If you don't need to use DAGs for your simulation, have a look at the
196     \ref MSG_API programming environment.
197     If you want to implement a real distributed application, have a look at the
198     \ref GRAS_API programming environment.
199     If you want to study an existing MPI program, have a look at the 
200     \ref SMPI_API one. 
201     If none of those programming environments fits your needs, you may
202     consider implementing your own directly on top of \ref SURF_API (but you
203     probably want to contact us before).
204
205 */
206
207 /** 
208 @defgroup SURF_API SURF
209 @ingroup SimGrid_API
210 @brief Internal kernel of all the simulators used in SimGrid, and associated models.
211  
212 SURF provides the core functionnalities to simulate a virtual
213 platform. It is very low-level and is not intended to be used by end
214 users, but rather to serve as a basis for higher-level simulators. Its
215 interface are not frozen (and will probably never be), and the
216 structure emphasis on performance over ease of use. This module
217 contains the platform models. If you need a model that is not encoded
218 yet, please come to the devel mailing list so that we can discuss on
219 the feasibility of your idea.
220
221 Please note that as it is not really intended for public use, this
222 module is only partially documented. 
223 */
224
225
226 /**
227 @defgroup TRACE_API TRACE
228 @ingroup SimGrid_API
229 @brief Tracing mechanism and its functions.
230
231 SimGrid can trace the resource (of hosts and links) utilization using
232 any of its programming interfaces (MSG, SimDAG and SMPI). This means
233 that the tracing will register how much power is used for each host
234 and how much bandwidth is used for each link of the platform.
235
236 The idea of the tracing facilities is to give SimGrid users to
237 possibility to classify MSG and SimDAG tasks by category, tracing the
238 platform utilization (hosts and links) for each of the categories.
239 The API enables the declaration of categories and a function to
240 associate them to the tasks (MSG and SD). The tasks that are not
241 classified according to a category are not traced. If no categories
242 are specified, simulations can still be traced using a special
243 parameter in the command line (see \ref tracing_tracing for details).
244 */
245