Embedded Multicore Building Blocks V1.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
mtapi_node_attributes_struct Struct Reference

Node attributes. More...

#include <mtapi.h>

Public Types

typedef struct mtapi_node_attributes_struct mtapi_node_attributes_t
 Node attributes type. More...
 

Public Member Functions

void mtapi_nodeattr_init (mtapi_node_attributes_t *attributes, mtapi_status_t *status)
 This function initializes a node attributes object. More...
 
void mtapi_nodeattr_set (mtapi_node_attributes_t *attributes, const mtapi_uint_t attribute_num, const void *attribute, const mtapi_size_t attribute_size, mtapi_status_t *status)
 This function sets node attribute values in a node attributes object. More...
 

Public Attributes

embb_core_set_t core_affinity
 stores MTAPI_NODE_CORE_AFFINITY More...
 
mtapi_uint_t num_cores
 stores MTAPI_NODE_NUMCORES More...
 
mtapi_uint_t type
 stores MTAPI_NODE_TYPE More...
 
mtapi_uint_t max_tasks
 stores MTAPI_NODE_MAX_TASKS More...
 
mtapi_uint_t max_actions
 stores MTAPI_NODE_MAX_ACTIONS More...
 
mtapi_uint_t max_groups
 stores MTAPI_NODE_MAX_GROUPS More...
 
mtapi_uint_t max_queues
 stores MTAPI_NODE_MAX_QUEUES More...
 
mtapi_uint_t queue_limit
 stores MTAPI_NODE_QUEUE_LIMIT More...
 
mtapi_uint_t max_jobs
 stores MTAPI_NODE_MAX_JOBS More...
 
mtapi_uint_t max_actions_per_job
 stores MTAPI_NODE_MAX_ACTIONS_PER_JOB More...
 
mtapi_uint_t max_priorities
 stores MTAPI_NODE_MAX_PRIORITIES More...
 
mtapi_boolean_t reuse_main_thread
 stores MTAPI_NODE_REUSE_MAIN_THREAD More...
 
mtapi_worker_priority_entry_tworker_priorities
 stores MTAPI_NODE_WORKER_PRIORITIES More...
 

Detailed Description

Node attributes.

Member Typedef Documentation

Node attributes type.

Member Function Documentation

void mtapi_nodeattr_init ( mtapi_node_attributes_t attributes,
mtapi_status_t *  status 
)

This function initializes a node attributes object.

A node attributes object is a container of node attributes. It is an optional argument passed to mtapi_initialize() to specify non-default node attributes when creating a node.

To set node attributes to non-default values, the application must allocate a node attributes object of type mtapi_node_attributes_t and initialize it with a call to mtapi_nodeattr_init(). The application may call mtapi_nodeattr_set() to specify attribute values. Calls to mtapi_nodeattr_init() have no effect on node attributes after the node has been created and initialized with mtapi_initialize(). The mtapi_node_attributes_t object may safely be deleted by the application after the call to mtapi_nodeattr_init().

On success, *status is set to MTAPI_SUCCESS. On error, *status is set to the appropriate error defined below.

Error code Description
MTAPI_ERR_PARAMETER Invalid attributes parameter.
See also
mtapi_initialize(), mtapi_nodeattr_set()
Concurrency
Not thread-safe
Parameters
[out]attributesPointer to attributes
[out]statusPointer to error code, may be MTAPI_NULL
void mtapi_nodeattr_set ( mtapi_node_attributes_t attributes,
const mtapi_uint_t  attribute_num,
const void *  attribute,
const mtapi_size_t  attribute_size,
mtapi_status_t *  status 
)

This function sets node attribute values in a node attributes object.

A node attributes object is a container of node attributes, optionally passed to mtapi_initialize() to specify non-default node attributes when creating a node.

attributes is a pointer to a node attributes object that was previously initialized with a call to mtapi_nodeattr_init(). Calls to mtapi_nodeattr_set() have no effect on node attributes after the node has been created and initialized with mtapi_initialize(). The node attributes object may safely be deleted by the application after the call to mtapi_initialize().

See the table below for a list of predefined attribute numbers and the sizes of the attribute values. The application must set attribute_size to the exact size in bytes of the attribute value. Additional attributes may be defined by the implementation.

MTAPI-defined node attributes:

Attribute num Description Data Type Default
MTAPI_NODES_NUMCORES (Read-only) number of processor cores of the node. mtapi_uint_t (none)

On success, *status is set to MTAPI_SUCCESS. On error, *status is set to the appropriate error defined below.

Error code Description
MTAPI_ERR_ATTR_READONLY Attribute cannot be modified.
MTAPI_ERR_PARAMETER Invalid attribute parameter.
MTAPI_ERR_ATTR_NUM Unknown attribute number.
MTAPI_ERR_ATTR_SIZE Incorrect attribute size.
See also
mtapi_nodeattr_init(), mtapi_initialize()
Concurrency
Not thread-safe
Parameters
[in,out]attributesPointer to attributes
[in]attribute_numAttribute id
[in]attributePointer to attribute value
[in]attribute_sizeSize of attribute value. may be 0, attribute is interpreted as value in that case
[out]statusPointer to error code, may be MTAPI_NULL

Member Data Documentation

embb_core_set_t mtapi_node_attributes_struct::core_affinity

stores MTAPI_NODE_CORE_AFFINITY

mtapi_uint_t mtapi_node_attributes_struct::num_cores

stores MTAPI_NODE_NUMCORES

mtapi_uint_t mtapi_node_attributes_struct::type

stores MTAPI_NODE_TYPE

mtapi_uint_t mtapi_node_attributes_struct::max_tasks

stores MTAPI_NODE_MAX_TASKS

mtapi_uint_t mtapi_node_attributes_struct::max_actions

stores MTAPI_NODE_MAX_ACTIONS

mtapi_uint_t mtapi_node_attributes_struct::max_groups

stores MTAPI_NODE_MAX_GROUPS

mtapi_uint_t mtapi_node_attributes_struct::max_queues

stores MTAPI_NODE_MAX_QUEUES

mtapi_uint_t mtapi_node_attributes_struct::queue_limit

stores MTAPI_NODE_QUEUE_LIMIT

mtapi_uint_t mtapi_node_attributes_struct::max_jobs

stores MTAPI_NODE_MAX_JOBS

mtapi_uint_t mtapi_node_attributes_struct::max_actions_per_job

stores MTAPI_NODE_MAX_ACTIONS_PER_JOB

mtapi_uint_t mtapi_node_attributes_struct::max_priorities

stores MTAPI_NODE_MAX_PRIORITIES

mtapi_boolean_t mtapi_node_attributes_struct::reuse_main_thread

stores MTAPI_NODE_REUSE_MAIN_THREAD

mtapi_worker_priority_entry_t* mtapi_node_attributes_struct::worker_priorities

stores MTAPI_NODE_WORKER_PRIORITIES