deal.II version GIT relicensing-2167-g9622207b8f 2024-11-21 12:40:00+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Classes | Functions
parallel::internal Namespace Reference

Classes

struct  EnableOpenMPSimdFor
 
class  TBBPartitioner
 

Functions

template<typename Iterator , typename Functor >
void parallel_for (Iterator x_begin, Iterator x_end, const Functor &functor, const unsigned int grainsize)
 
template<typename Iterator , typename Functor >
void parallel_for (Iterator x_begin, Iterator x_end, const Functor &functor, const unsigned int grainsize, const std::shared_ptr< tbb::affinity_partitioner > &partitioner)
 
template<typename Iterator , typename Function >
void apply_to_subranges (const tbb::blocked_range< Iterator > &range, const Function &f)
 

Detailed Description

A class that wraps a TBB affinity partitioner in a thread-safe way. In Vector, we use a shared pointer to share an affinity partitioner between different vectors of the same size for improving data (and NUMA) locality. However, when an outer task does multiple vector operations, the shared pointer could lead to race conditions. This class only allows one instance to get a partitioner. The other objects cannot use that object and need to create their own copy.

Function Documentation

◆ parallel_for() [1/2]

template<typename Iterator , typename Functor >
void parallel::internal::parallel_for ( Iterator  x_begin,
Iterator  x_end,
const Functor &  functor,
const unsigned int  grainsize 
)

Encapsulate tbb::parallel_for.

Definition at line 83 of file parallel.h.

◆ parallel_for() [2/2]

template<typename Iterator , typename Functor >
void parallel::internal::parallel_for ( Iterator  x_begin,
Iterator  x_end,
const Functor &  functor,
const unsigned int  grainsize,
const std::shared_ptr< tbb::affinity_partitioner > &  partitioner 
)

Encapsulate tbb::parallel_for when an affinite_partitioner is provided.

Definition at line 100 of file parallel.h.

◆ apply_to_subranges()

template<typename Iterator , typename Function >
void parallel::internal::apply_to_subranges ( const tbb::blocked_range< Iterator > &  range,
const Function f 
)

Take a range argument and call the given function with its begin and end.

Note
This class, function, or variable is a template, and it can only be instantiated if the following condition is true:
(std::invocable<Function, Iterator, Iterator>)
If your compiler supports the C++20 standard, then this constraint will be enforced by a C++20 requires clause.

Definition at line 370 of file parallel.h.