24#include "PTL/Config.hh"
38TaskRunManager::GetPrivateMasterRunManager()
40 static pointer _instance =
nullptr;
47TaskRunManager::GetPrivateMasterRunManager(
bool init,
bool useTBB)
49 auto& _v = GetPrivateMasterRunManager();
62 auto& _v = GetPrivateMasterRunManager(
true, useTBB);
77: m_workers(
std::thread::hardware_concurrency())
79 if(!GetPrivateMasterRunManager())
80 GetPrivateMasterRunManager() =
this;
82#if defined(PTL_USE_TBB)
97 if(GetPrivateMasterRunManager() ==
this)
98 GetPrivateMasterRunManager() =
nullptr;
112 std::cout <<
"TaskRunManager :: Creating thread pool..." << std::endl;
115 std::cout <<
"TaskRunManager :: Creating task manager..." << std::endl;
123 std::cout <<
"TaskRunManager :: Resizing thread pool from "
134 std::cout <<
"TaskRunManager :: Using TBB..." << std::endl;
139 std::cout <<
"TaskRunManager :: Using ThreadPool..." << std::endl;
144 std::cout <<
"TaskRunManager :: initialized..." << std::endl;
TaskManager * m_task_manager
static TaskRunManager * GetMasterRunManager(bool useTBB=false)
virtual void Initialize(uint64_t n=std::thread::hardware_concurrency())
ThreadPool * m_thread_pool
TaskRunManager(bool useTBB=false)
VUserTaskQueue * m_task_queue
static TaskRunManager * GetInstance(bool useTBB=false)
virtual ~TaskRunManager()
void resize(size_type _n)
size_type destroy_threadpool()
static void set_use_tbb(bool _v)
Tp GetEnv(const std::string &env_id, Tp _default=Tp())