Peano
Loading...
Searching...
No Matches
Hardcoded.cpp
Go to the documentation of this file.
1#include "Hardcoded.h"
2
4
5#include <limits>
6
8 return new Hardcoded(
9 std::numeric_limits<int>::max(), // numberOfTasksToHoldBack
10 std::numeric_limits<int>::max(), // min tasks to fuse
11 0, // max tasks to fuse
12 tarch::multicore::Task::Host, // deviceForFusedTasks
13 false, // fuseTasksImmediatelyWhenSpawned
14 1
15 );
16}
17
19 return new Hardcoded(
20 0, // numberOfTasksToHoldBack
21 std::numeric_limits<int>::max(), // min tasks to fuse
22 0, // max tasks to fuse
23 tarch::multicore::Task::Host, // deviceForFusedTasks
24 false, // fuseTasksImmediatelyWhenSpawned
25 1
26 );
27}
28
30 return new Hardcoded(
31 std::numeric_limits<int>::max(), // numberOfTasksToHoldBack
32 std::numeric_limits<int>::max(), // min tasks to fuse
33 0, // max tasks to fuse
34 tarch::multicore::Task::Host, // deviceForFusedTasks
35 false, // fuseTasksImmediatelyWhenSpawned
36 1
37 );
38}
39
41 [[maybe_unused]] int numberOfTasksToFuse,
42 [[maybe_unused]] bool fuseImmediately,
43 [[maybe_unused]] bool processTasksWhileWaitingInBSPArea,
44 [[maybe_unused]] int targetDevice
45) {
46 return new Hardcoded(
47 std::numeric_limits<int>::max(), // numberOfTasksToHoldBack
48 numberOfTasksToFuse, // tasksToFuse
49 numberOfTasksToFuse, // tasksToFuse
50 targetDevice, // deviceForFusedTasks
51 fuseImmediately, // fuseTasksImmediatelyWhenSpawned
52 1
53 );
54}
55
57 int numberOfTasksToHoldBack,
58 int minTasksToFuse,
59 int maxTasksToFuse,
60 int deviceForFusedTasks,
61 bool fuseTasksImmediatelyWhenSpawned,
62 int maxNestedConcurrency
63):
64 _numberOfTasksToHoldBack(numberOfTasksToHoldBack),
65 _minTasksToFuse(minTasksToFuse),
66 _maxTasksToFuse(maxTasksToFuse),
67 _deviceForFusedTasks(deviceForFusedTasks),
68 _fuseTasksImmediatelyWhenSpawned(fuseTasksImmediatelyWhenSpawned),
69 _maxNestedConcurrency(maxNestedConcurrency) {}
70
72
73void tarch::multicore::orchestration::Hardcoded::endBSPSection(int /*nestedParallelismLevel*/) {}
74
80
82 [[maybe_unused]] int nestedParallelismLevel,
83 [[maybe_unused]] int numberOfTasks,
84 [[maybe_unused]] int codeLocationIdentifier
85) {
86 if (nestedParallelismLevel > _maxNestedConcurrency) {
88 } else {
90 }
91}
92
93
94
96 int taskType,
97 int queueSize,
98 double averageNumberOfPendingReadyTasksPerProcessTaskExecution
99) {
100 // empty on purpose
101}
static constexpr int Host
Definition Task.h:28
A hard coded strategy that can realise a few standard tasking patterns.
Definition Hardcoded.h:21
virtual void endBSPSection(int nestedParallelismLevel) override
Notifies the strategy that we leave a BSP (fork-join) section.
Definition Hardcoded.cpp:73
static Hardcoded * createFuseAll(int numberOfTasksToFuse, bool fuseImmediately, bool processTasksWhileWaitingInBSPArea, int targetDevice)
Create a strategy where tasks are always fused if possible given the configuration constraints.
Definition Hardcoded.cpp:40
virtual void updateFuseStatistics(int taskType, int queueSize, double averageNumberOfPendingReadyTasksPerProcessTaskExecution) override
Definition Hardcoded.cpp:95
virtual FuseInstruction fuse(int taskType) override
How many tasks shall system hold back from tasking runtime in user-defined queues.
Definition Hardcoded.cpp:75
virtual void startBSPSection(int nestedParallelismLevel) override
Notifies the strategy that we enter a BSP section.
Definition Hardcoded.cpp:71
virtual ExecutionPolicy paralleliseForkJoinSection(int nestedParallelismLevel, int numberOfTasks, int taskType) override
Determine how to handle/realise parallelisation within fork/join region.
Definition Hardcoded.cpp:81
static Hardcoded * createNative()
Fall back to native tasking.
Definition Hardcoded.cpp:18
static Hardcoded * createBSP()
If you want to use sole BSP, you effectively switch off the tasking.
Definition Hardcoded.cpp:7
Hardcoded(int numberOfTasksToHoldBack, int minTasksToFuse, int maxTasksToFuse, int deviceForFusedTasks, bool fuseTasksImmediatelyWhenSpawned, int maxNestedConcurrency)
Construct hardcoded scheme.
Definition Hardcoded.cpp:56
static Hardcoded * createBackfill()
Backfill strategy from the IWOMP paper.
Definition Hardcoded.cpp:29
ExecutionPolicy
Provide hint of execution policy.
Definition Strategy.h:41