|
Peano
|
A hard coded strategy that can realise a few standard tasking patterns. More...
#include <SamplingMulticoreOrchestration.h>


Data Structures | |
| struct | Key |
| struct | Value |
Public Member Functions | |
| GeneticOptimisation () | |
| virtual | ~GeneticOptimisation ()=default |
| virtual void | startBSPSection () override |
| virtual void | endBSPSection () override |
| virtual int | getNumberOfTasksToHoldBack () override |
| virtual FuseInstruction | getNumberOfTasksToFuseAndTargetDevice () override |
| virtual bool | fuseTasksImmediatelyWhenSpawned () override |
| virtual ExecutionPolicy | paralleliseForkJoinSection (int nestedParallelismLevel, int numberOfTasks, int taskType) override |
| Determine how to handle/realise parallelisation within fork/join region. | |
| Public Member Functions inherited from tarch::multicore::orchestration::Strategy | |
| virtual | ~Strategy ()=default |
| virtual void | startBSPSection (int nestedParallelismLevel)=0 |
| Notifies the strategy that we enter a BSP section. | |
| virtual void | endBSPSection (int nestedParallelismLevel)=0 |
| Notifies the strategy that we leave a BSP (fork-join) section. | |
| virtual void | updateFuseStatistics (int taskType, int queueSize, double averageNumberOfReadyTasksPerProcessTaskExecution, double probabilityThatTaskIsCompleted)=0 |
| Update task fusion status. | |
| virtual FuseInstruction | fuse (int taskType)=0 |
| How many tasks to fuse and to which device to deploy. | |
| virtual FusionImplementation | getFusionImplementation () const =0 |
| Determine how the implementation handles fusable tasks. | |
Private Member Functions | |
| void | createInitialConfigurations () |
| void | normalise () |
| void | increaseProbabilityOfActiveConfiguration () |
| void | removeUnreasonableProbabilities () |
| void | pickNewActiveConfigurationRandomly () |
Private Attributes | |
| std::map< Key, Value > | _configurationVariants |
| Key | _activeKey |
| tarch::timing::Watch | _currentWatch |
| double | _lastDuration |
| int | _bspRunThroughsWithActiveKey |
| int | _currentDevice |
Static Private Attributes | |
| static tarch::logging::Log | _log |
Additional Inherited Members | |
| Public Types inherited from tarch::multicore::orchestration::Strategy | |
| enum class | ExecutionPolicy { RunSerially , RunParallel } |
| Provide hint of execution policy. More... | |
| Static Public Attributes inherited from tarch::multicore::orchestration::Strategy | |
| static constexpr int | EndOfBSPSection = -1 |
A hard coded strategy that can realise a few standard tasking patterns.
Definition at line 25 of file SamplingMulticoreOrchestration.h.
| tarch::multicore::orchestration::GeneticOptimisation::GeneticOptimisation | ( | ) |
Definition at line 43 of file SamplingMulticoreOrchestration.cpp.
References _activeKey, _bspRunThroughsWithActiveKey, _currentDevice, _currentWatch, _lastDuration, createInitialConfigurations(), int, and normalise().

|
virtualdefault |
|
private |
Definition at line 53 of file SamplingMulticoreOrchestration.cpp.
References _configurationVariants, fuseTasksImmediatelyWhenSpawned(), and tarch::multicore::Core::getInstance().
Referenced by GeneticOptimisation().


|
overridevirtual |
Definition at line 98 of file SamplingMulticoreOrchestration.cpp.
References _activeKey, _bspRunThroughsWithActiveKey, _configurationVariants, _currentWatch, _lastDuration, increaseProbabilityOfActiveConfiguration(), normalise(), pickNewActiveConfigurationRandomly(), and removeUnreasonableProbabilities().

|
overridevirtual |
Definition at line 234 of file SamplingMulticoreOrchestration.cpp.
References _activeKey.
Referenced by createInitialConfigurations().

