Logo AND Algorithmique Numérique Distribuée

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