Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
8ca4c0ea
Commit
8ca4c0ea
authored
Jun 22, 2013
by
Pedro Gonnet
Browse files
more elaborate weighting scheme.
Former-commit-id: d678c84107d8a4855ed4d66f5a25e827f1e7469b
parent
63abecd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scheduler.c
View file @
8ca4c0ea
...
...
@@ -477,40 +477,40 @@ void scheduler_ranktasks ( struct scheduler *s ) {
for
(
k
=
nr_tasks
-
1
;
k
>=
0
;
k
--
)
{
t
=
&
tasks
[
tid
[
k
]
];
t
->
maxdepth
=
0
;
switch
(
t
->
type
)
{
case
task_type_none
:
t
->
weight
=
0
;
break
;
case
task_type_sort
:
t
->
weight
=
t
->
ci
->
count
*
(
sizeof
(
int
)
*
8
-
__builtin_clz
(
t
->
ci
->
count
)
);
break
;
case
task_type_self
:
t
->
weight
=
t
->
ci
->
count
*
t
->
ci
->
count
;
break
;
case
task_type_pair
:
t
->
weight
=
t
->
ci
->
count
*
t
->
cj
->
count
;
break
;
case
task_type_sub
:
if
(
t
->
cj
!=
NULL
)
t
->
weight
=
t
->
ci
->
count
*
t
->
cj
->
count
;
else
t
->
weight
=
t
->
ci
->
count
*
t
->
ci
->
count
;
break
;
case
task_type_ghost
:
if
(
t
->
ci
==
t
->
ci
->
super
)
t
->
weight
=
t
->
ci
->
count
;
else
t
->
weight
=
0
;
break
;
case
task_type_kick2
:
t
->
weight
=
t
->
ci
->
count
;
break
;
}
t
->
weight
=
0
;
for
(
j
=
0
;
j
<
t
->
nr_unlock_tasks
;
j
++
)
{
t
->
weight
+
=
t
->
unlock_tasks
[
j
]
->
weight
;
t
->
weight
=
t
->
unlock_tasks
[
j
]
->
weight
;
if
(
t
->
unlock_tasks
[
j
]
->
maxdepth
>
t
->
maxdepth
)
t
->
maxdepth
=
t
->
unlock_tasks
[
j
]
->
maxdepth
;
}
t
->
maxdepth
+=
1
;
if
(
t
->
tic
>
0
)
t
->
weight
+=
t
->
toc
-
t
->
tic
;
else
switch
(
t
->
type
)
{
case
task_type_sort
:
t
->
weight
+=
t
->
ci
->
count
*
(
sizeof
(
int
)
*
8
-
__builtin_clz
(
t
->
ci
->
count
)
);
break
;
case
task_type_self
:
t
->
weight
+=
t
->
ci
->
count
*
t
->
ci
->
count
;
break
;
case
task_type_pair
:
t
->
weight
+=
t
->
ci
->
count
*
t
->
cj
->
count
;
break
;
case
task_type_sub
:
if
(
t
->
cj
!=
NULL
)
t
->
weight
+=
t
->
ci
->
count
*
t
->
cj
->
count
;
else
t
->
weight
+=
t
->
ci
->
count
*
t
->
ci
->
count
;
break
;
case
task_type_ghost
:
if
(
t
->
ci
==
t
->
ci
->
super
)
t
->
weight
+=
t
->
ci
->
count
;
break
;
case
task_type_kick2
:
t
->
weight
+=
t
->
ci
->
count
;
break
;
}
}
}
...
...
Write
Preview
Supports
Markdown
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