1 /* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "src/msg/msg_private.hpp"
8 /** \ingroup msg_simulation
9 * \brief An application deployer.
11 * Creates the process described in \a file.
12 * \param file a filename of a xml description of the application. This file follows this DTD :
14 * \include simgrid.dtd
16 * Here is a small example of such a platform
18 * \include msg/masterslave/deployment_masterslave.xml
20 * Have a look in the directory examples/msg/ to have a bigger example.
22 void MSG_launch_application(const char *file)
24 xbt_assert(msg_global, "MSG_init has to be called before MSG_launch_application.");
25 SIMIX_launch_application(file);
28 /** \ingroup msg_simulation
29 * \brief Registers the main function of a process in a global table.
31 * Registers a code function in a global table.
32 * This table is then used by #MSG_launch_application.
33 * \param name the reference name of the function.
34 * \param code the function (must have the same prototype than the main function of any C program: int ..(int argc, char *argv[]))
36 void MSG_function_register(const char *name, xbt_main_func_t code)
38 SIMIX_function_register(name, code);
41 /** \ingroup msg_simulation
42 * \brief Registers a function as the default main function of processes.
44 * 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.
45 * \param code the function (must have the same prototype than the main function of any C program: int ..(int argc, char *argv[]))
47 void MSG_function_register_default(xbt_main_func_t code)
49 SIMIX_function_register_default(code);
53 * \brief register functions bypassing the parser
56 void MSG_set_function(const char *host_id, const char *function_name, xbt_dynar_t arguments)
58 SIMIX_process_set_function(host_id, function_name, arguments, -1, -1);