Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define correctly variables for windows.
[simgrid.git] / src / msg / deployment.c
1 /* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include "msg/private.h"
8 #include "xbt/sysdep.h"
9 #include "xbt/log.h"
10
11
12 /** \ingroup msg_easier_life
13  * \brief An application deployer.
14  *
15  * Creates the process described in \a file.
16  * \param file a filename of a xml description of the application. This file 
17  * follows this DTD :
18  *
19  *     \include simgrid.dtd
20  *
21  * Here is a small example of such a platform 
22  *
23  *     \include msg/masterslave/deployment_masterslave.xml
24  *
25  * Have a look in the directory examples/msg/ to have a bigger example.
26  */
27 void MSG_launch_application(const char *file)
28 {
29
30   xbt_assert0(msg_global,
31               "MSG_global_init_args has to be called before MSG_launch_application.");
32
33   SIMIX_launch_application(file);
34
35   return;
36 }
37
38 /** \ingroup msg_easier_life
39  * \brief Registers the main function of an agent in a global table.
40  *
41  * Registers a code function in a global table. 
42  * This table is then used by #MSG_launch_application. 
43  * \param name the reference name of the function.
44  * \param code the function (must have the same prototype than the main function of any C program: int ..(int argc, char *argv[]))
45  */
46 void MSG_function_register(const char *name, xbt_main_func_t code)
47 {
48   SIMIX_function_register(name, code);
49   return;
50 }
51
52 /** \ingroup msg_easier_life
53  * \brief Registers a function as the default main function of agents.
54  *
55  * Registers a code function as being the default value. This function will get used by MSG_launch_application() when there is no registered function of the requested name in.
56  * \param code the function (must have the same prototype than the main function of any C program: int ..(int argc, char *argv[]))
57  */
58 void MSG_function_register_default(xbt_main_func_t code)
59 {
60   SIMIX_function_register_default(code);
61 }
62
63 /** \ingroup msg_easier_life
64  * \brief Retrieves a registered main function
65  *
66  * Registers a code function in a global table. 
67  * This table is then used by #MSG_launch_application. 
68  * \param name the reference name of the function.
69  */
70 xbt_main_func_t MSG_get_registered_function(const char *name)
71 {
72   return SIMIX_get_registered_function(name);
73 }