SimGrid
3.14.159
Versatile Simulation of Distributed Systems
|
How to setup and control your simulation.
The basic workflow is the following (check the MSG examples for details).
Macros | |
#define | MSG_init(argc, argv) |
Initialize the MSG internal data. More... | |
Functions | |
void | MSG_launch_application (const char *file) |
An application deployer. More... | |
void | MSG_function_register (const char *name, xbt_main_func_t code) |
Registers the main function of a process in a global table. More... | |
void | MSG_function_register_default (xbt_main_func_t code) |
Registers a function as the default main function of processes. More... | |
void | MSG_create_environment (const char *file) |
A platform constructor. More... | |
void | MSG_init_nocheck (int *argc, char **argv) |
Initialize MSG with less verifications You should use the MSG_init() function instead. More... | |
msg_error_t | MSG_main () |
Launch the MSG simulation. More... | |
void | MSG_config (const char *key, const char *value) |
set a configuration variable More... | |
int | MSG_process_killall (int reset_PIDs) |
Kill all running process. More... | |
double | MSG_get_clock () |
A clock (in second). More... | |
enum | msg_error_t { MSG_OK = 0, MSG_TIMEOUT = 1, MSG_TRANSFER_FAILURE = 2, MSG_HOST_FAILURE = 4, MSG_TASK_CANCELED = 8 } |
Return code of most MSG functions. More... | |
Initialize the MSG internal data.
It also check that the link-time and compile-time versions of SimGrid do match, so you should use this version instead of the MSG_init_nocheck function that does the same initializations, but without this check.
We allow to link against compiled versions that differ in the patch level.
enum msg_error_t |
Return code of most MSG functions.
void MSG_launch_application | ( | const char * | file | ) |
An application deployer.
Creates the process described in file.
file | a filename of a xml description of the application. This file follows this DTD : \include simgrid.dtd |
Here is a small example of such a platform
\include msg/masterslave/deployment_masterslave.xml
Have a look in the directory examples/msg/ to have a bigger example.
void MSG_function_register | ( | const char * | name, |
xbt_main_func_t | code | ||
) |
Registers the main function of a process in a global table.
Registers a code function in a global table. This table is then used by MSG_launch_application.
name | the reference name of the function. |
code | the function (must have the same prototype than the main function of any C program: int ..(int argc, char *argv[])) |
void MSG_function_register_default | ( | xbt_main_func_t | code | ) |
Registers a function as the default main function of processes.
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.
code | the function (must have the same prototype than the main function of any C program: int ..(int argc, char *argv[])) |
void MSG_create_environment | ( | const char * | file | ) |
A platform constructor.
Creates a new platform, including hosts, links and the routing_table.
file | a filename of a xml description of a platform. This file follows this DTD : \include simgrid.dtd |
Here is a small example of such a platform
\include small_platform.xml
Have a look in the directory examples/msg/ to have a big example.
void MSG_init_nocheck | ( | int * | argc, |
char ** | argv | ||
) |
Initialize MSG with less verifications You should use the MSG_init() function instead.
Failing to do so may turn into PEBKAC some day. You've been warned.
msg_error_t MSG_main | ( | ) |
Launch the MSG simulation.
void MSG_config | ( | const char * | key, |
const char * | value | ||
) |
set a configuration variable
Do –help on any simgrid binary to see the list of currently existing configuration variables, and see Section Configure SimGrid.
Example: MSG_config("host/model","ptask_L07");
int MSG_process_killall | ( | int | reset_PIDs | ) |
Kill all running process.
reset_PIDs | should we reset the PID numbers. A negative number means no reset and a positive number will be used to set the PID of the next newly created process. |
double MSG_get_clock | ( | ) |
A clock (in second).