AutoPas  3.0.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
autopas::utils::ConfigurationAndRankIteratorHandler Class Reference

Functionality needed to iterate through ranks and configurations simultaneously in an evenly distributed manner. More...

#include <ConfigurationAndRankIteratorHandler.h>

Public Member Functions

 ConfigurationAndRankIteratorHandler (const std::set< ContainerOption > &containerOptions, const std::set< double > &cellSizeFactors, const std::set< TraversalOption > &traversalOptions, const std::set< LoadEstimatorOption > &loadEstimatorOptions, const std::set< DataLayoutOption > &dataLayoutOptions, const std::set< Newton3Option > &newton3Options, const InteractionTypeOption &interactionType, const int numConfigs, const int commSize)
 Constructor for ConfigurationAndRankIteratorHandler.
 
void advanceIterators (int numConfigs, int commSize)
 Advances the rankIterator (getRankIterator()) and/or the Option iterators for a single step such that repeated.
 
void reset (const int numConfigs, const int commSize)
 Resets all iterators to the beginning, while keeping the containers.
 
void getConfigIterators (std::set< ContainerOption >::iterator &containerIt, std::set< double >::iterator &cellSizeFactorIt, std::set< TraversalOption >::iterator &traversalIt, std::set< LoadEstimatorOption >::iterator &loadEstimatorIt, std::set< DataLayoutOption >::iterator &dataLayoutIt, std::set< Newton3Option >::iterator &newton3It)
 Alternative getter for all Configuration iterators.
 
int getRankIterator () const
 Getter for the rankIterator.
 
int getInfiniteCellSizeFactorsOffset () const
 Getter for the number of ranks smaller than getRankIterator that have the exact same configs assigned to them.
 
int getInfiniteCellSizeFactorsBlockSize () const
 Getter for the number of ranks in total that have the exact same configs assigned to them.
 
std::set< ContainerOption >::iterator getContainerIterator () const
 Getter for containerIterator.
 
std::set< double >::iterator getCellSizeFactorIterator () const
 Getter for the CellSizeFactorIterator.
 
std::set< TraversalOption >::iterator getTraversalIterator () const
 Getter for the TraversalIterator.
 
std::set< LoadEstimatorOption >::iterator getLoadEstimatorIterator () const
 Getter for the LoadEstimatorIterator.
 
std::set< DataLayoutOption >::iterator getDataLayoutIterator () const
 Getter for the DataLayoutIterator.
 
std::set< Newton3Option >::iterator getNewton3Iterator () const
 Getter for the Newton3Iterator.
 

Detailed Description

Functionality needed to iterate through ranks and configurations simultaneously in an evenly distributed manner.

If more configurations than ranks exist, each configuration is paired with a single rank. If more ranks exist, it's the other way around. Since it cannot traverse infinite sets of CellSizeFactors, it provides information for splitting those among configurations if more ranks than configurations exist.

Constructor & Destructor Documentation

◆ ConfigurationAndRankIteratorHandler()

autopas::utils::ConfigurationAndRankIteratorHandler::ConfigurationAndRankIteratorHandler ( const std::set< ContainerOption > &  containerOptions,
const std::set< double > &  cellSizeFactors,
const std::set< TraversalOption > &  traversalOptions,
const std::set< LoadEstimatorOption > &  loadEstimatorOptions,
const std::set< DataLayoutOption > &  dataLayoutOptions,
const std::set< Newton3Option > &  newton3Options,
const InteractionTypeOption &  interactionType,
const int  numConfigs,
const int  commSize 
)
inline

Constructor for ConfigurationAndRankIteratorHandler.

Parameters
containerOptions
cellSizeFactors
traversalOptions
loadEstimatorOptions
dataLayoutOptions
newton3Options
interactionType
numConfigs
commSize

Member Function Documentation

◆ advanceIterators()

void autopas::utils::ConfigurationAndRankIteratorHandler::advanceIterators ( int  numConfigs,
int  commSize 
)

Advances the rankIterator (getRankIterator()) and/or the Option iterators for a single step such that repeated.

execution of this function ends up in both reaching their respective ends simultaneously.

Parameters
numConfigs
commSize

◆ getCellSizeFactorIterator()

std::set< double >::iterator autopas::utils::ConfigurationAndRankIteratorHandler::getCellSizeFactorIterator ( ) const
inline

Getter for the CellSizeFactorIterator.

Returns

◆ getConfigIterators()

void autopas::utils::ConfigurationAndRankIteratorHandler::getConfigIterators ( std::set< ContainerOption >::iterator &  containerIt,
std::set< double >::iterator &  cellSizeFactorIt,
std::set< TraversalOption >::iterator &  traversalIt,
std::set< LoadEstimatorOption >::iterator &  loadEstimatorIt,
std::set< DataLayoutOption >::iterator &  dataLayoutIt,
std::set< Newton3Option >::iterator &  newton3It 
)
inline

Alternative getter for all Configuration iterators.

Parameters
containerItout
cellSizeFactorItout
loadEstimatorItout
traversalItout
dataLayoutItout
newton3Itout

◆ getContainerIterator()

std::set< ContainerOption >::iterator autopas::utils::ConfigurationAndRankIteratorHandler::getContainerIterator ( ) const
inline

Getter for containerIterator.

Returns

◆ getDataLayoutIterator()

std::set< DataLayoutOption >::iterator autopas::utils::ConfigurationAndRankIteratorHandler::getDataLayoutIterator ( ) const
inline

Getter for the DataLayoutIterator.

Returns

◆ getInfiniteCellSizeFactorsBlockSize()

int autopas::utils::ConfigurationAndRankIteratorHandler::getInfiniteCellSizeFactorsBlockSize ( ) const
inline

Getter for the number of ranks in total that have the exact same configs assigned to them.

Used to reduce infinite CSFs on a rank if more ranks than configurations exist.

Returns

◆ getInfiniteCellSizeFactorsOffset()

int autopas::utils::ConfigurationAndRankIteratorHandler::getInfiniteCellSizeFactorsOffset ( ) const
inline

Getter for the number of ranks smaller than getRankIterator that have the exact same configs assigned to them.

Used to reduce infinite CSFs on a rank if more ranks than configurations exist.

Returns

◆ getLoadEstimatorIterator()

std::set< LoadEstimatorOption >::iterator autopas::utils::ConfigurationAndRankIteratorHandler::getLoadEstimatorIterator ( ) const
inline

Getter for the LoadEstimatorIterator.

Returns

◆ getNewton3Iterator()

std::set< Newton3Option >::iterator autopas::utils::ConfigurationAndRankIteratorHandler::getNewton3Iterator ( ) const
inline

Getter for the Newton3Iterator.

Returns

◆ getRankIterator()

int autopas::utils::ConfigurationAndRankIteratorHandler::getRankIterator ( ) const
inline

Getter for the rankIterator.

The value will correspond to the rank that holds the Options that the other iterators point to.

Returns

◆ getTraversalIterator()

std::set< TraversalOption >::iterator autopas::utils::ConfigurationAndRankIteratorHandler::getTraversalIterator ( ) const
inline

Getter for the TraversalIterator.

Returns

◆ reset()

void autopas::utils::ConfigurationAndRankIteratorHandler::reset ( const int  numConfigs,
const int  commSize 
)

Resets all iterators to the beginning, while keeping the containers.

Parameters
numConfigs
commSize

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