3 /* Copyright (c) 2002-2007 Arnaud Legrand. */
4 /* Copyright (c) 2007 Bruno Donassolo. */
5 /* All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
10 #include "msg/private.h"
11 #include "xbt/sysdep.h"
15 /** \ingroup msg_easier_life
16 * \brief An application deployer.
18 * Creates the process described in \a file.
19 * \param file a filename of a xml description of the application. This file
22 * \include simgrid.dtd
24 * Here is a small example of such a platform
26 * \include msg/masterslave/deployment_masterslave.xml
28 * Have a look in the directory examples/msg/ to have a bigger example.
30 void MSG_launch_application(const char *file)
33 xbt_assert0(msg_global,
34 "MSG_global_init_args has to be called before MSG_launch_application.");
36 SIMIX_launch_application(file);
41 /** \ingroup msg_easier_life
42 * \brief Registers the main function of an agent in a global table.
44 * Registers a code function in a global table.
45 * This table is then used by #MSG_launch_application.
46 * \param name the reference name of the function.
47 * \param code the function (must have the same prototype than the main function of any C program: int ..(int argc, char *argv[]))
49 void MSG_function_register(const char *name, xbt_main_func_t code)
51 SIMIX_function_register(name, code);
55 /** \ingroup msg_easier_life
56 * \brief Registers a function as the default main function of agents.
58 * 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.
59 * \param code the function (must have the same prototype than the main function of any C program: int ..(int argc, char *argv[]))
61 void MSG_function_register_default(xbt_main_func_t code)
63 SIMIX_function_register_default(code);
66 /** \ingroup msg_easier_life
67 * \brief Retrieves a registered main function
69 * Registers a code function in a global table.
70 * This table is then used by #MSG_launch_application.
71 * \param name the reference name of the function.
73 xbt_main_func_t MSG_get_registered_function(const char *name)
75 return SIMIX_get_registered_function(name);