Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Field is not used (and apparently has never been used).
[simgrid.git] / include / simgrid / jedule / jedule_platform.hpp
1 /* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef JED_SIMGRID_PLATFORM_H_
7 #define JED_SIMGRID_PLATFORM_H_
8
9 #include <simgrid/forward.h>
10
11 #include <memory>
12 #include <string>
13 #include <unordered_map>
14 #include <vector>
15
16 namespace simgrid {
17 namespace jedule{
18 class XBT_PUBLIC Container {
19 public:
20   explicit Container(const std::string& name);
21   Container(const Container&) = delete;
22   Container& operator=(const Container&) = delete;
23
24 private:
25   int last_id_   = 0;
26
27 public:
28   std::string name;
29   std::unordered_map<const char*, unsigned int> name2id;
30   Container *parent = nullptr;
31   std::vector<std::unique_ptr<Container>> children;
32   std::vector<sg_host_t> resource_list;
33   void add_child(Container* child);
34   void add_resources(std::vector<sg_host_t> hosts);
35   void create_hierarchy(sg_netzone_t from_as);
36   std::vector<int> get_hierarchy();
37   std::string get_hierarchy_as_string();
38   void print(FILE *file);
39   void print_resources(FILE* file);
40 };
41
42 class XBT_PUBLIC Subset {
43 public:
44   Subset(int s, int n, Container* p);
45   int start_idx; // start idx in resource_list of container
46   int nres;      // number of resources spanning starting at start_idx
47   Container *parent;
48 };
49
50 }
51 }
52 typedef simgrid::jedule::Container * jed_container_t;
53 void get_resource_selection_by_hosts(std::vector<simgrid::jedule::Subset>& subset_list,
54                                      const std::vector<sg_host_t>& host_list);
55
56 #endif /* JED_SIMGRID_PLATFORM_H_ */