Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
distribution.h
Go to the documentation of this file.
1
13#ifndef DISTRIBUTION_H
14#define DISTRIBUTION_H
15
16#include <cstdint>
17#include <vector>
18
20inline constexpr const char * PARTITION_ZONE = "__partition__";
21
29 std::vector<uint64_t> global_cell; // local cell -> global cell
30 std::vector<uint8_t> layer; // 0 for owned cells, k for halo layer k
31 std::vector<int> neighbors; // ranks this rank exchanges with
32 std::vector<std::vector<uint32_t>> send_cells; // per neighbor: owned cells it needs
33 std::vector<std::vector<uint32_t>> recv_cells; // per neighbor: halo cells it owns
34};
35
42void plan_halo_exchange(Distribution & dist, const std::vector<int> & halo_owner);
43
48void trim_halo_exchange(Distribution & dist, const std::vector<uint8_t> & needed);
49
50#endif // DISTRIBUTION_H
KOKKOS_INLINE_FUNCTION rtype dot(const rtype *a, const rtype *b)
Compute the dot product of two arrays.
Definition common_math.h:32
void plan_halo_exchange(Distribution &dist, const std::vector< int > &halo_owner)
Fill the exchange plan of dist, whose cells are numbered, from the owner of each of its halo cells (c...
Definition distribution.cpp:20
constexpr const char * PARTITION_ZONE
Boundary zone of local faces that border cells of other ranks.
Definition distribution.h:20
void trim_halo_exchange(Distribution &dist, const std::vector< uint8_t > &needed)
Keep in the exchange plan only the halo cells marked in needed (local cells); each neighbor stops sen...
Definition distribution.cpp:52
Local numbering: owned cells first (in global order), then halo layer 1, 2, ... Every local cell keep...
Definition distribution.h:26
std::vector< std::vector< uint32_t > > recv_cells
Definition distribution.h:33
uint32_t n_owned
Definition distribution.h:27
std::vector< uint8_t > layer
Definition distribution.h:30
std::vector< int > neighbors
Definition distribution.h:31
uint8_t halo_layers
Definition distribution.h:28
std::vector< std::vector< uint32_t > > send_cells
Definition distribution.h:32
std::vector< uint64_t > global_cell
Definition distribution.h:29