Interface Documentation
Version: invalid
topology.hh
Go to the documentation of this file.
1 /*
2  @@@@@@@@ @@ @@@@@@ @@@@@@@@ @@
3  /@@///// /@@ @@////@@ @@////// /@@
4  /@@ /@@ @@@@@ @@ // /@@ /@@
5  /@@@@@@@ /@@ @@///@@/@@ /@@@@@@@@@/@@
6  /@@//// /@@/@@@@@@@/@@ ////////@@/@@
7  /@@ /@@/@@//// //@@ @@ /@@/@@
8  /@@ @@@//@@@@@@ //@@@@@@ @@@@@@@@ /@@
9  // /// ////// ////// //////// //
10 
11  Copyright (c) 2020, Triad National Security, LLC
12  All rights reserved.
13  */
14 #pragma once
15 
18 #if !defined(__FLECSI_PRIVATE__)
19 #error Do not include this file directly!
20 #endif
21 
22 #include "flecsi/data/backend.hh"
23 
24 #include <cstddef>
25 #include <utility>
26 
27 namespace flecsi::data {
28 #ifdef DOXYGEN // implemented per-backend
29 struct region {
30  region(std::size_t, const fields &);
31 };
32 
33 struct partition {
34  template<class F> // F: int -> [start, end)
35  partition(const region &,
36  std::size_t,
37  F,
38  disjointness = {},
39  completeness = {});
40  std::size_t colors() const;
41  template<topo::single_space>
42  const partition & get_partition() const {
43  return *this;
44  }
45 };
46 #endif
47 
48 template<class Topo,
49  topo::index_space_t<Topo> Index = topo::default_space<Topo>>
50 region
51 make_region(std::size_t n) {
52  return {n, run::context::instance().get_field_info_store<Topo, Index>()};
53 }
54 
56  template<class... TT>
57  partitioned(region && r, TT &&... tt)
58  : region(std::move(r)), partition(*this, std::forward<TT>(tt)...) {}
59 };
60 
61 } // namespace flecsi::data
Definition: policy.hh:105
Definition: policy.hh:85
Definition: accessor.hh:31
size_t colors()
Definition: execution.hh:336
Definition: topology.hh:55