AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
autopas::VLCSlicedBalancedTraversal< ParticleCell, PairwiseFunctor, NeighborList > Class Template Reference

This class provides the balanced sliced traversal. More...

#include <VLCSlicedBalancedTraversal.h>

Inheritance diagram for autopas::VLCSlicedBalancedTraversal< ParticleCell, PairwiseFunctor, NeighborList >:
Inheritance graph
[legend]
Collaboration diagram for autopas::VLCSlicedBalancedTraversal< ParticleCell, PairwiseFunctor, NeighborList >:
Collaboration graph
[legend]

Public Member Functions

 VLCSlicedBalancedTraversal (const std::array< unsigned long, 3 > &dims, PairwiseFunctor *pairwiseFunctor, double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3, ContainerOption::Value typeOfList)
 Constructor of the balanced sliced traversal.
 
void traverseParticles () override
 Traverse the particles by pairs, triplets etc.
 
TraversalOption getTraversalType () const override
 Return a enum representing the name of the traversal class.
 
bool isApplicable () const override
 Checks if the traversal is applicable to the current state of the domain.
 
void setSortingThreshold (size_t sortingThreshold) override
 Set the sorting-threshold for traversals that use the CellFunctor If the sum of the number of particles in two cells is greater or equal to that value, the CellFunctor creates a sorted view of the particles to avoid unnecessary distance checks.
 
- Public Member Functions inherited from autopas::SlicedBalancedBasedTraversal< ParticleCell, PairwiseFunctor >
 SlicedBalancedBasedTraversal (const std::array< unsigned long, 3 > &dims, PairwiseFunctor *functor, const double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3, bool spaciallyForward)
 Constructor of the balanced sliced traversal.
 
void initSliceThickness (unsigned long minSliceThickness) override
 Calculates slice thickness according to estimates loads.
 
- Public Member Functions inherited from autopas::SlicedLockBasedTraversal< ParticleCell, Functor >
 SlicedLockBasedTraversal (const std::array< unsigned long, 3 > &dims, Functor *functor, const double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3, bool spaciallyForward)
 Constructor of the sliced traversal.
 
- Public Member Functions inherited from autopas::SlicedBasedTraversal< ParticleCell, Functor >
 SlicedBasedTraversal (const std::array< unsigned long, 3 > &dims, Functor *functor, const double interactionLength, const std::array< double, 3 > &cellLength, DataLayoutOption dataLayout, bool useNewton3, bool spaciallyForward)
 Constructor of the sliced traversal.
 
bool isApplicable () const override
 Checks if the traversal is applicable to the current state of the domain.
 
virtual void initSliceThickness (unsigned long minSliceThickness)
 Sets up the slice thicknesses to create as many slices as possible while respecting minSliceThickness.
 
void initTraversal () override
 Load Data Layouts and sets up slice thicknesses.
 
void endTraversal () override
 Write Data to AoS if cells have been set through setCellsToTraverse().
 
- Public Member Functions inherited from autopas::CellTraversal< ParticleCell >
 CellTraversal (const std::array< unsigned long, 3 > &dims)
 Constructor of CellTraversal.
 
virtual ~CellTraversal ()=default
 Destructor of CellTraversal.
 
virtual void setCellsToTraverse (std::vector< ParticleCell > &cells)
 Sets the cells to iterate over.
 
virtual void setSortingThreshold (size_t sortingThreshold)=0
 Set the sorting-threshold for traversals that use the CellFunctor If the sum of the number of particles in two cells is greater or equal to that value, the CellFunctor creates a sorted view of the particles to avoid unnecessary distance checks.
 
- Public Member Functions inherited from autopas::TraversalInterface
virtual ~TraversalInterface ()=default
 Destructor of TraversalInterface.
 
 TraversalInterface (DataLayoutOption dataLayout, bool useNewton3)
 Constructor of the TraversalInterface.
 
virtual TraversalOption getTraversalType () const =0
 Return a enum representing the name of the traversal class.
 
