|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
|
Classes | |
| class | AdaptBins |
| A class that bins particles in energy bins and allows for adaptive runtime rebinning. More... | |
| struct | DeviceViewTraits |
| Traits class to extract host and device view types from a given ViewType. More... | |
| struct | DeviceViewTraits< true, ViewType > |
| Specialization of DeviceViewTraits for when DualView is used. More... | |
| struct | DeviceViewTraits< false, ViewType > |
| Specialization of DeviceViewTraits for when DualView is not used. More... | |
| class | Histogram |
| Template class providing adaptive particle histogram binning with support for Kokkos Views and DualViews. More... | |
| struct | CoordinateSelector |
| Example struct used to access the binning variable for each particle. More... | |
| struct | ArrayReduction |
| A templated structure for performing array-based reductions in parallel computations. More... | |
| struct | ReductionVariantHelper |
| Primary template for generating std::variant types containing ArrayReduction specializations. More... | |
| struct | ReductionVariantHelper< SizeType, IndexType, std::integer_sequence< IndexType, Sizes... > > |
| Specialized template that expands std::integer_sequence to create a variant of ArrayReduction types. More... | |
| struct | HostArrayReduction |
| Host-only array reduction structure for dynamic array sizes in Kokkos::parallel_reduce. More... | |
Typedefs | |
| template<typename SizeType, typename IndexType> | |
| using | ReductionVariant = typename ReductionVariantHelper<SizeType, IndexType, std::make_integer_sequence<IndexType, maxArrSize<IndexType>>>::type |
| Type alias for a std::variant containing all possible ArrayReduction types up to maxArrSize. | |
Enumerations | |
| enum class | HistoReductionMode { Standard , ParallelReduce , TeamBased , HostOnly } |
Functions | |
| template<typename bin_index_type> | |
| HistoReductionMode | determineHistoReductionMode (HistoReductionMode modePreference, bin_index_type binCount) |
| Determines the appropriate histogram reduction mode based on user preference, bin count, and execution environment. | |
| template<typename ViewType> | |
| void | computeFixSum (const ViewType &input_view, const ViewType &post_sum_view) |
| Computes the post- or prefix-sum of the input view and stores the result in the ...-sum view. | |
| template<typename ValueType, typename SizeType, typename HashType> | |
| bool | viewIsSorted (const Kokkos::View< ValueType * > view, HashType indices, SizeType npart) |
| Checks if the elements in a Kokkos::View are sorted in non-decreasing order. | |
| template<typename SizeType, typename IndexType, IndexType N> | |
| ReductionVariant< SizeType, IndexType > | createReductionObjectHelper (IndexType binCount) |
| Recursive helper function to create ArrayReduction objects with compile-time size matching. | |
| template<typename SizeType, typename IndexType> | |
| ReductionVariant< SizeType, IndexType > | createReductionObject (IndexType binCount) |
| Factory function to create ArrayReduction objects with runtime-specified size. | |
| template<typename T, unsigned Dim> | |
| T | vnorm (const VField_t< T, Dim > &field, int p=2) |
| Computes the (p)-norm of a vector field (for debugging purpose). | |
Variables | |
| template<typename IndexType> | |
| constexpr IndexType | maxArrSize = 5 |
| Maximum allowed array size for compile-time array reduction types. | |
| template<typename SizeType, typename IndexType> | |
| IndexType | HostArrayReduction< SizeType, IndexType >::binCountStatic = 10 |
| Static member initialization for the array size variable. | |
| struct ParticleBinning::DeviceViewTraits |
Traits class to extract host and device view types from a given ViewType.
This primary template is specialized based on the UseDualView boolean flag.
| UseDualView | Flag indicating whether Kokkos::DualView is used. |
| ViewType | The original view type (e.g., Kokkos::View or Kokkos::DualView). |
Definition at line 20 of file BinHisto.h.
| struct ParticleBinning::DeviceViewTraits< true, ViewType > |
Specialization of DeviceViewTraits for when DualView is used.
Definition at line 26 of file BinHisto.h.
| Class Members | ||
|---|---|---|
| typedef typename t_dev | d_type typename ViewType::t_dev | |
| typedef typename t_host | h_type typename ViewType::t_host | |
| struct ParticleBinning::DeviceViewTraits< false, ViewType > |
Specialization of DeviceViewTraits for when DualView is not used.
Definition at line 35 of file BinHisto.h.
| Class Members | ||
|---|---|---|
| typedef ViewType | d_type ViewType | |
| typedef ViewType | h_type ViewType | |
| struct ParticleBinning::ReductionVariantHelper |
Primary template for generating std::variant types containing ArrayReduction specializations.
This template is not used directly but serves as the base for the specialized version. It works in conjunction with std::integer_sequence to generate a variant containing ArrayReduction types with sizes from 1 to maxArrSize.
This is necessary to pre-compile types for histogram reduction on device.
| SizeType | The type used for array elements in the reduction operations. |
| IndexType | The type used for array indexing. |
| Sequence | A std::integer_sequence type that will be expanded in the specialization. |
Definition at line 97 of file ParallelReduceTools.h.
| struct ParticleBinning::ReductionVariantHelper< SizeType, IndexType, std::integer_sequence< IndexType, Sizes... > > |
Specialized template that expands std::integer_sequence to create a variant of ArrayReduction types.
This specialization takes a std::integer_sequence and expands it into a std::variant containing ArrayReduction types with consecutive sizes. Each size in the sequence is incremented by 1 to create ArrayReduction<SizeType, IndexType, Sizes + 1>.
| SizeType | The type used for array elements in the reduction operations. |
| IndexType | The type used for array indexing. |
| Sizes... | Parameter pack of integer values from the std::integer_sequence. |
Definition at line 111 of file ParallelReduceTools.h.
| Class Members | ||
|---|---|---|
| typedef variant< ArrayReduction< SizeType, IndexType, Sizes+1 >... > | type std::variant<ArrayReduction<SizeType, IndexType, Sizes + 1>...> | |
| using ParticleBinning::ReductionVariant = typename ReductionVariantHelper<SizeType, IndexType, std::make_integer_sequence<IndexType, maxArrSize<IndexType>>>::type |
Type alias for a std::variant containing all possible ArrayReduction types up to maxArrSize.
This alias creates a variant that can hold ArrayReduction objects with sizes from 1 to maxArrSize. It uses ReductionVariantHelper with std::make_integer_sequence to generate all variants type at compile time.
| SizeType | The type used for array elements in the reduction operations. |
| IndexType | The type used for array indexing and size specification. |
Definition at line 126 of file ParallelReduceTools.h.
|
strong |
| Enumerator | |
|---|---|
| Standard | |
| ParallelReduce | |
| TeamBased | |
| HostOnly | |
Definition at line 11 of file ParallelReduceTools.h.
| void ParticleBinning::computeFixSum | ( | const ViewType & | input_view, |
| const ViewType & | post_sum_view ) |
Computes the post- or prefix-sum of the input view and stores the result in the ...-sum view.
| SizeType | The type of the elements in the input and ...-sum views. |
| input_view | The input view containing the elements to be summed. |
| post_sum_view | The output view where the ...-sum results will be stored. It must have a size of input_view.extent(0) + 1. |
| postSum | If true, the post-sum is computed; otherwise, the prefix-sum is computed. |
| `ippl::Comm->abort();` | if the size of the post_sum_view is not equal to input_view.extent(0) + 1. |
Definition at line 140 of file BinningTools.h.
Referenced by ParticleBinning::Histogram< size_type, bin_index_type, value_type, true >::initPostSum().
| ReductionVariant< SizeType, IndexType > ParticleBinning::createReductionObject | ( | IndexType | binCount | ) |
Factory function to create ArrayReduction objects with runtime-specified size.
This function provides an interface for creating ArrayReduction objects where the array size is determined at runtime. It internally uses compile-time template recursion to match the runtime binCount with the template specialization.
This allows using "runtime sized arrays" as reducer objects inside a Kokkos kernel on device.
| SizeType | The type used for array elements in the reduction operations. |
| IndexType | The type used for array indexing. |
| binCount | The desired number of bins for the reduction array (must be $\leq$ maxArrSize). |
| `std::out_of_range` | If binCount exceeds maxArrSize or is less than 1. |
Example usage (also see implementation of AdaptBins::initLocalHisto()):
Definition at line 186 of file ParallelReduceTools.h.
References createReductionObjectHelper().
| ReductionVariant< SizeType, IndexType > ParticleBinning::createReductionObjectHelper | ( | IndexType | binCount | ) |
Recursive helper function to create ArrayReduction objects with compile-time size matching.
This function uses compile-time recursion to find and instantiate the correct ArrayReduction type based on the requested binCount. It recursively increments the template parameter N until it matches binCount, then returns the appropriate ArrayReduction instance.
| SizeType | The type used for array elements in the reduction operations. |
| IndexType | The type used for array indexing. |
| N | Current array size being tested in the recursive search. |
| binCount | The desired number of bins for the reduction array. |
| `std::out_of_range` | If binCount exceeds maxArrSize. |
Definition at line 148 of file ParallelReduceTools.h.
References createReductionObjectHelper(), and maxArrSize.
Referenced by createReductionObject(), and createReductionObjectHelper().
| HistoReductionMode ParticleBinning::determineHistoReductionMode | ( | HistoReductionMode | modePreference, |
| bin_index_type | binCount ) |
Determines the appropriate histogram reduction mode based on user preference, bin count, and execution environment.
This function selects the optimal histogram reduction method. If the code is compiled with a host execution space (e.g., Serial or OpenMP), it forces the reduction mode to HistoReductionMode::HostOnly, disregarding the user's preference. Otherwise, if the user preference is HistoReductionMode::Standard, it automatically chooses between ParallelReduce or TeamBased based on the binCount. If a specific preference is provided (not Standard), that preference is respected.
| modePreference | The user's preferred reduction mode.
|
HostOnly if the default execution space is a host space.
ParallelReduce if binCount is within maxArrSize<bin_index_type>.
TeamBased if binCount exceeds maxArrSize<bin_index_type>.
Otherwise, respects the specified modePreference.
Definition at line 33 of file BinningTools.h.
References HostOnly, maxArrSize, ParallelReduce, Standard, and TeamBased.
| bool ParticleBinning::viewIsSorted | ( | const Kokkos::View< ValueType * > | view, |
| HashType | indices, | ||
| SizeType | npart ) |
Checks if the elements in a Kokkos::View are sorted in non-decreasing order.
| ValueType | The type of the elements in the Kokkos::View so be checked. |
| SizeType | The type used for indexing and size. |
| view | The Kokkos::View containing the elements to be checked. |
| indices | Argsort of view. |
| npart | The number of elements in the view to be checked. |
Definition at line 182 of file BinningTools.h.
| T ParticleBinning::vnorm | ( | const VField_t< T, Dim > & | field, |
| int | p = 2 ) |
Computes the (p)-norm of a vector field (for debugging purpose).
| field | The input vector field. |
| p | The order of the norm (default is 2 for Euclidean norm). |
Definition at line 322 of file ParallelReduceTools.h.
| IndexType ParticleBinning::HostArrayReduction< SizeType, IndexType >::binCountStatic = 10 |
Static member initialization for the array size variable.
This line provides the definition and default initialization for the static member binCountStatic. The default value of 10 serves as a place holder and should be overridden based on the required histogram size.
| SizeType | The type used for array elements. |
| IndexType | The type used for indexing and size specification. |
Definition at line 310 of file ParallelReduceTools.h.
|
constexpr |
Maximum allowed array size for compile-time array reduction types.
This constexpr variable defines the upper limit for statically-sized array reductions that are used in parallel histogram reductions. For small histograms, this is prefereable to pure atomics. However, for large values, compile time is increased significantly.
| IndexType | The type used for array indexing and size specification. |
Definition at line 81 of file ParallelReduceTools.h.
Referenced by createReductionObjectHelper(), and determineHistoReductionMode().