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
3f458c34
authored
Dec 30, 2014
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtapi_c: added simple load balancing
parent
2aad5ee8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
mtapi_c/src/embb_mtapi_task_t.c
+16
-2
No files found.
mtapi_c/src/embb_mtapi_task_t.c
View file @
3f458c34
...
@@ -209,9 +209,23 @@ static mtapi_task_hndl_t embb_mtapi_task_start(
...
@@ -209,9 +209,23 @@ static mtapi_task_hndl_t embb_mtapi_task_start(
task
->
queue
.
id
=
EMBB_MTAPI_IDPOOL_INVALID_ID
;
task
->
queue
.
id
=
EMBB_MTAPI_IDPOOL_INVALID_ID
;
}
}
/* load balancing is unsupported right now,
/* load balancing: choose action with minimum tasks */
so always choose action 0 */
action_index
=
0
;
action_index
=
0
;
for
(
mtapi_uint_t
ii
=
0
;
ii
<
local_job
->
num_actions
;
ii
++
)
{
if
(
embb_mtapi_action_pool_is_handle_valid
(
node
->
action_pool
,
local_job
->
actions
[
ii
]))
{
embb_mtapi_action_t
*
act_m
=
embb_mtapi_action_pool_get_storage_for_handle
(
node
->
action_pool
,
local_job
->
actions
[
action_index
]);
embb_mtapi_action_t
*
act_i
=
embb_mtapi_action_pool_get_storage_for_handle
(
node
->
action_pool
,
local_job
->
actions
[
ii
]);
if
(
embb_atomic_load_int
(
&
act_m
->
num_tasks
)
>
embb_atomic_load_int
(
&
act_i
->
num_tasks
))
{
action_index
=
ii
;
}
}
}
if
(
embb_mtapi_action_pool_is_handle_valid
(
if
(
embb_mtapi_action_pool_is_handle_valid
(
node
->
action_pool
,
local_job
->
actions
[
action_index
]))
{
node
->
action_pool
,
local_job
->
actions
[
action_index
]))
{
task
->
action
=
local_job
->
actions
[
action_index
];
task
->
action
=
local_job
->
actions
[
action_index
];
...
...
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