Core: particle data structures and algorithms. More...
Classes | |
class | AoSoA |
Array-of-Struct-of-Arrays. More... | |
struct | AtomicAccessMemory |
Atomic memory access. All reads and writes are atomic. More... | |
class | BinningData |
Data describing the bin sizes and offsets resulting from a binning operation. More... | |
struct | CheckMemberTypes |
Check that member types are valid. More... | |
struct | CheckMemberTypes< MemberTypes< Types... > > |
Check that member types are valid. More... | |
class | CommunicationData |
Store communication plan and communication buffers. More... | |
struct | CommunicationDataAoSoA |
Store AoSoA send/receive buffers. More... | |
struct | CommunicationDataSlice |
Store slice send/receive buffers. More... | |
class | CommunicationPlan |
Communication plan base class. More... | |
struct | DefaultAccessMemory |
class | Distributor |
A communication plan for migrating data from one uniquely-owned decomposition to another uniquely owned decomposition. More... | |
class | FirstNeighborsTag |
Loop over particle neighbors. More... | |
class | FullNeighborTag |
Tag for full neighbor lists. More... | |
class | Gather |
class | Gather< HaloType, AoSoAType, typename std::enable_if< is_aosoa< AoSoAType >::value >::type > |
Synchronously gather data from the local decomposition to the ghosts using the halo forward communication plan. AoSoA version. This is a uniquely-owned to multiply-owned communication. More... | |
class | Gather< HaloType, SliceType, typename std::enable_if< is_slice< SliceType >::value >::type > |
Synchronously gather data from the local decomposition to the ghosts using the halo forward communication plan. AoSoA version. This is a uniquely-owned to multiply-owned communication. More... | |
class | HalfNeighborTag |
Tag for half neighbor lists. More... | |
class | Halo |
A communication plan for scattering and gathering of ghosted data. More... | |
struct | InitRandom |
Random particle initialization type tag. More... | |
struct | InitUniform |
Uniform particle initialization type tag. More... | |
struct | is_accessible_from |
struct | is_accessible_from< MemorySpace, ExecutionSpace, std::enable_if_t< Kokkos::SpaceAccessibility< ExecutionSpace, MemorySpace >::accessible > > |
struct | is_aosoa |
AoSoA static type checker. More... | |
struct | is_binning_data< const BinningData< MemorySpace > > |
BinningData static type checker. More... | |
struct | is_distributor |
Distributor static type checker. More... | |
struct | is_halo |
Halo static type checker. More... | |
struct | is_linked_cell_list |
LinkedCellList static type checker. More... | |
struct | is_member_types |
Static type checker. More... | |
struct | is_memory_access_tag |
Memory access type checker. More... | |
struct | is_memory_access_tag< AtomicAccessMemory > |
struct | is_memory_access_tag< DefaultAccessMemory > |
Memory access type checker. More... | |
struct | is_memory_access_tag< RandomAccessMemory > |
struct | is_parameter_pack |
ParameterPack static type checker. More... | |
struct | is_particle_list |
ParticleList static type checker. More... | |
struct | is_particle_list_impl |
struct | is_particle_list_impl< ParticleList< MemorySpace, VectorLength, FieldTags... > > |
struct | is_slice |
Slice static type checker. More... | |
struct | is_soa |
SoA static type checker. More... | |
struct | is_tuple |
Tuple static type checker. More... | |
class | LinkedCellList |
Data describing the bin sizes and offsets resulting from a binning operation on a 3d regular Cartesian grid. More... | |
struct | LinkedCellStencil |
Stencil of cells surrounding each cell. More... | |
struct | MemberTypeAtIndex |
Get the type of the member at a given index. More... | |
struct | MemberTypeAtIndex< M, MemberTypes< Types... > > |
Get the type of the member at a given index. More... | |
struct | MemberTypes |
General sequence of types for SoA and AoSoA member data. More... | |
class | NeighborDiscriminator |
Neighborhood discriminator. More... | |
class | NeighborDiscriminator< FullNeighborTag > |
Full list discriminator specialization. More... | |
class | NeighborDiscriminator< HalfNeighborTag > |
Half list discriminator specialization. More... | |
class | NeighborList |
Neighbor list interface. Provides an interface callable at the functor level that gives access to neighbor data for particles. More... | |
class | NeighborList< Experimental::CrsGraph< MemorySpace, Tag > > |
1d ArborX NeighborList interface. More... | |
class | NeighborList< Experimental::Dense< MemorySpace, Tag > > |
2d ArborX NeighborList interface. More... | |
class | NeighborList< LinkedCellList< MemorySpace, Scalar > > |
LinkedCellList NeighborList interface. More... | |
class | NeighborList< VerletList< MemorySpace, AlgorithmTag, VerletLayout2D, BuildTag > > |
2D VerletList NeighborList interface. More... | |
class | NeighborList< VerletList< MemorySpace, AlgorithmTag, VerletLayoutCSR, BuildTag > > |
CSR VerletList NeighborList interface. More... | |
struct | PackTypeAtIndex |
Get the type at the given index of a parameter pack. More... | |
struct | ParameterPack |
struct | ParameterPackElement |
Parameter pack element. More... | |
struct | Particle |
Single particle copy. Wraps a tuple copy of a particle. More... | |
class | ParticleList |
List of particle fields stored in AoSoA. More... | |
struct | ParticleTraits |
Extract AoSoA particle fields for ParticleList. More... | |
struct | ParticleView |
Single SoA particle view. Wraps a view of the SoA the particle resides in. More... | |
struct | RandomAccessMemory |
Random access memory. Read-only and const with limited spatial locality. More... | |
class | Scatter |
Synchronously scatter data from the ghosts to the local decomposition of a slice using the halo reverse communication plan. This is a multiply-owned to uniquely owned communication. More... | |
class | SecondNeighborsTag |
Loop over particle neighbors (first) and neighbor's neighbors (second) More... | |
class | SerialOpTag |
Neighbor operations are executed in serial on each particle thread. More... | |
class | SimdPolicy |
Execution policy over a range of 2d indices. More... | |
class | Slice |
A slice of an array-of-structs-of-arrays with data access to a single multidimensional member. More... | |
struct | SoA |
struct | SoA< MemberTypes< Types... >, VectorLength > |
Struct-of-Arrays. More... | |
class | TeamOpTag |
Neighbor operations are executed with team parallelism. More... | |
class | TeamVectorOpTag |
Neighbor operations are executed with team vector parallelism. More... | |
struct | Tuple |
struct | Tuple< MemberTypes< Types... > > |
Tuple. More... | |
struct | TypeIndexer |
Get the index of a field type within a particle type list. More... | |
struct | VerletLayout2D |
2D array neighbor list layout. More... | |
struct | VerletLayoutCSR |
CSR (compressed sparse row) neighbor list layout. More... | |
class | VerletList |
Neighbor list implementation based on binning particles on a 3d Cartesian grid with cells of the same size as the interaction distance. More... | |
struct | VerletListData |
struct | VerletListData< MemorySpace, VerletLayout2D > |
Store the VerletList 2D neighbor data. More... | |
struct | VerletListData< MemorySpace, VerletLayoutCSR > |
Store the VerletList compressed sparse row (CSR) neighbor data. More... | |
Functions | |
template<std::size_t M, class AoSoA_t> | |
AoSoA_t::template member_slice_type< M > | slice (const AoSoA_t &aosoa, const std::string &slice_label="") |
Create a slice from an AoSoA. | |
std::vector< int > | getUniqueTopology (MPI_Comm comm, std::vector< int > topology) |
Return unique neighbor ranks, with the current rank first. | |
template<class Space, class SrcAoSoA> | |
AoSoA< typename SrcAoSoA::member_types, Space, SrcAoSoA::vector_length > | create_mirror (const Space &, const SrcAoSoA &src, typename std::enable_if<(!std::is_same< typename SrcAoSoA::memory_space, typename Space::memory_space >::value)>::type *=0) |
Allocate a mirror of the given AoSoA in the given space. | |
template<class Space, class SrcAoSoA> | |
SrcAoSoA | create_mirror_view (const Space &, const SrcAoSoA &src, typename std::enable_if<(std::is_same< typename SrcAoSoA::memory_space, typename Space::memory_space >::value)>::type *=0) |
Create a mirror view of the given AoSoA in the given space. Same space specialization returns the input AoSoA. | |
template<class Space, class SrcAoSoA> | |
AoSoA< typename SrcAoSoA::member_types, Space, SrcAoSoA::vector_length > | create_mirror_view (const Space &space, const SrcAoSoA &src, typename std::enable_if<(!std::is_same< typename SrcAoSoA::memory_space, typename Space::memory_space >::value)>::type *=0) |
Create a mirror view of the given AoSoA in the given memory space. Different space specialization allocates a new AoSoA. | |
template<class Space, class SrcAoSoA> | |
SrcAoSoA | create_mirror_view_and_copy (const Space &, const SrcAoSoA &src, typename std::enable_if<(std::is_same< typename SrcAoSoA::memory_space, typename Space::memory_space >::value &&is_aosoa< SrcAoSoA >::value)>::type *=0) |
Create a mirror view of the given AoSoA in the given memory space and copy the contents of the input AoSoA. Same space specialization returns the input AoSoA. | |
template<class Space, class SrcAoSoA> | |
AoSoA< typename SrcAoSoA::member_types, Space, SrcAoSoA::vector_length > | create_mirror_view_and_copy (const Space &space, const SrcAoSoA &src, typename std::enable_if<(!std::is_same< typename SrcAoSoA::memory_space, typename Space::memory_space >::value &&is_aosoa< SrcAoSoA >::value)>::type *=0) |
Create a mirror of the given AoSoA in the given memory space and deep copy the AoSoA into the mirror. Different space specialization allocates a new AoSoA and performs the deep copy. | |
template<class DstAoSoA, class SrcAoSoA> | |
void | deep_copy (DstAoSoA &dst, const SrcAoSoA &src, typename std::enable_if<(is_aosoa< DstAoSoA >::value &&is_aosoa< SrcAoSoA >::value)>::type *=0) |
Deep copy data between compatible AoSoA objects. | |
template<class DstMemorySpace, class SrcMemorySpace, int DstVectorLength, int SrcVectorLength, class... FieldTags> | |
void | deep_copy (ParticleList< DstMemorySpace, DstVectorLength, FieldTags... > &dst, const ParticleList< SrcMemorySpace, SrcVectorLength, FieldTags... > &src) |
Deep copy data between compatible ParticleList objects. | |
template<class AoSoA_t> | |
void | deep_copy (AoSoA_t &aosoa, const typename AoSoA_t::tuple_type &tuple) |
Fill an AoSoA with a tuple. | |
template<class DstSlice, class SrcSlice> | |
void | deep_copy (DstSlice &dst, const SrcSlice &src, typename std::enable_if<(is_slice< DstSlice >::value &&is_slice< SrcSlice >::value)>::type *=0) |
Deep copy data between compatible Slice objects. | |
template<class Slice_t> | |
void | deep_copy (Slice_t &slice, const typename Slice_t::value_type scalar) |
Fill a slice with a scalar. | |
template<class DstMemorySpace, class SrcMemorySpace, int VectorLength, class... FieldTags> | |
auto | create_mirror_view_and_copy (DstMemorySpace, ParticleList< SrcMemorySpace, VectorLength, FieldTags... > plist_src, typename std::enable_if< std::is_same< SrcMemorySpace, DstMemorySpace >::value >::type *=0) |
Create a mirror of the given ParticleList in the given memory space. | |
template<class DstMemorySpace, class SrcMemorySpace, int VectorLength, class... FieldTags> | |
auto | create_mirror_view_and_copy (DstMemorySpace, ParticleList< SrcMemorySpace, VectorLength, FieldTags... > plist_src, typename std::enable_if< !std::is_same< SrcMemorySpace, DstMemorySpace >::value >::type *=0) |
Create a mirror of the given ParticleList in the given memory space. | |
template<class ExecutionSpace, class Distributor_t, class AoSoA_t> | |
void | migrate (ExecutionSpace exec_space, const Distributor_t &distributor, const AoSoA_t &src, AoSoA_t &dst, typename std::enable_if<(is_distributor< Distributor_t >::value &&is_aosoa< AoSoA_t >::value), int >::type *=0) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Multiple AoSoA version. | |
template<class Distributor_t, class AoSoA_t> | |
void | migrate (const Distributor_t &distributor, const AoSoA_t &src, AoSoA_t &dst, typename std::enable_if<(is_distributor< Distributor_t >::value &&is_aosoa< AoSoA_t >::value), int >::type *=0) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Multiple AoSoA version. | |
template<class ExecutionSpace, class Distributor_t, class AoSoA_t> | |
void | migrate (ExecutionSpace exec_space, const Distributor_t &distributor, AoSoA_t &aosoa, typename std::enable_if<(is_distributor< Distributor_t >::value &&is_aosoa< AoSoA_t >::value), int >::type *=0) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Single AoSoA version that will resize in-place. Note that resizing does not necessarily allocate more memory. The AoSoA memory will only increase if not enough has already been reserved/allocated for the needed number of elements. | |
template<class Distributor_t, class AoSoA_t> | |
void | migrate (const Distributor_t &distributor, AoSoA_t &aosoa, typename std::enable_if<(is_distributor< Distributor_t >::value &&is_aosoa< AoSoA_t >::value), int >::type *=0) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Single AoSoA version that will resize in-place. Note that resizing does not necessarily allocate more memory. The AoSoA memory will only increase if not enough has already been reserved/allocated for the needed number of elements. | |
template<class ExecutionSpace, class Distributor_t, class Slice_t> | |
void | migrate (ExecutionSpace, const Distributor_t &distributor, const Slice_t &src, Slice_t &dst, typename std::enable_if<(is_distributor< Distributor_t >::value &&is_slice< Slice_t >::value), int >::type *=0) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Slice version. The user can do this in-place with the same slice but they will need to manage the resizing themselves as we can't resize slices. | |
template<class Distributor_t, class Slice_t> | |
void | migrate (const Distributor_t &distributor, const Slice_t &src, Slice_t &dst, typename std::enable_if<(is_distributor< Distributor_t >::value &&is_slice< Slice_t >::value), int >::type *=0) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Slice version. The user can do this in-place with the same slice but they will need to manage the resizing themselves as we can't resize slices. | |
template<class Halo, class ParticleData> | |
bool | haloCheckValidSize (const Halo &halo, const ParticleData &particles, typename std::enable_if<(is_halo< Halo >::value), int >::type *=0) |
Ensure the particle size matches the total halo (local and ghost) size. | |
template<class HaloType, class ParticleDataType> | |
auto | createGather (const HaloType &halo, const ParticleDataType &data, const double overallocation=1.0) |
Create the gather. | |
template<class HaloType, class ParticleDataType> | |
void | gather (const HaloType &halo, ParticleDataType &data) |
Synchronously gather data from the local decomposition to the ghosts using the halo forward communication plan. Slice version. This is a uniquely-owned to multiply-owned communication. | |
template<class HaloType, class SliceType> | |
auto | createScatter (const HaloType &halo, const SliceType &slice, const double overallocation=1.0, typename std::enable_if<(is_halo< HaloType >::value &&is_slice< SliceType >::value), int >::type *=0) |
Create the scatter. | |
template<class HaloType, class SliceType> | |
void | scatter (const HaloType &halo, SliceType &slice, typename std::enable_if<(is_halo< HaloType >::value &&is_slice< SliceType >::value), int >::type *=0) |
Synchronously scatter data from the ghosts to the local decomposition of a slice using the halo reverse communication plan. This is a multiply-owned to uniquely owned communication. | |
template<class MemorySpace, class PositionType, class Scalar> | |
auto | createLinkedCellList (PositionType positions, const Scalar grid_delta[3], const Scalar grid_min[3], const Scalar grid_max[3]) |
Creation function for linked cell list. | |
template<class MemorySpace, class PositionType, class Scalar> | |
auto | createLinkedCellList (PositionType positions, const std::size_t begin, const std::size_t end, const Scalar grid_delta[3], const Scalar grid_min[3], const Scalar grid_max[3]) |
Creation function for linked cell list with partial range. | |
template<class MemorySpace, class PositionType, class Scalar> | |
auto | createLinkedCellList (PositionType positions, const Scalar grid_delta[3], const Scalar grid_min[3], const Scalar grid_max[3], const Scalar neighborhood_radius, const Scalar cell_size_ratio=1.0) |
Creation function for linked cell list with custom cutoff radius and cell ratio. | |
template<class MemorySpace, class PositionType, class Scalar> | |
auto | createLinkedCellList (PositionType positions, const std::size_t begin, const std::size_t end, const Scalar grid_delta[3], const Scalar grid_min[3], const Scalar grid_max[3], const Scalar neighborhood_radius, const Scalar cell_size_ratio=1.0) |
Creation function for linked cell list with partial range and custom cutoff radius and/or cell ratio. | |
template<class LinkedCellListType, class PositionType> | |
void | permute (LinkedCellListType &linked_cell_list, PositionType &positions, typename std::enable_if<(is_linked_cell_list< LinkedCellListType >::value &&(is_aosoa< PositionType >::value||is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value)), int >::type *=0) |
Given a linked cell list permute positions. | |
template<class ExecutionSpace, class ListType> | |
Kokkos::View< int *[2], typename ListType::memory_space > | neighborHistogram (ExecutionSpace exec_space, const std::size_t num_particles, const ListType &list, const int num_bin) |
Construct a histogram of neighbors per particle. | |
template<class FunctorType, int VectorLength, class... ExecParameters> | |
void | simd_parallel_for (const SimdPolicy< VectorLength, ExecParameters... > &exec_policy, const FunctorType &functor, const std::string &str="") |
Execute a vectorized functor in parallel with a 2d execution policy. | |
template<class FunctorType, class NeighborListType, class... ExecParameters> | |
void | neighbor_parallel_for (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const NeighborListType &list, const FirstNeighborsTag, const SerialOpTag, const std::string &str="", typename std::enable_if<(!is_linked_cell_list< NeighborListType >::value), int >::type *=0) |
Execute functor in parallel according to the execution policy over particles with a thread-local serial loop over particle first neighbors. | |
template<class FunctorType, class NeighborListType, class... ExecParameters> | |
void | neighbor_parallel_for (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const NeighborListType &list, const SecondNeighborsTag, const SerialOpTag, const std::string &str="", typename std::enable_if<(!is_linked_cell_list< NeighborListType >::value), int >::type *=0) |
Execute functor in parallel according to the execution policy over particles with thread-local serial loops over particle first and second neighbors. | |
template<class FunctorType, class NeighborListType, class... ExecParameters> | |
void | neighbor_parallel_for (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const NeighborListType &list, const FirstNeighborsTag, const TeamOpTag, const std::string &str="", typename std::enable_if<(!is_linked_cell_list< NeighborListType >::value), int >::type *=0) |
Execute functor in parallel according to the execution policy over particles with team parallelism over particle first neighbors. | |
template<class FunctorType, class NeighborListType, class... ExecParameters> | |
void | neighbor_parallel_for (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const NeighborListType &list, const SecondNeighborsTag, const TeamOpTag, const std::string &str="", typename std::enable_if<(!is_linked_cell_list< NeighborListType >::value), int >::type *=0) |
Execute functor in parallel according to the execution policy over particles with team parallelism over particle first neighbors and serial loop over second neighbors. | |
template<class FunctorType, class NeighborListType, class... ExecParameters> | |
void | neighbor_parallel_for (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const NeighborListType &list, const SecondNeighborsTag, const TeamVectorOpTag, const std::string &str="", typename std::enable_if<(!is_linked_cell_list< NeighborListType >::value), int >::type *=0) |
Execute functor in parallel according to the execution policy over particles with team parallelism over particle first neighbors and vector loop parallelism over second neighbors. | |
template<class FunctorType, class NeighborListType, class ReduceType, class... ExecParameters> | |
void | neighbor_parallel_reduce (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const NeighborListType &list, const FirstNeighborsTag, const SerialOpTag, ReduceType &reduce_val, const std::string &str="", typename std::enable_if<(!is_linked_cell_list< NeighborListType >::value), int >::type *=0) |
Execute functor reduction in parallel according to the execution policy over particles with a thread-local serial loop over particle first neighbors. | |
template<class FunctorType, class NeighborListType, class ReduceType, class... ExecParameters> | |
void | neighbor_parallel_reduce (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const NeighborListType &list, const SecondNeighborsTag, const SerialOpTag, ReduceType &reduce_val, const std::string &str="", typename std::enable_if<(!is_linked_cell_list< NeighborListType >::value), int >::type *=0) |
Execute functor reduction in parallel according to the execution policy over particles with thread-local serial loops over particle first and second neighbors. | |
template<class FunctorType, class NeighborListType, class ReduceType, class... ExecParameters> | |
void | neighbor_parallel_reduce (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const NeighborListType &list, const FirstNeighborsTag, const TeamOpTag, ReduceType &reduce_val, const std::string &str="", typename std::enable_if<(!is_linked_cell_list< NeighborListType >::value), int >::type *=0) |
Execute functor reduction in parallel according to the execution policy over particles with team parallelism over particle first neighbors. | |
template<class FunctorType, class NeighborListType, class ReduceType, class... ExecParameters> | |
void | neighbor_parallel_reduce (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const NeighborListType &list, const SecondNeighborsTag, const TeamOpTag, ReduceType &reduce_val, const std::string &str="", typename std::enable_if<(!is_linked_cell_list< NeighborListType >::value), int >::type *=0) |
Execute functor reduction in parallel according to the execution policy over particles with team parallelism over particle first neighbors and serial loop over second neighbors. | |
template<class FunctorType, class NeighborListType, class ReduceType, class... ExecParameters> | |
void | neighbor_parallel_reduce (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const NeighborListType &list, const SecondNeighborsTag, const TeamVectorOpTag, ReduceType &reduce_val, const std::string &str="", typename std::enable_if<(!is_linked_cell_list< NeighborListType >::value), int >::type *=0) |
Execute functor reduction in parallel according to the execution policy over particles with team parallelism over particle first neighbors and vector loop parallelism over second neighbors. | |
template<class IndexType, class FunctorType, class NeighborListType> | |
KOKKOS_INLINE_FUNCTION void | for_each_neighbor (const IndexType i, const FunctorType &neighbor_functor, const NeighborListType &list, const FirstNeighborsTag) |
Execute functor in serial within existing parallel kernel over particle first neighbors. | |
template<class IndexType, class FunctorType, class NeighborListType, class TeamMemberType> | |
KOKKOS_INLINE_FUNCTION void | for_each_neighbor (const IndexType i, const TeamMemberType team, const FunctorType &neighbor_functor, const NeighborListType &list, const FirstNeighborsTag) |
Execute team parallel functor within existing parallel kernel over particle first neighbors. | |
template<class FunctorType, class LinkedCellType, class... ExecParameters> | |
void | neighbor_parallel_for (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const LinkedCellType &list, const FirstNeighborsTag, const SerialOpTag, const std::string &str="", typename std::enable_if<(is_linked_cell_list< LinkedCellType >::value), int >::type *=0) |
Execute functor in parallel according to the execution policy over particles with thread-local serial loops over linked cell list bins and particle first neighbors in those bins. | |
template<class FunctorType, class LinkedCellType, class... ExecParameters> | |
void | neighbor_parallel_for (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const LinkedCellType &list, const FirstNeighborsTag, const TeamOpTag, const std::string &str="", typename std::enable_if<(is_linked_cell_list< LinkedCellType >::value), int >::type *=0) |
Execute functor in parallel according to the execution policy over particles with thread-local serial loops over linked cell list bins and team threading over particle first neighbors in those bins. | |
template<class FunctorType, class LinkedCellType, class ReduceType, class... ExecParameters> | |
void | neighbor_parallel_reduce (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const LinkedCellType &list, const FirstNeighborsTag, const SerialOpTag, ReduceType &reduce_val, const std::string &str="", typename std::enable_if<(is_linked_cell_list< LinkedCellType >::value), int >::type *=0) |
Execute functor in parallel according to the execution policy over particles with thread-local serial loops over linked cell list bins and particle first neighbors in those bins. | |
template<class FunctorType, class LinkedCellType, class ReduceType, class... ExecParameters> | |
void | neighbor_parallel_reduce (const Kokkos::RangePolicy< ExecParameters... > &exec_policy, const FunctorType &functor, const LinkedCellType &list, const FirstNeighborsTag, const TeamOpTag, ReduceType &reduce_val, const std::string &str="", typename std::enable_if<(is_linked_cell_list< LinkedCellType >::value), int >::type *=0) |
Execute functor in parallel according to the execution policy over particles with thread-local serial loops over linked cell list bins and team threading over particle first neighbors in those bins. | |
template<std::size_t N, class ParameterPack_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_parameter_pack< ParameterPack_t >::value, typenameParameterPack_t::templatevalue_type< N > & >::type | get (ParameterPack_t &pp) |
Get an element from a parameter pack. | |
template<std::size_t N, class ParameterPack_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_parameter_pack< ParameterPack_t >::value, consttypenameParameterPack_t::templatevalue_type< N > & >::type | get (const ParameterPack_t &pp) |
Get an element from a parameter pack. | |
template<typename ParameterPack_t, typename... Types> | |
void | fillParameterPack (ParameterPack_t &pp, const Types &... ts) |
template<typename ParameterPack_t> | |
void | fillParameterPack (ParameterPack_t &) |
Empty case - fill a parameter pack. | |
template<typename... Types> | |
ParameterPack< Types... > | makeParameterPack (const Types &... ts) |
Create a parameter pack. | |
template<class ExecutionSpace, class InitFunctor, class ParticleListType, class ArrayType> | |
int | createParticles (InitRandom, ExecutionSpace exec_space, const InitFunctor &create_functor, ParticleListType &particle_list, const std::size_t num_particles, const ArrayType box_min, const ArrayType box_max, const std::size_t previous_num_particles=0, const bool shrink_to_fit=true, const uint64_t seed=342343901, typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type *=0) |
Initialize random particles given an initialization functor. | |
template<class InitFunctor, class ParticleListType, class ArrayType> | |
int | createParticles (InitRandom tag, const InitFunctor &create_functor, ParticleListType &particle_list, const std::size_t num_particles, const ArrayType box_min, const ArrayType box_max, const std::size_t previous_num_particles=0, const bool shrink_to_fit=true, const uint64_t seed=342343901) |
Initialize random particles given an initialization functor. | |
template<class ExecutionSpace, class PositionType, class ArrayType> | |
void | createParticles (InitRandom, ExecutionSpace exec_space, PositionType &positions, const std::size_t num_particles, const ArrayType box_min, const ArrayType box_max, const std::size_t previous_num_particles=0, const uint64_t seed=342343901, typename std::enable_if<(is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type *=0) |
Initialize random particles. | |
template<class PositionType, class ArrayType> | |
void | createParticles (InitRandom tag, PositionType &positions, const std::size_t num_particles, const ArrayType box_min, const ArrayType box_max, const std::size_t previous_num_particles=0, const uint64_t seed=342343901, typename std::enable_if<(is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type *=0) |
Initialize random particles. | |
template<class ExecutionSpace, class InitFunctor, class ParticleListType, class PositionTag, class ArrayType> | |
int | createParticles (InitRandom tag, ExecutionSpace exec_space, const InitFunctor &create_functor, ParticleListType &particle_list, PositionTag position_tag, const std::size_t num_particles, const double min_dist, const ArrayType box_min, const ArrayType box_max, const std::size_t previous_num_particles=0, const bool shrink_to_fit=true, const uint64_t seed=342343901, typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type *=0) |
Initialize random particles with minimum separation. | |
template<class InitFunctor, class ParticleListType, class PositionTag, class ArrayType> | |
int | createParticles (InitRandom tag, const InitFunctor &create_functor, ParticleListType &particle_list, PositionTag position_tag, const std::size_t num_particles, const double min_dist, const ArrayType box_min, const ArrayType box_max, const std::size_t previous_num_particles=0, const bool shrink_to_fit=true, const uint64_t seed=342343901) |
Initialize random particles with minimum separation. | |
template<class FieldTag, class... FieldTags, class... IndexTypes> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< sizeof...(IndexTypes)==FieldTag::rank, typenameParticle< FieldTags... >::tuple_type::templatemember_const_reference_type< TypeIndexer< FieldTag, FieldTags... >::index > >::type | get (const Particle< FieldTags... > &particle, FieldTag, IndexTypes... indices) |
Return a single element of a single field from indices. | |
template<class FieldTag, class... FieldTags, class... IndexTypes> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< sizeof...(IndexTypes)==FieldTag::rank, typenameParticle< FieldTags... >::tuple_type::templatemember_reference_type< TypeIndexer< FieldTag, FieldTags... >::index > >::type | get (Particle< FieldTags... > &particle, FieldTag, IndexTypes... indices) |
Return a single element of a single field from indices. | |
template<class FieldTag, class... FieldTags, class... IndexTypes, int VectorLength> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< sizeof...(IndexTypes)==FieldTag::rank, typenameParticleView< VectorLength, FieldTags... >::soa_type::templatemember_const_reference_type< TypeIndexer< FieldTag, FieldTags... >::index > >::type | get (const ParticleView< VectorLength, FieldTags... > &particle, FieldTag, IndexTypes... indices) |
Return a single element of a single field from indices. | |
template<class FieldTag, class... FieldTags, class... IndexTypes, int VectorLength> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< sizeof...(IndexTypes)==FieldTag::rank, typenameParticleView< VectorLength, FieldTags... >::soa_type::templatemember_reference_type< TypeIndexer< FieldTag, FieldTags... >::index > >::type | get (ParticleView< VectorLength, FieldTags... > &particle, FieldTag, IndexTypes... indices) |
Return a single element of a single field from indices. | |
template<class MemorySpace, int VectorLength, class... FieldTags> | |
auto | createParticleList (const std::string &label, ParticleTraits< FieldTags... >) |
ParticleList creation function. | |
template<class MemorySpace, class... FieldTags> | |
auto | createParticleList (const std::string &label, ParticleTraits< FieldTags... >) |
ParticleList creation function with default vector length. | |
template<class ExecutionSpace, class KeepView, class ParticleAoSoA> | |
void | remove (const ExecutionSpace &exec_space, const int num_keep, const KeepView &keep_particle, ParticleAoSoA &particles, const int num_particles_ignore=0, const bool shrink_to_fit=true) |
Filter out empty/unneeded particles. | |
template<class ExecutionSpace, class ViewType, class SliceType> | |
void | copySliceToView (ExecutionSpace exec_space, ViewType &view, const SliceType &slice, const std::size_t begin, const std::size_t end, typename std::enable_if< 2==SliceType::kokkos_view::traits::dimension::rank, int * >::type=0) |
Copy from slice to View. Rank-0. | |
template<class ExecutionSpace, class ViewType, class SliceType> | |
void | copySliceToView (ExecutionSpace exec_space, ViewType &view, const SliceType &slice, const std::size_t begin, const std::size_t end, typename std::enable_if< 3==SliceType::kokkos_view::traits::dimension::rank, int * >::type=0) |
Copy from slice to View. Rank-1. | |
template<class ExecutionSpace, class ViewType, class SliceType> | |
void | copySliceToView (ExecutionSpace exec_space, ViewType &view, const SliceType &slice, const std::size_t begin, const std::size_t end, typename std::enable_if< 4==SliceType::kokkos_view::traits::dimension::rank, int * >::type=0) |
Copy from slice to View. Rank-2. | |
template<class ViewType, class SliceType> | |
void | copySliceToView (ViewType &view, const SliceType &slice, const std::size_t begin, const std::size_t end) |
Copy from slice to View with default execution space. | |
template<class ExecutionSpace, class SliceType, class ViewType> | |
void | copyViewToSlice (ExecutionSpace exec_space, SliceType &slice, const ViewType &view, const std::size_t begin, const std::size_t end, typename std::enable_if< 2==SliceType::kokkos_view::traits::dimension::rank, int * >::type=0) |
Copy from View to slice. Rank-0. | |
template<class ExecutionSpace, class SliceType, class ViewType> | |
void | copyViewToSlice (ExecutionSpace exec_space, SliceType &slice, const ViewType &view, const std::size_t begin, const std::size_t end, typename std::enable_if< 3==SliceType::kokkos_view::traits::dimension::rank, int * >::type=0) |
Copy from View to slice. Rank-1. | |
template<class ExecutionSpace, class SliceType, class ViewType> | |
void | copyViewToSlice (ExecutionSpace exec_space, SliceType &slice, const ViewType &view, const std::size_t begin, const std::size_t end, typename std::enable_if< 4==SliceType::kokkos_view::traits::dimension::rank, int * >::type=0) |
Copy from View to slice. Rank-2. | |
template<class ViewType, class SliceType> | |
void | copyViewToSlice (SliceType &slice, const ViewType &view, const std::size_t begin, const std::size_t end) |
Copy from View to slice with default execution space. | |
template<class SliceType> | |
void | checkSize (SliceType slice, const std::size_t size, typename std::enable_if< is_slice< SliceType >::value, int >::type *=0) |
Check slice size (differs from Kokkos View). | |
template<class ViewType> | |
void | checkSize (ViewType view, const std::size_t size, typename std::enable_if< Kokkos::is_view< ViewType >::value, int >::type *=0) |
Check View size (differs from Slice). | |
template<class SliceType> | |
auto | size (SliceType slice, typename std::enable_if< is_slice< SliceType >::value, int >::type *=0) |
Check slice size (differs from Kokkos View). | |
template<class ViewType> | |
auto | size (ViewType view, typename std::enable_if< Kokkos::is_view< ViewType >::value, int >::type *=0) |
Check View size (differs from Slice). | |
template<std::size_t M, class SoA_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_soa< SoA_t >::value, typenameSoA_t::templatemember_reference_type< M > >::type | get (SoA_t &soa, const std::size_t a) |
Get Rank-0 non-const. | |
template<std::size_t M, class SoA_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_soa< SoA_t >::value, typenameSoA_t::templatemember_const_reference_type< M > >::type | get (const SoA_t &soa, const std::size_t a) |
Get Rank-0 const. | |
template<std::size_t M, class SoA_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_soa< SoA_t >::value, typenameSoA_t::templatemember_reference_type< M > >::type | get (SoA_t &soa, const std::size_t a, const std::size_t d0) |
Get Rank-1 non-const. | |
template<std::size_t M, class SoA_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_soa< SoA_t >::value, typenameSoA_t::templatemember_const_reference_type< M > >::type | get (const SoA_t &soa, const std::size_t a, const std::size_t d0) |
Get Rank-1 const. | |
template<std::size_t M, class SoA_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_soa< SoA_t >::value, typenameSoA_t::templatemember_reference_type< M > >::type | get (SoA_t &soa, const std::size_t a, const std::size_t d0, const std::size_t d1) |
Get Rank-2 non-const. | |
template<std::size_t M, class SoA_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_soa< SoA_t >::value, typenameSoA_t::templatemember_const_reference_type< M > >::type | get (const SoA_t &soa, const std::size_t a, const std::size_t d0, const std::size_t d1) |
Get Rank-2 const. | |
template<std::size_t M, class SoA_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_soa< SoA_t >::value, typenameSoA_t::templatemember_reference_type< M > >::type | get (SoA_t &soa, const std::size_t a, const std::size_t d0, const std::size_t d1, const std::size_t d2) |
Get Rank-3 non-const. | |
template<std::size_t M, class SoA_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_soa< SoA_t >::value, typenameSoA_t::templatemember_const_reference_type< M > >::type | get (const SoA_t &soa, const std::size_t a, const std::size_t d0, const std::size_t d1, const std::size_t d2) |
Get Rank-3 const. | |
template<class KeyViewType, class Comparator, class ExecutionSpace = typename KeyViewType::execution_space> | |
auto | sortByKeyWithComparator (KeyViewType keys, Comparator comp, const std::size_t begin, const std::size_t end, typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type *=0) |
Sort an AoSoA over a subset of its range using a general comparator over the given Kokkos View of keys. | |
template<class KeyViewType, class Comparator, class ExecutionSpace = typename KeyViewType::execution_space> | |
auto | sortByKeyWithComparator (KeyViewType keys, Comparator comp, typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type *=0) |
Sort an entire AoSoA using a general comparator over the given Kokkos View of keys. | |
template<class KeyViewType, class Comparator, class ExecutionSpace = typename KeyViewType::execution_space> | |
auto | binByKeyWithComparator (KeyViewType keys, Comparator comp, const std::size_t begin, const std::size_t end, typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type *=0) |
Bin an AoSoA over a subset of its range using a general comparator over the given Kokkos View of keys. | |
template<class KeyViewType, class Comparator, class ExecutionSpace = typename KeyViewType::execution_space> | |
auto | binByKeyWithComparator (KeyViewType keys, Comparator comp, typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type *=0) |
Bin an entire AoSoA using a general comparator over the given Kokkos View of keys. | |
template<class KeyViewType, class ExecutionSpace = typename KeyViewType::execution_space> | |
auto | sortByKey (KeyViewType keys, const std::size_t begin, const std::size_t end, typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type *=0) |
Sort an AoSoA over a subset of its range based on the associated key values. | |
template<class KeyViewType, class ExecutionSpace = typename KeyViewType::execution_space> | |
auto | sortByKey (KeyViewType keys, typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type *=0) |
Sort an entire AoSoA based on the associated key values. | |
template<class KeyViewType, class ExecutionSpace = typename KeyViewType::execution_space> | |
auto | binByKey (KeyViewType keys, const int nbin, const std::size_t begin, const std::size_t end, typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type *=0) |
Bin an AoSoA over a subset of its range based on the associated key values and number of bins. The bins are evenly divided over the range of key values. | |
template<class KeyViewType, class ExecutionSpace = typename KeyViewType::execution_space> | |
auto | binByKey (KeyViewType keys, const int nbin, typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type *=0) |
Bin an entire AoSoA based on the associated key values and number of bins. The bins are evenly divided over the range of key values. | |
template<class SliceType, class ExecutionSpace = typename SliceType::execution_space> | |
auto | sortByKey (SliceType slice, const std::size_t begin, const std::size_t end, typename std::enable_if<(is_slice< SliceType >::value), int >::type *=0) |
Sort an AoSoA over a subset of its range based on the associated slice of keys. | |
template<class SliceType, class ExecutionSpace = typename SliceType::execution_space> | |
auto | sortByKey (SliceType slice, typename std::enable_if<(is_slice< SliceType >::value), int >::type *=0) |
Sort an entire AoSoA based on the associated slice of keys. | |
template<class SliceType, class ExecutionSpace = typename SliceType::execution_space> | |
auto | binByKey (SliceType slice, const int nbin, const std::size_t begin, const std::size_t end, typename std::enable_if<(is_slice< SliceType >::value), int >::type *=0) |
Bin an AoSoA over a subset of its range based on the associated slice of keys. | |
template<class SliceType, class ExecutionSpace = typename SliceType::execution_space> | |
auto | binByKey (SliceType slice, const int nbin, typename std::enable_if<(is_slice< SliceType >::value), int >::type *=0) |
Bin an entire AoSoA based on the associated slice of keys. | |
template<class BinningDataType, class AoSoA_t, class ExecutionSpace = typename BinningDataType::execution_space> | |
void | permute (const BinningDataType &binning_data, AoSoA_t &aosoa, typename std::enable_if<(is_binning_data< BinningDataType >::value &&is_aosoa< AoSoA_t >::value), int >::type *=0) |
Given binning data permute an AoSoA. | |
template<class BinningDataType, class SliceType, class ExecutionSpace = typename BinningDataType::execution_space> | |
void | permute (const BinningDataType &binning_data, SliceType &slice, typename std::enable_if<(is_binning_data< BinningDataType >::value &&is_slice< SliceType >::value), int >::type *=0) |
Given binning data permute a slice. | |
template<class BinningDataType, class ViewType, class DeviceType = typename BinningDataType::device_type> | |
void | permute (const BinningDataType &binning_data, ViewType &view, typename std::enable_if<(is_binning_data< BinningDataType >::value &&Kokkos::is_view< ViewType >::value), int >::type *=0) |
Given binning data permute a View. | |
template<std::size_t M, class Tuple_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_tuple< Tuple_t >::value, typenameTuple_t::templatemember_reference_type< M > >::type | get (Tuple_t &tp) |
Get Rank-0 non-const. | |
template<std::size_t M, class Tuple_t> | |
KOKKOS_FORCEINLINE_FUNCTION Tuple_t::template member_const_reference_type< M > | get (const Tuple_t &tp) |
Get Rank-0 const. | |
template<std::size_t M, class Tuple_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_tuple< Tuple_t >::value, typenameTuple_t::templatemember_reference_type< M > >::type | get (Tuple_t &tp, const std::size_t d0) |
Get Rank-1 non-const. | |
template<std::size_t M, class Tuple_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_tuple< Tuple_t >::value, typenameTuple_t::templatemember_const_reference_type< M > >::type | get (const Tuple_t &tp, const std::size_t d0) |
Get Rank-1 const. | |
template<std::size_t M, class Tuple_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_tuple< Tuple_t >::value, typenameTuple_t::templatemember_reference_type< M > >::type | get (Tuple_t &tp, const std::size_t d0, const std::size_t d1) |
Get Rank-2 non-const. | |
template<std::size_t M, class Tuple_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_tuple< Tuple_t >::value, typenameTuple_t::templatemember_const_reference_type< M > >::type | get (const Tuple_t &tp, const std::size_t d0, const std::size_t d1) |
Get Rank-2 const. | |
template<std::size_t M, class Tuple_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_tuple< Tuple_t >::value, typenameTuple_t::templatemember_reference_type< M > >::type | get (Tuple_t &tp, const std::size_t d0, const std::size_t d1, const std::size_t d2) |
Get Rank-3 non-const. | |
template<std::size_t M, class Tuple_t> | |
KOKKOS_FORCEINLINE_FUNCTION std::enable_if< is_tuple< Tuple_t >::value, typenameTuple_t::templatemember_const_reference_type< M > >::type | get (const Tuple_t &tp, const std::size_t d0, const std::size_t d1, const std::size_t d2) |
Get Rank-3 const. | |
std::string | version () |
Cabana version. | |
std::string | git_commit_hash () |
Cabana git hash. | |
Core: particle data structures and algorithms.
auto Cabana::binByKey | ( | KeyViewType | keys, |
const int | nbin, | ||
const std::size_t | begin, | ||
const std::size_t | end, | ||
typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type * | = 0 ) |
Bin an AoSoA over a subset of its range based on the associated key values and number of bins. The bins are evenly divided over the range of key values.
KeyViewType | The Kokkos::View type for keys. |
keys | The key values to use for binning. A key value is needed for every element of the AoSoA. |
nbin | The number of bins to use for binning. The range of key values will subdivided equally by the number of bins. |
begin | The beginning index of the AoSoA range to bin. |
end | The end index of the AoSoA range to bin. |
auto Cabana::binByKey | ( | KeyViewType | keys, |
const int | nbin, | ||
typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type * | = 0 ) |
Bin an entire AoSoA based on the associated key values and number of bins. The bins are evenly divided over the range of key values.
KeyViewType | The Kokkos::View type for keys. |
keys | The key values to use for binning. A key value is needed for every element of the AoSoA. |
nbin | The number of bins to use for binning. The range of key values will subdivided equally by the number of bins. |
auto Cabana::binByKey | ( | SliceType | slice, |
const int | nbin, | ||
const std::size_t | begin, | ||
const std::size_t | end, | ||
typename std::enable_if<(is_slice< SliceType >::value), int >::type * | = 0 ) |
Bin an AoSoA over a subset of its range based on the associated slice of keys.
SliceType | Slice type for keys |
slice | Slice of keys. |
nbin | The number of bins to use for binning. The range of key values will subdivided equally by the number of bins. |
begin | The beginning index of the AoSoA range to bin. |
end | The end index of the AoSoA range to bin. |
auto Cabana::binByKey | ( | SliceType | slice, |
const int | nbin, | ||
typename std::enable_if<(is_slice< SliceType >::value), int >::type * | = 0 ) |
Bin an entire AoSoA based on the associated slice of keys.
SliceType | Slice type for keys. |
slice | Slice of keys. |
nbin | The number of bins to use for binning. The range of key values will subdivided equally by the number of bins. |
auto Cabana::binByKeyWithComparator | ( | KeyViewType | keys, |
Comparator | comp, | ||
const std::size_t | begin, | ||
const std::size_t | end, | ||
typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type * | = 0 ) |
Bin an AoSoA over a subset of its range using a general comparator over the given Kokkos View of keys.
KeyViewType | The Kokkos::View type for keys. |
Comparator | Kokkos::BinSort compatible comparator type. |
keys | The key values to use for binning. A key value is needed for every element of the AoSoA. |
comp | The comparator to use for binning. Must be compatible with Kokkos::BinSort. |
begin | The beginning index of the AoSoA range to bin. |
end | The end index of the AoSoA range to bin. |
auto Cabana::binByKeyWithComparator | ( | KeyViewType | keys, |
Comparator | comp, | ||
typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type * | = 0 ) |
Bin an entire AoSoA using a general comparator over the given Kokkos View of keys.
KeyViewType | The Kokkos::View type for keys. |
Comparator | Kokkos::BinSort compatible comparator type. |
keys | The key values to use for binning. A key value is needed for every element of the AoSoA. |
comp | The comparator to use for binning. Must be compatible with Kokkos::BinSort. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
auto Cabana::create_mirror_view_and_copy | ( | DstMemorySpace | , |
ParticleList< SrcMemorySpace, VectorLength, FieldTags... > | plist_src, | ||
typename std::enable_if< !std::is_same< SrcMemorySpace, DstMemorySpace >::value >::type * | = 0 ) |
Create a mirror of the given ParticleList in the given memory space.
auto Cabana::create_mirror_view_and_copy | ( | DstMemorySpace | , |
ParticleList< SrcMemorySpace, VectorLength, FieldTags... > | plist_src, | ||
typename std::enable_if< std::is_same< SrcMemorySpace, DstMemorySpace >::value >::type * | = 0 ) |
Create a mirror of the given ParticleList in the given memory space.
auto Cabana::createGather | ( | const HaloType & | halo, |
const ParticleDataType & | data, | ||
const double | overallocation = 1.0 ) |
Create the gather.
halo | The halo to use for the gather. |
data | The data on which to perform the gather. The slice should have a size equivalent to halo.numGhost() + halo.numLocal(). The locally owned elements are expected to appear first (i.e. in the first halo.numLocal() elements) and the ghosted elements are expected to appear second (i.e. in the next halo.numGhost() elements()). |
overallocation | An optional factor to keep extra space in the buffers to avoid frequent resizing. |
auto Cabana::createLinkedCellList | ( | PositionType | positions, |
const Scalar | grid_delta[3], | ||
const Scalar | grid_min[3], | ||
const Scalar | grid_max[3] ) |
Creation function for linked cell list.
auto Cabana::createLinkedCellList | ( | PositionType | positions, |
const Scalar | grid_delta[3], | ||
const Scalar | grid_min[3], | ||
const Scalar | grid_max[3], | ||
const Scalar | neighborhood_radius, | ||
const Scalar | cell_size_ratio = 1.0 ) |
Creation function for linked cell list with custom cutoff radius and cell ratio.
auto Cabana::createLinkedCellList | ( | PositionType | positions, |
const std::size_t | begin, | ||
const std::size_t | end, | ||
const Scalar | grid_delta[3], | ||
const Scalar | grid_min[3], | ||
const Scalar | grid_max[3] ) |
Creation function for linked cell list with partial range.
auto Cabana::createLinkedCellList | ( | PositionType | positions, |
const std::size_t | begin, | ||
const std::size_t | end, | ||
const Scalar | grid_delta[3], | ||
const Scalar | grid_min[3], | ||
const Scalar | grid_max[3], | ||
const Scalar | neighborhood_radius, | ||
const Scalar | cell_size_ratio = 1.0 ) |
Creation function for linked cell list with partial range and custom cutoff radius and/or cell ratio.
auto Cabana::createParticleList | ( | const std::string & | label, |
ParticleTraits< FieldTags... > | ) |
ParticleList creation function.
auto Cabana::createParticleList | ( | const std::string & | label, |
ParticleTraits< FieldTags... > | ) |
ParticleList creation function with default vector length.
int Cabana::createParticles | ( | InitRandom | tag, |
const InitFunctor & | create_functor, | ||
ParticleListType & | particle_list, | ||
const std::size_t | num_particles, | ||
const ArrayType | box_min, | ||
const ArrayType | box_max, | ||
const std::size_t | previous_num_particles = 0, | ||
const bool | shrink_to_fit = true, | ||
const uint64_t | seed = 342343901 ) |
Initialize random particles given an initialization functor.
tag | Initialization type tag. |
create_functor | A functor which populates a particle given the logical position of a particle. This functor returns true if a particle was created and false if it was not giving the signature: bool createFunctor( const double pid, const double px[3], const double pv, typename ParticleAoSoA::tuple_type& particle ); |
particle_list | The ParticleList to populate. This will be filled with particles and resized to a size equal to the number of particles created. |
num_particles | The number of particles to create. |
box_min | Array specifying lower corner to create particles within. |
box_max | Array specifying upper corner to create particles within. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
shrink_to_fit | Optionally remove unused allocated space after creation. |
seed | Optional random seed for generating particles. |
int Cabana::createParticles | ( | InitRandom | tag, |
const InitFunctor & | create_functor, | ||
ParticleListType & | particle_list, | ||
PositionTag | position_tag, | ||
const std::size_t | num_particles, | ||
const double | min_dist, | ||
const ArrayType | box_min, | ||
const ArrayType | box_max, | ||
const std::size_t | previous_num_particles = 0, | ||
const bool | shrink_to_fit = true, | ||
const uint64_t | seed = 342343901 ) |
Initialize random particles with minimum separation.
tag | Initialization type tag. |
create_functor | A functor which populates a particle given the logical position of a particle. This functor returns true if a particle was created and false if it was not giving the signature: bool createFunctor( const double pid, const double px[3], const double pv, typename ParticleAoSoA::tuple_type& particle ); |
particle_list | The ParticleList to populate. This will be filled with particles and resized to a size equal to the number of particles created. |
position_tag | Position particle list type tag. |
num_particles | The number of particles to create. |
min_dist | Minimum separation distance between particles. Potential particles created within this distance of an existing particle are rejected. |
box_min | Array specifying lower corner to create particles within. |
box_max | Array specifying upper corner to create particles within. |
shrink_to_fit | Optionally remove unused allocated space after creation. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
seed | Optional random seed for generating particles. |
int Cabana::createParticles | ( | InitRandom | tag, |
ExecutionSpace | exec_space, | ||
const InitFunctor & | create_functor, | ||
ParticleListType & | particle_list, | ||
PositionTag | position_tag, | ||
const std::size_t | num_particles, | ||
const double | min_dist, | ||
const ArrayType | box_min, | ||
const ArrayType | box_max, | ||
const std::size_t | previous_num_particles = 0, | ||
const bool | shrink_to_fit = true, | ||
const uint64_t | seed = 342343901, | ||
typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type * | = 0 ) |
Initialize random particles with minimum separation.
tag | Initialization type tag. |
exec_space | Kokkos execution space. |
create_functor | A functor which populates a particle given the logical position of a particle. This functor returns true if a particle was created and false if it was not giving the signature: bool createFunctor( const double pid, const double px[3], const double pv, typename ParticleAoSoA::tuple_type& particle ); |
particle_list | The ParticleList to populate. This will be filled with particles and resized to a size equal to the number of particles created. |
position_tag | Position particle list type tag. |
num_particles | The number of particles to create. |
min_dist | Minimum separation distance between particles. Potential particles created within this distance of an existing particle are rejected. |
box_min | Array specifying lower corner to create particles within. |
box_max | Array specifying upper corner to create particles within. |
shrink_to_fit | Optionally remove unused allocated space after creation. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
seed | Optional random seed for generating particles. |
void Cabana::createParticles | ( | InitRandom | tag, |
PositionType & | positions, | ||
const std::size_t | num_particles, | ||
const ArrayType | box_min, | ||
const ArrayType | box_max, | ||
const std::size_t | previous_num_particles = 0, | ||
const uint64_t | seed = 342343901, | ||
typename std::enable_if<(is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type * | = 0 ) |
Initialize random particles.
tag | Initialization type tag. |
positions | Particle positions slice. |
num_particles | The number of particles to create. |
box_min | Array specifying lower corner to create particles within. |
box_max | Array specifying upper corner to create particles within. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
seed | Optional random seed for generating particles. |
int Cabana::createParticles | ( | InitRandom | , |
ExecutionSpace | exec_space, | ||
const InitFunctor & | create_functor, | ||
ParticleListType & | particle_list, | ||
const std::size_t | num_particles, | ||
const ArrayType | box_min, | ||
const ArrayType | box_max, | ||
const std::size_t | previous_num_particles = 0, | ||
const bool | shrink_to_fit = true, | ||
const uint64_t | seed = 342343901, | ||
typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type * | = 0 ) |
Initialize random particles given an initialization functor.
exec_space | Kokkos execution space. |
create_functor | A functor which populates a particle given the logical position of a particle. This functor returns true if a particle was created and false if it was not giving the signature: bool createFunctor( const double pid, const double px[3], const double pv, typename ParticleAoSoA::tuple_type& particle ); |
particle_list | The ParticleList to populate. This will be filled with particles and resized to a size equal to the number of particles created. |
num_particles | The number of particles to create. |
box_min | Array specifying lower corner to create particles within. |
box_max | Array specifying upper corner to create particles within. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
shrink_to_fit | Optionally remove unused allocated space after creation. |
seed | Optional random seed for generating particles. |
void Cabana::createParticles | ( | InitRandom | , |
ExecutionSpace | exec_space, | ||
PositionType & | positions, | ||
const std::size_t | num_particles, | ||
const ArrayType | box_min, | ||
const ArrayType | box_max, | ||
const std::size_t | previous_num_particles = 0, | ||
const uint64_t | seed = 342343901, | ||
typename std::enable_if<(is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type * | = 0 ) |
Initialize random particles.
exec_space | Kokkos execution space. |
positions | Particle positions slice. |
num_particles | The number of particles to create. |
box_min | Array specifying lower corner to create particles within. |
box_max | Array specifying upper corner to create particles within. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
seed | Optional random seed for generating particles. |
auto Cabana::createScatter | ( | const HaloType & | halo, |
const SliceType & | slice, | ||
const double | overallocation = 1.0, | ||
typename std::enable_if<(is_halo< HaloType >::value &&is_slice< SliceType >::value), int >::type * | = 0 ) |
Create the scatter.
halo | The halo to use for the scatter. |
slice | The slice on which to perform the scatter. The slice should have a size equivalent to halo.numGhost() + halo.numLocal(). The locally owned elements are expected to appear first (i.e. in the first halo.numLocal() elements) and the ghosted elements are expected to appear second (i.e. in the next halo.numGhost() elements()). |
overallocation | An optional factor to keep extra space in the buffers to avoid frequent resizing. |
|
inline |
|
inline |
Deep copy data between compatible ParticleList objects.
dst | The destination for the copied data. |
src | The source of the copied data. s |
|
inline |
Fill a slice with a scalar.
slice | The slice to fill. |
scalar | The scalar to assign. All slice elements will be assigned this value. |
void Cabana::fillParameterPack | ( | ParameterPack_t & | pp, |
const Types &... | ts ) |
Fill a parameter pack. Note the indexing is such that the Nth element of a parameter pack is the Nth element of the tuple.
KOKKOS_INLINE_FUNCTION void Cabana::for_each_neighbor | ( | const IndexType | i, |
const FunctorType & | neighbor_functor, | ||
const NeighborListType & | list, | ||
const FirstNeighborsTag | ) |
Execute functor in serial within existing parallel kernel over particle first neighbors.
IndexType | The particle index type. |
FunctorType | The neighbor functor type to execute. |
NeighborListType | The neighbor list type. |
i | Particle index. |
neighbor_functor | The neighbor functor to execute in parallel. |
list | The neighbor list over which to execute the neighbor operations. |
A "functor" is a class containing the function to execute in parallel, data needed for that execution, and an optional execution_space
typedef. Here is an example functor for neighbor parallel_for:
In the above example, Index
is a Cabana index to a given AoSoA element for a particle and its neighbor. Its operator()
method defines the operation to parallelize, over the range of indices idx=[begin,end]
. This compares to a single iteration idx
of a for
loop.
KOKKOS_INLINE_FUNCTION void Cabana::for_each_neighbor | ( | const IndexType | i, |
const TeamMemberType | team, | ||
const FunctorType & | neighbor_functor, | ||
const NeighborListType & | list, | ||
const FirstNeighborsTag | ) |
Execute team parallel functor within existing parallel kernel over particle first neighbors.
IndexType | The particle index type. |
FunctorType | The neighbor functor type to execute. |
NeighborListType | The neighbor list type. |
TeamMemberType | Kokkos team policy. |
i | Particle index. |
team | Kokkos team. |
neighbor_functor | The neighbor functor to execute in parallel. |
list | The neighbor list over which to execute the neighbor operations. |
void Cabana::gather | ( | const HaloType & | halo, |
ParticleDataType & | data ) |
Synchronously gather data from the local decomposition to the ghosts using the halo forward communication plan. Slice version. This is a uniquely-owned to multiply-owned communication.
halo | The halo to use for the gather. |
data | The data on which to perform the gather. The slice should have a size equivalent to halo.numGhost() + halo.numLocal(). The locally owned elements are expected to appear first (i.e. in the first halo.numLocal() elements) and the ghosted elements are expected to appear second (i.e. in the next halo.numGhost() elements()). |
|
inline |
Return unique neighbor ranks, with the current rank first.
comm | MPI communicator. |
topology | MPI neighbor ranks in any order with possible duplication. |
bool Cabana::haloCheckValidSize | ( | const Halo & | halo, |
const ParticleData & | particles, | ||
typename std::enable_if<(is_halo< Halo >::value), int >::type * | = 0 ) |
Ensure the particle size matches the total halo (local and ghost) size.
halo | The halo that will be used for the gather. Used to query import and export sizes. |
particles | The particle data (either AoSoA or slice). Used to query the total size. |
void Cabana::migrate | ( | const Distributor_t & | distributor, |
AoSoA_t & | aosoa, | ||
typename std::enable_if<(is_distributor< Distributor_t >::value &&is_aosoa< AoSoA_t >::value), int >::type * | = 0 ) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Single AoSoA version that will resize in-place. Note that resizing does not necessarily allocate more memory. The AoSoA memory will only increase if not enough has already been reserved/allocated for the needed number of elements.
Migrate moves all data to a new distribution that is uniquely owned - each element will only have a single destination rank.
Distributor_t | Distributor type - must be a distributor. |
AoSoA_t | AoSoA type - must be an AoSoA. |
distributor | The distributor to use for the migration. |
aosoa | The AoSoA containing the data to be migrated. Upon input, must have the same number of elements as the inputs used to construct the distributor. At output, it will be the same size as th enumber of import elements on this rank provided by the distributor. Before using this function, consider reserving enough memory in the data structure so reallocating is not necessary. |
void Cabana::migrate | ( | const Distributor_t & | distributor, |
const AoSoA_t & | src, | ||
AoSoA_t & | dst, | ||
typename std::enable_if<(is_distributor< Distributor_t >::value &&is_aosoa< AoSoA_t >::value), int >::type * | = 0 ) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Multiple AoSoA version.
Migrate moves all data to a new distribution that is uniquely owned - each element will only have a single destination rank.
Distributor_t | Distributor type - must be a distributor. |
AoSoA_t | AoSoA type - must be an AoSoA. |
distributor | The distributor to use for the migration. |
src | The AoSoA containing the data to be migrated. Must have the same number of elements as the inputs used to construct the distributor. |
dst | The AoSoA to which the migrated data will be written. Must be the same size as the number of imports given by the distributor on this rank. Call totalNumImport() on the distributor to get this size value. |
void Cabana::migrate | ( | const Distributor_t & | distributor, |
const Slice_t & | src, | ||
Slice_t & | dst, | ||
typename std::enable_if<(is_distributor< Distributor_t >::value &&is_slice< Slice_t >::value), int >::type * | = 0 ) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Slice version. The user can do this in-place with the same slice but they will need to manage the resizing themselves as we can't resize slices.
Migrate moves all data to a new distribution that is uniquely owned - each element will only have a single destination rank.
Distributor_t | Distributor type - must be a distributor. |
Slice_t | Slice type - must be an Slice. |
distributor | The distributor to use for the migration. |
src | The slice containing the data to be migrated. Must have the same number of elements as the inputs used to construct the distributor. |
dst | The slice to which the migrated data will be written. Must be the same size as the number of imports given by the distributor on this rank. Call totalNumImport() on the distributor to get this size value. |
void Cabana::migrate | ( | ExecutionSpace | exec_space, |
const Distributor_t & | distributor, | ||
AoSoA_t & | aosoa, | ||
typename std::enable_if<(is_distributor< Distributor_t >::value &&is_aosoa< AoSoA_t >::value), int >::type * | = 0 ) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Single AoSoA version that will resize in-place. Note that resizing does not necessarily allocate more memory. The AoSoA memory will only increase if not enough has already been reserved/allocated for the needed number of elements.
Migrate moves all data to a new distribution that is uniquely owned - each element will only have a single destination rank.
ExecutionSpace | Kokkos execution space. |
Distributor_t | Distributor type - must be a distributor. |
AoSoA_t | AoSoA type - must be an AoSoA. |
exec_space | Kokkos execution space. |
distributor | The distributor to use for the migration. |
aosoa | The AoSoA containing the data to be migrated. Upon input, must have the same number of elements as the inputs used to construct the distributor. At output, it will be the same size as th enumber of import elements on this rank provided by the distributor. Before using this function, consider reserving enough memory in the data structure so reallocating is not necessary. |
void Cabana::migrate | ( | ExecutionSpace | exec_space, |
const Distributor_t & | distributor, | ||
const AoSoA_t & | src, | ||
AoSoA_t & | dst, | ||
typename std::enable_if<(is_distributor< Distributor_t >::value &&is_aosoa< AoSoA_t >::value), int >::type * | = 0 ) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Multiple AoSoA version.
Migrate moves all data to a new distribution that is uniquely owned - each element will only have a single destination rank.
ExecutionSpace | Kokkos execution space. |
Distributor_t | Distributor type - must be a distributor. |
AoSoA_t | AoSoA type - must be an AoSoA. |
exec_space | Kokkos execution space. |
distributor | The distributor to use for the migration. |
src | The AoSoA containing the data to be migrated. Must have the same number of elements as the inputs used to construct the distributor. |
dst | The AoSoA to which the migrated data will be written. Must be the same size as the number of imports given by the distributor on this rank. Call totalNumImport() on the distributor to get this size value. |
void Cabana::migrate | ( | ExecutionSpace | , |
const Distributor_t & | distributor, | ||
const Slice_t & | src, | ||
Slice_t & | dst, | ||
typename std::enable_if<(is_distributor< Distributor_t >::value &&is_slice< Slice_t >::value), int >::type * | = 0 ) |
Synchronously migrate data between two different decompositions using the distributor forward communication plan. Slice version. The user can do this in-place with the same slice but they will need to manage the resizing themselves as we can't resize slices.
Migrate moves all data to a new distribution that is uniquely owned - each element will only have a single destination rank.
ExecutionSpace | Kokkos execution space. |
Distributor_t | Distributor type - must be a distributor. |
Slice_t | Slice type - must be an Slice. |
distributor | The distributor to use for the migration. |
src | The slice containing the data to be migrated. Must have the same number of elements as the inputs used to construct the distributor. |
dst | The slice to which the migrated data will be written. Must be the same size as the number of imports given by the distributor on this rank. Call totalNumImport() on the distributor to get this size value. |
|
inline |
Execute functor in parallel according to the execution policy over particles with thread-local serial loops over linked cell list bins and particle first neighbors in those bins.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The linked cell list over which to execute neighbor operations. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_for called by this code and can be used for identification and profiling purposes. |
A "functor" is a class containing the function to execute in parallel, data needed for that execution, and an optional execution_space
typedef. Here is an example functor for neighbor parallel_for:
In the above example, Index
is a Cabana index to a given AoSoA element for a particle and its neighbor. Its operator()
method defines the operation to parallelize, over the range of indices idx=[begin,end]
. This compares to a single iteration idx
of a for
loop.
|
inline |
Execute functor in parallel according to the execution policy over particles with thread-local serial loops over linked cell list bins and team threading over particle first neighbors in those bins.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The linked cell list over which to execute neighbor operations. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_for called by this code and can be used for identification and profiling purposes. |
|
inline |
Execute functor in parallel according to the execution policy over particles with a thread-local serial loop over particle first neighbors.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The neighbor list over which to execute the neighbor operations. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_for called by this code and can be used for identification and profiling purposes. |
A "functor" is a class containing the function to execute in parallel, data needed for that execution, and an optional execution_space
typedef. Here is an example functor for neighbor parallel_for:
In the above example, Index
is a Cabana index to a given AoSoA element for a particle and its neighbor. Its operator()
method defines the operation to parallelize, over the range of indices idx=[begin,end]
. This compares to a single iteration idx
of a for
loop.
|
inline |
Execute functor in parallel according to the execution policy over particles with team parallelism over particle first neighbors.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The neighbor list over which to execute the neighbor operations. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_for called by this code and can be used for identification and profiling purposes. |
|
inline |
Execute functor in parallel according to the execution policy over particles with thread-local serial loops over particle first and second neighbors.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The neighbor list over which to execute the neighbor operations. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_for called by this code and can be used for identification and profiling purposes. |
|
inline |
Execute functor in parallel according to the execution policy over particles with team parallelism over particle first neighbors and serial loop over second neighbors.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The neighbor list over which to execute the neighbor operations. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_for called by this code and can be used for identification and profiling purposes. |
|
inline |
Execute functor in parallel according to the execution policy over particles with team parallelism over particle first neighbors and vector loop parallelism over second neighbors.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The neighbor list over which to execute the neighbor operations. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_for called by this code and can be used for identification and profiling purposes. |
|
inline |
Execute functor in parallel according to the execution policy over particles with thread-local serial loops over linked cell list bins and particle first neighbors in those bins.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The linked cell list over which to execute neighbor operations. |
reduce_val | the value begin reduced |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_for called by this code and can be used for identification and profiling purposes. |
A "functor" is a class containing the function to execute in parallel, data needed for that execution, and an optional execution_space
typedef. Here is an example functor for neighbor parallel_for:
In the above example, Index
is a Cabana index to a given AoSoA element for a particle and its neighbor. Its operator()
method defines the operation to parallelize, over the range of indices idx=[begin,end]
. This compares to a single iteration idx
of a for
loop.
|
inline |
Execute functor in parallel according to the execution policy over particles with thread-local serial loops over linked cell list bins and team threading over particle first neighbors in those bins.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The linked cell list over which to execute neighbor operations. |
reduce_val | the value begin reduced |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_for called by this code and can be used for identification and profiling purposes. |
|
inline |
Execute functor reduction in parallel according to the execution policy over particles with a thread-local serial loop over particle first neighbors.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
ReduceType | The reduction type. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The neighbor list over which to execute the neighbor operations. |
reduce_val | Scalar to be reduced across particles and neighbors. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_reduce called by this code and can be used for identification and profiling purposes. |
A "functor" is a class containing the function to execute in parallel, data needed for that execution, and an optional execution_space
typedef. Here is an example functor for neighbor parallel_for:
In the above example, Index
is a Cabana index to a given AoSoA element for a particle and its neighbor. Its operator()
method defines the operation to parallelize, over the range of indices idx=[begin,end]
. This compares to a single iteration idx
of a for
loop.
|
inline |
Execute functor reduction in parallel according to the execution policy over particles with team parallelism over particle first neighbors.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
ReduceType | The reduction type. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The neighbor list over which to execute the neighbor operations. |
reduce_val | Scalar to be reduced across particles and neighbors. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_reduce called by this code and can be used for identification and profiling purposes. |
|
inline |
Execute functor reduction in parallel according to the execution policy over particles with thread-local serial loops over particle first and second neighbors.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
ReduceType | The reduction type. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The neighbor list over which to execute the neighbor operations. |
reduce_val | Scalar to be reduced across particles and neighbors. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_reduce called by this code and can be used for identification and profiling purposes. |
|
inline |
Execute functor reduction in parallel according to the execution policy over particles with team parallelism over particle first neighbors and serial loop over second neighbors.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
ReduceType | The reduction type. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The neighbor list over which to execute the neighbor operations. |
reduce_val | Scalar to be reduced across particles and neighbors. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_reduce called by this code and can be used for identification and profiling purposes. |
|
inline |
Execute functor reduction in parallel according to the execution policy over particles with team parallelism over particle first neighbors and vector loop parallelism over second neighbors.
FunctorType | The functor type to execute. |
NeighborListType | The neighbor list type. |
ExecParams | The Kokkos range policy parameters. |
ReduceType | The reduction type. |
exec_policy | The policy over which to execute the functor. |
functor | The functor to execute in parallel |
list | The neighbor list over which to execute the neighbor operations. |
reduce_val | Scalar to be reduced across particles and neighbors. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_reduce called by this code and can be used for identification and profiling purposes. |
Kokkos::View< int *[2], typename ListType::memory_space > Cabana::neighborHistogram | ( | ExecutionSpace | exec_space, |
const std::size_t | num_particles, | ||
const ListType & | list, | ||
const int | num_bin ) |
Construct a histogram of neighbors per particle.
exec_space | Kokkos execution space. |
num_particles | Number of particles. |
list | Neighbor list with valid NeighborList interface. |
num_bin | Number of bins for the histogram. |
void Cabana::permute | ( | const BinningDataType & | binning_data, |
AoSoA_t & | aosoa, | ||
typename std::enable_if<(is_binning_data< BinningDataType >::value &&is_aosoa< AoSoA_t >::value), int >::type * | = 0 ) |
void Cabana::permute | ( | const BinningDataType & | binning_data, |
SliceType & | slice, | ||
typename std::enable_if<(is_binning_data< BinningDataType >::value &&is_slice< SliceType >::value), int >::type * | = 0 ) |
Given binning data permute a slice.
BinningDataType | The binning data type. |
SliceType | The slice type. |
binning_data | The binning data. |
slice | The slice to permute. |
void Cabana::permute | ( | const BinningDataType & | binning_data, |
ViewType & | view, | ||
typename std::enable_if<(is_binning_data< BinningDataType >::value &&Kokkos::is_view< ViewType >::value), int >::type * | = 0 ) |
Given binning data permute a View.
BinningDataType | The binning data type. |
ViewType | The view type. |
binning_data | The binning data. |
view | The view to permute. |
void Cabana::permute | ( | LinkedCellListType & | linked_cell_list, |
PositionType & | positions, | ||
typename std::enable_if<(is_linked_cell_list< LinkedCellListType >::value &&(is_aosoa< PositionType >::value||is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value)), int >::type * | = 0 ) |
void Cabana::remove | ( | const ExecutionSpace & | exec_space, |
const int | num_keep, | ||
const KeepView & | keep_particle, | ||
ParticleAoSoA & | particles, | ||
const int | num_particles_ignore = 0, | ||
const bool | shrink_to_fit = true ) |
Filter out empty/unneeded particles.
exec_space | Kokkos execution space. |
num_keep | The total number of particles in the compaction section to keep. |
num_particles_ignore | The number of particles to ignore (which precede those which may be kept/removed). |
keep_particle | Boolean Kokkos View of particles to keep (true) or remove (false). |
particles | The AoSoA containing particles. |
shrink_to_fit | Whether to remove additional AoSoA capacity or not. |
void Cabana::scatter | ( | const HaloType & | halo, |
SliceType & | slice, | ||
typename std::enable_if<(is_halo< HaloType >::value &&is_slice< SliceType >::value), int >::type * | = 0 ) |
Synchronously scatter data from the ghosts to the local decomposition of a slice using the halo reverse communication plan. This is a multiply-owned to uniquely owned communication.
halo | The halo to use for the scatter. |
slice | The Slice on which to perform the scatter. The Slice should have a size equivalent to halo.numGhost() + halo.numLocal(). The locally owned elements are expected to appear first (i.e. in the first halo.numLocal() elements) and the ghosted elements are expected to appear second (i.e. in the next halo.numGhost() elements()). |
|
inline |
Execute a vectorized functor in parallel with a 2d execution policy.
FunctorType | The functor type to execute. |
VectorLength | The length of the vector over which to execute the vectorized code. |
ExecParameters | Execution policy parameters. |
exec_policy | The 2D range policy over which to execute the functor. |
functor | The vectorized functor to execute in parallel. Must accept both a struct and array index. |
str | Optional name for the functor. Will be forwarded if non-empty to the Kokkos::parallel_for called by this code and can be used for identification and profiling purposes. |
A "functor" is a callable object containing the function to execute in parallel, data needed for that execution, and an optional execution_space
typedef. Here is an example functor for parallel_for:
In the above example, struct
defines an index to a given AoSoA/Slice struct and array defines and index to the given array element in that struct. Its operator()
method defines the operation to parallelize, over the range of indices idx=[begin,end]
. The kernel represented by the functor is intended to vectorize of the array index.
AoSoA_t::template member_slice_type< M > Cabana::slice | ( | const AoSoA_t & | aosoa, |
const std::string & | slice_label = "" ) |
auto Cabana::sortByKey | ( | KeyViewType | keys, |
const std::size_t | begin, | ||
const std::size_t | end, | ||
typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type * | = 0 ) |
Sort an AoSoA over a subset of its range based on the associated key values.
KeyViewType | The Kokkos::View type for keys. |
keys | The key values to use for sorting. A key value is needed for every element of the AoSoA. |
begin | The beginning index of the AoSoA range to sort. |
end | The end index of the AoSoA range to sort. |
auto Cabana::sortByKey | ( | KeyViewType | keys, |
typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type * | = 0 ) |
auto Cabana::sortByKey | ( | SliceType | slice, |
const std::size_t | begin, | ||
const std::size_t | end, | ||
typename std::enable_if<(is_slice< SliceType >::value), int >::type * | = 0 ) |
Sort an AoSoA over a subset of its range based on the associated slice of keys.
SliceType | Slice type for keys. |
slice | Slice of keys. |
begin | The beginning index of the AoSoA range to sort. |
end | The end index of the AoSoA range to sort. |
auto Cabana::sortByKey | ( | SliceType | slice, |
typename std::enable_if<(is_slice< SliceType >::value), int >::type * | = 0 ) |
auto Cabana::sortByKeyWithComparator | ( | KeyViewType | keys, |
Comparator | comp, | ||
const std::size_t | begin, | ||
const std::size_t | end, | ||
typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type * | = 0 ) |
Sort an AoSoA over a subset of its range using a general comparator over the given Kokkos View of keys.
KeyViewType | The Kokkos::View type for keys. |
Comparator | Kokkos::BinSort compatible comparator type. |
keys | The key values to use for sorting. A key value is needed for every element of the AoSoA. |
comp | The comparator to use for sorting. Must be compatible with Kokkos::BinSort. |
begin | The beginning index of the AoSoA range to sort. |
end | The end index of the AoSoA range to sort. |
auto Cabana::sortByKeyWithComparator | ( | KeyViewType | keys, |
Comparator | comp, | ||
typename std::enable_if<(Kokkos::is_view< KeyViewType >::value), int >::type * | = 0 ) |
Sort an entire AoSoA using a general comparator over the given Kokkos View of keys.
KeyViewType | The Kokkos::View type for keys. |
Comparator | Kokkos::BinSort compatible comparator type. |
keys | The key values to use for sorting. A key value is needed for every element of the AoSoA. |
comp | The comparator to use for sorting. Must be compatible with Kokkos::BinSort. |