Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::TBBTaskImplementation Class Reference
Inheritance diagram for Arcane::TBBTaskImplementation:
Collaboration diagram for Arcane::TBBTaskImplementation:

Classes

class  MDParallelForExecute
class  TaskInfoLockGuard
 Class for positioning TaskThreadInfo::taskIndex(). More...
class  Impl
class  ParallelForExecute

Public Member Functions

class ARCCORE_ALIGNAS_PACKED (64) TaskThreadInfo
void build ()
void initialize (Int32 nb_thread) override
void terminate () override
ITaskcreateRootTask (ITaskFunctor *f) override
 Creates a root task. The implementation must copy the value of f, which is either a TaskFunctor or a TaskFunctorWithContext.
void executeParallelFor (Int32 begin, Int32 size, const ParallelLoopOptions &options, IRangeFunctor *f) final
 Executes the functor f in parallel.
void executeParallelFor (Int32 begin, Int32 size, Integer grain_size, IRangeFunctor *f) final
 Executes the functor f in parallel.
void executeParallelFor (Int32 begin, Int32 size, IRangeFunctor *f) final
 Executes the functor f in parallel.
void executeParallelFor (const ParallelFor1DLoopInfo &loop_info) override
 Executes the loop loop_info in parallel.
void executeParallelFor (const ComplexForLoopRanges< 1 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 1 > *functor) final
 Executes a 1D loop in parallel.
void executeParallelFor (const ComplexForLoopRanges< 2 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 2 > *functor) final
 Executes a 2D loop in parallel.
void executeParallelFor (const ComplexForLoopRanges< 3 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 3 > *functor) final
 Executes a 3D loop in parallel.
void executeParallelFor (const ComplexForLoopRanges< 4 > &loop_ranges, const ForLoopRunInfo &run_info, IMDRangeFunctor< 4 > *functor) final
 Executes a 4D loop in parallel.
bool isActive () const final
 Indicates if the implementation is active.
Int32 currentTaskThreadIndex () const final
 Implementation of TaskFactory::currentTaskThreadIndex().
Int32 currentTaskIndex () const final
 Implementation of TaskFactory::currentTaskIndex().
void printInfos (std::ostream &o) const final
 Prints information about the runtime used.
TaskThreadInfo * currentTaskThreadInfo () const
 Instance of TaskThreadInfo associated with the current thread.
Public Member Functions inherited from Arcane::ITaskImplementation
Int32 nbAllowedThread () const
 Maximum number of threads used to manage tasks.

Private Member Functions

template<int RankValue>
void _executeMDParallelFor (const ComplexForLoopRanges< RankValue > &loop_ranges, IMDRangeFunctor< RankValue > *functor, const ForLoopRunInfo &run_info)
 Execution of an N-dimensional loop.
void _executeParallelFor (const ParallelFor1DLoopInfo &loop_info)

Private Attributes

bool m_is_active = false
Implm_p = nullptr

Detailed Description

Definition at line 343 of file TBBTaskImplementation.cc.

Constructor & Destructor Documentation

◆ ~TBBTaskImplementation()

Arcane::TBBTaskImplementation::~TBBTaskImplementation ( )
override

Definition at line 1035 of file TBBTaskImplementation.cc.

Member Function Documentation

◆ _executeMDParallelFor()

template<int RankValue>
void Arcane::TBBTaskImplementation::_executeMDParallelFor ( const ComplexForLoopRanges< RankValue > & loop_ranges,
IMDRangeFunctor< RankValue > * functor,
const ForLoopRunInfo & run_info )
private

Execution of an N-dimensional loop.

Warning
The current implementation does not take into account options for loops other than one dimension.

Definition at line 1146 of file TBBTaskImplementation.cc.

References Arcane::TaskFactory::defaultParallelLoopOptions(), Arcane::ParallelLoopOptions::grainSize(), Arcane::makeLoopRanges(), Arcane::ParallelLoopOptions::maxThread(), Arcane::ParallelLoopOptions::mergeUnsetValues(), and Arcane::TaskFactory::verboseLevel().

