1 /* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #include "msg/private.h"
8 #include "xbt/sysdep.h"
12 /** \ingroup msg_easier_life
13 * \brief An application deployer.
15 * Creates the process described in \a file.
16 * \param file a filename of a xml description of the application. This file
19 * \include simgrid.dtd
21 * Here is a small example of such a platform
23 * \include msg/masterslave/deployment_masterslave.xml
25 * Have a look in the directory examples/msg/ to have a bigger example.
27 void MSG_launch_application(const char *file)
30 xbt_assert0(msg_global,
31 "MSG_global_init_args has to be called before MSG_launch_application.");
33 SIMIX_launch_application(file);
38 /** \ingroup msg_easier_life
39 * \brief Registers the main function of an agent in a global table.
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[]))
46 void MSG_function_register(const char *name, xbt_main_func_t code)
48 SIMIX_function_register(name, code);
52 /** \ingroup msg_easier_life
53 * \brief Registers a function as the default main function of agents.
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[]))
58 void MSG_function_register_default(xbt_main_func_t code)
60 SIMIX_function_register_default(code);
63 /** \ingroup msg_easier_life
64 * \brief Retrieves a registered main function
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.
70 xbt_main_func_t MSG_get_registered_function(const char *name)
72 return SIMIX_get_registered_function(name);