hpx/threading_base/scheduler_base.hpp¶
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace
hpx
-
namespace
threads
-
namespace
policies
Functions
-
std::ostream &
operator<<
(std::ostream &os, scheduler_base const &scheduler)¶
-
struct
scheduler_base
¶ - #include <scheduler_base.hpp>
The scheduler_base defines the interface to be implemented by all scheduler policies
Public Types
-
using
polling_function_ptr
= detail::polling_status (*)()¶
Public Functions
-
HPX_NON_COPYABLE
(scheduler_base)¶
-
scheduler_base
(std::size_t num_threads, char const *description = "", thread_queue_init_parameters thread_queue_init = {}, scheduler_mode mode = scheduler_mode::nothing_special)¶
-
virtual
~scheduler_base
()¶
-
threads::thread_pool_base *
get_parent_pool
() const¶
-
void
set_parent_pool
(threads::thread_pool_base *p)¶
-
char const *
get_description
() const¶
-
void
do_some_work
(std::size_t)¶ This function gets called by the thread-manager whenever new work has been added, allowing the scheduler to reactivate one or more of possibly idling OS threads
-
std::size_t
select_active_pu
(std::unique_lock<pu_mutex_type> &l, std::size_t num_thread, bool allow_fallback = false)¶
-
scheduler_mode
get_scheduler_mode
() const¶
-
bool
has_scheduler_mode
(scheduler_mode mode) const¶
-
virtual void
set_scheduler_mode
(scheduler_mode mode)¶
-
void
add_scheduler_mode
(scheduler_mode mode)¶
-
void
remove_scheduler_mode
(scheduler_mode mode)¶
-
void
add_remove_scheduler_mode
(scheduler_mode to_add_mode, scheduler_mode to_remove_mode)¶
-
void
update_scheduler_mode
(scheduler_mode mode, bool set)¶
-
pu_mutex_type &
get_pu_mutex
(std::size_t num_thread)¶
-
std::vector<std::size_t>
domain_threads
(std::size_t local_id, const std::vector<std::size_t> &ts, hpx::function<bool(std::size_t, std::size_t)> pred)¶
-
virtual std::int64_t
get_thread_count
(thread_schedule_state state = thread_schedule_state::unknown, thread_priority priority = thread_priority::default_, std::size_t num_thread = std::size_t(-1), bool reset = false) const = 0¶
-
void
increment_background_thread_count
()¶
-
void
decrement_background_thread_count
()¶
-
virtual bool
enumerate_threads
(hpx::function<bool(thread_id_type)> const &f, thread_schedule_state state = thread_schedule_state::unknown, ) const = 0¶
-
virtual void
abort_all_suspended_threads
() = 0¶
-
virtual bool
cleanup_terminated
(bool delete_all) = 0¶
-
virtual void
create_thread
(thread_init_data &data, thread_id_ref_type *id, error_code &ec) = 0¶
-
virtual bool
get_next_thread
(std::size_t num_thread, bool running, threads::thread_id_ref_type &thrd, bool enable_stealing) = 0¶
-
virtual void
schedule_thread
(threads::thread_id_ref_type thrd, threads::thread_schedule_hint schedulehint, bool allow_fallback = false, thread_priority priority = thread_priority::normal) = 0¶
-
virtual void
schedule_thread_last
(threads::thread_id_ref_type thrd, threads::thread_schedule_hint schedulehint, bool allow_fallback = false, thread_priority priority = thread_priority::normal) = 0¶
-
virtual void
destroy_thread
(threads::thread_data *thrd) = 0¶
-
virtual bool
wait_or_add_new
(std::size_t num_thread, bool running, std::int64_t &idle_loop_count, bool enable_stealing, std::size_t &added) = 0¶
-
virtual void
reset_thread_distribution
()¶
-
std::ptrdiff_t
get_stack_size
(threads::thread_stacksize stacksize) const¶
-
void
set_mpi_polling_functions
(polling_function_ptr mpi_func, polling_work_count_function_ptr mpi_work_count_func)¶
-
void
clear_mpi_polling_function
()¶
-
void
set_cuda_polling_functions
(polling_function_ptr cuda_func, polling_work_count_function_ptr cuda_work_count_func)¶
-
void
clear_cuda_polling_function
()¶
-
detail::polling_status
custom_polling_function
() const¶
Public Static Functions
-
static detail::polling_status
null_polling_function
()¶
Protected Attributes
-
util::cache_line_data<std::atomic<scheduler_mode>>
mode_
¶
-
std::vector<pu_mutex_type>
suspend_mtxs_
¶
-
std::vector<pu_mutex_type>
pu_mtxs_
¶
-
char const *
description_
¶
-
thread_queue_init_parameters
thread_queue_init_
¶
-
threads::thread_pool_base *
parent_pool_
¶
-
std::atomic<polling_function_ptr>
polling_function_mpi_
¶
-
std::atomic<polling_function_ptr>
polling_function_cuda_
¶
-
std::atomic<polling_work_count_function_ptr>
polling_work_count_function_mpi_
¶
-
std::atomic<polling_work_count_function_ptr>
polling_work_count_function_cuda_
¶
-
using
-
std::ostream &
-
namespace
-
namespace