class local_queue_scheduler
Declaration
template <
typename Mutex = std::mutex,
typename PendingQueuing = pika::threads::policies::lockfree_fifo,
typename StagedQueuing = pika::threads::policies::lockfree_fifo,
typename TerminatedQueuing = pika::threads::policies::
default_local_queue_scheduler_terminated_queue>
class local_queue_scheduler : public scheduler_base { /* full declaration omitted */ };Description
//////////////////////////////////////////////////////////////////////// The local_queue_scheduler maintains exactly one queue of work items (threads) per OS thread, where this OS thread pulls its next work from.
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:57
Inherits from: scheduler_base
Member Variables
- protected std::vector<thread_queue_type*> queues_
- protected std::atomic<std::size_t> curr_queue_
- protected const pika::detail::affinity_data& affinity_data_
- protected ::pika::threads::detail::mask_type steals_in_numa_domain_
- protected ::pika::threads::detail::mask_type steals_outside_numa_domain_
- protected std::vector< ::pika::threads::detail::mask_type> numa_domain_masks_
- protected std::vector< ::pika::threads::detail::mask_type> outside_numa_domain_masks_
Inherited from scheduler_base:
- protected mode_
- protected mtx_
- protected cond_
- protected wait_counts_
- protected suspend_mtxs_
- protected suspend_conds_
- protected pu_mtxs_
- protected states_
- protected description_
- protected thread_queue_init_
- protected parent_pool_
- protected background_thread_count_
- protected polling_function_mpi_
- protected polling_function_cuda_
- protected polling_work_count_function_mpi_
- protected polling_work_count_function_cuda_
Method Overview
- public void abort_all_suspended_threads()
- public bool cleanup_terminated(bool delete_all)
- public bool cleanup_terminated(std::size_t num_thread, bool delete_all)
- public void create_thread(pika::threads::thread_init_data & data, pika::threads::thread_id_ref_type * id, pika::error_code & ec)
- public void destroy_thread(threads::thread_data * thrd)
- public bool enumerate_threads(const util::function<bool (thread_id_type)> & f, pika::threads::thread_schedule_state state = thread_schedule_state::unknown) const
- public virtual bool get_next_thread(std::size_t num_thread, bool running, threads::thread_id_ref_type & thrd, bool)
- public std::int64_t get_queue_length(std::size_t num_thread = unsigned long(-1)) const
- public static std::string get_scheduler_name()
- public std::int64_t get_thread_count(pika::threads::thread_schedule_state state = thread_schedule_state::unknown, pika::threads::thread_priority priority = thread_priority::default_, std::size_t num_thread = unsigned long(-1), bool = false) const
- public bool is_core_idle(std::size_t num_thread) const
- public local_queue_scheduler<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing>(const pika::threads::policies::local_queue_scheduler::init_parameter_type & init, bool deferred_initialization = true)
- public void on_error(std::size_t num_thread, const std::exception_ptr & e)
- public void on_start_thread(std::size_t num_thread)
- public void on_stop_thread(std::size_t num_thread)
- public void schedule_thread(threads::thread_id_ref_type thrd, threads::thread_schedule_hint schedulehint, bool allow_fallback, pika::threads::thread_priority = thread_priority::normal)
- public void schedule_thread_last(threads::thread_id_ref_type thrd, threads::thread_schedule_hint schedulehint, bool allow_fallback, pika::threads::thread_priority = thread_priority::normal)
- public virtual bool wait_or_add_new(std::size_t num_thread, bool running, std::int64_t & idle_loop_count, bool, std::size_t & added)
- public virtual ~local_queue_scheduler<Mutex, PendingQueuing, StagedQueuing, TerminatedQueuing>()
Inherited from scheduler_base:
- public abort_all_suspended_threads
- public add_remove_scheduler_mode
- public add_scheduler_mode
- public cleanup_terminated
- public cleanup_terminated
- public clear_cuda_polling_function
- public clear_mpi_polling_function
- public create_thread
- public custom_polling_function
- public decrement_background_thread_count
- public destroy_thread
- public do_some_work
- public domain_from_local_thread_index
- public domain_threads
- public enumerate_threads
- public get_background_thread_count
- public get_description
- public get_minmax_state
- public get_next_thread
- public get_parent_pool
- public get_polling_work_count
- public get_pu_mutex
- public get_queue_length
- public get_scheduler_mode
- public get_stack_size
- public get_state
- public get_state
- public get_thread_count
- public global_to_local_thread_index
- public has_reached_state
- public has_scheduler_mode
- public idle_callback
- public increment_background_thread_count
- public is_core_idle
- public is_state
- public local_to_global_thread_index
- public null_polling_function
- public null_polling_work_count_function
- public num_domains
- public on_error
- public on_start_thread
- public on_stop_thread
- public remove_scheduler_mode
- public reset_thread_distribution
- public resume
- public schedule_thread
- public schedule_thread_last
- public select_active_pu
- public set_all_states
- public set_all_states_at_least
- public set_cuda_polling_functions
- public set_mpi_polling_functions
- public set_parent_pool
- public set_scheduler_mode
- public suspend
- public update_scheduler_mode
- public wait_or_add_new
Methods
void abort_all_suspended_threads()
void abort_all_suspended_threads()Description
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:270
bool cleanup_terminated(bool delete_all)
bool cleanup_terminated(bool delete_all)Description
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:277
Parameters
- bool delete_all
bool cleanup_terminated(std::size_t num_thread,
bool delete_all)
bool cleanup_terminated(std::size_t num_thread,
bool delete_all)Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:286
Parameters
- std::size_t num_thread
- bool delete_all
void create_thread(
pika::threads::thread_init_data& data,
pika::threads::thread_id_ref_type* id,
pika::error_code& ec)
void create_thread(
pika::threads::thread_init_data& data,
pika::threads::thread_id_ref_type* id,
pika::error_code& ec)Description
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:295
Parameters
void destroy_thread(threads::thread_data* thrd)
void destroy_thread(threads::thread_data* thrd)Description
Destroy the passed thread as it has been terminated
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:542
Parameters
- threads::thread_data* thrd
bool enumerate_threads(
const util::function<bool(thread_id_type)>& f,
pika::threads::thread_schedule_state state =
thread_schedule_state::unknown) const
bool enumerate_threads(
const util::function<bool(thread_id_type)>& f,
pika::threads::thread_schedule_state state =
thread_schedule_state::unknown) constDescription
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:641
Parameters
- const util::function<bool(thread_id_type)>& f
- pika::threads::thread_schedule_state state = thread_schedule_state::unknown
virtual bool get_next_thread(
std::size_t num_thread,
bool running,
threads::thread_id_ref_type& thrd,
bool)
virtual bool get_next_thread(
std::size_t num_thread,
bool running,
threads::thread_id_ref_type& thrd,
bool)Description
Return the next thread to be executed, return false if none is available
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:334
Parameters
- std::size_t num_thread
- bool running
- threads::thread_id_ref_type& thrd
- bool
std::int64_t get_queue_length(
std::size_t num_thread =
unsigned long(-1)) const
std::int64_t get_queue_length(
std::size_t num_thread =
unsigned long(-1)) constDescription
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:550
Parameters
- std::size_t num_thread = unsigned long(-1)
static std::string get_scheduler_name()
static std::string get_scheduler_name()Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:136
std::int64_t get_thread_count(
pika::threads::thread_schedule_state state =
thread_schedule_state::unknown,
pika::threads::thread_priority priority =
thread_priority::default_,
std::size_t num_thread = unsigned long(-1),
bool = false) const
std::int64_t get_thread_count(
pika::threads::thread_schedule_state state =
thread_schedule_state::unknown,
pika::threads::thread_priority priority =
thread_priority::default_,
std::size_t num_thread = unsigned long(-1),
bool = false) constDescription
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:570
Parameters
- pika::threads::thread_schedule_state state = thread_schedule_state::unknown
- pika::threads::thread_priority priority = thread_priority::default_
- std::size_t num_thread = unsigned long(-1)
- bool = false
bool is_core_idle(std::size_t num_thread) const
bool is_core_idle(std::size_t num_thread) constDeclared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:634
Parameters
- std::size_t num_thread
local_queue_scheduler<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>(
const pika::threads::policies::
local_queue_scheduler::
init_parameter_type& init,
bool deferred_initialization = true)
local_queue_scheduler<Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>(
const pika::threads::policies::
local_queue_scheduler::
init_parameter_type& init,
bool deferred_initialization = true)Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:95
Parameters
- const pika::threads::policies:: local_queue_scheduler::init_parameter_type& init
- bool deferred_initialization = true
void on_error(std::size_t num_thread,
const std::exception_ptr& e)
void on_error(std::size_t num_thread,
const std::exception_ptr& e)Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:942
Parameters
- std::size_t num_thread
- const std::exception_ptr& e
void on_start_thread(std::size_t num_thread)
void on_start_thread(std::size_t num_thread)Description
////////////////////////////////////////////////////////////////////
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:875
Parameters
- std::size_t num_thread
void on_stop_thread(std::size_t num_thread)
void on_stop_thread(std::size_t num_thread)Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:937
Parameters
- std::size_t num_thread
void schedule_thread(
threads::thread_id_ref_type thrd,
threads::thread_schedule_hint schedulehint,
bool allow_fallback,
pika::threads::thread_priority =
thread_priority::normal)
void schedule_thread(
threads::thread_id_ref_type thrd,
threads::thread_schedule_hint schedulehint,
bool allow_fallback,
pika::threads::thread_priority =
thread_priority::normal)Description
Schedule the passed thread
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:463
Parameters
- threads::thread_id_ref_type thrd
- threads::thread_schedule_hint schedulehint
- bool allow_fallback
- pika::threads::thread_priority = thread_priority::normal
void schedule_thread_last(
threads::thread_id_ref_type thrd,
threads::thread_schedule_hint schedulehint,
bool allow_fallback,
pika::threads::thread_priority =
thread_priority::normal)
void schedule_thread_last(
threads::thread_id_ref_type thrd,
threads::thread_schedule_hint schedulehint,
bool allow_fallback,
pika::threads::thread_priority =
thread_priority::normal)Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:506
Parameters
- threads::thread_id_ref_type thrd
- threads::thread_schedule_hint schedulehint
- bool allow_fallback
- pika::threads::thread_priority = thread_priority::normal
virtual bool wait_or_add_new(
std::size_t num_thread,
bool running,
std::int64_t& idle_loop_count,
bool,
std::size_t& added)
virtual bool wait_or_add_new(
std::size_t num_thread,
bool running,
std::int64_t& idle_loop_count,
bool,
std::size_t& added)Description
This is a function which gets called periodically by the thread manager to allow for maintenance tasks to be executed in the scheduler. Returns true if the OS thread calling this function has to be terminated (i.e. no more work has to be done).
Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:710
Parameters
- std::size_t num_thread
- bool running
- std::int64_t& idle_loop_count
- bool
- std::size_t& added
virtual ~local_queue_scheduler<
Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>()
virtual ~local_queue_scheduler<
Mutex,
PendingQueuing,
StagedQueuing,
TerminatedQueuing>()Declared at: libs/pika/schedulers/include/pika/schedulers/local_queue_scheduler.hpp:130