#include <TaskRunManager.hh>
Definition at line 41 of file TaskRunManager.hh.
◆ pointer
◆ TaskRunManager()
TaskRunManager::TaskRunManager |
( |
bool |
useTBB = false | ) |
|
|
explicit |
Definition at line 76 of file TaskRunManager.cc.
77:
m_workers(std::thread::hardware_concurrency())
78{
79 if(!GetPrivateMasterRunManager())
80 GetPrivateMasterRunManager() = this;
81
82#if defined(PTL_USE_TBB)
83 auto _useTBB = GetEnv<bool>("PTL_FORCE_TBB", GetEnv<bool>("FORCE_TBB", useTBB));
84 if(_useTBB)
85 useTBB = true;
86#endif
87
88
91}
static void set_use_tbb(bool _v)
◆ ~TaskRunManager()
TaskRunManager::~TaskRunManager |
( |
| ) |
|
|
virtual |
Definition at line 95 of file TaskRunManager.cc.
96{
97 if(GetPrivateMasterRunManager() == this)
98 GetPrivateMasterRunManager() = nullptr;
99}
◆ GetInstance()
Definition at line 69 of file TaskRunManager.cc.
70{
72}
static TaskRunManager * GetMasterRunManager(bool useTBB=false)
◆ GetMasterRunManager()
TaskRunManager * TaskRunManager::GetMasterRunManager |
( |
bool |
useTBB = false | ) |
|
|
static |
◆ GetNumberActiveThreads()
virtual size_t PTL::TaskRunManager::GetNumberActiveThreads |
( |
| ) |
const |
|
inlinevirtual |
◆ GetNumberOfThreads()
virtual int PTL::TaskRunManager::GetNumberOfThreads |
( |
| ) |
const |
|
inlinevirtual |
◆ GetTaskManager()
TaskManager * PTL::TaskRunManager::GetTaskManager |
( |
| ) |
const |
|
inline |
◆ GetThreadPool()
ThreadPool * PTL::TaskRunManager::GetThreadPool |
( |
| ) |
const |
|
inline |
◆ GetVerbose()
int PTL::TaskRunManager::GetVerbose |
( |
| ) |
const |
|
inline |
◆ Initialize()
void TaskRunManager::Initialize |
( |
uint64_t |
n = std::thread::hardware_concurrency() | ) |
|
|
virtual |
Reimplemented in G4TaskRunManager.
Definition at line 104 of file TaskRunManager.cc.
105{
107
108
110 {
112 std::cout << "TaskRunManager :: Creating thread pool..." << std::endl;
115 std::cout << "TaskRunManager :: Creating task manager..." << std::endl;
117 }
118
120 {
122 {
123 std::cout << "TaskRunManager :: Resizing thread pool from "
125 << std::endl;
126 }
128 }
129
130
132 {
134 std::cout << "TaskRunManager :: Using TBB..." << std::endl;
135 }
136 else
137 {
139 std::cout << "TaskRunManager :: Using ThreadPool..." << std::endl;
140 }
141
144 std::cout << "TaskRunManager :: initialized..." << std::endl;
145}
VUserTaskQueue * m_task_queue
void resize(size_type _n)
Referenced by G4TaskRunManager::Initialize(), and G4TaskRunManager::InitializeThreadPool().
◆ IsInitialized()
bool PTL::TaskRunManager::IsInitialized |
( |
| ) |
const |
|
inline |
◆ SetVerbose()
void PTL::TaskRunManager::SetVerbose |
( |
int |
val | ) |
|
|
inline |
◆ Terminate()
void TaskRunManager::Terminate |
( |
| ) |
|
|
virtual |
◆ m_is_initialized
bool PTL::TaskRunManager::m_is_initialized = false |
|
protected |
◆ m_task_manager
TaskManager* PTL::TaskRunManager::m_task_manager = nullptr |
|
protected |
◆ m_task_queue
◆ m_thread_pool
ThreadPool* PTL::TaskRunManager::m_thread_pool = nullptr |
|
protected |
◆ m_verbose
int PTL::TaskRunManager::m_verbose = 0 |
|
protected |
◆ m_workers
uint64_t PTL::TaskRunManager::m_workers = 0 |
|
protected |
The documentation for this class was generated from the following files: