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

This strategy spreads the configuration queue in a round robin fashion over all ranks (with similar domain). More...

#include <MPIParallelizedStrategy.h>

Inheritance diagram for autopas::MPIParallelizedStrategy:
Inheritance graph
[legend]
Collaboration diagram for autopas::MPIParallelizedStrategy:
Collaboration graph
[legend]

Public Member Functions

 MPIParallelizedStrategy (const Configuration &fallbackConfiguration, const AutoPas_MPI_Comm &comm, double mpiTuningMaxDifferenceForBucket, double mpiTuningWeightForMaxDensity)
 Constructor.
 
TuningStrategyOption getOptionType () const override
 Get this object's associated TuningStrategyOption type.
 
bool optimizeSuggestions (std::vector< Configuration > &configQueue, const EvidenceCollection &evidenceCollection) override
 Optimizes the queue of configurations to process.
 
void receiveSmoothedHomogeneityAndMaxDensity (double homogeneity, double maxDensity) override
 Method to pass smoothed homogeneity and the maximal density to the tuning strategy.
 
bool reset (size_t iteration, size_t tuningPhase, std::vector< Configuration > &configQueue, const autopas::EvidenceCollection &evidenceCollection) override
 Reset all internal parameters to the beginning of a new tuning phase.
 
bool needsSmoothedHomogeneityAndMaxDensity () const override
 Indicate whether the strategy needs smoothed values of homogeneity and max density.
 
void rejectConfiguration (const Configuration &configuration, bool indefinitely) override
 Notify the strategy about a configuration that is (currently) invalid and thus can potentially be dropped from some internal storage.
 
const AutoPas_MPI_CommgetBucket () const
 Get the MPI communicator for this rank's bucket.
 
- Public Member Functions inherited from autopas::TuningStrategyInterface
virtual TuningStrategyOption getOptionType () const =0
 Get this object's associated TuningStrategyOption type.
 
virtual void addEvidence (const Configuration &configuration, const Evidence &evidence)
 Notifies the strategy about empirically collected information for the given configuration.
 
virtual bool optimizeSuggestions (std::vector< Configuration > &configQueue, const EvidenceCollection &evidenceCollection)=0
 Optimizes the queue of configurations to process.
 
virtual bool reset (size_t iteration, size_t tuningPhase, std::vector< Configuration > &configQueue, const autopas::EvidenceCollection &evidenceCollection)=0
 Reset all internal parameters to the beginning of a new tuning phase.
 
virtual bool needsLiveInfo () const
 Returns whether this tuning strategy wants to get a LiveInfo object passed before a new tuning phase.
 
virtual void receiveLiveInfo (const LiveInfo &info)
 Virtual method that subclasses can override to receive the LiveInfo object before a tuning phase if they return true in needsLiveInfo().
 
virtual void rejectConfiguration (const Configuration &configuration, bool indefinitely)
 Notify the strategy about a configuration that is (currently) invalid and thus can potentially be dropped from some internal storage.
 
virtual bool needsSmoothedHomogeneityAndMaxDensity () const
 Indicate whether the strategy needs smoothed values of homogeneity and max density.
 
virtual void receiveSmoothedHomogeneityAndMaxDensity (double homogeneity, double maxDensity)
 Method to pass smoothed homogeneity and the maximal density to the tuning strategy.
 

Static Public Member Functions

static Configuration createFallBackConfiguration (const std::set< Configuration > &searchSpace, const InteractionTypeOption &interactionType)
 Create a resilient configuration that should always be applicable.
 

Detailed Description

This strategy spreads the configuration queue in a round robin fashion over all ranks (with similar domain).

The actual splitting of the search space and details of the communication logic is not currently handled by this class, but by AutoPasConfigurationCommunicator.

Constructor & Destructor Documentation

◆ MPIParallelizedStrategy()

autopas::MPIParallelizedStrategy::MPIParallelizedStrategy ( const Configuration fallbackConfiguration,
const AutoPas_MPI_Comm comm,
double  mpiTuningMaxDifferenceForBucket,
double  mpiTuningWeightForMaxDensity 
)