|
overridevirtual |
Definition at line 225 of file SamplingMulticoreOrchestration.cpp.
References _activeKey, _currentDevice, and tarch::multicore::Core::getInstance().

|
overridevirtual |
Definition at line 221 of file SamplingMulticoreOrchestration.cpp.
References _activeKey.
|
private |
Definition at line 128 of file SamplingMulticoreOrchestration.cpp.
References _activeKey, _configurationVariants, logInfo, and tarch::multicore::orchestration::GeneticOptimisation::Key::toString().
Referenced by endBSPSection().


|
private |
Definition at line 76 of file SamplingMulticoreOrchestration.cpp.
References _configurationVariants, and logInfo.
Referenced by endBSPSection(), and GeneticOptimisation().

|
overridevirtual |
Determine how to handle/realise parallelisation within fork/join region.
Peano models its execution with multiple parallel, nested fork/join sections. You could also think of these as mini-BSP sections. This routine guides the orchestration how to map those BSP sections onto tasks.
The decision can be guided by basically arbitrary contextual factors. The most important one for me is the nesting factor. As we work mainly with OpenMP, where tasks are tied to one core, it makes limited sense to have nested parallel fors. Notably, it makes stuff slower. So usually, I return ExecutionPolicy::RunSerially with anything with a nesting level greater than 1.
| nestedParallelismLevel | Please compare with tarch::multicore::spawnAndWait() which ensures that this flag equals 1 on the top level. A parameter of 0 would mean that no fork/join region has been opened. For such a parameter, the code would not query this function. |
| taskType | If we enter a fork-join section, this section logically spawns a set of tasks, which are all of the same type. So the task type here is given implicitly by the code location. But each BSP section has a unique identifier. |
Implements tarch::multicore::orchestration::Strategy.
Definition at line 242 of file SamplingMulticoreOrchestration.cpp.
References _activeKey, tarch::multicore::orchestration::Strategy::RunParallel, and tarch::multicore::orchestration::Strategy::RunSerially.
|
private |
Definition at line 203 of file SamplingMulticoreOrchestration.cpp.
References _activeKey, _configurationVariants, and logInfo.
Referenced by endBSPSection().

|
private |
Definition at line 184 of file SamplingMulticoreOrchestration.cpp.
References _configurationVariants, and logInfo.
Referenced by endBSPSection().

|
overridevirtual |
Definition at line 92 of file SamplingMulticoreOrchestration.cpp.
References _bspRunThroughsWithActiveKey, and _currentWatch.
|
private |
Definition at line 57 of file SamplingMulticoreOrchestration.h.
Referenced by endBSPSection(), fuseTasksImmediatelyWhenSpawned(), GeneticOptimisation(), getNumberOfTasksToFuseAndTargetDevice(), getNumberOfTasksToHoldBack(), increaseProbabilityOfActiveConfiguration(), paralleliseForkJoinSection(), and pickNewActiveConfigurationRandomly().
|
private |
Definition at line 60 of file SamplingMulticoreOrchestration.h.
Referenced by endBSPSection(), GeneticOptimisation(), and startBSPSection().
|
private |
Definition at line 55 of file SamplingMulticoreOrchestration.h.
Referenced by createInitialConfigurations(), endBSPSection(), increaseProbabilityOfActiveConfiguration(), normalise(), pickNewActiveConfigurationRandomly(), and removeUnreasonableProbabilities().
|
private |
Definition at line 61 of file SamplingMulticoreOrchestration.h.
Referenced by GeneticOptimisation(), and getNumberOfTasksToFuseAndTargetDevice().
|
private |
Definition at line 58 of file SamplingMulticoreOrchestration.h.
Referenced by endBSPSection(), GeneticOptimisation(), and startBSPSection().
|
private |
Definition at line 59 of file SamplingMulticoreOrchestration.h.
Referenced by endBSPSection(), and GeneticOptimisation().
|
staticprivate |
Definition at line 46 of file SamplingMulticoreOrchestration.h.