Skip to content
GitLab
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
171dddb5
Commit
171dddb5
authored
Dec 01, 2017
by
Matthieu Schaller
Browse files
Compute the self and pair task costs differently for hydro and gravity tasks.
parent
1dc45640
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scheduler.c
View file @
171dddb5
...
...
@@ -1113,15 +1113,32 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
cost
=
wscale
*
intrinsics_popcount
(
t
->
flags
)
*
t
->
ci
->
count
*
(
sizeof
(
int
)
*
8
-
intrinsics_clz
(
t
->
ci
->
count
));
break
;
case
task_type_self
:
cost
=
1
*
wscale
*
t
->
ci
->
count
*
t
->
ci
->
count
;
if
(
t
->
subtype
==
task_subtype_grav
)
cost
=
1
*
wscale
*
t
->
ci
->
gcount
*
t
->
ci
->
gcount
;
else
if
(
t
->
subtype
==
task_subtype_external_grav
)
cost
=
1
*
wscale
*
t
->
ci
->
gcount
;
else
cost
=
1
*
wscale
*
t
->
ci
->
count
*
t
->
ci
->
count
;
break
;
case
task_type_pair
:
if
(
t
->
ci
->
nodeID
!=
nodeID
||
t
->
cj
->
nodeID
!=
nodeID
)
cost
=
3
*
wscale
*
t
->
ci
->
count
*
t
->
cj
->
count
*
sid_scale
[
t
->
flags
];
else
cost
=
2
*
wscale
*
t
->
ci
->
count
*
t
->
cj
->
count
*
sid_scale
[
t
->
flags
];
if
(
t
->
subtype
==
task_subtype_grav
)
{
if
(
t
->
ci
->
nodeID
!=
nodeID
||
t
->
cj
->
nodeID
!=
nodeID
)
cost
=
3
*
wscale
*
t
->
ci
->
gcount
*
t
->
cj
->
gcount
;
else
cost
=
2
*
wscale
*
t
->
ci
->
gcount
*
t
->
cj
->
gcount
;
}
else
{
if
(
t
->
ci
->
nodeID
!=
nodeID
||
t
->
cj
->
nodeID
!=
nodeID
)
cost
=
3
*
wscale
*
t
->
ci
->
count
*
t
->
cj
->
count
*
sid_scale
[
t
->
flags
];
else
cost
=
2
*
wscale
*
t
->
ci
->
count
*
t
->
cj
->
count
*
sid_scale
[
t
->
flags
];
}
break
;
case
task_type_sub_pair
:
if
(
t
->
ci
->
nodeID
!=
nodeID
||
t
->
cj
->
nodeID
!=
nodeID
)
{
if
(
t
->
flags
<
0
)
...
...
@@ -1137,6 +1154,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
2
*
wscale
*
t
->
ci
->
count
*
t
->
cj
->
count
*
sid_scale
[
t
->
flags
];
}
break
;
case
task_type_sub_self
:
cost
=
1
*
wscale
*
t
->
ci
->
count
*
t
->
ci
->
count
;
break
;
...
...
@@ -1153,14 +1171,14 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
cost
=
wscale
*
t
->
ci
->
gcount
;
break
;
case
task_type_init_grav
:
cost
=
wscale
*
t
->
ci
->
gcount
;
break
;
cost
=
wscale
*
t
->
ci
->
gcount
;
break
;
case
task_type_grav_down
:
cost
=
wscale
*
t
->
ci
->
gcount
;
break
;
cost
=
wscale
*
t
->
ci
->
gcount
;
break
;
case
task_type_grav_long_range
:
cost
=
wscale
*
t
->
ci
->
gcount
;
break
;
cost
=
wscale
*
t
->
ci
->
gcount
;
break
;
case
task_type_kick1
:
cost
=
wscale
*
t
->
ci
->
count
+
wscale
*
t
->
ci
->
gcount
;
break
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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