Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
202c8301098ec7c2e859e24bb791cdfa36ca8b34
[simgrid.git] / doc / module-msg.doc
1 /** \defgroup MSG_JAVA      jMSG
2     \ingroup MSG_API
3     \brief Java bindings to MSG (\ref MSG_API)
4
5     \htmlonly <!-- 
6       DOXYGEN_NAVBAR_LABEL="JAVA bindings" 
7       DOXYGEN_NAVBAR_CHILD "Simulation functions"=classsimgrid_1_1msg_1_1Msg.html
8       DOXYGEN_NAVBAR_CHILD "Host"=classsimgrid_1_1msg_1_1Host.html
9       DOXYGEN_NAVBAR_CHILD "Process"=classsimgrid_1_1msg_1_1Process.html
10       DOXYGEN_NAVBAR_CHILD "Task"=classsimgrid_1_1msg_1_1Task.html      
11       DOXYGEN_NAVBAR_CHILD "MsgException"=classsimgrid_1_1msg_1_1MsgException.html
12     --> \endhtmlonly 
13           
14       MSG was the first distributed programming environment provided within
15       SimGrid. While almost realistic, it remains quite simple (simplistic?).
16       This describes the Java bindings to this interface.
17
18       \section jMSG_who Who should use this (and who shouldn't)
19       
20       You should use MSG if you want to study some heuristics for a
21       given problem you don't really want to implement. If you want to
22       use the Java programming language, your are in the right
23       section. To use the C interface, please refer to \ref MSG_C.
24 */
25
26 /** \defgroup MSG_C      MSG native
27     \ingroup MSG_API
28     \brief Native interface to MSG (\ref MSG_API)
29
30     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Native interface" --> \endhtmlonly 
31           
32       MSG was the first distributed programming environment provided within
33       SimGrid. While almost realistic, it remains quite simple (simplistic?).
34       This describes the native to MSG.
35
36       \section jMSG_who Who should use this (and who shouldn't)
37       
38       You should use MSG if you want to study some heuristics for a
39       given problem you don't really want to implement. If you want to
40       use the C programming language, your are in the right
41       section. To use the Java programming interface, please refer to
42       \ref MSG_JAVA.
43 */
44
45
46 /**
47
48 \defgroup MSG_LUA      lMSG
49     \ingroup MSG_API
50     \brief Lua bindings to MSG (\ref MSG_API)
51
52     \htmlonly <!-- 
53       DOXYGEN_NAVBAR_LABEL="LUA bindings" 
54     --> \endhtmlonly 
55           
56       MSG was the first distributed programming environment provided within
57       SimGrid. While almost realistic, it remains quite simple (simplistic?).
58       This describes the Lua bindings to this interface.
59
60       \section lMSG_who Who should use this (and who shouldn't)
61       
62       You should use MSG if you want to study some heuristics for a
63       given problem you don't really want to implement. If you want to
64       use the Lua script language, your are in the right
65       section. To use the C interface, please refer to \ref MSG_C.
66
67 */
68
69 /** @addtogroup MSG_C
70
71   \section MSG_funct Offered functionnalities
72    - \ref m_process_management
73    - \ref m_datatypes_management
74    - \ref m_host_management
75    - \ref m_task_management
76    - \ref msg_gos_functions
77    - \ref m_channel_management
78    - \ref msg_easier_life
79    - \ref msg_simulation
80
81   \section MSG_examples Examples of MSG
82  
83    - \ref MSG_ex_master_slave
84 */
85
86 /** @addtogroup MSG_LUA
87
88   \section MSG_Lua_funct  Lua offered functionnalities in MSG
89    - \ref host_management
90    - \ref tasks_management
91    - \ref environment_management
92   \section Lua_examples Examples of lua MSG
93  
94    - \ref MSG_ex_master_slave_lua
95    - \ref MSG_ex_master_slave_lua_bypass
96 */
97
98
99 /** @defgroup m_datatypes_management MSG Data Types 
100     @ingroup MSG_C
101     @brief This section describes the different datatypes provided by MSG.
102     
103     \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Data types" --> \endhtmlonly
104 */
105 /**     \addtogroup m_process_management
106         \ingroup MSG_C  */
107 /**     \addtogroup m_host_management
108         \ingroup MSG_C  */
109 /**     \addtogroup m_task_management
110         \ingroup MSG_C  */
111 /**     \addtogroup msg_gos_functions
112         \ingroup MSG_C  */
113 /**     \addtogroup m_channel_management
114         \ingroup MSG_C  */
115 /**     \addtogroup msg_easier_life
116         \ingroup MSG_C  */
117 /**     \addtogroup msg_simulation
118         \ingroup MSG_C  */
119
120 /** \page MSG_ex_master_slave Master/slave application
121     
122     Simulation of a master-slave application using a realistic platform and
123     an external description of the deployment. 
124
125     \section MSG_ex_ms_TOC Table of contents:
126     
127      - \ref MSG_ext_ms_code
128        - \ref MSG_ext_ms_preliminary
129        - \ref MSG_ext_ms_master
130        - \ref MSG_ext_ms_slave
131        - \ref MSG_ext_ms_forwarder
132        - \ref MSG_ext_ms_core
133        - \ref MSG_ext_ms_main
134      - \ref MSG_ext_ms_helping
135        - \ref MSG_ext_ms_application 
136        - \ref MSG_ext_ms_platform
137      
138     <hr> 
139     
140     \dontinclude msg/masterslave/masterslave_forwarder.c
141     
142     \section MSG_ext_ms_code Code of the application
143     
144     \subsection MSG_ext_ms_preliminary Preliminary declarations
145     
146     \skip include
147     \until printf
148     \until }
149     
150     \subsection MSG_ext_ms_master Master code
151     
152       This function has to be assigned to a m_process_t that will behave as the master.
153       It should not be called directly but either given as a parameter to
154       #MSG_process_create() or registered as a public function through 
155       #MSG_function_register() and then automatically assigned to a process through
156       #MSG_launch_application().
157  
158       C style arguments (argc/argv) are interpreted as:
159        - the number of tasks to distribute
160        - the computation size of each task
161        - the size of the files associated to each task
162        - a list of host that will accept those tasks.
163
164       Tasks are dumbly sent in a round-robin style.
165       
166       \until end_of_master
167     
168     \subsection MSG_ext_ms_slave Slave code
169     
170       This function has to be assigned to a #m_process_t that has to behave as a slave.
171       Just like the master fuction (described in \ref MSG_ext_ms_master), it should not be called directly.
172
173       This function keeps waiting for tasks and executes them as it receives them.
174       
175       \until end_of_slave
176
177    \subsection MSG_ext_ms_forwarder Forwarder code
178    
179       This function has to be assigned to a #m_process_t that has to behave as a forwarder.
180       Just like the master function (described in \ref MSG_ext_ms_master), it should not be called directly.
181
182       C style arguments (argc/argv) are interpreted as a list of host
183       that will accept those tasks.
184
185       This function keeps waiting for tasks and dispathes them to its slaves.
186
187       \until end_of_forwarder
188
189    \subsection MSG_ext_ms_core Simulation core
190
191       This function is the core of the simulation and is divided only into 3 parts
192       thanks to MSG_create_environment() and MSG_launch_application().
193          -# Simulation settings : MSG_create_environment() creates a realistic 
194             environment
195          -# Application deployment : create the agents on the right locations with  
196             MSG_launch_application()
197          -# The simulation is run with #MSG_main()
198          
199       Its arguments are:
200         - <i>platform_file</i>: the name of a file containing an valid surfxml platform description.
201         - <i>application_file</i>: the name of a file containing a valid surfxml application description
202         
203       \until end_of_test_all
204       
205    \subsection MSG_ext_ms_main Main() function
206    
207       This initializes MSG, runs a simulation, and free all data-structures created by MSG.
208       
209       \until end_of_main
210
211    \section MSG_ext_ms_helping Helping files
212
213    \subsection MSG_ext_ms_application Example of application file
214
215    \include msg/masterslave/deployment_masterslave.xml
216
217    \subsection MSG_ext_ms_platform Example of platform file
218    
219    \include msg/small_platform.xml
220    
221 */
222
223 /** \page MSG_ex_master_slave_lua Master/slave Lua application
224     
225     Simulation of a master-slave application using lua bindings
226        - \ref MSG_ext_ms_code_lua
227        - \ref MSG_ext_ms_master_lua
228        - \ref MSG_ext_ms_slave_lua
229        - \ref MSG_ext_ms_core_lua
230
231      - \ref MSG_ext_ms_helping
232        - \ref MSG_ext_ms_application 
233        - \ref MSG_ext_ms_platform
234        
235        
236       \dontinclude lua/master_slave.lua
237       
238       \section MSG_ext_ms_code_lua Code of the application
239       
240       \subsection MSG_ext_ms_master_lua Master code
241       
242             as described ine the C native master/Slave exmaple , this function has to be assigned to a m_process_t that will behave as the master.
243  
244       Lua style arguments (...) in for the master are interpreted as:
245        - the number of tasks to distribute
246        - the computation size of each task
247        - the size of the files associated to each task
248        - a list of host that will accept those tasks.
249
250       Tasks are dumbly sent in a round-robin style.
251       
252       \until end_of_master
253       
254       
255       \subsection MSG_ext_ms_slave_lua Slave code
256     
257       This function has to be assigned to a #m_process_t that has to behave as a slave.
258       This function keeps waiting for tasks and executes them as it receives them.
259       
260       \until end_of_slave
261          \subsection MSG_ext_ms_core_lua Simulation core
262
263       in this section the core of the simulation which start by including the simgrid lib for bindings
264       : <i>require "simgrid" </i>
265       
266          -# Simulation settings : <i>simgrid.platform</i> creates a realistic 
267             environment 
268          -# Application deployment : create the agents on the right locations with  
269             <i>simgrid.application</i>
270          -# The simulation is run with <i>simgrid.run</i>
271          
272       Its arguments are:
273         - <i>platform_file</i>: the name of a file containing an valid surfxml platform description.( first command line argument)
274         - <i>application_file</i>: the name of a file containing a valid surfxml application description ( second commande line argument )
275         
276       \until simgrid.clean()
277       
278 */
279
280 /** \page MSG_ex_master_slave_lua_bypass Master/slave Bypass Lua application
281     
282     Simulation of a master-slave application using lua bindings, Bypassing the XML parser
283        - \ref MSG_ext_ms_code_lua
284        - \ref MSG_ext_ms_master_lua
285        - \ref MSG_ext_ms_slave_lua
286        - \ref MSG_ext_ms_core_lua
287        
288        
289       \dontinclude lua/master_slave_bypass.lua
290       
291       \section MSG_ext_ms_code_lua Code of the application
292       
293       \subsection MSG_ext_ms_master_lua Master code
294       
295             as described ine the C native master/Slave exmaple , this function has to be assigned to a m_process_t that will behave as the master.
296  
297       Lua style arguments (...) in for the master are interpreted as:
298        - the number of tasks to distribute
299        - the computation size of each task
300        - the size of the files associated to each task
301        - a list of host that will accept those tasks.
302
303       Tasks are dumbly sent in a round-robin style.
304       
305       \until end_of_master
306       
307       
308       \subsection MSG_ext_ms_slave_lua Slave code
309     
310       This function has to be assigned to a #m_process_t that has to behave as a slave.
311       This function keeps waiting for tasks and executes them as it receives them.
312       
313       \until end_of_slave
314          \subsection MSG_ext_ms_core_lua Simulation core
315
316       in this section the core of the simulation which start by including the simgrid lib for bindings, then create the resources we need to set up our environment bypassing the XML parser.
317       : <i>require "simgrid" </i>
318       
319          -# Hosts : <i>simgrid.Host.new</i> instanciate a new host with an id, and power.
320          -# Links : <i>simgrid.Link.new</i> instanictae a new link that will require an id, bandwith and latency values.
321          -# Route : <i>simgrid.Route.new</i> define a route between two hosts specifying the links to use.
322          -# Simulation settings : <i>simgrid.register_platform();</i> register own platform without using the XML SURF parser.
323
324          we can also bypass the XML deployment file, and associate functions for each of defined hosts.
325         - <i>simgrid.Host.setFunction</i>: associate a function to a host, specifying arguments if needed.
326         - <i>simgrid.register_application()</i>: saving the deployment settings before running the simualtion.
327
328       \until simgrid.clean()
329       
330 */