1 /** \defgroup MSG_JAVA jMSG
3 \brief Java bindings to MSG (\ref MSG_API)
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
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.
18 \section jMSG_who Who should use this (and who shouldn't)
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.
26 /** \defgroup MSG_C MSG native
28 \brief Native interface to MSG (\ref MSG_API)
30 \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Native interface" --> \endhtmlonly
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.
36 \section jMSG_who Who should use this (and who shouldn't)
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
48 \defgroup MSG_LUA lMSG
50 \brief Lua bindings to MSG (\ref MSG_API)
53 DOXYGEN_NAVBAR_LABEL="LUA bindings"
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.
60 \section lMSG_who Who should use this (and who shouldn't)
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.
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
81 \section MSG_examples Examples of MSG
83 - \ref MSG_ex_master_slave
86 /** @addtogroup MSG_LUA
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
94 - \ref MSG_ex_master_slave_lua
95 - \ref MSG_ex_master_slave_lua_bypass
99 /** @defgroup m_datatypes_management MSG Data Types
101 @brief This section describes the different datatypes provided by MSG.
103 \htmlonly <!-- DOXYGEN_NAVBAR_LABEL="Data types" --> \endhtmlonly
105 /** \addtogroup m_process_management
107 /** \addtogroup m_host_management
109 /** \addtogroup m_task_management
111 /** \addtogroup msg_gos_functions
113 /** \addtogroup m_channel_management
115 /** \addtogroup msg_easier_life
117 /** \addtogroup msg_simulation
120 /** \page MSG_ex_master_slave Master/slave application
122 Simulation of a master-slave application using a realistic platform and
123 an external description of the deployment.
125 \section MSG_ex_ms_TOC Table of contents:
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
140 \dontinclude msg/masterslave/masterslave_forwarder.c
142 \section MSG_ext_ms_code Code of the application
144 \subsection MSG_ext_ms_preliminary Preliminary declarations
150 \subsection MSG_ext_ms_master Master code
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().
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.
164 Tasks are dumbly sent in a round-robin style.
168 \subsection MSG_ext_ms_slave Slave code
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.
173 This function keeps waiting for tasks and executes them as it receives them.
177 \subsection MSG_ext_ms_forwarder Forwarder code
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.
182 C style arguments (argc/argv) are interpreted as a list of host
183 that will accept those tasks.
185 This function keeps waiting for tasks and dispathes them to its slaves.
187 \until end_of_forwarder
189 \subsection MSG_ext_ms_core Simulation core
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
195 -# Application deployment : create the agents on the right locations with
196 MSG_launch_application()
197 -# The simulation is run with #MSG_main()
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
203 \until end_of_test_all
205 \subsection MSG_ext_ms_main Main() function
207 This initializes MSG, runs a simulation, and free all data-structures created by MSG.
211 \section MSG_ext_ms_helping Helping files
213 \subsection MSG_ext_ms_application Example of application file
215 \include msg/masterslave/deployment_masterslave.xml
217 \subsection MSG_ext_ms_platform Example of platform file
219 \include msg/small_platform.xml
223 /** \page MSG_ex_master_slave_lua Master/slave Lua application
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
231 - \ref MSG_ext_ms_helping
232 - \ref MSG_ext_ms_application
233 - \ref MSG_ext_ms_platform
236 \dontinclude lua/master_slave.lua
238 \section MSG_ext_ms_code_lua Code of the application
240 \subsection MSG_ext_ms_master_lua Master code
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.
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.
250 Tasks are dumbly sent in a round-robin style.
255 \subsection MSG_ext_ms_slave_lua Slave code
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.
261 \subsection MSG_ext_ms_core_lua Simulation core
263 in this section the core of the simulation which start by including the simgrid lib for bindings
264 : <i>require "simgrid" </i>
266 -# Simulation settings : <i>simgrid.platform</i> creates a realistic
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>
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 )
276 \until simgrid.clean()
280 /** \page MSG_ex_master_slave_lua_bypass Master/slave Bypass Lua application
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
289 \dontinclude lua/master_slave_bypass.lua
291 \section MSG_ext_ms_code_lua Code of the application
293 \subsection MSG_ext_ms_master_lua Master code
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.
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.
303 Tasks are dumbly sent in a round-robin style.
308 \subsection MSG_ext_ms_slave_lua Slave code
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.
314 \subsection MSG_ext_ms_core_lua Simulation core
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>
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.
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.
328 \until simgrid.clean()