Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Working on SimDag.
[simgrid.git] / src / simdag / sd_global.c
1 #include "simdag/simdag.h"
2 #include "private.h"
3 #include "xbt/asserts.h"
4 #include "xbt/sysdep.h"
5 #include "surf/surf.h"
6
7 static int init_done = 0;
8
9 /* Initialises SG internal data. This function should be called before any other SG function.
10  */
11 void SG_init(int *argc, char **argv) {
12   xbt_assert0(!init_done, "SG_init already called");
13
14   sg_global = xbt_new0(s_SG_global_t, 1);
15   sg_global->workstations = xbt_dict_new();
16   sg_global->workstation_count = 0;
17
18   surf_init(argc, argv);
19
20   init_done = 1;
21 }
22
23 /* Checks that SG_init has been called.
24  */
25 void check_init_done() {
26   xbt_assert0(init_done, "SG_init not called yet");
27 }
28
29 /* Creates the environnement described in a xml file of a platform descriptions.
30  */
31 void SG_create_environnement(const char *platform_file) {
32   check_init_done();
33   surf_timer_resource_init(file);
34   surf_workstation_resource_init_KCCFLN05(file); /* tell Surf to create the environnement */
35 }
36
37
38 /* Launches the simulation. Returns a NULL-terminated array of SG_task_t whose state has changed.
39  */
40 SG_task_t* SG_simulate(double how_long)
41 {
42   /* TODO */
43   return NULL;
44 }