Interface to the Active Harmony (AH) tuning framework. More...
#include <ActiveHarmony.h>
Public Member Functions | |
ActiveHarmony (const InteractionTypeOption &interactionType, const std::set< ContainerOption > &allowedContainerOptions, const NumberSet< double > &allowedCellSizeFactors, const std::set< TraversalOption > &allowedTraversalOptions, const std::set< LoadEstimatorOption > &allowedLoadEstimatorOptions, const std::set< DataLayoutOption > &allowedDataLayoutOptions, const std::set< Newton3Option > &allowedNewton3Options, bool mpiDivideAndConquer, AutoPas_MPI_Comm comm) | |
Constructor. | |
TuningStrategyOption | getOptionType () const override |
Get this object's associated TuningStrategyOption type. | |
void | addEvidence (const Configuration &configuration, const Evidence &evidence) override |
Notifies the strategy about empirically collected information for the given configuration. | |
bool | optimizeSuggestions (std::vector< Configuration > &configQueue, const EvidenceCollection &evidenceCollection) override |
Optimizes the queue of configurations to process. | |
bool | searchSpaceIsTrivial () const |
Indicate if the search space contains only one configuration. | |
bool | searchSpaceIsEmpty () const |
Indicate if the search space contains any configurations. | |
bool | needsSmoothedHomogeneityAndMaxDensity () const override |
Indicate whether the strategy needs smoothed values of homogeneity and max density. | |
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. | |
![]() | |
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. | |
Interface to the Active Harmony (AH) tuning framework.
If a global AH server is provided and MPI is enabled, the server can be reached via the environment variables HARMONY_HOST and HARMONY_PORT. They have to be set to the host address and port of the server respectively.
autopas::ActiveHarmony::ActiveHarmony | ( | const InteractionTypeOption & | interactionType, |
const std::set< ContainerOption > & | allowedContainerOptions, | ||
const NumberSet< double > & | allowedCellSizeFactors, | ||
const std::set< TraversalOption > & | allowedTraversalOptions, | ||
const std::set< LoadEstimatorOption > & | allowedLoadEstimatorOptions, | ||
const std::set< DataLayoutOption > & | allowedDataLayoutOptions, | ||
const std::set< Newton3Option > & | allowedNewton3Options, | ||
bool | mpiDivideAndConquer, | ||
AutoPas_MPI_Comm | comm | ||
) |
Constructor.
Note that ActiveHarmony assumes every traversal option is only applicable for one container.
interactionType | |
allowedContainerOptions | |
allowedCellSizeFactors | |
allowedTraversalOptions | |
allowedLoadEstimatorOptions | |
allowedDataLayoutOptions | |
allowedNewton3Options | |
mpiDivideAndConquer | |
comm |
|
overridevirtual |
Notifies the strategy about empirically collected information for the given configuration.
All evidence is stored centrally in the AutoTuner and its EvidenceCollection is passed to the tuning strategies during optimization.
Implementing this function is only necessary if the tuning strategy processes evidence differently than EvidenceCollection.
configuration | Configuration used to obtain the evidence. |
evidence | Measurement and when it was taken. |
Reimplemented from autopas::TuningStrategyInterface.
|
overridevirtual |
Get this object's associated TuningStrategyOption type.
Implements autopas::TuningStrategyInterface.
|
overridevirtual |
Indicate whether the strategy needs smoothed values of homogeneity and max density.
Reimplemented from autopas::TuningStrategyInterface.
|
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).
configQueue | Queue of configurations to be tested. The tuning strategy should edit this queue. |
evidenceCollection | All collected evidence until now. |
Implements autopas::TuningStrategyInterface.
|
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.
iteration | Gives the current iteration to the tuning strategy. |
tuningPhase | Gives the current tuning phase to the tuning strategy. |
configQueue | Queue of configurations to be tested. The tuning strategy should edit this queue. |
evidenceCollection | All collected evidence until now. |
Implements autopas::TuningStrategyInterface.
bool autopas::ActiveHarmony::searchSpaceIsEmpty | ( | ) | const |
Indicate if the search space contains any configurations.
bool autopas::ActiveHarmony::searchSpaceIsTrivial | ( | ) | const |
Indicate if the search space contains only one configuration.