Constructor.

Parameters
fallbackConfigurationGenerally applicable configuration that can be used if no local configuration are applicable. It is suggested to use MPIParallelizedStrategy::createFallBackConfiguration() for this.
commThe communicator holding all ranks which participate in this tuning strategy.
mpiTuningMaxDifferenceForBucket
mpiTuningWeightForMaxDensity

Member Function Documentation

◆ createFallBackConfiguration()

Configuration autopas::MPIParallelizedStrategy::createFallBackConfiguration ( const std::set< Configuration > &  searchSpace,
const InteractionTypeOption &  interactionType 
)
static

Create a resilient configuration that should always be applicable.

The idea is to pick some configuration that is basically always applicable (lc_c08) and guess from the search space which options Newton3 and Data Layout options are allowed.

Parameters
searchSpace
interactionType
Returns
The fall back configuration.

◆ getBucket()

const AutoPas_MPI_Comm & autopas::MPIParallelizedStrategy::getBucket ( ) const

Get the MPI communicator for this rank's bucket.

Returns

◆ getOptionType()

TuningStrategyOption autopas::MPIParallelizedStrategy::getOptionType ( ) const
overridevirtual

Get this object's associated TuningStrategyOption type.

Returns
TuningStrategyOption

Implements autopas::TuningStrategyInterface.

◆ needsSmoothedHomogeneityAndMaxDensity()

bool autopas::MPIParallelizedStrategy::needsSmoothedHomogeneityAndMaxDensity ( ) const
inlineoverridevirtual

Indicate whether the strategy needs smoothed values of homogeneity and max density.

Returns

Reimplemented from autopas::TuningStrategyInterface.

◆ optimizeSuggestions()

bool autopas::MPIParallelizedStrategy::optimizeSuggestions ( std::vector< Configuration > &  configQueue,
const EvidenceCollection evidenceCollection 
)
overridevirtual

Optimizes the queue of configurations to process.

This function is called once before each iteration in a tuning phase so all tuning strategies can give their input on which configuration to try next. This is done by reordering configQueue so that the next configuration to try is at the end (FIFO).

Parameters
configQueueQueue of configurations to be tested. The tuning strategy should edit this queue.
evidenceCollectionAll collected evidence until now.
Returns
boolean value to signal if the tuning strategy has intentionally wiped the config queue

Implements autopas::TuningStrategyInterface.

◆ receiveSmoothedHomogeneityAndMaxDensity()

void autopas::MPIParallelizedStrategy::receiveSmoothedHomogeneityAndMaxDensity ( double  homogeneity,
double  maxDensity 
)
overridevirtual

Method to pass smoothed homogeneity and the maximal density to the tuning strategy.

Parameters
homogeneity
maxDensity

Reimplemented from autopas::TuningStrategyInterface.

◆ rejectConfiguration()

void autopas::MPIParallelizedStrategy::rejectConfiguration ( const Configuration configuration,
bool  indefinitely 
)
overridevirtual

Notify the strategy about a configuration that is (currently) invalid and thus can potentially be dropped from some internal storage.

Parameters
configuration
indefinitelyWhether the given configuration will never be valid

Reimplemented from autopas::TuningStrategyInterface.

◆ reset()

bool autopas::MPIParallelizedStrategy::reset ( size_t  iteration,
size_t  tuningPhase,
std::vector< Configuration > &  configQueue,
const autopas::EvidenceCollection evidenceCollection 
)
overridevirtual

Reset all internal parameters to the beginning of a new tuning phase.

This can also mean to reorder the configQueue to some initially expected state.

Parameters
iterationGives the current iteration to the tuning strategy.
tuningPhaseGives the current tuning phase to the tuning strategy.
configQueueQueue of configurations to be tested. The tuning strategy should edit this queue.
evidenceCollectionAll collected evidence until now.
Returns
boolean value to signal if the tuning strategy has intentionally wiped the config queue

Implements autopas::TuningStrategyInterface.


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