virtual bool isApplicable () const =0
 Checks if the traversal is applicable to the current state of the domain.
 
virtual void initTraversal ()=0
 Initializes the traversal.
 
virtual void traverseParticles ()=0
 Traverse the particles by pairs, triplets etc.
 
virtual void endTraversal ()=0
 Finalizes the traversal.
 
bool getUseNewton3 () const
 Return whether the traversal uses newton 3.
 
DataLayoutOption getDataLayout () const
 Return the data layout option.
 
- Public Member Functions inherited from autopas::BalancedTraversal
void setLoadEstimator (EstimatorFunction loadEstimator)
 Setter for load estimation algorithm.
 
- Public Member Functions inherited from autopas::VLCTraversalInterface< ParticleCell::ParticleType, NeighborList >
 VLCTraversalInterface (ContainerOption typeOfList)
 Constructor of the VLCTraversalInterface.
 
virtual void setVerletList (NeighborList &verlet)
 Sets the verlet list for the traversal to iterate over.
 

Additional Inherited Members

- Public Types inherited from autopas::BalancedTraversal
using EstimatorFunction = std::function< unsigned long(const std::array< unsigned long, 3 > &, const std::array< unsigned long, 3 > &, const std::array< unsigned long, 3 > &)>
 Type signature for load estimators.
 
- Protected Member Functions inherited from autopas::SlicedLockBasedTraversal< ParticleCell, Functor >
template<typename LoopBody >
void slicedTraversal (LoopBody &&loopBody)
 The main traversal of the sliced traversal.
 
- Protected Member Functions inherited from autopas::SlicedBasedTraversal< ParticleCell, Functor >
void init (const std::array< unsigned long, 3 > &dims)
 Resets the cell structure of the traversal.
 
virtual void loadDataLayout ()
 Load Data Layouts required for this Traversal if cells have been set through setCellsToTraverse().
 
- Protected Member Functions inherited from autopas::VLCTraversalInterface< ParticleCell::ParticleType, NeighborList >
void processCellLists (NeighborList &neighborLists, unsigned long cellIndex, PairwiseFunctor *pairwiseFunctor, DataLayoutOption dataLayout, bool useNewton3)
 Iterate over all neighbor lists list of a given cell.
 
void loadSoA (PairwiseFunctor *pairwiseFunctor, NeighborList &neighborLists)
 Load the SoA from the respective neighbor list.
 
void extractSoA (PairwiseFunctor *pairwiseFunctor, NeighborList &neighborLists)
 Extract the SoA from the respective neighbor list.
 
- Protected Attributes inherited from autopas::SlicedLockBasedTraversal< ParticleCell, Functor >
bool _dynamic = true
 whether to use static or dynamic scheduling.
 
- Protected Attributes inherited from autopas::SlicedBasedTraversal< ParticleCell, Functor >
std::array< unsigned long, 3 > _overlap
 Overlap of interacting cells.
 
std::array< int, 3 > _dimsPerLength
 Store ids of dimensions ordered by number of cells per dimensions.
 
unsigned long _overlapLongestAxis
 Overlap of interacting cells along the longest axis.
 
std::vector< unsigned long > _sliceThickness
 The number of cells per slice in the dimension that was sliced.
 
bool _spaciallyForward
 Whether the base step only covers neigboring cells tha are spacially forward (for example c08).
 
- Protected Attributes inherited from autopas::CellTraversal< ParticleCell >
std::array< unsigned long, 3 > _cellsPerDimension
 The dimensions of the cellblock.
 
std::vector< ParticleCell > * _cells
 The cells to traverse.
 
- Protected Attributes inherited from autopas::TraversalInterface
DataLayoutOption _dataLayout
 The datalayout used by this traversal.
 
bool _useNewton3
 If this traversal makes use of newton3.
 
- Protected Attributes inherited from autopas::BalancedTraversal
EstimatorFunction _loadEstimator
 Algorithm to use for estimating load.
 
- Protected Attributes inherited from autopas::VLCTraversalInterface< ParticleCell::ParticleType, NeighborList >
NeighborList * _verletList
 The verlet list to iterate over.
 
