SimGrid
3.14.159
Versatile Simulation of Distributed Systems
|
Functions for creating the environment and launching the simulation.
This section describes the functions for initializing SURF, performing the simulation and exiting SURF.
Functions | |
void | surf_init (int *argc, char **argv) |
Initialize SURF. More... | |
void | surf_presolve () |
Finish simulation initialization. More... | |
double | surf_solve (double max_date) |
Performs a part of the simulation. More... | |
double | surf_get_clock () |
Return the current time. More... | |
void | surf_exit () |
Exit SURF. More... | |
Variables | |
xbt_dict_t | watched_hosts_lib |
List of hosts for which one want to be notified if they ever restart. More... | |
std::vector< sg_host_t > | host_that_restart |
List of hosts that have just restarted and whose autorestart process should be restarted. More... | |
void surf_init | ( | int * | argc, |
char ** | argv | ||
) |
Initialize SURF.
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_host_model_init_CM02()
void surf_presolve | ( | ) |
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.
max_date | Maximum date to update the simulation to, or -1 |
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 | ( | ) |
Return the current time.
Return the current time in millisecond.
void surf_exit | ( | ) |
xbt_dict_t watched_hosts_lib |
List of hosts for which one want to be notified if they ever restart.
std::vector<sg_host_t> host_that_restart |
List of hosts that have just restarted and whose autorestart process should be restarted.