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
8834481a
authored
Jan 30, 2016
by
Winter
Committed by
Marcus Winter
Feb 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tasks_cpp: add function to query for the maximum number of queues
parent
f0088aa7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
tasks_cpp/include/embb/tasks/node.h
+10
-0
tasks_cpp/src/node.cc
+2
-0
No files found.
tasks_cpp/include/embb/tasks/node.h
View file @
8834481a
...
@@ -120,6 +120,15 @@ class Node {
...
@@ -120,6 +120,15 @@ class Node {
static
void
Finalize
();
static
void
Finalize
();
/**
/**
* Returns the number of available queues.
* \return The number of available queues
* \waitfree
*/
mtapi_uint_t
GetQueueCount
()
const
{
return
queue_count_
;
}
/**
* 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
...
@@ -218,6 +227,7 @@ class Node {
...
@@ -218,6 +227,7 @@ class Node {
mtapi_size_t
node_local_data_size
,
mtapi_size_t
node_local_data_size
,
mtapi_task_context_t
*
context
);
mtapi_task_context_t
*
context
);
mtapi_uint_t
queue_count_
;
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 @
8834481a
...
@@ -74,6 +74,8 @@ Node::Node(
...
@@ -74,6 +74,8 @@ Node::Node(
EMBB_THROW
(
embb
::
base
::
ErrorException
,
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"mtapi::Node could not initialize mtapi"
);
"mtapi::Node could not initialize mtapi"
);
}
}
mtapi_node_get_attribute
(
node_id
,
MTAPI_NODE_MAX_QUEUES
,
&
queue_count_
,
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