Embedded Multicore Building Blocks V1.0.0
|
A singleton representing the MTAPI runtime. More...
#include <node.h>
Public Types | |
typedef embb::base::Function< void, TaskContext & > | SMPFunction |
Function type for simple SMP interface. More... | |
Public Member Functions | |
~Node () | |
Destroys the runtime singleton. More... | |
mtapi_uint_t | GetCoreCount () const |
Returns the number of available cores. More... | |
mtapi_uint_t | GetWorkerThreadCount () const |
Returns the number of worker threads. More... | |
mtapi_uint_t | GetQueueCount () const |
Returns the number of available queues. More... | |
mtapi_uint_t | GetGroupCount () const |
Returns the number of available groups. More... | |
mtapi_uint_t | GetTaskLimit () const |
Returns the number of available tasks. More... | |
Task | Start (SMPFunction const &func) |
Starts a new Task. More... | |
Task | Start (SMPFunction const &func, ExecutionPolicy const &policy) |
Starts a new Task with a given affinity and priority. More... | |
template<typename ARGS , typename RES > | |
Task | Start (mtapi_task_id_t task_id, Job const &job, const ARGS *arguments, RES *results, TaskAttributes const &attributes) |
Starts a new Task. More... | |
template<typename ARGS , typename RES > | |
Task | Start (mtapi_task_id_t task_id, Job const &job, const ARGS *arguments, RES *results) |
Starts a new Task. More... | |
template<typename ARGS , typename RES > | |
Task | Start (Job const &job, const ARGS *arguments, RES *results, TaskAttributes const &attributes) |
Starts a new Task. More... | |
template<typename ARGS , typename RES > | |
Task | Start (Job const &job, const ARGS *arguments, RES *results) |
Starts a new Task. More... | |
Job | GetJob (mtapi_job_id_t job_id) |
Retrieves a handle to the Job identified by job_id within the domain of the local Node. More... | |
Job | GetJob (mtapi_job_id_t job_id, mtapi_domain_t domain_id) |
Retrieves a handle to the Job identified by job_id and domain_id . More... | |
Action | CreateAction (mtapi_job_id_t job_id, mtapi_action_function_t func, const void *node_local_data, mtapi_size_t node_local_data_size, ActionAttributes const &attributes) |
Constructs an Action. More... | |
Action | CreateAction (mtapi_job_id_t job_id, mtapi_action_function_t func, const void *node_local_data, mtapi_size_t node_local_data_size) |
Constructs an Action. More... | |
Action | CreateAction (mtapi_job_id_t job_id, mtapi_action_function_t func, ActionAttributes const &attributes) |
Constructs an Action. More... | |
Action | CreateAction (mtapi_job_id_t job_id, mtapi_action_function_t func) |
Constructs an Action. More... | |
Group | CreateGroup () |
Constructs a Group object with default attributes. More... | |
Group | CreateGroup (mtapi_group_id_t id) |
Constructs a Group object with default attributes and the given ID. More... | |
Group | CreateGroup (GroupAttributes const &group_attr) |
Constructs a Group object using the given Attributes. More... | |
Group | CreateGroup (mtapi_group_id_t id, GroupAttributes const &group_attr) |
Constructs a Group object with given attributes and ID. More... | |
Queue | CreateQueue (Job &job) |
Constructs a Queue with the given Job and default attributes. More... | |
Queue | CreateQueue (Job const &job, QueueAttributes const &attr) |
Constructs a Queue with the given Job and QueueAttributes. More... | |
Task | Start (mtapi_task_id_t task_id, mtapi_job_hndl_t job, const void *arguments, mtapi_size_t arguments_size, void *results, mtapi_size_t results_size, mtapi_task_attributes_t const *attributes) |
Starts a new Task. More... | |
void | YieldToScheduler () |
This function yields execution to the MTAPI scheduler for at most one task. More... | |
Static Public Member Functions | |
static void | Initialize (mtapi_domain_t domain_id, mtapi_node_t node_id) |
Initializes the runtime singleton using default values: More... | |
static void | Initialize (mtapi_domain_t domain_id, mtapi_node_t node_id, NodeAttributes const &attributes) |
Initializes the runtime singleton. More... | |
static bool | IsInitialized () |
Checks if runtime is initialized. More... | |
static Node & | GetInstance () |
Gets the instance of the runtime system. More... | |
static void | Finalize () |
Shuts the runtime system down. More... | |
A singleton representing the MTAPI runtime.
typedef embb::base::Function<void, TaskContext &> embb::mtapi::Node::SMPFunction |
Function type for simple SMP interface.
embb::mtapi::Node::~Node | ( | ) |
Destroys the runtime singleton.
|
static |
Initializes the runtime singleton using default values:
ErrorException | if the singleton was already initialized or the Node could not be initialized. |
[in] | domain_id | The domain id to use |
[in] | node_id | The node id to use |
|
static |
Initializes the runtime singleton.
ErrorException | if the singleton was already initialized or the Node could not be initialized. |
[in] | domain_id | The domain id to use |
[in] | node_id | The node id to use |
[in] | attributes | Attributes to use |
|
static |
Checks if runtime is initialized.
true
if the Node singleton is already initialized, false otherwise
|
static |
Gets the instance of the runtime system.
|
static |
Shuts the runtime system down.
ErrorException | if the singleton is not initialized. |
mtapi_uint_t embb::mtapi::Node::GetCoreCount | ( | ) | const |
Returns the number of available cores.
mtapi_uint_t embb::mtapi::Node::GetWorkerThreadCount | ( | ) | const |
Returns the number of worker threads.
mtapi_uint_t embb::mtapi::Node::GetQueueCount | ( | ) | const |
Returns the number of available queues.
mtapi_uint_t embb::mtapi::Node::GetGroupCount | ( | ) | const |
Returns the number of available groups.
mtapi_uint_t embb::mtapi::Node::GetTaskLimit | ( | ) | const |
Returns the number of available tasks.
Task embb::mtapi::Node::Start | ( | SMPFunction const & | func | ) |
Task embb::mtapi::Node::Start | ( | SMPFunction const & | func, |
ExecutionPolicy const & | policy | ||
) |
Task embb::mtapi::Node::Start | ( | mtapi_task_id_t | task_id, |
Job const & | job, | ||
const ARGS * | arguments, | ||
RES * | results, | ||
TaskAttributes const & | attributes | ||
) |
Task embb::mtapi::Node::Start | ( | Job const & | job, |
const ARGS * | arguments, | ||
RES * | results, | ||
TaskAttributes const & | attributes | ||
) |
Job embb::mtapi::Node::GetJob | ( | mtapi_job_id_t | job_id | ) |
Job embb::mtapi::Node::GetJob | ( | mtapi_job_id_t | job_id, |
mtapi_domain_t | domain_id | ||
) |
Action embb::mtapi::Node::CreateAction | ( | mtapi_job_id_t | job_id, |
mtapi_action_function_t | func, | ||
const void * | node_local_data, | ||
mtapi_size_t | node_local_data_size, | ||
ActionAttributes const & | attributes | ||
) |
Action embb::mtapi::Node::CreateAction | ( | mtapi_job_id_t | job_id, |
mtapi_action_function_t | func, | ||
const void * | node_local_data, | ||
mtapi_size_t | node_local_data_size | ||
) |
Action embb::mtapi::Node::CreateAction | ( | mtapi_job_id_t | job_id, |
mtapi_action_function_t | func, | ||
ActionAttributes const & | attributes | ||
) |
Action embb::mtapi::Node::CreateAction | ( | mtapi_job_id_t | job_id, |
mtapi_action_function_t | func | ||
) |
Group embb::mtapi::Node::CreateGroup | ( | ) |
Group embb::mtapi::Node::CreateGroup | ( | mtapi_group_id_t | id | ) |
Group embb::mtapi::Node::CreateGroup | ( | GroupAttributes const & | group_attr | ) |
Constructs a Group object using the given Attributes.
group_attr | The GroupAttributes to use. |
Group embb::mtapi::Node::CreateGroup | ( | mtapi_group_id_t | id, |
GroupAttributes const & | group_attr | ||
) |
Constructs a Group object with given attributes and ID.
id | A user defined ID of the Group. |
group_attr | The GroupAttributes to use. |
Queue embb::mtapi::Node::CreateQueue | ( | Job const & | job, |
QueueAttributes const & | attr | ||
) |
Task embb::mtapi::Node::Start | ( | mtapi_task_id_t | task_id, |
mtapi_job_hndl_t | job, | ||
const void * | arguments, | ||
mtapi_size_t | arguments_size, | ||
void * | results, | ||
mtapi_size_t | results_size, | ||
mtapi_task_attributes_t const * | attributes | ||
) |
void embb::mtapi::Node::YieldToScheduler | ( | ) |
This function yields execution to the MTAPI scheduler for at most one task.