|
IPPL (Independent Parallel Particle Layer)
IPPL
|
#include <ParticleSpatialOverlapLayout.h>
Classes | |
| class | ParticleNeighborData |
Public Types | |
| using | Base = ParticleSpatialLayout<T, Dim, Mesh, PositionProperties...> |
| using | size_type = detail::size_type |
| using | index_t = typename hash_type::value_type |
| using | particle_neighbor_list_type = hash_type |
| using | neighbor_list = typename FieldLayout_t::neighbor_list |
| Array of N rank lists, where N = number of hypercubes for the dimension Dim. | |
| using | locate_type_nd = Kokkos::View<index_t * [1 << Dim], position_memory_space> |
| using | hash_type = detail::hash_type<position_memory_space> |
| using | locate_type = typename detail::ViewType<int, 1, position_memory_space>::view_type |
| using | bool_type = typename detail::ViewType<bool, 1, position_memory_space>::view_type |
| using | vector_type = typename Base::vector_type |
| using | RegionLayout_t |
| using | FieldLayout_t = typename ippl::FieldLayout<Dim> |
| typedef T | value_type |
| typedef std::int64_t | index_type |
| using | particle_position_type |
| using | position_memory_space |
| using | position_execution_space |
| typedef std::array< BC, 2 *Dim > | bc_container_type |
Public Member Functions | |
| ParticleSpatialOverlapLayout (FieldLayout< Dim > &fl, Mesh &mesh, const T &rcutoff) | |
| ParticleSpatialOverlapLayout () | |
| ~ParticleSpatialOverlapLayout ()=default | |
| void | updateLayout (FieldLayout< Dim > &, Mesh &) |
| template<class ParticleContainer> | |
| void | update (ParticleContainer &pc) |
| updates particles by exchanging them across ranks according to their positions. then constructs the particle neighbor list structure | |
| template<typename ExecutionSpace, typename Functor> | |
| void | forEachPair (Functor &&f) const |
| call functor for each combination i, j. make sure to call update first | |
| ParticleNeighborData | getParticleNeighborData () const |
| size_type | numberOfSends (int rank, const locate_type &ranks) |
| utility function to compute how many particles to sent to a given rank | |
| void | fillHash (int rank, const locate_type &ranks, const locate_type &offsets, hash_type &hash) |
| utility function to collect all indices of particles to send to given rank | |
| template<typename ParticleContainer> | |
| std::pair< detail::size_type, detail::size_type > | locateParticles (const ParticleContainer &pc, locate_type &ranks, locate_type &rankOffsets, bool_type &invalid, locate_type &nSends_dview, locate_type &sends_dview) const |
| This function determines to which rank particles need to be sent after the iteration step. It starts by first scanning direct rank neighbors, and only does a global scan if particles are far away from the current rank. It then calculates how many particles need to be sent to each rank and how many ranks are sent to in total. | |
| locate_type | getFlatNeighbors (const neighbor_list &neighbors) const |
| utility function to get a flat view of all neighbor processes | |
| locate_type | getNonNeighborRanks (const locate_type &neighbors_view) const |
| utility function to get a view of all non-neighboring ranks | |
| void | initializeCells () |
| initializes all data necessary for the cells | |
| template<class ParticleContainer> | |
| void | particleExchange (ParticleContainer &pc) |
| exchange particles by scanning neighbor ranks first, only scan other ranks if needed. assumes overlap is smaller than half the smallest region width. | |
| template<class ParticleContainer> | |
| void | buildCells (ParticleContainer &pc) |
| builds the cell structure, sorts the particles according to the cells and makes sure only local particles are counted towards pc.getLocalNum() | |
| template<class ParticleContainer> | |
| void | createPeriodicGhostParticles (ParticleContainer &pc) |
| copies particles close to the boundary and offsets them to their closest periodic image | |
| template<std::size_t... Idx> | |
| KOKKOS_INLINE_FUNCTION constexpr bool | isCloseToBoundary (const std::index_sequence< Idx... > &, const vector_type &pos, const region_type &globalRegion, Vector< bool, Dim > periodic, T overlap) |
| template<std::size_t... Idx> | |
| KOKKOS_INLINE_FUNCTION constexpr bool | positionInRegion (const std::index_sequence< Idx... > &, const vector_type &pos, const region_type ®ion, T overlap) |
| template<std::size_t... Idx> | |
| constexpr bool | isLocalCellIndex (const std::index_sequence< Idx... > &, const CellIndex_t &index, const Vector< size_type, Dim > &numCells) |
| void | update (PBase &) |
| const RegionLayout_t & | getRegionLayout () const |
| template<typename ParticleContainer> | |
| std::pair< size_type, size_type > | locateParticles (const ParticleContainer &pc, locate_type &ranks, bool_type &invalid, locate_type &nSends_dview, locate_type &sends_dview) const |
| void | fillHash (int rank, const locate_type &ranks, hash_type &hash) |
| void | setParticleBC (bc_container_type bcs) |
| void | setParticleBC (BC bc) |
| const bc_container_type & | getParticleBC () const |
| void | applyBC (const particle_position_type &R, const NDRegion< T, Dim > &nr) |
Static Public Member Functions | |
| static KOKKOS_FUNCTION particle_neighbor_list_type | getParticleNeighbors (index_t particleIndex, const ParticleNeighborData &particleNeighborData) |
| Function to get particle neighbors depending on index (possible inside Kokkos parallel region) make sure to call update first. | |
| static KOKKOS_FUNCTION particle_neighbor_list_type | getParticleNeighbors (const vector_type &pos, const ParticleNeighborData &particleNeighborData) |
| Function to get particle neighbors depending on position (possible inside Kokkos parallel region) make sure to call update first. | |
Static Public Attributes | |
| static constexpr unsigned | dim |
Protected Types | |
| using | CellIndex_t = Vector<size_type, Dim> |
| using | FlatCellIndex_t = typename CellIndex_t::value_type |
| using | cell_particle_neighbor_list_type |
| using | region_view_type = typename RegionLayout_t::view_type |
| Type of the Kokkos view containing the local regions. | |
| using | region_type = typename region_view_type::value_type |
| Type of a single Region object. | |
Protected Member Functions | |
| size_type | getNeighborSize (const neighbor_list &neighbors) const |
Static Protected Member Functions | |
| template<std::size_t... Idx> | |
| KOKKOS_INLINE_FUNCTION static constexpr bool | isCloseToBoundary (const std::index_sequence< Idx... > &, const vector_type &pos, const region_type ®ion, Vector< bool, Dim > periodic, T overlap) |
| determines whether a position is within overlap to the boundary of a region | |
| KOKKOS_INLINE_FUNCTION static constexpr FlatCellIndex_t | toFlatCellIndex (const CellIndex_t &cellIndex, const Vector< size_type, Dim > &cellStrides, hash_type cellPermutationForward) |
| convert a nd-cell-index to flat cell index | |
| KOKKOS_INLINE_FUNCTION static constexpr CellIndex_t | toCellIndex (FlatCellIndex_t nonPermutedIndex, const Vector< size_type, Dim > &numCells) |
| template<std::size_t... Idx> | |
| KOKKOS_INLINE_FUNCTION static constexpr bool | isLocalCellIndex (const std::index_sequence< Idx... > &, const CellIndex_t &index, const Vector< size_type, Dim > &numCells) |
| determines whether cell index is local cell index | |
| template<std::size_t... Idx> | |
| KOKKOS_INLINE_FUNCTION static constexpr bool | positionInRegion (const std::index_sequence< Idx... > &, const vector_type &pos, const region_type ®ion, T overlap) |
| determines whether a position is in a region including its overlap | |
| KOKKOS_INLINE_FUNCTION static constexpr CellIndex_t | getCellIndex (const vector_type &pos, const region_type ®ion, const Vector< T, Dim > &cellWidth) |
| get the nd-cell-index of a position | |
| KOKKOS_INLINE_FUNCTION static constexpr cell_particle_neighbor_list_type | getCellNeighbors (const CellIndex_t &cellIndex, const Vector< size_type, Dim > &cellStrides, const hash_type &cellPermutationForward) |
| get all indices of cell neighbors of a given nd-cell-index | |
| template<size_t... Idx> | |
| KOKKOS_INLINE_FUNCTION static constexpr bool | positionInRegion (const std::index_sequence< Idx... > &, const vector_type &pos, const region_type ®ion) |
Protected Attributes | |
| const T | rcutoff_m |
| ! overlap in each dimension | |
| Vector< size_type, Dim > | numCells_m |
| ! number of cells in each dimension | |
| Vector< size_type, Dim > | cellStrides_m |
| ! strides to compute cell indices | |
| Vector< T, Dim > | cellWidth_m |
| ! width of cells in each dimension | |
| size_type | totalCells_m |
| ! the number of total cells | |
| size_type | numGhostCells_m |
| ! the number of interior cells | |
| size_type | numLocalCells_m |
| ! the number of ghost cells | |
| size_type | numLocalParticles_m |
| ! the number of local particles (particles in local cells) | |
| hash_type | cellPermutationForward_m |
| hash_type | cellPermutationBackward_m |
| ! the inverse of cellPermutationForward_m | |
| hash_type | cellStartingIdx_m |
| ! cell i contains particles cellStartingIdx_m(i), ..., cellStartingIdx_m(i + 1) - 1 | |
| hash_type | cellIndex_m |
| hash_type | cellParticleCount_m |
| ! view of number of particles in each cell | |
| RegionLayout_t | rlayout_m |
| The RegionLayout which determines where our particles go. | |
| FieldLayout_t & | flayout_m |
| The FieldLayout containing information on nearest neighbors. | |
| std::vector< size_type > | nRecvs_m |
| mpi::rma::Window< mpi::rma::Active > | window_m |
Static Protected Attributes | |
| static constexpr size_type | numGhostCellsPerDim_m = 1 |
| ! number of ghost cells | |
Private Attributes | |
| bc_container_type | bcs_m |
| the list of boundary conditions for this set of particles | |
ParticleSpatialOverlapLayout class definition.
Definition at line 39 of file ParticleSpatialOverlapLayout.h.
| using ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::Base = ParticleSpatialLayout<T, Dim, Mesh, PositionProperties...> |
Definition at line 42 of file ParticleSpatialOverlapLayout.h.
|
inherited |
Definition at line 54 of file ParticleLayout.h.
|
inherited |
Definition at line 53 of file ParticleSpatialLayout.h.
|
protected |
Definition at line 355 of file ParticleSpatialOverlapLayout.h.
|
protected |
Definition at line 261 of file ParticleSpatialOverlapLayout.h.
|
inherited |
Definition at line 58 of file ParticleSpatialLayout.h.
|
protected |
Definition at line 262 of file ParticleSpatialOverlapLayout.h.
|
inherited |
Definition at line 51 of file ParticleSpatialLayout.h.
| using ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::index_t = typename hash_type::value_type |
Definition at line 56 of file ParticleSpatialOverlapLayout.h.
|
inherited |
Definition at line 47 of file ParticleLayout.h.
|
inherited |
Definition at line 52 of file ParticleSpatialLayout.h.
| using ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::locate_type_nd = Kokkos::View<index_t * [1 << Dim], position_memory_space> |
Definition at line 69 of file ParticleSpatialOverlapLayout.h.
| using ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::neighbor_list = typename FieldLayout_t::neighbor_list |
Array of N rank lists, where N = number of hypercubes for the dimension Dim.
Definition at line 65 of file ParticleSpatialOverlapLayout.h.
| using ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::particle_neighbor_list_type = hash_type |
Definition at line 57 of file ParticleSpatialOverlapLayout.h.
|
inherited |
Definition at line 50 of file ParticleLayout.h.
|
inherited |
Definition at line 52 of file ParticleLayout.h.
|
inherited |
Definition at line 51 of file ParticleLayout.h.
|
protectedinherited |
Type of a single Region object.
Definition at line 95 of file ParticleSpatialLayout.h.
|
protectedinherited |
Type of the Kokkos view containing the local regions.
Definition at line 93 of file ParticleSpatialLayout.h.
|
inherited |
Definition at line 56 of file ParticleSpatialLayout.h.
| using ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::size_type = detail::size_type |
Definition at line 54 of file ParticleSpatialOverlapLayout.h.
|
inherited |
Definition at line 46 of file ParticleLayout.h.
|
inherited |
Definition at line 55 of file ParticleSpatialLayout.h.
| ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::ParticleSpatialOverlapLayout | ( | FieldLayout< Dim > & | fl, |
| Mesh & | mesh, | ||
| const T & | rcutoff ) |
Definition at line 27 of file ParticleSpatialOverlapLayout.hpp.
References initializeCells(), numLocalParticles_m, and rcutoff_m.
|
inline |
Definition at line 115 of file ParticleSpatialOverlapLayout.h.
References Dim, and ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >::ParticleSpatialLayout().
|
default |
|
inherited |
Apply the given boundary conditions to the current particle positions.
| R | is the particle position attribute |
| nr | is the NDRegion |
Referenced by ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::particleExchange(), and ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >::update().
| void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::buildCells | ( | ParticleContainer & | pc | ) |
builds the cell structure, sorts the particles according to the cells and makes sure only local particles are counted towards pc.getLocalNum()
| pc | particle container of which to sort the particles |
Definition at line 826 of file ParticleSpatialOverlapLayout.hpp.
References cellIndex_m, cellParticleCount_m, cellPermutationForward_m, cellStartingIdx_m, cellStrides_m, cellWidth_m, ippl::Comm, getCellIndex(), ippl::ParticleBase< PLayout, IDProperties >::getLocalNum(), IpplTimings::getTimer(), numLocalCells_m, numLocalParticles_m, ippl::ParticleBase< PLayout, IDProperties >::R, ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >::rlayout_m, ippl::ParticleBase< PLayout, IDProperties >::setLocalNum(), ippl::detail::sortParticles(), IpplTimings::startTimer(), IpplTimings::stopTimer(), toFlatCellIndex(), and totalCells_m.
Referenced by update().
| void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::createPeriodicGhostParticles | ( | ParticleContainer & | pc | ) |
copies particles close to the boundary and offsets them to their closest periodic image
| pc | particle container of which to construct periodic ghost particles |
Definition at line 174 of file ParticleSpatialOverlapLayout.hpp.
References ippl::detail::copyAttributes(), Dim, ippl::ParticleBase< PLayout, IDProperties >::getLocalNum(), ippl::detail::ParticleLayout< T, Dim, PositionProperties... >::getParticleBC(), IpplTimings::getTimer(), isCloseToBoundary(), ippl::min(), ippl::periodic, ippl::ParticleBase< PLayout, IDProperties >::R, rcutoff_m, ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >::rlayout_m, IpplTimings::startTimer(), and IpplTimings::stopTimer().
Referenced by particleExchange().
|
inherited |
| rank | we sent to |
| ranks | a container specifying where a particle at the i-th index should go. |
| hash | a mapping to fill the send buffer contiguously |
Definition at line 437 of file ParticleSpatialLayout.hpp.
| void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::fillHash | ( | int | rank, |
| const locate_type & | ranks, | ||
| const locate_type & | offsets, | ||
| hash_type & | hash ) |
utility function to collect all indices of particles to send to given rank
| rank | rank to send to |
| ranks | The view containing which rank each particle belongs to |
| offsets | The offsets to determine where the ranks of a particle start in ranks |
| hash | the view containing all particle indices to send |
Definition at line 435 of file ParticleSpatialOverlapLayout.hpp.
Referenced by particleExchange().
| void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::forEachPair | ( | Functor && | f | ) | const |
call functor for each combination i, j. make sure to call update first
| ExecutionSpace | Space in which to generate all indices |
| Functor | type of loop body |
| f | loop body functor to call for all pair of indices i, j where i are all internal particle indices and j include ghost particles |
Definition at line 1061 of file ParticleSpatialOverlapLayout.hpp.
References cellParticleCount_m, cellPermutationBackward_m, cellPermutationForward_m, cellStartingIdx_m, cellStrides_m, ippl::detail::countHypercubes(), Dim, getCellNeighbors(), IpplTimings::getTimer(), numCells_m, numLocalCells_m, IpplTimings::startTimer(), IpplTimings::stopTimer(), and toCellIndex().
|
staticconstexprprotected |
get the nd-cell-index of a position
| pos | position to get the cell index for |
| region | region of the cells |
| cellWidth | in each dimension |
Definition at line 784 of file ParticleSpatialOverlapLayout.hpp.
References Dim, ippl::min(), and numGhostCellsPerDim_m.
Referenced by buildCells(), and getParticleNeighbors().
|
staticconstexprprotected |
get all indices of cell neighbors of a given nd-cell-index
| cellIndex | to get the neighbors from |
| cellStrides | in each dimension |
| cellPermutationForward | the permutation to apply to all neighbors |
Definition at line 924 of file ParticleSpatialOverlapLayout.hpp.
References ippl::detail::countHypercubes(), Dim, and toFlatCellIndex().
Referenced by forEachPair(), getParticleNeighbors(), and getParticleNeighbors().
| ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::locate_type ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::getFlatNeighbors | ( | const neighbor_list & | neighbors | ) | const |
utility function to get a flat view of all neighbor processes
| neighbors | FieldLayouts neighbor_list |
Definition at line 472 of file ParticleSpatialOverlapLayout.hpp.
Referenced by locateParticles().
|
protectedinherited |
Evaluates the total number of MPI ranks sharing the spatial nearest neighbors.
| neighbors | structure containing, for every spatial direction, a list of MPI ranks IDs corresponding to the nearest neighbors of the current local domain section. |
Definition at line 245 of file ParticleSpatialLayout.hpp.
| ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::locate_type ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::getNonNeighborRanks | ( | const locate_type & | neighbors_view | ) | const |
utility function to get a view of all non-neighboring ranks
| neighbors_view | view of all neighboring ranks |
Definition at line 503 of file ParticleSpatialOverlapLayout.hpp.
References ippl::Comm.
Referenced by locateParticles().
|
inlineinherited |
Copy over the given boundary conditions.
| bcs | are the boundary conditions |
Definition at line 79 of file ParticleLayout.h.
References bcs_m.
Referenced by ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::createPeriodicGhostParticles().
| ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::ParticleNeighborData ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::getParticleNeighborData | ( | ) | const |
Definition at line 951 of file ParticleSpatialOverlapLayout.hpp.
References cellIndex_m, cellParticleCount_m, cellPermutationBackward_m, cellPermutationForward_m, cellStartingIdx_m, cellStrides_m, cellWidth_m, ippl::Comm, numCells_m, numLocalParticles_m, and ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >::rlayout_m.
|
static |
Function to get particle neighbors depending on position (possible inside Kokkos parallel region) make sure to call update first.
| pos | position of particle to get neighbors for |
| particleNeighborData | proxy of (own) data required for the calculation |
Definition at line 962 of file ParticleSpatialOverlapLayout.hpp.
References ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::cellParticleCount, ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::cellPermutationForward, ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::cellStartingIdx, ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::cellStrides, ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::cellWidth, ippl::detail::countHypercubes(), Dim, getCellIndex(), getCellNeighbors(), and ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::region.
|
static |
Function to get particle neighbors depending on index (possible inside Kokkos parallel region) make sure to call update first.
| particleIndex | index of particle to get neighbors for |
| particleNeighborData | proxy of (own) data required for the calculation |
Definition at line 1010 of file ParticleSpatialOverlapLayout.hpp.
References ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::cellIndex, ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::cellParticleCount, ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::cellPermutationBackward, ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::cellPermutationForward, ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::cellStartingIdx, ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::cellStrides, ippl::detail::countHypercubes(), Dim, getCellNeighbors(), ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::ParticleNeighborData::numCells, and toCellIndex().
|
inlineinherited |
Definition at line 76 of file ParticleSpatialLayout.h.
| void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::initializeCells | ( | ) |
initializes all data necessary for the cells
Definition at line 43 of file ParticleSpatialOverlapLayout.hpp.
References cellParticleCount_m, cellPermutationBackward_m, cellPermutationForward_m, cellStartingIdx_m, cellStrides_m, cellWidth_m, ippl::Comm, Dim, isLocalCellIndex(), numCells_m, numGhostCells_m, numGhostCellsPerDim_m, numLocalCells_m, PAssert, rcutoff_m, ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >::rlayout_m, toCellIndex(), totalCells_m, and update().
Referenced by ParticleSpatialOverlapLayout(), and updateLayout().
|
constexpr |
Definition at line 132 of file ParticleSpatialOverlapLayout.hpp.
References ippl::max, ippl::min(), and ippl::periodic.
|
staticconstexprprotected |
determines whether a position is within overlap to the boundary of a region
| pos | position to query |
| region | region of the position |
| periodic | vector determining which dimensions to consider (as they are periodic) |
| overlap | distance to consider as close |
References ippl::periodic.
Referenced by createPeriodicGhostParticles().
|
staticconstexprprotected |
determines whether cell index is local cell index
| index | to test |
| numCells | in each dimension |
Referenced by initializeCells().
|
constexpr |
Definition at line 796 of file ParticleSpatialOverlapLayout.hpp.
|
inherited |
For each particle in the bunch, determine the rank on which it should be stored based on its location
| ParticleContainer | the particle container type |
| pc | the particle container |
| ranks | the integer view in which to store the destination ranks |
| invalid | the boolean view in which to store whether each particle is invalidated, i.e. needs to be sent to another rank |
| std::pair< detail::size_type, detail::size_type > ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::locateParticles | ( | const ParticleContainer & | pc, |
| locate_type & | ranks, | ||
| locate_type & | rankOffsets, | ||
| bool_type & | invalid, | ||
| locate_type & | nSends_dview, | ||
| locate_type & | sends_dview ) const |
This function determines to which rank particles need to be sent after the iteration step. It starts by first scanning direct rank neighbors, and only does a global scan if particles are far away from the current rank. It then calculates how many particles need to be sent to each rank and how many ranks are sent to in total.
| pc | Particle Container |
| ranks | A vector where each value refers to the new rank of the particle which rank values correspond to which particles is determined by rankOffsets |
| rankOffsets | A vector of offsets where rankOffset(i) determines where the ranks of particle i in ranks start. |
| invalid | A vector marking the particles that need to be sent away, and thus locally deleted |
| nSends_dview | Device view the length of number of ranks, where each value determines the number of particles sent to that rank from the current rank |
| sends_dview | Device view for the number of ranks that are sent to from current rank |
outsideIds: Container of particle IDs that travelled outside of the neighborhood. counts: count assignments per particle
outsideCount: Tracks the number of particles that travelled outside of the neighborhood.
invalidCount: Tracks the number of particles that need to be sent to other ranks.
neighbors_view: Kokkos view with the IDs of the neighboring MPI ranks.
Begin Kokkos loop: Step 1: search in current rank Step 2: search in neighbors Step 3: save information on whether the particle was located Step 4: run additional loop on non-located particles
Step 4
pID: (local) ID of the particle that is currently being searched.
inRegion: Checks whether particle pID is inside region j.
pID: (local) ID of the particle that is currently being searched.
Definition at line 542 of file ParticleSpatialOverlapLayout.hpp.
References ippl::Comm, ippl::increment_type::count, ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >::flayout_m, getFlatNeighbors(), ippl::ParticleBase< PLayout, IDProperties >::getLocalNum(), getNonNeighborRanks(), IpplTimings::getTimer(), ippl::increment_type::init(), positionInRegion(), ippl::ParticleBase< PLayout, IDProperties >::R, rcutoff_m, ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >::rlayout_m, IpplTimings::startTimer(), and IpplTimings::stopTimer().
Referenced by particleExchange().
| detail::size_type ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::numberOfSends | ( | int | rank, |
| const locate_type & | ranks ) |
utility function to compute how many particles to sent to a given rank
| rank | rank to send to |
| ranks | The view containing which rank each particle belongs to |
Definition at line 417 of file ParticleSpatialOverlapLayout.hpp.
| void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::particleExchange | ( | ParticleContainer & | pc | ) |
exchange particles by scanning neighbor ranks first, only scan other ranks if needed. assumes overlap is smaller than half the smallest region width.
| pc | particle container of which to exchange particles |
Definition at line 254 of file ParticleSpatialOverlapLayout.hpp.
References ippl::detail::ParticleLayout< T, Dim, PositionProperties... >::applyBC(), ippl::Comm, createPeriodicGhostParticles(), fillHash(), ippl::ParticleBase< PLayout, IDProperties >::getLocalNum(), IpplTimings::getTimer(), ippl::ParticleBase< PLayout, IDProperties >::internalDestroy(), locateParticles(), ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >::nRecvs_m, ippl::mpi::tag::P_LAYOUT_CYCLE, ippl::mpi::tag::P_SPATIAL_LAYOUT, ippl::ParticleBase< PLayout, IDProperties >::R, ippl::ParticleBase< PLayout, IDProperties >::recvFromRank(), ippl::ParticleBase< PLayout, IDProperties >::sendToRank(), IpplTimings::startTimer(), IpplTimings::stopTimer(), and ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >::window_m.
Referenced by update().
|
staticconstexprprotectedinherited |
|
staticconstexprprotected |
determines whether a position is in a region including its overlap
| pos | position to query |
| region | region to test |
| overlap | overlap of the region in every dimension |
Referenced by locateParticles().
|
constexpr |
Definition at line 751 of file ParticleSpatialOverlapLayout.hpp.
References ippl::min().
|
inlineinherited |
Use the same boundary condition on each face
| bcs | are the boundary conditions |
Definition at line 85 of file ParticleLayout.h.
References bcs_m.
|
inlineinherited |
Copy over the given boundary conditions.
| bcs | are the boundary conditions |
Definition at line 73 of file ParticleLayout.h.
References bcs_m.
|
staticconstexprprotected |
@brieg compute the nd-cell-index from a flattened (non-permuted) index
| nonPermutedIndex | the flat index to transform |
| numCells | in each dimension |
Definition at line 770 of file ParticleSpatialOverlapLayout.hpp.
References Dim.
Referenced by forEachPair(), getParticleNeighbors(), and initializeCells().
|
staticconstexprprotected |
convert a nd-cell-index to flat cell index
| cellIndex | to convert |
| cellStrides | cell strides to flatten the cell index with |
| cellPermutationForward | the permutation to apply to the flattened index |
Definition at line 761 of file ParticleSpatialOverlapLayout.hpp.
References ippl::Vector< T, Dim >::dot().
Referenced by buildCells(), and getCellNeighbors().
|
inlineinherited |
Definition at line 64 of file ParticleLayout.h.
| void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::update | ( | ParticleContainer & | pc | ) |
updates particles by exchanging them across ranks according to their positions. then constructs the particle neighbor list structure
| pc | particle container to update |
Definition at line 411 of file ParticleSpatialOverlapLayout.hpp.
References buildCells(), and particleExchange().
Referenced by initializeCells().
| void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::updateLayout | ( | FieldLayout< Dim > & | fl, |
| Mesh & | mesh ) |
Definition at line 36 of file ParticleSpatialOverlapLayout.hpp.
References initializeCells(), and ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties... >::updateLayout().
|
privateinherited |
the list of boundary conditions for this set of particles
Definition at line 97 of file ParticleLayout.h.
Referenced by getParticleBC(), ParticleLayout(), setParticleBC(), and setParticleBC().
|
protected |
! view storing the cell index of each particle (TODO not needed if getParticleNeighbors depending on index is not required)
Definition at line 257 of file ParticleSpatialOverlapLayout.h.
Referenced by buildCells(), and getParticleNeighborData().
|
protected |
! view of number of particles in each cell
Definition at line 259 of file ParticleSpatialOverlapLayout.h.
Referenced by buildCells(), forEachPair(), getParticleNeighborData(), and initializeCells().
|
protected |
! the inverse of cellPermutationForward_m
Definition at line 252 of file ParticleSpatialOverlapLayout.h.
Referenced by forEachPair(), getParticleNeighborData(), and initializeCells().
|
protected |
To ensure the interior particles are at indices 0, ..., numLocalParticles_m - 1 the cells need to be permuted such that local cells are at the beginning and ghost cells at the end cellPermutationForward_m at cell index computed from actual position and cellStrides gives permuted index
Definition at line 250 of file ParticleSpatialOverlapLayout.h.
Referenced by buildCells(), forEachPair(), getParticleNeighborData(), and initializeCells().
|
protected |
! cell i contains particles cellStartingIdx_m(i), ..., cellStartingIdx_m(i + 1) - 1
Definition at line 254 of file ParticleSpatialOverlapLayout.h.
Referenced by buildCells(), forEachPair(), getParticleNeighborData(), and initializeCells().
|
protected |
! strides to compute cell indices
Definition at line 231 of file ParticleSpatialOverlapLayout.h.
Referenced by buildCells(), forEachPair(), getParticleNeighborData(), and initializeCells().
|
protected |
! width of cells in each dimension
Definition at line 233 of file ParticleSpatialOverlapLayout.h.
Referenced by buildCells(), getParticleNeighborData(), and initializeCells().
|
staticconstexprinherited |
Definition at line 56 of file ParticleLayout.h.
|
protectedinherited |
The FieldLayout containing information on nearest neighbors.
Definition at line 83 of file ParticleSpatialLayout.h.
Referenced by ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::locateParticles().
|
protectedinherited |
Definition at line 87 of file ParticleSpatialLayout.h.
Referenced by ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::particleExchange().
|
protected |
! number of cells in each dimension
Definition at line 229 of file ParticleSpatialOverlapLayout.h.
Referenced by forEachPair(), getParticleNeighborData(), and initializeCells().
|
protected |
! the number of interior cells
Definition at line 237 of file ParticleSpatialOverlapLayout.h.
Referenced by initializeCells().
|
staticconstexprprotected |
! number of ghost cells
Definition at line 243 of file ParticleSpatialOverlapLayout.h.
Referenced by getCellIndex(), and initializeCells().
|
protected |
! the number of ghost cells
Definition at line 239 of file ParticleSpatialOverlapLayout.h.
Referenced by buildCells(), forEachPair(), and initializeCells().
|
protected |
! the number of local particles (particles in local cells)
Definition at line 241 of file ParticleSpatialOverlapLayout.h.
Referenced by buildCells(), getParticleNeighborData(), and ParticleSpatialOverlapLayout().
|
protected |
! overlap in each dimension
Definition at line 227 of file ParticleSpatialOverlapLayout.h.
Referenced by createPeriodicGhostParticles(), initializeCells(), locateParticles(), and ParticleSpatialOverlapLayout().
|
protectedinherited |
The RegionLayout which determines where our particles go.
Definition at line 80 of file ParticleSpatialLayout.h.
Referenced by ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::buildCells(), ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::createPeriodicGhostParticles(), ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::getParticleNeighborData(), ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::initializeCells(), ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::locateParticles(), ParticleSpatialLayout(), and update().
|
protected |
! the number of total cells
Definition at line 235 of file ParticleSpatialOverlapLayout.h.
Referenced by buildCells(), and initializeCells().
|
protectedinherited |
Definition at line 90 of file ParticleSpatialLayout.h.
Referenced by ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::particleExchange().