deal.II version GIT relicensing-2289-g1e5549a87a 2024-12-21 21:30: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
Public Member Functions | Private Attributes | List of all members
parallel::internal::TBBPartitioner Class Reference

#include <deal.II/base/parallel.h>

Public Member Functions

 TBBPartitioner ()
 
 ~TBBPartitioner ()
 
std::shared_ptr< tbb::affinity_partitioner > acquire_one_partitioner ()
 
void release_one_partitioner (const std::shared_ptr< tbb::affinity_partitioner > &p)
 

Private Attributes

std::shared_ptr< tbb::affinity_partitioner > my_partitioner
 
bool in_use
 
Threads::Mutex mutex
 

Detailed Description

Definition at line 647 of file parallel.h.

Constructor & Destructor Documentation

◆ TBBPartitioner()

parallel::internal::TBBPartitioner::TBBPartitioner ( )

Constructor.

Definition at line 56 of file parallel.cc.

◆ ~TBBPartitioner()

parallel::internal::TBBPartitioner::~TBBPartitioner ( )

Destructor. Check that the object is not in use any more, i.e., all loops have been completed.

Definition at line 63 of file parallel.cc.

Member Function Documentation

◆ acquire_one_partitioner()

std::shared_ptr< tbb::affinity_partitioner > parallel::internal::TBBPartitioner::acquire_one_partitioner ( )

Return an affinity partitioner. In case the partitioner owned by the class is free, it is returned here. In case another thread has not released it yet, a new object is created. To free the partitioner again, return it by the release_one_partitioner() call.

Definition at line 74 of file parallel.cc.

◆ release_one_partitioner()

void parallel::internal::TBBPartitioner::release_one_partitioner ( const std::shared_ptr< tbb::affinity_partitioner > &  p)

After using the partitioner in a tbb loop through acquire_one_partitioner(), this call makes the partitioner available again.

Definition at line 87 of file parallel.cc.

Member Data Documentation

◆ my_partitioner

std::shared_ptr<tbb::affinity_partitioner> parallel::internal::TBBPartitioner::my_partitioner
private

The stored partitioner that can accumulate knowledge over several runs of tbb::parallel_for

Definition at line 685 of file parallel.h.

◆ in_use

bool parallel::internal::TBBPartitioner::in_use
private

A flag to indicate whether the partitioner has been acquired but not released yet, i.e., it is in use somewhere else.

Definition at line 691 of file parallel.h.

◆ mutex

Threads::Mutex parallel::internal::TBBPartitioner::mutex
private

A mutex to guard the access to the in_use flag.

Definition at line 696 of file parallel.h.


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