QMCPACK
OMPThreadCountProtectorLA Class Reference

For linear algebra only. More...

+ Collaboration diagram for OMPThreadCountProtectorLA:

Public Member Functions

 OMPThreadCountProtectorLA ()
 
 ~OMPThreadCountProtectorLA ()
 

Private Types

using Protector = Concurrency::ThreadCountProtector< Executor::OPENMP >
 

Private Attributes

std::unique_ptr< Protectorhandle_
 

Detailed Description

For linear algebra only.

A service class to restore active avaiable threads upon destruction as the thread count recorded during construction It protects any side effects from linear algebra library calls changing the number of active avaiable threads. Known trouble maker: OpenBLAS https://github.com/xianyi/OpenBLAS/issues/3940

Definition at line 25 of file OMPThreadCountProtectorLA.hpp.

Member Typedef Documentation

◆ Protector

Constructor & Destructor Documentation

◆ OMPThreadCountProtectorLA()

Definition at line 17 of file OMPThreadCountProtectorLA.cpp.

References OMPThreadCountProtectorLA::handle_.

18  {
19 #if defined(HAVE_OPENBLAS)
20  handle_ = std::make_unique<Protector>();
21 #endif
22  }

◆ ~OMPThreadCountProtectorLA()

Member Data Documentation

◆ handle_

std::unique_ptr<Protector> handle_
private

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