SimGrid: Simulation

SimGrid 3.10 Versatile Simulation of Distributed Systems

- Home page
- Online documentation
- Dev's Corner

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions | Variables
Simulation
SURF

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

## Functions
| XBT_PUBLIC_DATA (xbt_dynar_t) model_list
| List of initialized models.
void | surf_init (int *argc, char **argv)
| Initialize SURF.
void | surf_presolve (void)
| Finish simulation initialization.
double | surf_solve (double max_date)
| Performs a part of the simulation.
double | surf_get_clock (void)
| Return the current time.
void | surf_exit (void)
| Exit SURF.

## Variables
xbt_dict_t | watched_hosts_lib
| List of hosts for which one want to be notified if they ever restart.

## Detailed Description

Functions for creating the environment and launching the simulation.

This section describes the functions for initialising SURF, performing the simulation and exiting SURF.

## Function Documentation

XBT_PUBLIC_DATA | ( | xbt_dynar_t |  | ) |

List of initialized models.

List of hosts that have juste restarted and whose autorestart process should be restarted.

void surf_init | ( | int * | argc,
|  | char ** | argv
| ) |  |

Initialize SURF.

Parameters

  argc | argument number
  argv | arguments

This function has to be called to initialize the common structures. Then you will have to create the environment by calling e.g. surf_workstation_model_init_CM02()

See Also
  surf_workstation_model_init_CM02(), surf_workstation_model_init_compound(), surf_exit()

void surf_presolve | ( | void |  | ) |

Finish simulation initialization.

This function must be called before the first call to surf_solve()

double surf_solve | ( | double | max_date | ) |

Performs a part of the simulation.

Parameters

  max_date | Maximum date to update the simulation to, or -1

Returns
  the elapsed time, or -1.0 if no event could be executed

This function execute all possible events, update the action states and returns the time elapsed. When you call execute or communicate on a model, the corresponding actions are not executed immediately but only when you call surf_solve. Note that the returned elapsed time can be zero.

double surf_get_clock | ( | void |  | ) |

Return the current time.

Return the current time in millisecond.

void surf_exit | ( | void |  | ) |

Exit SURF.

Clean everything.

See Also
  surf_init()