SoA< typename Particle_T::SoAArraysType > * _soa
 Structure of arrays to be used if the data layout is SoA.
 
ContainerOption _typeOfList
 The type of neighbor list as an enum value.
 

Detailed Description

template<class ParticleCell, class PairwiseFunctor, class NeighborList>
class autopas::VLCSlicedBalancedTraversal< ParticleCell, PairwiseFunctor, NeighborList >

This class provides the balanced sliced traversal.

The traversal finds the longest dimension of the simulation domain and cuts the domain along this dimension in one slice (block) per thread. The cut positions are calculated to even out load among the threads. Slices are assigned to the threads in a round robin fashion. Each thread locks the cells on the boundary wall to the previous slice with one lock. This lock is lifted as soon the boundary wall is fully processed.

Template Parameters
ParticleCellthe type of cells
PairwiseFunctorThe functor that defines the interaction of two particles.
NeighborListtype of the neighbor list

Constructor & Destructor Documentation

◆ VLCSlicedBalancedTraversal()

template<class ParticleCell , class PairwiseFunctor , class NeighborList >
autopas::VLCSlicedBalancedTraversal< ParticleCell, PairwiseFunctor, NeighborList >::VLCSlicedBalancedTraversal ( const std::array< unsigned long, 3 > &  dims,
PairwiseFunctor pairwiseFunctor,
double  interactionLength,
const std::array< double, 3 > &  cellLength,
DataLayoutOption  dataLayout,
bool  useNewton3,
ContainerOption::Value  typeOfList 
)
inlineexplicit

Constructor of the balanced sliced traversal.

Parameters
dimsThe dimensions of the cellblock, i.e. the number of cells in x, y and z direction.
interactionLengthcutoff + skin
cellLengthlength of the underlying cells
pairwiseFunctorThe functor that defines the interaction of two particles.
dataLayout
useNewton3
typeOfListindicates the type of neighbor list as an enum value, currently only used for getTraversalType

Member Function Documentation

◆ getTraversalType()

template<class ParticleCell , class PairwiseFunctor , class NeighborList >
TraversalOption autopas::VLCSlicedBalancedTraversal< ParticleCell, PairwiseFunctor, NeighborList >::getTraversalType ( ) const
inlineoverridevirtual

Return a enum representing the name of the traversal class.

Returns
Enum representing traversal.

Implements autopas::TraversalInterface.

◆ isApplicable()

template<class ParticleCell , class PairwiseFunctor , class NeighborList >
bool autopas::VLCSlicedBalancedTraversal< ParticleCell, PairwiseFunctor, NeighborList >::isApplicable ( ) const
inlineoverridevirtual

Checks if the traversal is applicable to the current state of the domain.

Returns
true iff the traversal can be applied.

Reimplemented from autopas::SlicedBasedTraversal< ParticleCell, Functor >.

◆ setSortingThreshold()

template<class ParticleCell , class PairwiseFunctor , class NeighborList >
void autopas::VLCSlicedBalancedTraversal< ParticleCell, PairwiseFunctor, NeighborList >::setSortingThreshold ( size_t  sortingThreshold)
inlineoverridevirtual

Set the sorting-threshold for traversals that use the CellFunctor If the sum of the number of particles in two cells is greater or equal to that value, the CellFunctor creates a sorted view of the particles to avoid unnecessary distance checks.

Parameters
sortingThresholdSum of the number of particles in two cells from which sorting should be enabled This traversal does not use the CellFunctor, so the function has no effect here

Implements autopas::CellTraversal< ParticleCell >.

◆ traverseParticles()

template<class ParticleCell , class PairwiseFunctor , class NeighborList >
void autopas::VLCSlicedBalancedTraversal< ParticleCell, PairwiseFunctor, NeighborList >::traverseParticles ( )
inlineoverridevirtual

Traverse the particles by pairs, triplets etc.

as determined by the Functor type.

Implements autopas::TraversalInterface.


The documentation for this class was generated from the following file: