class runtime::impl
Declaration
class runtime::impl : public runtime,
private delegate,
private delegate,
private delegate { /* full declaration omitted */ };
Declared at: src/runtime.cc:88
Inherits from: runtime, task_manager::delegate, scheduler::delegate, executor::delegate
Member Variables
- std::thread::id m_application_thread
- std::unique_ptr<config> m_cfg
- size_t m_num_nodes = 0
- node_id m_local_nid = 0
- size_t m_num_local_devices = 0
- size_t m_num_live_queues = 0
- std::unordered_set<buffer_id> m_live_buffers
- std::unordered_set<host_object_id> m_live_host_objects
- buffer_id m_next_buffer_id = 0
- raw_allocation_id m_next_user_allocation_id = 1
- host_object_id m_next_host_object_id = 0
- reduction_id m_next_reduction_id = no_reduction_id + 1
- task_graph m_tdag
- std::unique_ptr<task_manager> m_task_mngr
- std::unique_ptr<scheduler> m_schdlr
- std::unique_ptr<executor> m_exec
- std::optional<task_id> m_latest_horizon_reached
- std::atomic<size_t> m_latest_epoch_reached
- task_id m_last_epoch_pruned_before = 0
- std::unique_ptr<detail::task_recorder> m_task_recorder
- std::unique_ptr<detail::command_recorder> m_command_recorder
- std::unique_ptr<detail::instruction_recorder> m_instruction_recorder
- std::unique_ptr< detail::thread_pinning::thread_pinner> m_thread_pinner
Member Function Overview
- create_buffer(const range<3> & range, size_t elem_size, size_t elem_align, allocation_id user_aid) → buffer_id
- create_host_object(std::unique_ptr<host_object_instance> instance) → host_object_id
- create_queue() → void
- create_reduction(std::unique_ptr<reducer> reducer) → reduction_id
- create_user_allocation(void * ptr) → allocation_id
- destroy_buffer(buffer_id bid) → void
- destroy_host_object(host_object_id hoid) → void
- destroy_queue() → void
- fence(buffer_access access, std::unique_ptr<task_promise> fence_promise) → task_id
- fence(host_object_effect effect, std::unique_ptr<task_promise> fence_promise) → task_id
- flush_scheduler() → void
- impl(const runtime::impl &)
- impl(int * argc, char *** argv, const devices_or_selector & user_devices_or_selector)
- impl(runtime::impl &&)
- is_dry_run() const → bool
- operator=(runtime::impl &&) → impl &
- operator=(const runtime::impl &) → impl &
- set_buffer_debug_name(buffer_id bid, const std::string & debug_name) → void
- set_scheduler_lookahead(experimental::lookahead lookahead) → void
- submit(raw_command_group && cg) → task_id
- sync(detail::epoch_action action) → task_id
- ~impl()
- epoch_reached(task_id epoch_tid) → void
- flush(std::vector<const instruction *> instructions, std::vector<outbound_pilot> pilot) → void
- horizon_reached(task_id horizon_tid) → void
- is_unreferenced() const → bool
- maybe_prune_task_graph() → void
- on_scheduler_busy() → void
- on_scheduler_idle() → void
- require_call_from_application_thread() const → void
- task_created(const task * tsk) → void
Inherited from runtime:
- public create_buffer
- public create_host_object
- public create_queue
- public create_reduction
- public create_user_allocation
- public destroy_buffer
- public destroy_host_object
- public destroy_queue
- public fence
- public fence
- public flush_scheduler
- public get_instance
- public has_instance
- public init
- public is_dry_run
- public operator=
- public operator=
- public set_buffer_debug_name
- public set_scheduler_lookahead
- public shutdown
- public submit
- public sync
Member Functions
¶buffer_id create_buffer(const range<3>& range,
size_t elem_size,
size_t elem_align,
allocation_id user_aid)
buffer_id create_buffer(const range<3>& range,
size_t elem_size,
size_t elem_align,
allocation_id user_aid)
Declared at: src/runtime.cc:113
Parameters
- const range<3>& range
- size_t elem_size
- size_t elem_align
- allocation_id user_aid
¶host_object_id create_host_object(
std::unique_ptr<host_object_instance>
instance)
host_object_id create_host_object(
std::unique_ptr<host_object_instance>
instance)
Declared at: src/runtime.cc:119
Parameters
- std::unique_ptr<host_object_instance> instance
¶void create_queue()
void create_queue()
Declared at: src/runtime.cc:107
¶reduction_id create_reduction(
std::unique_ptr<reducer> reducer)
reduction_id create_reduction(
std::unique_ptr<reducer> reducer)
Declared at: src/runtime.cc:123
Parameters
- std::unique_ptr<reducer> reducer
¶allocation_id create_user_allocation(void* ptr)
allocation_id create_user_allocation(void* ptr)
Declared at: src/runtime.cc:111
Parameters
- void* ptr
¶void destroy_buffer(buffer_id bid)
void destroy_buffer(buffer_id bid)
Declared at: src/runtime.cc:117
Parameters
- buffer_id bid
¶void destroy_host_object(host_object_id hoid)
void destroy_host_object(host_object_id hoid)
Declared at: src/runtime.cc:121
Parameters
- host_object_id hoid
¶void destroy_queue()
void destroy_queue()
Declared at: src/runtime.cc:109
¶task_id fence(
buffer_access access,
std::unique_ptr<task_promise> fence_promise)
task_id fence(
buffer_access access,
std::unique_ptr<task_promise> fence_promise)
Declared at: src/runtime.cc:101
Parameters
- buffer_access access
- std::unique_ptr<task_promise> fence_promise
¶task_id fence(
host_object_effect effect,
std::unique_ptr<task_promise> fence_promise)
task_id fence(
host_object_effect effect,
std::unique_ptr<task_promise> fence_promise)
Declared at: src/runtime.cc:103
Parameters
- host_object_effect effect
- std::unique_ptr<task_promise> fence_promise
¶void flush_scheduler()
void flush_scheduler()
Declared at: src/runtime.cc:129
¶impl(const runtime::impl&)
impl(const runtime::impl&)
Declared at: src/runtime.cc:92
Parameters
- const runtime::impl&
¶impl(int* argc,
char*** argv,
const devices_or_selector&
user_devices_or_selector)
impl(int* argc,
char*** argv,
const devices_or_selector&
user_devices_or_selector)
Declared at: src/runtime.cc:90
Parameters
- int* argc
- char*** argv
- const devices_or_selector& user_devices_or_selector
¶impl(runtime::impl&&)
impl(runtime::impl&&)
Declared at: src/runtime.cc:93
Parameters
¶bool is_dry_run() const
bool is_dry_run() const
Declared at: src/runtime.cc:125
¶impl& operator=(runtime::impl&&)
impl& operator=(runtime::impl&&)
Declared at: src/runtime.cc:95
Parameters
¶impl& operator=(const runtime::impl&)
impl& operator=(const runtime::impl&)
Declared at: src/runtime.cc:94
Parameters
- const runtime::impl&
¶void set_buffer_debug_name(
buffer_id bid,
const std::string& debug_name)
void set_buffer_debug_name(
buffer_id bid,
const std::string& debug_name)
Declared at: src/runtime.cc:115
Parameters
- buffer_id bid
- const std::string& debug_name
¶void set_scheduler_lookahead(
experimental::lookahead lookahead)
void set_scheduler_lookahead(
experimental::lookahead lookahead)
Declared at: src/runtime.cc:127
Parameters
- experimental::lookahead lookahead
¶task_id submit(raw_command_group&& cg)
task_id submit(raw_command_group&& cg)
Declared at: src/runtime.cc:99
Parameters
- raw_command_group&& cg
¶task_id sync(detail::epoch_action action)
task_id sync(detail::epoch_action action)
Declared at: src/runtime.cc:105
Parameters
- detail::epoch_action action
¶~impl()
~impl()
Declared at: src/runtime.cc:97
¶void epoch_reached(task_id epoch_tid)
void epoch_reached(task_id epoch_tid)
Description
Called from the executor thread as soon as an epoch_instruction has finished executing.
Declared at: src/runtime.cc:187
Parameters
- task_id epoch_tid
¶void flush(
std::vector<const instruction*> instructions,
std::vector<outbound_pilot> pilot)
void flush(
std::vector<const instruction*> instructions,
std::vector<outbound_pilot> pilot)
Description
Called whenever new instructions have been generated and inserted into the instruction graph, and / or new pilot messages have been generated that must be transmitted to peer nodes before they can accept data transmitted through send_instruction
s originating from the local node. The vector of instructions is in topological order of dependencies, and so is the concatenation of all vectors that are passed through this function. Topological order here means that sequential execution in that order would fulfill all internal dependencies. The instruction graph generator guarantees that instruction pointers are stable and the pointed-to instructions are both immutable and safe to read from other threads. This is exposed as a single function on vectors to minimize lock contention in a threaded delegate implementations.
Declared at: src/runtime.cc:181
Parameters
- std::vector<const instruction*> instructions
- std::vector<outbound_pilot> pilot
¶void horizon_reached(task_id horizon_tid)
void horizon_reached(task_id horizon_tid)
Description
Called from the executor thread as soon as a horizon_instruction has finished executing.
Declared at: src/runtime.cc:186
Parameters
- task_id horizon_tid
¶bool is_unreferenced() const
bool is_unreferenced() const
Description
True when no buffers, host objects or queues are live that keep the runtime alive.
Declared at: src/runtime.cc:190
¶void maybe_prune_task_graph()
void maybe_prune_task_graph()
Declared at: src/runtime.cc:175
¶void on_scheduler_busy()
void on_scheduler_busy()
Declared at: src/runtime.cc:183
¶void on_scheduler_idle()
void on_scheduler_idle()
Declared at: src/runtime.cc:182
¶void require_call_from_application_thread() const
void require_call_from_application_thread() const
Description
Panic when not called from m_application_thread (see that variable for more info on the matter). Since there are thread-safe and non thread-safe member functions, we call this check at the beginning of all the non-safe ones.
Declared at: src/runtime.cc:173
¶void task_created(const task* tsk)
void task_created(const task* tsk)
Description
Called whenever new tasks have been generated and inserted into the tasks graph.
Declared at: src/runtime.cc:178
Parameters
- const task* tsk