Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
d8ff8f33
Commit
d8ff8f33
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Handle more types/subtypes explicitly in scheduler_reweight()
parent
d5ae23d4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scheduler.c
+79
-16
79 additions, 16 deletions
src/scheduler.c
with
79 additions
and
16 deletions
src/scheduler.c
+
79
−
16
View file @
d8ff8f33
...
...
@@ -1366,21 +1366,35 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
(
sizeof
(
int
)
*
8
-
intrinsics_clz
(
t
->
ci
->
stars
.
count
));
break
;
case
task_type_stars_resort
:
cost
=
wscale
*
intrinsics_popcount
(
t
->
flags
)
*
scount_i
*
(
sizeof
(
int
)
*
8
-
intrinsics_clz
(
t
->
ci
->
stars
.
count
));
break
;
case
task_type_self
:
if
(
t
->
subtype
==
task_subtype_grav
)
{
cost
=
1
.
f
*
(
wscale
*
gcount_i
)
*
gcount_i
;
}
else
if
(
t
->
subtype
==
task_subtype_external_grav
)
cost
=
1
.
f
*
wscale
*
gcount_i
;
else
if
(
t
->
subtype
==
task_subtype_stars_density
)
cost
=
1
.
f
*
wscale
*
scount_i
*
count_i
;
else
if
(
t
->
subtype
==
task_subtype_stars_feedback
)
else
if
(
t
->
subtype
==
task_subtype_stars_density
||
t
->
subtype
==
task_subtype_stars_feedback
)
cost
=
1
.
f
*
wscale
*
scount_i
*
count_i
;
else
if
(
t
->
subtype
==
task_subtype_bh_density
)
else
if
(
t
->
subtype
==
task_subtype_bh_density
||
t
->
subtype
==
task_subtype_bh_swallow
||
t
->
subtype
==
task_subtype_bh_feedback
)
cost
=
1
.
f
*
wscale
*
bcount_i
*
count_i
;
else
if
(
t
->
subtype
==
task_subtype_bh_feedback
)
cost
=
1
.
f
*
wscale
*
bcount_i
*
count_i
;
else
// hydro loops
else
if
(
t
->
subtype
==
task_subtype_do_gas_swallow
)
cost
=
1
.
f
*
wscale
*
count_i
;
else
if
(
t
->
subtype
==
task_subtype_do_bh_swallow
)
cost
=
1
.
f
*
wscale
*
bcount_i
;
else
if
(
t
->
subtype
==
task_subtype_density
||
t
->
subtype
==
task_subtype_gradient
||
t
->
subtype
==
task_subtype_force
||
t
->
subtype
==
task_subtype_limiter
)
cost
=
1
.
f
*
(
wscale
*
count_i
)
*
count_i
;
else
error
(
"Untreated sub-type for selfs: %s"
,
subtaskID_names
[
t
->
subtype
]);
break
;
case
task_type_pair
:
...
...
@@ -1401,6 +1415,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
sid_scale
[
t
->
flags
];
}
else
if
(
t
->
subtype
==
task_subtype_bh_density
||
t
->
subtype
==
task_subtype_bh_swallow
||
t
->
subtype
==
task_subtype_bh_feedback
)
{
if
(
t
->
ci
->
nodeID
!=
nodeID
)
cost
=
3
.
f
*
wscale
*
count_i
*
bcount_j
*
sid_scale
[
t
->
flags
];
...
...
@@ -1410,11 +1425,24 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
cost
=
2
.
f
*
wscale
*
(
bcount_i
*
count_j
+
bcount_j
*
count_i
)
*
sid_scale
[
t
->
flags
];
}
else
{
// hydro loops
}
else
if
(
t
->
subtype
==
task_subtype_do_gas_swallow
)
{
cost
=
1
.
f
*
wscale
*
(
count_i
+
count_j
);
}
else
if
(
t
->
subtype
==
task_subtype_do_bh_swallow
)
{
cost
=
1
.
f
*
wscale
*
(
bcount_i
+
bcount_j
);
}
else
if
(
t
->
subtype
==
task_subtype_density
||
t
->
subtype
==
task_subtype_gradient
||
t
->
subtype
==
task_subtype_force
||
t
->
subtype
==
task_subtype_limiter
)
{
if
(
t
->
ci
->
nodeID
!=
nodeID
||
t
->
cj
->
nodeID
!=
nodeID
)
cost
=
3
.
f
*
(
wscale
*
count_i
)
*
count_j
*
sid_scale
[
t
->
flags
];
else
cost
=
2
.
f
*
(
wscale
*
count_i
)
*
count_j
*
sid_scale
[
t
->
flags
];
}
else
{
error
(
"Untreated sub-type for pairs: %s"
,
subtaskID_names
[
t
->
subtype
]);
}
break
;
...
...
@@ -1434,6 +1462,7 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
}
}
else
if
(
t
->
subtype
==
task_subtype_bh_density
||
t
->
subtype
==
task_subtype_bh_swallow
||
t
->
subtype
==
task_subtype_bh_feedback
)
{
if
(
t
->
ci
->
nodeID
!=
nodeID
)
{
cost
=
3
.
f
*
(
wscale
*
count_i
)
*
bcount_j
*
sid_scale
[
t
->
flags
];
...
...
@@ -1444,26 +1473,48 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
sid_scale
[
t
->
flags
];
}
}
else
{
// hydro loops
}
else
if
(
t
->
subtype
==
task_subtype_do_gas_swallow
)
{
cost
=
1
.
f
*
wscale
*
(
count_i
+
count_j
);
}
else
if
(
t
->
subtype
==
task_subtype_do_bh_swallow
)
{
cost
=
1
.
f
*
wscale
*
(
bcount_i
+
bcount_j
);
}
else
if
(
t
->
subtype
==
task_subtype_density
||
t
->
subtype
==
task_subtype_gradient
||
t
->
subtype
==
task_subtype_force
||
t
->
subtype
==
task_subtype_limiter
)
{
if
(
t
->
ci
->
nodeID
!=
nodeID
||
t
->
cj
->
nodeID
!=
nodeID
)
{
cost
=
3
.
f
*
(
wscale
*
count_i
)
*
count_j
*
sid_scale
[
t
->
flags
];
}
else
{
cost
=
2
.
f
*
(
wscale
*
count_i
)
*
count_j
*
sid_scale
[
t
->
flags
];
}
}
else
{
error
(
"Untreated sub-type for sub-pairs: %s"
,
subtaskID_names
[
t
->
subtype
]);
}
break
;
case
task_type_sub_self
:
if
(
t
->
subtype
==
task_subtype_stars_density
)
{
cost
=
1
.
f
*
(
wscale
*
scount_i
)
*
count_i
;
}
else
if
(
t
->
subtype
==
task_subtype_stars_feedback
)
{
if
(
t
->
subtype
==
task_subtype_stars_density
||
t
->
subtype
==
task_subtype_stars_feedback
)
{
cost
=
1
.
f
*
(
wscale
*
scount_i
)
*
count_i
;
}
else
if
(
t
->
subtype
==
task_subtype_bh_density
)
{
cost
=
1
.
f
*
(
wscale
*
bcount_i
)
*
count_i
;
}
else
if
(
t
->
subtype
==
task_subtype_bh_feedback
)
{
}
else
if
(
t
->
subtype
==
task_subtype_bh_density
||
t
->
subtype
==
task_subtype_bh_swallow
||
t
->
subtype
==
task_subtype_bh_feedback
)
{
cost
=
1
.
f
*
(
wscale
*
bcount_i
)
*
count_i
;
}
else
{
}
else
if
(
t
->
subtype
==
task_subtype_do_gas_swallow
)
{
cost
=
1
.
f
*
wscale
*
count_i
;
}
else
if
(
t
->
subtype
==
task_subtype_do_bh_swallow
)
{
cost
=
1
.
f
*
wscale
*
bcount_i
;
}
else
if
(
t
->
subtype
==
task_subtype_density
||
t
->
subtype
==
task_subtype_gradient
||
t
->
subtype
==
task_subtype_force
||
t
->
subtype
==
task_subtype_limiter
)
{
cost
=
1
.
f
*
(
wscale
*
count_i
)
*
count_i
;
}
else
{
error
(
"Untreated sub-type for sub-selfs: %s"
,
subtaskID_names
[
t
->
subtype
]);
}
break
;
case
task_type_ghost
:
...
...
@@ -1478,6 +1529,9 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
case
task_type_bh_density_ghost
:
if
(
t
->
ci
==
t
->
ci
->
hydro
.
super
)
cost
=
wscale
*
bcount_i
;
break
;
case
task_type_bh_swallow_ghost2
:
if
(
t
->
ci
==
t
->
ci
->
hydro
.
super
)
cost
=
wscale
*
bcount_i
;
break
;
case
task_type_drift_part
:
cost
=
wscale
*
count_i
;
break
;
...
...
@@ -1499,6 +1553,9 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
case
task_type_grav_long_range
:
cost
=
wscale
*
gcount_i
;
break
;
case
task_type_grav_mesh
:
cost
=
wscale
*
gcount_i
;
break
;
case
task_type_grav_mm
:
cost
=
wscale
*
(
gcount_i
+
gcount_j
);
break
;
...
...
@@ -1523,6 +1580,12 @@ void scheduler_reweight(struct scheduler *s, int verbose) {
case
task_type_timestep
:
cost
=
wscale
*
(
count_i
+
gcount_i
+
scount_i
+
bcount_i
);
break
;
case
task_type_timestep_limiter
:
cost
=
wscale
*
count_i
;
break
;
case
task_type_timestep_sync
:
cost
=
wscale
*
count_i
;
break
;
case
task_type_send
:
if
(
count_i
<
1e5
)
cost
=
10
.
f
*
(
wscale
*
count_i
)
*
count_i
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment