Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
added jedule output to SimDAG
[simgrid.git] / include / instr / jedule / jedule_platform.h
1 /*
2  * jed_simgrid_platform.h
3  *
4  *  Created on: Nov 30, 2010
5  *      Author: sascha
6  */
7
8 #ifndef JED_SIMGRID_PLATFORM_H_
9 #define JED_SIMGRID_PLATFORM_H_
10
11 #include "simgrid_config.h"
12
13 #include "xbt/dynar.h"
14 #include "xbt/hash.h"
15
16 #ifdef HAVE_JEDULE
17
18 typedef struct jed_simgrid_container s_jed_simgrid_container_t,
19                 *jed_simgrid_container_t;
20
21
22 struct jed_simgrid_container {
23         char *name;
24         xbt_dynar_t container_children;
25         jed_simgrid_container_t parent;
26         xbt_dynar_t resource_list;
27         xbt_dict_t name2id;
28         int last_id;
29         int is_lowest;
30 };
31
32
33 /**
34  * selection of a subset of resources from the original set
35  *
36  */
37 struct jed_res_subset {
38         jed_simgrid_container_t parent;
39         int start_idx; // start idx in resource_list of container
40         int nres;      // number of resources spanning starting at start_idx
41 };
42
43 typedef struct jed_res_subset s_jed_res_subset_t, *jed_res_subset_t;
44
45 struct jedule_struct {
46         jed_simgrid_container_t root_container;
47         xbt_dict_t jedule_meta_info;
48 };
49
50 typedef struct jedule_struct s_jedule_t, *jedule_t;
51
52
53 /*********************************************************/
54
55 void jed_create_jedule(jedule_t *jedule);
56
57 void jed_free_jedule(jedule_t jedule);
58
59 void jedule_add_meta_info(jedule_t jedule, char *key, char *value);
60
61 void jed_simgrid_create_container(jed_simgrid_container_t *container, char *name);
62
63 void jed_simgrid_add_container(jed_simgrid_container_t parent,
64                 jed_simgrid_container_t child);
65
66 void jed_simgrid_add_resources(jed_simgrid_container_t parent,
67                 xbt_dynar_t host_names);
68
69 /**
70  *
71  * it is assumed that the host_names in the entire system are unique
72  * that means that we don't need parent references
73  *
74  * subset_list must be allocated
75  * host_names is the list of host_names associated with an event
76  */
77 void jed_simgrid_get_resource_selection_by_hosts(xbt_dynar_t subset_list,
78                 xbt_dynar_t host_names);
79
80 /*
81   global:
82           hash host_id -> container
83
84   container:
85           hash host_id -> jed_host_id
86
87           list <- [ jed_host_ids ]
88           list <- sort( list )
89           list_chunks <- chunk( list )   -> [ 1, 3-5, 7-9 ]
90
91 */
92
93 #endif
94
95
96 #endif /* JED_SIMGRID_PLATFORM_H_ */