|
|
using | NDIndex_t = NDIndex< Dim > |
| |
|
using | view_type = typename detail::ViewType< NDIndex_t, 1 >::view_type |
| |
|
using | host_mirror_type = typename view_type::host_mirror_type |
| |
|
using | rank_list = std::vector< int > |
| |
|
using | bounds_list = std::vector< bound_type > |
| |
|
using | neighbor_list = std::array< rank_list, detail::countHypercubes(Dim) - 1 > |
| |
|
using | neighbor_range_list = std::array< bounds_list, detail::countHypercubes(Dim) - 1 > |
| |
|
| | FieldLayout (const mpi::Communicator &=MPI_COMM_WORLD) |
| |
|
| FieldLayout (mpi::Communicator, const NDIndex< Dim > &domain, std::array< bool, Dim > decomp, bool isAllPeriodic=false) |
| |
|
void | initialize (const NDIndex< Dim > &domain, std::array< bool, Dim > decomp, bool isAllPeriodic=false) |
| |
|
const NDIndex< Dim > & | getDomain () const |
| |
|
template<unsigned Dim2> |
| bool | operator== (const FieldLayout< Dim2 > &x) const |
| |
|
bool | operator== (const FieldLayout< Dim > &x) const |
| |
|
bool | getDistribution (unsigned int d) const |
| |
|
std::array< bool, Dim > | isParallel () const |
| |
|
const NDIndex_t & | getLocalNDIndex () const |
| |
|
const NDIndex_t & | getLocalNDIndex (int rank) const |
| |
|
const host_mirror_type | getHostLocalDomains () const |
| |
|
const view_type | getDeviceLocalDomains () const |
| |
| const neighbor_list & | getNeighbors () const |
| |
| const neighbor_range_list & | getNeighborsSendRange () const |
| |
| const neighbor_range_list & | getNeighborsRecvRange () const |
| |
| void | findPeriodicNeighbors (const int nghost, const NDIndex< Dim > &localDomain, NDIndex< Dim > &grown, NDIndex< Dim > &neighborDomain, const int rank, std::map< unsigned int, int > &offsets, unsigned d0=0, unsigned codim=0) |
| |
| void | findNeighbors (int nghost=1) |
| |
| void | addNeighbors (const NDIndex_t &gnd, const NDIndex_t &nd, const NDIndex_t &ndNeighbor, const NDIndex_t &intersect, int nghost, int rank) |
| |
|
void | write (std::ostream &=std::cout) const |
| |
|
void | updateLayout (const std::vector< NDIndex_t > &domains) |
| |
|
|
NDIndex_t | gDomain_m |
| | Global domain.
|
| |
|
view_type | dLocalDomains_m |
| | Local domains (device view)
|
| |
|
host_mirror_type | hLocalDomains_m |
| | Local domains (host mirror view)
|
| |
|
std::array< bool, Dim > | isParallelDim_m |
| |
|
unsigned int | minWidth_m [Dim] |
| |
◆ FieldLayout()
Default constructor, which should only be used if you are going to call 'initialize' soon after (before using in any context)
◆ addNeighbors()
Adds a neighbor to the neighbor list
- Parameters
-
| gnd | the local domain, including ghost cells |
| nd | the local domain |
| ndNeighbor | the neighbor rank's domain |
| intersect | the intersection of the domains |
| nghost | number of ghost cells |
| rank | the neighbor's rank |
◆ findNeighbors()
Finds all neighboring ranks based on the field layout
- Parameters
-
| nghost | number of ghost cells (default 1) |
◆ findPeriodicNeighbors()
template<unsigned Dim>
| void ippl::FieldLayout< Dim >::findPeriodicNeighbors |
( |
const int |
nghost, |
|
|
const NDIndex< Dim > & |
localDomain, |
|
|
NDIndex< Dim > & |
grown, |
|
|
NDIndex< Dim > & |
neighborDomain, |
|
|
const int |
rank, |
|
|
std::map< unsigned int, int > & |
offsets, |
|
|
unsigned |
d0 = 0, |
|
|
unsigned |
codim = 0 |
|
) |
| |
Recursively finds neighbor ranks for layouts with all periodic boundary conditions
- Parameters
-
| nghost | number of ghost cells |
| localDomain | the rank's local domain |
| grown | the local domain, grown by the number of ghost cells |
| neighborDomain | a candidate neighbor rank's domain |
| rank | the candidate neighbor's rank |
| offsets | a dictionary containing offsets along different dimensions |
| d0 | the dimension from which to start checking (default 0) |
| codim | the codimension of overlapping regions to check (default 0) |
◆ getMatchingIndex()
Given the index of a hypercube, find the index of the opposite hypercube, i.e. the component with the same codimension belonging to a neighboring domain that touches the hypercube with the given index, as determined by the ternary encoding for hypercubes.
For neighbor communication, the opposite component is the one that receives sent data or sends us data to receive for a given component.
The matching index is given by swapping alls 1s for 0s and vice versa in the ternary encoding, while keeping the 2s unchanged. This can be understood from the fact that if the local component is on the upper boundary of the local domain, the neighbor component must be on the lower boundary of its local domain, and vice versa. The 2s are unchanged because both the local component and the neighbor component must be parallel to the same axes, otherwise their intersection would have lower or higher dimension than the components themselves.
- Parameters
-
| index | index of the known component |
- Returns
- Index of the matching component
◆ getNeighbors()
Get a list of all the neighbors, arranged by ternary encoding of the hypercubes
- Returns
- List of list of neighbor ranks touching each boundary component
◆ getNeighborsRecvRange()
Get the domain ranges corresponding to regions that should be received from neighbor ranks
- Returns
- Ranges to receive
◆ getNeighborsSendRange()
Get the domain ranges corresponding to regions that should be sent to neighbor ranks
- Returns
- Ranges to send
The documentation for this class was generated from the following files: