18 #if !defined(__FLECSI_PRIVATE__) 19 #error Do not include this file directly! 22 #if !defined(FLECSI_ENABLE_LEGION) 23 #error FLECSI_ENABLE_LEGION not defined! This file depends on Legion! 27 #include "flecsi/topo/core.hh" 31 #include <unordered_map> 39 return *Legion::Runtime::get_runtime();
43 return Legion::Runtime::get_context();
46 template<
class T,
void (Legion::Runtime::*D)(Legion::Context, T,
bool)>
53 (run().*D)(ctx(), h,
false);
59 explicit operator bool() {
73 using unique_index_partition = Legion::IndexPartition;
77 &Legion::Runtime::destroy_logical_region>;
78 using unique_logical_partition = Legion::LogicalPartition;
81 index1(std::size_t n) {
82 return run().create_index_space(ctx(), Legion::Rect<1>(0, n - 1));
86 region(std::size_t n,
const fields & fs)
87 : index_space(index1(n)),
92 Legion::FieldAllocator allocator = r.create_field_allocator(c, ret);
93 for(
auto const & fi : fs)
94 allocator.allocate_field(fi->type_size, fi->fid);
98 run().create_logical_region(ctx(), index_space, field_space)) {}
111 disjointness dis = {},
112 completeness cpt = {})
113 : color_space(index1(n)),
114 index_partition(run().create_partition_by_domain(
118 std::map<Legion::DomainPoint, Legion::Domain> ret;
119 for(std::size_t i = 0; i < n; ++i) {
121 const auto [b, e] = f(i);
122 ret.try_emplace(i, Legion::Rect<1>(b, e - 1));
128 Legion::PartitionKind((dis + 2) % 3 + (cpt + 3) % 3 * 3))),
129 logical_partition(run().get_logical_partition(ctx(),
133 std::size_t
colors()
const {
134 return run().get_index_space_domain(color_space).get_volume();
138 unique_index_partition index_partition;
139 unique_logical_partition logical_partition;
141 template<topo::single_space>
142 const partition & get_partition()
const {
Definition: policy.hh:105
size_t colors()
Definition: execution.hh:336
Definition: control.hh:31