Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Functions implemented, task_execute tested with a small example.
[simgrid.git] / src / msg_simix / msg_simix_deployment.c
1
2 #include "msg_simix_private.h"
3 #include "xbt/sysdep.h"
4 #include "xbt/log.h"
5
6
7 /** \ingroup msg_easier_life
8  * \brief An application deployer.
9  *
10  * Creates the process described in \a file.
11  * \param file a filename of a xml description of the application. This file 
12  * follows this DTD :
13  *
14  *     \include surfxml.dtd
15  *
16  * Here is a small example of such a platform 
17  *
18  *     \include small_deployment.xml
19  *
20  * Have a look in the directory examples/msg/ to have a bigger example.
21  */
22 void MSG_launch_application(const char *file) 
23 {
24
25   xbt_assert0(msg_global,"MSG_global_init_args has to be called before MSG_launch_application.");
26         SIMIX_function_register_process_create(&__MSG_process_create_with_arguments);
27         SIMIX_function_register_process_kill(&MSG_process_kill);
28         SIMIX_launch_application(file);
29
30         return;
31 }
32
33 /** \ingroup msg_easier_life
34  * \brief Registers a #m_process_code_t code in a global table.
35  *
36  * Registers a code function in a global table. 
37  * This table is then used by #MSG_launch_application. 
38  * \param name the reference name of the function.
39  * \param code the function
40  */
41 void MSG_function_register(const char *name,m_process_code_t code)
42 {
43         SIMIX_function_register(name, code);
44         return;
45 }
46
47 /** \ingroup msg_easier_life
48  * \brief Registers a #m_process_t code in a global table.
49  *
50  * Registers a code function in a global table. 
51  * This table is then used by #MSG_launch_application. 
52  * \param name the reference name of the function.
53  */
54 m_process_code_t MSG_get_registered_function(const char *name)
55 {
56   m_process_code_t code = NULL;
57
58         code = (m_process_code_t)SIMIX_get_registered_function(name);
59
60   return code;
61 }
62