Referenced by executeParallelFor(), executeParallelFor(), executeParallelFor(), and executeParallelFor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _executeParallelFor()

void Arcane::TBBTaskImplementation::_executeParallelFor ( const ParallelFor1DLoopInfo & loop_info)
private

Definition at line 1083 of file TBBTaskImplementation.cc.

◆ ARCCORE_ALIGNAS_PACKED()

class Arcane::TBBTaskImplementation::ARCCORE_ALIGNAS_PACKED ( 64 )
inline

Definition at line 331 of file TBBTaskImplementation.cc.

◆ build()

void Arcane::TBBTaskImplementation::build ( )
inline

Definition at line 412 of file TBBTaskImplementation.cc.

◆ createRootTask()

ITask * Arcane::TBBTaskImplementation::createRootTask ( ITaskFunctor * f)
inlineoverridevirtual

Creates a root task. The implementation must copy the value of f, which is either a TaskFunctor or a TaskFunctorWithContext.

Implements Arcane::ITaskImplementation.

Definition at line 416 of file TBBTaskImplementation.cc.

◆ currentTaskIndex()

Int32 Arcane::TBBTaskImplementation::currentTaskIndex ( ) const
finalvirtual

Implementation of TaskFactory::currentTaskIndex().

Implements Arcane::ITaskImplementation.

Definition at line 1243 of file TBBTaskImplementation.cc.

References currentTaskThreadIndex(), and currentTaskThreadInfo().

Here is the call graph for this function:

◆ currentTaskThreadIndex()

Int32 Arcane::TBBTaskImplementation::currentTaskThreadIndex ( ) const
inlinefinalvirtual

Implementation of TaskFactory::currentTaskThreadIndex().

Implements Arcane::ITaskImplementation.

Definition at line 460 of file TBBTaskImplementation.cc.

References Arcane::ITaskImplementation::nbAllowedThread().

Referenced by currentTaskIndex(), and currentTaskThreadInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ currentTaskThreadInfo()

TBBTaskImplementation::TaskThreadInfo * Arcane::TBBTaskImplementation::currentTaskThreadInfo ( ) const

Instance of TaskThreadInfo associated with the current thread.

May be null if the current thread is not associated with a TBB thread or if it is outside the execution of a task or a parallel loop.

Definition at line 1231 of file TBBTaskImplementation.cc.

References currentTaskThreadIndex().

Referenced by currentTaskIndex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeParallelFor() [1/8]

void Arcane::TBBTaskImplementation::executeParallelFor ( const ComplexForLoopRanges< 1 > & loop_ranges,
const ForLoopRunInfo & run_info,
IMDRangeFunctor< 1 > * functor )
inlinefinalvirtual

Executes a 1D loop in parallel.

Implements Arcane::ITaskImplementation.

Definition at line 430 of file TBBTaskImplementation.cc.

References _executeMDParallelFor().

Here is the call graph for this function:

◆ executeParallelFor() [2/8]

void Arcane::TBBTaskImplementation::executeParallelFor ( const ComplexForLoopRanges< 2 > & loop_ranges,
const ForLoopRunInfo & run_info,
IMDRangeFunctor< 2 > * functor )
inlinefinalvirtual

Executes a 2D loop in parallel.

Implements Arcane::ITaskImplementation.

Definition at line 436 of file TBBTaskImplementation.cc.

References _executeMDParallelFor().

Here is the call graph for this function:

◆ executeParallelFor() [3/8]

void Arcane::TBBTaskImplementation::executeParallelFor ( const ComplexForLoopRanges< 3 > & loop_ranges,
const ForLoopRunInfo & run_info,
IMDRangeFunctor< 3 > * functor )
inlinefinalvirtual

Executes a 3D loop in parallel.

Implements Arcane::ITaskImplementation.

Definition at line 442 of file TBBTaskImplementation.cc.

References _executeMDParallelFor().

Here is the call graph for this function:

◆ executeParallelFor() [4/8]

