Peano
Loading...
Searching...
No Matches
MulticoreOrchestration.cpp
Go to the documentation of this file.
2
3#include <limits>
4
5#include "tarch/multicore/Task.h"
6#include "tarch/accelerator/Device.h"
7
8#ifdef PureFV
9#else
10#include "tasks/CCZ4SBH_FD4EnclaveTask.h"
11#endif
12
13#ifdef PureFD4
14#else
15#include "tasks/CCZ4SBH_FVEnclaveTask.h"
16#endif
17
23
31
38
40 if ( taskType == tasks::CCZ4SBH_FVEnclaveTask::getEnclaveTaskTypeId() ) {
42 }
43
44 if (
46 and
47 tarch::accelerator::Device::getInstance().getNumberOfDevices()>0
48 and
49 taskType == tasks::CCZ4SBH_FVEnclaveTask::getEnclaveTaskTypeId()
50 ) {
52 }
53 else {
54 return 0;
55 }
56}
57
58benchmarks::exahype2::ccz4::MulticoreOrchestration::FuseInstruction benchmarks::exahype2::ccz4::MulticoreOrchestration::getNumberOfTasksToFuseAndTargetDevice(
59 int taskType
60) {
61 if (
62 taskType == tasks::CCZ4SBH_FVEnclaveTask::getEnclaveTaskTypeId()
63 ) {
64 return benchmarks::exahype2::ccz4::MulticoreOrchestration::FuseInstruction(
65 0, 1, 1
66 );
67 }
68 else {
69 return benchmarks::exahype2::ccz4::MulticoreOrchestration::FuseInstruction(
70 0, 16, std::numeric_limits<int>::max()
71 );
72 }
73}
74
78
79tarch::multicore::orchestration::Strategy::ExecutionPolicy benchmarks::exahype2::ccz4::MulticoreOrchestration::paralleliseForkJoinSection(
80 int nestedParallelismLevel, int numberOfTasks, int codeLocationIdentifier
81) {
82 if (nestedParallelismLevel > 1) {
83 return tarch::multicore::orchestration::Strategy::ExecutionPolicy::RunSerially;
84 }
85 else {
86 return tarch::multicore::orchestration::Strategy::ExecutionPolicy::RunParallel;
87 }
88}
int _finiteVolumeTasksInThisBSPSection
Current number of finite volume tasks that already have been spawned.
virtual bool fuseTasksImmediatelyWhenSpawned(int taskType) override
Ensure Finite Volume tasks end up on GPU asap.
int _nestedBSPLevels
Number of nested fork/join levels.
virtual void startBSPSection(int nestedParallelismLevel) override
Start a fork/join section.
virtual void endBSPSection(int nestedParallelismLevel) override
End fork/join section.
virtual FuseInstruction getNumberOfTasksToFuseAndTargetDevice(int taskType) override
Ensure right cardinality ends up on GPU.
int _maxFiniteVolumeTasks
Maximum number of finite volume tasks in the system.
virtual ExecutionPolicy paralleliseForkJoinSection(int nestedParallelismLevel, int numberOfTasks, int taskType) override
Determine how to parallelise a fork/join section.
virtual int getNumberOfTasksToHoldBack(int taskType) override
How many tasks should be held back.