Interface Documentation
Version: invalid
index.hh
Go to the documentation of this file.
1 /*
2  @@@@@@@@ @@ @@@@@@ @@@@@@@@ @@
3  /@@///// /@@ @@////@@ @@////// /@@
4  /@@ /@@ @@@@@ @@ // /@@ /@@
5  /@@@@@@@ /@@ @@///@@/@@ /@@@@@@@@@/@@
6  /@@//// /@@/@@@@@@@/@@ ////////@@/@@
7  /@@ /@@/@@//// //@@ @@ /@@/@@
8  /@@ @@@//@@@@@@ //@@@@@@ @@@@@@@@ /@@
9  // /// ////// ////// //////// //
10 
11  Copyright (c) 2016, 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/topology.hh"
23 #include "flecsi/topo/core.hh"
24 
25 namespace flecsi {
26 namespace topo {
27 
28 struct index_base {
29  struct coloring {
30  coloring(size_t size) : size_(size) {}
31 
32  size_t size() const {
33  return size_;
34  }
35 
36  private:
37  size_t size_;
38  };
39 };
40 
41 template<class P>
43  index_category(const coloring & c)
44  : partitioned(
45  data::make_region<P>(c.size()),
46  c.size(),
47  [](std::size_t i) {
48  return std::pair{i, i + 1};
49  },
50  data::disjoint,
51  data::complete) {}
52 };
53 template<>
55  using type = index_base;
56 };
57 
64 struct index : specialization<index_category, index> {
65  static coloring color(size_t size) {
66  return {size};
67  } // color
68 
69 }; // struct index
70 
71 } // namespace topo
72 } // namespace flecsi
Definition: core.hh:110
Definition: core.hh:40
Definition: index.hh:42
Definition: index.hh:64
size_t color()
Definition: execution.hh:326
Definition: index.hh:29
Definition: index.hh:28
Definition: control.hh:31
Definition: topology.hh:55