Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplify
[simgrid.git] / src / include / surf / surf.hpp
1 /* Copyright (c) 2004-2021. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #ifndef SURF_SURF_H
7 #define SURF_SURF_H
8
9 #include "simgrid/forward.h"
10
11 /*** SURF Globals **************************/
12
13 /** @ingroup SURF_simulation
14  *  @brief Initialize SURF
15  *  @param argc argument number
16  *  @param argv arguments
17  *
18  *  This function has to be called to initialize the common structures. Then you will have to create the environment by
19  *  calling  e.g. surf_host_model_init_CM02()
20  *
21  *  @see surf_host_model_init_CM02(), surf_host_model_init_compound(), surf_exit()
22  */
23 XBT_PUBLIC void surf_init(int* argc, char** argv); /* initialize common structures */
24
25 /** @ingroup SURF_simulation
26  *  @brief Finish simulation initialization
27  *
28  *  This function must be called before the first call to surf_solve()
29  */
30 XBT_PUBLIC void surf_presolve();
31
32 /** @ingroup SURF_simulation
33  *  @brief Performs a part of the simulation
34  *  @param max_date Maximum date to update the simulation to, or -1
35  *  @return the elapsed time, or -1.0 if no event could be executed
36  *
37  *  This function execute all possible events, update the action states  and returns the time elapsed.
38  *  When you call execute or communicate on a model, the corresponding actions are not executed immediately but only
39  *  when you call surf_solve.
40  *  Note that the returned elapsed time can be zero.
41  */
42 XBT_PUBLIC double surf_solve(double max_date);
43
44 /** @ingroup SURF_simulation
45  *  @brief Return the current time
46  *
47  *  Return the current time in millisecond.
48  */
49 XBT_PUBLIC double surf_get_clock();
50
51 /** @ingroup SURF_simulation
52  *  @brief Exit SURF
53  *
54  *  Clean everything.
55  *
56  *  @see surf_init()
57  */
58 XBT_PUBLIC void surf_exit();
59
60 /* surf parse file related (public because called from a test suite) */
61 XBT_PUBLIC void parse_platform_file(const std::string& file);
62
63 #endif