#include <thread_pool.hpp>
Definition at line 51 of file thread_pool.hpp.
◆ size_type
◆ thread_container_type
◆ thread_pool() [1/2]
| lbann::thread_pool::thread_pool |
( |
| ) |
|
Construct an empty threadpool. Size must be set with launch().
◆ thread_pool() [2/2]
| lbann::thread_pool::thread_pool |
( |
size_type |
max_threads | ) |
|
Construct a threadpool of a given size.
- Parameters
-
| max_threads | Total threads available. max_threads-1 worker threads will be launched. |
◆ ~thread_pool()
| lbann::thread_pool::~thread_pool |
( |
| ) |
|
|
inline |
◆ do_thread_work_()
| void lbann::thread_pool::do_thread_work_ |
( |
| ) |
|
|
private |
The task executed by each thread.
◆ finish_work_group()
| bool lbann::thread_pool::finish_work_group |
( |
| ) |
|
|
inline |
Wait for all of the jobs in a work group to finish.
Definition at line 128 of file thread_pool.hpp.
◆ get_local_thread_id()
| int lbann::thread_pool::get_local_thread_id |
( |
| ) |
|
Convert the C++ thread id into a local thread pool id.
◆ get_num_threads()
| size_type lbann::thread_pool::get_num_threads |
( |
| ) |
const |
|
inlinenoexcept |
Query the number of worker threads actually present.
Definition at line 145 of file thread_pool.hpp.
◆ get_threads_offset()
| int lbann::thread_pool::get_threads_offset |
( |
| ) |
|
|
inline |
Convert the C++ thread id into a local thread pool id.
Definition at line 151 of file thread_pool.hpp.
◆ launch_pinned_threads()
| void lbann::thread_pool::launch_pinned_threads |
( |
size_type |
num_threads, |
|
|
int |
cpu_offset |
|
) |
| |
Launch the threads and pin them to the Hyperthreaded cores.
◆ launch_threads()
| void lbann::thread_pool::launch_threads |
( |
size_type |
num_threads | ) |
|
◆ reap_threads()
| void lbann::thread_pool::reap_threads |
( |
| ) |
|
Wake and terminate all threads in the pool
◆ relaunch_pinned_threads()
| void lbann::thread_pool::relaunch_pinned_threads |
( |
size_type |
num_threads | ) |
|
Reap all threads in the pool and relaunch pinned threads
◆ submit_job()
template<typename FunctionT >
| std::future<typename std::result_of<FunctionT()>::type> lbann::thread_pool::submit_job |
( |
FunctionT |
func | ) |
|
|
inline |
◆ submit_job_to_work_group()
template<typename FunctionT >
| void lbann::thread_pool::submit_job_to_work_group |
( |
FunctionT |
func | ) |
|
|
inline |
Submit a job to the pool's queue and place the future into a work group.
Definition at line 116 of file thread_pool.hpp.
◆ all_work_done_
| std::atomic<bool> lbann::thread_pool::all_work_done_ |
|
private |
◆ global_work_queue_
◆ m_thread_id_to_local_id_map
| std::unordered_map<std::thread::id, int> lbann::thread_pool::m_thread_id_to_local_id_map |
|
private |
◆ m_thread_map_mutex
| std::mutex lbann::thread_pool::m_thread_map_mutex |
|
private |
◆ m_threads_offset
| int lbann::thread_pool::m_threads_offset |
|
private |
◆ m_work_group
| std::vector<std::future<bool> > lbann::thread_pool::m_work_group |
|
private |
◆ thread_joiner_
◆ threads_
The documentation for this class was generated from the following file: