SimGrid  3.10
Versatile Simulation of Distributed Systems
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Simulation

Functions for creating the environment and launching the simulation. More...

Functions

void SD_init (int *argc, char **argv)
 Initializes SD internal data.
void SD_config (const char *key, const char *value)
 set a configuration variable
void SD_application_reinit (void)
 Reinits the application part of the simulation (experimental feature)
void SD_create_environment (const char *platform_file)
 Creates the environment.
xbt_dynar_t SD_simulate (double how_long)
 Launches the simulation.
double SD_get_clock (void)
 Returns the current clock.
void SD_exit (void)
 Destroys all SD internal data.
xbt_dynar_t SD_daxload (const char *filename)
 loads a DAX file describing a DAG
xbt_dynar_t SD_dotload (const char *filename)
 loads a DOT file describing a DAG

Detailed Description

Functions for creating the environment and launching the simulation.

This section describes the functions for initialising SimDag, launching the simulation and exiting SimDag.

Function Documentation

void SD_init ( int *  argc,
char **  argv 
)

Initializes SD internal data.

This function must be called before any other SD function. Then you should call SD_create_environment().

Parameters
argcargument number
argvargument list
See Also
SD_create_environment(), SD_exit()
void SD_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 Simgrid options and configurations.

Example: SD_config("workstation/model","default");

void SD_application_reinit ( void  )

Reinits the application part of the simulation (experimental feature)

This function allows you to run several simulations on the same platform by resetting the part describing the application.

Warning
: this function is still experimental and not perfect. For example, the simulation clock (and traces usage) is not reset. So, do not use it if you use traces in your simulation, and do not use absolute timing after using it. That being said, this function is still precious if you want to compare a bunch of heuristics on the same platforms.
void SD_create_environment ( const char *  platform_file)

Creates the environment.

The environment (i.e. the workstations and the links) is created with the data stored in the given XML platform file.

Parameters
platform_filename of an XML file describing the environment to create
See Also
Workstations, Links

The XML file follows this DTD:

\include simgrid.dtd

Here is a small example of such a platform:

\include small_platform.xml
xbt_dynar_t SD_simulate ( double  how_long)

Launches the simulation.

The function will execute the SD_RUNNABLE runnable tasks. If how_long is positive, then the simulation will be stopped either when time reaches how_long or when a watch point is reached. A non-positive value for how_long means no time limit, in which case the simulation will be stopped either when a watch point is reached or when no more task can be executed. Then you can call SD_simulate() again.

Parameters
how_longmaximum duration of the simulation (a negative value means no time limit)
Returns
a dynar of SD_task_t whose state has changed.
See Also
SD_task_schedule(), SD_task_watch()
double SD_get_clock ( void  )

Returns the current clock.

Returns
the current clock, in second
void SD_exit ( void  )

Destroys all SD internal data.

This function should be called when the simulation is over. Don't forget to destroy too.

See Also
SD_init(), SD_task_destroy()
xbt_dynar_t SD_daxload ( const char *  filename)

loads a DAX file describing a DAG

See https://confluence.pegasus.isi.edu/display/pegasus/WorkflowGenerator for more details.

xbt_dynar_t SD_dotload ( const char *  filename)

loads a DOT file describing a DAG

See http://www.graphviz.org/doc/info/lang.html for more details. To obtain information about transfers and tasks, two attributes are required : size on task (execution time in Flop) and size on edge (the amount of data transfer in bit). if they aren't here, there choose to be equal to zero.