10 #ifndef WRENCH_COREAVAILABILITYTIMELINE_H
11 #define WRENCH_COREAVAILABILITYTIMELINE_H
14 #include <boost/icl/interval_map.hpp>
15 #include "BatchJobSetCoreLevel.h"
29 class CoreAvailabilityTimeLine {
32 explicit CoreAvailabilityTimeLine(
unsigned long max_num_nodes,
unsigned long max_num_cores_per_node);
33 void setTimeOrigin(u_int32_t t);
34 void add(u_int32_t start, u_int32_t end, std::shared_ptr<BatchJob>job) { update(
true, start, end, job);}
35 void remove(u_int32_t start, u_int32_t end, std::shared_ptr<BatchJob> job) { update(
false, start, end, job);}
38 std::set<std::shared_ptr<BatchJob>> getJobsInFirstSlot();
39 std::pair<u_int32_t, std::vector<int>> findEarliestStartTime(uint32_t duration,
unsigned long num_nodes,
unsigned long num_cores_per_node);
42 unsigned long max_num_nodes;
43 unsigned long max_num_cores_per_node;
44 boost::icl::interval_map<u_int32_t, BatchJobSetCoreLevel, boost::icl::partial_enricher> availability_timeslots;
46 void update(
bool add, u_int32_t start, u_int32_t end, std::shared_ptr<BatchJob>job);
48 std::set<int> integer_sequence;
58 #endif //WRENCH_COREEAVAILABILITYTIMELINE_H