Peano
Loading...
Searching...
No Matches
tarch::multicore::orchestration::AllOnGPU Class Reference

Deploy all tasks to GPU. More...

#include <AllOnGPU.h>

Inheritance diagram for tarch::multicore::orchestration::AllOnGPU:
Collaboration diagram for tarch::multicore::orchestration::AllOnGPU:

Public Member Functions

 AllOnGPU (int device, FusionImplementation FusionImplementation=FusionImplementation::LazyEvaluation)
 Initialise strategy.
 
virtual void startBSPSection (int nestedParallelismLevel) override
 Notifies the strategy that we enter a BSP section.
 
virtual void endBSPSection (int nestedParallelismLevel) override
 Notifies the strategy that we leave a BSP (fork-join) section.
 
virtual FuseInstruction fuse (int taskType) override
 Return how many tasks to fuse at least, at most and to which device to deploy them.
 
virtual ExecutionPolicy paralleliseForkJoinSection (int nestedParallelismLevel, int numberOfTasks, int taskType) override
 No if we encounter nested parallelism.
 
virtual void updateFuseStatistics (int taskType, int queueSize, double averageNumberOfPendingReadyTasksPerProcessTaskExecution, double probabilityThatTaskIsCompleted) override
 Update task fusion status.
 
virtual FusionImplementation getFusionImplementation () const override
 Hardcoded to tarch::multicore::orchestration::FusionImplementation::LazyEvaluation.
 
- Public Member Functions inherited from tarch::multicore::orchestration::Strategy
virtual ~Strategy ()=default
 

Static Public Attributes

static int constexpr RoundRobin = -1
 
- Static Public Attributes inherited from tarch::multicore::orchestration::Strategy
static constexpr int EndOfBSPSection = -1
 

Private Member Functions

void toggleDevice ()
 

Private Attributes

const int _device
 
int _deviceToUse
 
bool _isInBspSection
 
const FusionImplementation _fusionImplementation
 

Additional Inherited Members

- Public Types inherited from tarch::multicore::orchestration::Strategy
enum class  ExecutionPolicy { RunSerially , RunParallel }
 Provide hint of execution policy. More...
 

Detailed Description

Deploy all tasks to GPU.

This is a very simple orchestration which tries to get all tasks over to a GPU. For this, it relies on tarch::multicore::orchestration::FusionImplementation::LazyEvaluation as orchestration strategy. The class puts no restrictions on the number of tasks that it can fuse. Depending on how the object is initialised, all tasks either go on one GPU, or the routine runs round robin through all accelerators.

Definition at line 26 of file AllOnGPU.h.

Constructor & Destructor Documentation

◆ AllOnGPU()

tarch::multicore::orchestration::AllOnGPU::AllOnGPU ( int  device,
FusionImplementation  FusionImplementation = FusionImplementation::LazyEvaluation 
)

Initialise strategy.

Parameters
deviceEither a nonnegative integer picking one device or RoundRobin.

Member Function Documentation

◆ endBSPSection()

virtual void tarch::multicore::orchestration::AllOnGPU::endBSPSection ( int  nestedParallelismLevel)
overridevirtual

Notifies the strategy that we leave a BSP (fork-join) section.

Implements tarch::multicore::orchestration::Strategy.

◆ fuse()

virtual FuseInstruction tarch::multicore::orchestration::AllOnGPU::fuse ( int  taskType)
overridevirtual

Return how many tasks to fuse at least, at most and to which device to deploy them.

Returns
(-1,std::numeric_limits<int>::max(),0) within the BSP section, such that the lower limit is never exceeded. Return the device otherwise with a min size of 1.

Implements tarch::multicore::orchestration::Strategy.

◆ getFusionImplementation()

virtual FusionImplementation tarch::multicore::orchestration::AllOnGPU::getFusionImplementation ( ) const
overridevirtual

◆ paralleliseForkJoinSection()

virtual ExecutionPolicy tarch::multicore::orchestration::AllOnGPU::paralleliseForkJoinSection ( int  nestedParallelismLevel,
int  numberOfTasks,
int  taskType 
)
overridevirtual

No if we encounter nested parallelism.

Implements tarch::multicore::orchestration::Strategy.

◆ startBSPSection()

virtual void tarch::multicore::orchestration::AllOnGPU::startBSPSection ( int  nestedParallelismLevel)
overridevirtual

Notifies the strategy that we enter a BSP section.

Implements tarch::multicore::orchestration::Strategy.

◆ toggleDevice()

void tarch::multicore::orchestration::AllOnGPU::toggleDevice ( )
private

◆ updateFuseStatistics()

virtual void tarch::multicore::orchestration::AllOnGPU::updateFuseStatistics ( int  taskType,
int  queueSize,
double  averageNumberOfReadyTasksPerProcessTaskExecution,
double  probabilityThatTaskIsCompleted 
)
overridevirtual

Update task fusion status.

Feed orchestration with some stats around the task queue of interest. This routine is not called every time a process read tasks kicks off, but only every now and then. Furthermore, please note that this routine is invoked iff the orchestration beforehand had decided to fuse tasks.

Parameters
taskTypeNumber of the task that we are studying
queueSizeSize of the queue at this observation point
averageNumberOfReadyTasksPerProcessTaskExecutionaverage over number of tasks in the queue whenever a process task has kicked off and the underlying real task has not completed yet.
probabilityThatTaskIsCompletedProbability that task result has been there already when the corresponding instance of ProcessReadyTask fires up. This is a biased value: If we try to look up if a task is already completed and the underlying dictionary is locked, then this counts as a "no hit" as well.

Implements tarch::multicore::orchestration::Strategy.

Field Documentation

◆ _device

const int tarch::multicore::orchestration::AllOnGPU::_device
private

Definition at line 28 of file AllOnGPU.h.

◆ _deviceToUse

int tarch::multicore::orchestration::AllOnGPU::_deviceToUse
private

Definition at line 29 of file AllOnGPU.h.

◆ _fusionImplementation

const FusionImplementation tarch::multicore::orchestration::AllOnGPU::_fusionImplementation
private

Definition at line 31 of file AllOnGPU.h.

◆ _isInBspSection

bool tarch::multicore::orchestration::AllOnGPU::_isInBspSection
private

Definition at line 30 of file AllOnGPU.h.

◆ RoundRobin

int constexpr tarch::multicore::orchestration::AllOnGPU::RoundRobin = -1
staticconstexpr

Definition at line 35 of file AllOnGPU.h.


The documentation for this class was generated from the following file: