#include <TaskRunManager.hh>
Definition at line 44 of file TaskRunManager.hh.
◆ pointer
◆ TaskRunManager()
TaskRunManager::TaskRunManager |
( |
bool |
useTBB = false | ) |
|
|
explicit |
Definition at line 65 of file TaskRunManager.cc.
68,
m_workers(std::thread::hardware_concurrency())
72{
73 if(!GetPrivateMasterRunManager(false))
74 {
75 GetPrivateMasterRunManager(false) = this;
76 }
77
78#ifdef PTL_USE_TBB
79 auto _useTBB = GetEnv<bool>("FORCE_TBB", useTBB);
80 if(_useTBB)
81 useTBB = true;
82#endif
83
84
87}
TaskManager * m_task_manager
ThreadPool * m_thread_pool
VUserTaskQueue * m_task_queue
static void set_use_tbb(bool val)
◆ ~TaskRunManager()
TaskRunManager::~TaskRunManager |
( |
| ) |
|
|
virtual |
◆ GetInstance()
Definition at line 58 of file TaskRunManager.cc.
59{
61}
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 96 of file TaskRunManager.cc.
97{
99
100
102 {
104 std::cout << "TaskRunManager :: Creating thread pool..." << std::endl;
107 std::cout << "TaskRunManager :: Creating task manager..." << std::endl;
109 }
110
112 {
114 {
115 std::cout << "TaskRunManager :: Resizing thread pool from "
117 << std::endl;
118 }
120 }
121
122
124 {
126 std::cout << "TaskRunManager :: Using TBB..." << std::endl;
127 }
128 else
129 {
131 std::cout << "TaskRunManager :: Using ThreadPool..." << std::endl;
132 }
133
136 std::cout << "TaskRunManager :: initialized..." << std::endl;
137}
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: