12#include <unordered_map>
39 void addAutoTuner(std::unique_ptr<AutoTuner> tuner, InteractionTypeOption::Value interactionType);
48 bool tune(
size_t currentIteration,
const LiveInfo &info);
58 void addMeasurement(
long sampleRebuild,
long sampleTraverseParticles,
bool neighborListRebuilt,
size_t iteration,
59 InteractionTypeOption::Value interactionType)
const;
78 InteractionTypeOption::Value interactionType);
91 void logTuningResult(
long tuningTime,
size_t currentIteration, InteractionTypeOption::Value interactionType)
const;
153 std::unordered_map<InteractionTypeOption::Value, std::unique_ptr<AutoTuner>> &
getAutoTuners() {
return _autoTuners; }
159 void tuneConfigurations(
size_t currentIteration);
166 void setOptimalConfigurations();
171 std::set<std::pair<ContainerOption, double>> getCommonContainerAndCellSizeFactors()
const;
178 bool tuningPhaseAboutToBegin(
size_t currentIteration)
const;
184 std::unordered_map<InteractionTypeOption::Value, std::unique_ptr<AutoTuner>> _autoTuners;
189 size_t _tuningPhase = 0;
194 size_t _tuningInterval = 0;
199 size_t _maxSamples = 0;
204 bool _tuningFinished =
true;
209 size_t _lastTuningIteration{std::numeric_limits<size_t>::max()};
214 bool _tuningFinishedLastIteration =
false;
220 bool _forceRetunePending{
false};
Class containing multiple options that form an algorithm configuration for the pairwise iteration.
Definition: Configuration.h:26
This class is able to gather and store important information for a tuning phase from a container and ...
Definition: LiveInfo.h:33
The TuningManager is responsible for coordinating the AutoTuner(s) In the case of multiple AutoTuners...
Definition: TuningManager.h:26
void setRebuildFrequency(double rebuildFrequency)
Pass the given rebuild frequency over to all AutoTuners.
Definition: TuningManager.cpp:50
bool inFirstConfigurationLastSample(size_t currentIteration) const
Indicates whether the tuner is in the iteration corresponding to the last sample of the first configu...
Definition: TuningManager.cpp:116
void addMeasurement(long sampleRebuild, long sampleTraverseParticles, bool neighborListRebuilt, size_t iteration, InteractionTypeOption::Value interactionType) const
Add performance metrics for the currently active configuration.
Definition: TuningManager.cpp:42
void logTuningResult(long tuningTime, size_t currentIteration, InteractionTypeOption::Value interactionType) const
Log the tuning result for a specific interaction type.
Definition: TuningManager.cpp:75
std::unordered_map< InteractionTypeOption::Value, std::unique_ptr< AutoTuner > > & getAutoTuners()
Definition: TuningManager.h:153
bool allSearchSpacesAreTrivial() const
Definition: TuningManager.cpp:100
bool requiresRebuilding(size_t currentIteration)
Returns whether a rebuild is required during the given iteration, based on AutoTuner(s) providing a n...
Definition: TuningManager.cpp:82
void forceRetune()
Force all AutoTuners to start a new tuning phase immediately.
Definition: TuningManager.cpp:68
bool needsLiveInfo(size_t currentIteration)
Returns true if at least one AutoTuner needs LiveInfo.
Definition: TuningManager.cpp:89
const Configuration & getCurrentConfig(InteractionTypeOption::Value interactionType) const
Get the current configuration for a specific interaction type.
Definition: TuningManager.cpp:120
bool tuningPhaseJustFinished() const
Definition: TuningManager.cpp:109
Configuration rejectConfiguration(const Configuration &rejectedConfig, bool indefinitely, InteractionTypeOption::Value interactionType)
Reject the current configuration for the interactionType by either skipping over it (indefinitely = f...
Definition: TuningManager.cpp:56
const TuningMetricOption & getTuningMetric(InteractionTypeOption::Value interactionType) const
Gets the tuning metric of the AutoTuner of interactionType.
Definition: TuningManager.cpp:124
void addAutoTuner(std::unique_ptr< AutoTuner > tuner, InteractionTypeOption::Value interactionType)
Add an AutoTuner to the TuningManager, which will take over ownership.
Definition: TuningManager.cpp:17
bool isStartOfTuningPhase(size_t currentIteration) const
Calculate whether we are at the start of a new tuning phase based on the current iteration and tuning...
Definition: TuningManager.cpp:111
bool tune(size_t currentIteration, const LiveInfo &info)
This method is the backbone of the TuningManager.
Definition: TuningManager.cpp:21
Class representing the load estimator choices.
Definition: TuningMetricOption.h:18
This is the main namespace of AutoPas.
Definition: AutoPasDecl.h:34
Helper struct encapsulating most minor information for the auto tuner.
Definition: AutoTunerInfo.h:17