QMCPACK
OMPThreadCountProtectorLA.hpp
Go to the documentation of this file.
1
//////////////////////////////////////////////////////////////////////////////////////
2
// This file is distributed under the University of Illinois/NCSA Open Source License.
3
// See LICENSE file in top directory for details.
4
//
5
// Copyright (c) 2023 QMCPACK developers.
6
//
7
// File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8
//
9
// File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10
//
11
//////////////////////////////////////////////////////////////////////////////////////
12
13
#ifndef QMCPLUSPLUS_LATHREADPROTECTOR_H
14
#define QMCPLUSPLUS_LATHREADPROTECTOR_H
15
16
#include <memory>
17
#include <
Concurrency/UtilityFunctions.hpp
>
18
19
namespace
qmcplusplus
20
{
21
/** For linear algebra only. A service class to restore active avaiable threads upon destruction as the thread count recorded during construction
22
* It protects any side effects from linear algebra library calls changing the number of active avaiable threads.
23
* Known trouble maker: OpenBLAS https://github.com/xianyi/OpenBLAS/issues/3940
24
*/
25
class
OMPThreadCountProtectorLA
26
{
27
using
Protector
=
Concurrency::ThreadCountProtector<Executor::OPENMP>
;
28
std::unique_ptr<Protector>
handle_
;
29
30
public
:
31
OMPThreadCountProtectorLA
();
32
~OMPThreadCountProtectorLA
();
33
};
34
}
// namespace qmcplusplus
35
#endif
qmcplusplus
helper functions for EinsplineSetBuilder
Definition:
Configuration.h:43
qmcplusplus::OMPThreadCountProtectorLA::~OMPThreadCountProtectorLA
~OMPThreadCountProtectorLA()
qmcplusplus::OMPThreadCountProtectorLA
For linear algebra only.
Definition:
OMPThreadCountProtectorLA.hpp:25
qmcplusplus::OMPThreadCountProtectorLA::OMPThreadCountProtectorLA
OMPThreadCountProtectorLA()
Definition:
OMPThreadCountProtectorLA.cpp:17
qmcplusplus::Concurrency::ThreadCountProtector< Executor::OPENMP >
Definition:
UtilityFunctions.hpp:36
qmcplusplus::OMPThreadCountProtectorLA::handle_
std::unique_ptr< Protector > handle_
Definition:
OMPThreadCountProtectorLA.hpp:28
UtilityFunctions.hpp
utility functions for executors
src
Platforms
CPU
OMPThreadCountProtectorLA.hpp
Generated on Fri Jun 28 2024 10:45:16 for QMCPACK by
1.8.14