void Arcane::TBBTaskImplementation::executeParallelFor ( const ComplexForLoopRanges< 4 > & loop_ranges,
const ForLoopRunInfo & run_info,
IMDRangeFunctor< 4 > * functor )
inlinefinalvirtual

Executes a 4D loop in parallel.

Implements Arcane::ITaskImplementation.

Definition at line 448 of file TBBTaskImplementation.cc.

References _executeMDParallelFor().

Here is the call graph for this function:

◆ executeParallelFor() [5/8]

void Arcane::TBBTaskImplementation::executeParallelFor ( const ParallelFor1DLoopInfo & loop_info)
overridevirtual

Executes the loop loop_info in parallel.

Implements Arcane::ITaskImplementation.

Definition at line 1131 of file TBBTaskImplementation.cc.

◆ executeParallelFor() [6/8]

void Arcane::TBBTaskImplementation::executeParallelFor ( Int32 begin,
Int32 size,
const ParallelLoopOptions & options,
IRangeFunctor * f )
finalvirtual

Executes the functor f in parallel.

Implements Arcane::ITaskImplementation.

Definition at line 1222 of file TBBTaskImplementation.cc.

References executeParallelFor().

Referenced by executeParallelFor(), executeParallelFor(), and executeParallelFor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeParallelFor() [7/8]

void Arcane::TBBTaskImplementation::executeParallelFor ( Int32 begin,
Int32 size,
Integer block_size,
IRangeFunctor * f )
finalvirtual

Executes the functor f in parallel.

Implements Arcane::ITaskImplementation.

Definition at line 1210 of file TBBTaskImplementation.cc.

References Arcane::TaskFactory::defaultParallelLoopOptions(), executeParallelFor(), and Arcane::ParallelLoopOptions::setGrainSize().

Here is the call graph for this function:

◆ executeParallelFor() [8/8]

void Arcane::TBBTaskImplementation::executeParallelFor ( Int32 begin,
Int32 size,
IRangeFunctor * f )
inlinefinalvirtual

Executes the functor f in parallel.

Implements Arcane::ITaskImplementation.

Definition at line 424 of file TBBTaskImplementation.cc.

References Arcane::TaskFactory::defaultParallelLoopOptions(), and executeParallelFor().

Here is the call graph for this function:

◆ initialize()

void Arcane::TBBTaskImplementation::initialize ( Int32 nb_thread)
overridevirtual

. Initializes the implementation with a maximum of nb_thread. If nb_thread is 0, the implementation can choose the number of threads automatically. This method is internal to Arcane and should only be called during the execution initialization.

Implements Arcane::ITaskImplementation.

Definition at line 1044 of file TBBTaskImplementation.cc.

References Arcane::TaskFactory::defaultParallelLoopOptions(), Arcane::ITaskImplementation::nbAllowedThread(), Arcane::TaskFactory::setDefaultParallelLoopOptions(), and Arcane::ParallelLoopOptions::setMaxThread().

Here is the call graph for this function:

◆ isActive()

bool Arcane::TBBTaskImplementation::isActive ( ) const
inlinefinalvirtual

Indicates if the implementation is active.

Implements Arcane::ITaskImplementation.

Definition at line 455 of file TBBTaskImplementation.cc.

◆ printInfos()

void Arcane::TBBTaskImplementation::printInfos ( std::ostream & o) const
finalvirtual

Prints information about the runtime used.

Implements Arcane::ITaskImplementation.

Definition at line 1071 of file TBBTaskImplementation.cc.

◆ terminate()

void Arcane::TBBTaskImplementation::terminate ( )
overridevirtual

. Terminates the use of the implementation. This method must be called only at the end of the calculation.

Implements Arcane::ITaskImplementation.

Definition at line 1062 of file TBBTaskImplementation.cc.

Member Data Documentation

◆ m_is_active

bool Arcane::TBBTaskImplementation::m_is_active = false
private

Definition at line 481 of file TBBTaskImplementation.cc.

◆ m_p

Impl* Arcane::TBBTaskImplementation::m_p = nullptr
private

Definition at line 482 of file TBBTaskImplementation.cc.


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