Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f61ec036
authored
Apr 06, 2016
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tasks_cpp: add function to query the task limit
parent
e1b96eb4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
tasks_cpp/include/embb/tasks/node.h
+10
-0
tasks_cpp/src/node.cc
+3
-0
No files found.
tasks_cpp/include/embb/tasks/node.h
View file @
f61ec036
...
@@ -130,6 +130,15 @@ class Node {
...
@@ -130,6 +130,15 @@ class Node {
}
}
/**
/**
* Returns the number of available tasks.
* \return The number of available tasks
* \waitfree
*/
mtapi_uint_t
GetTaskLimit
()
const
{
return
task_limit_
;
}
/**
* Returns the number of available cores.
* Returns the number of available cores.
* \return The number of available cores
* \return The number of available cores
* \waitfree
* \waitfree
...
@@ -229,6 +238,7 @@ class Node {
...
@@ -229,6 +238,7 @@ class Node {
mtapi_task_context_t
*
context
);
mtapi_task_context_t
*
context
);
mtapi_uint_t
queue_count_
;
mtapi_uint_t
queue_count_
;
mtapi_uint_t
task_limit_
;
mtapi_uint_t
core_count_
;
mtapi_uint_t
core_count_
;
mtapi_uint_t
worker_thread_count_
;
mtapi_uint_t
worker_thread_count_
;
mtapi_action_hndl_t
action_handle_
;
mtapi_action_hndl_t
action_handle_
;
...
...
tasks_cpp/src/node.cc
View file @
f61ec036
...
@@ -78,6 +78,9 @@ Node::Node(
...
@@ -78,6 +78,9 @@ Node::Node(
mtapi_node_get_attribute
(
node_id
,
MTAPI_NODE_MAX_QUEUES
,
&
queue_count_
,
mtapi_node_get_attribute
(
node_id
,
MTAPI_NODE_MAX_QUEUES
,
&
queue_count_
,
sizeof
(
queue_count_
),
&
status
);
sizeof
(
queue_count_
),
&
status
);
assert
(
MTAPI_SUCCESS
==
status
);
assert
(
MTAPI_SUCCESS
==
status
);
mtapi_node_get_attribute
(
node_id
,
MTAPI_NODE_MAX_TASKS
,
&
task_limit_
,
sizeof
(
queue_count_
),
&
status
);
assert
(
MTAPI_SUCCESS
==
status
);
core_count_
=
info
.
hardware_concurrency
;
core_count_
=
info
.
hardware_concurrency
;
worker_thread_count_
=
embb_core_set_count
(
&
attr
->
core_affinity
);
worker_thread_count_
=
embb_core_set_count
(
&
attr
->
core_affinity
);
action_handle_
=
mtapi_action_create
(
TASKS_CPP_JOB
,
action_func
,
action_handle_
=
mtapi_action_create
(
TASKS_CPP_JOB
,
action_func
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment