Logo AND Algorithmique Numérique Distribuée

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