Logo AND Algorithmique Numérique Distribuée

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