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
1393ecee
Commit
1393ecee
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Only activate the limiter tasks when using the limiter!
parent
7a595dc2
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!956
Fully implement the timestep limiter (non MPI)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cell.c
+12
-6
12 additions, 6 deletions
src/cell.c
src/engine_marktasks.c
+5
-3
5 additions, 3 deletions
src/engine_marktasks.c
with
17 additions
and
9 deletions
src/cell.c
+
12
−
6
View file @
1393ecee
...
@@ -3011,6 +3011,7 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
...
@@ -3011,6 +3011,7 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
struct
scheduler
*
s
,
struct
scheduler
*
s
,
const
int
with_star_formation
)
{
const
int
with_star_formation
)
{
const
struct
engine
*
e
=
s
->
space
->
e
;
const
struct
engine
*
e
=
s
->
space
->
e
;
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_limiter
);
/* Store the current dx_max and h_max values. */
/* Store the current dx_max and h_max values. */
ci
->
stars
.
dx_max_part_old
=
ci
->
stars
.
dx_max_part
;
ci
->
stars
.
dx_max_part_old
=
ci
->
stars
.
dx_max_part
;
...
@@ -3053,7 +3054,7 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
...
@@ -3053,7 +3054,7 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
/* We have reached the bottom of the tree: activate drift */
/* We have reached the bottom of the tree: activate drift */
cell_activate_drift_spart
(
ci
,
s
);
cell_activate_drift_spart
(
ci
,
s
);
cell_activate_drift_part
(
ci
,
s
);
cell_activate_drift_part
(
ci
,
s
);
cell_activate_sync_part
(
ci
,
s
);
if
(
with_limiter
)
cell_activate_sync_part
(
ci
,
s
);
}
}
}
}
...
@@ -3101,7 +3102,8 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
...
@@ -3101,7 +3102,8 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
/* Activate the drifts if the cells are local. */
/* Activate the drifts if the cells are local. */
if
(
ci
->
nodeID
==
engine_rank
)
cell_activate_drift_spart
(
ci
,
s
);
if
(
ci
->
nodeID
==
engine_rank
)
cell_activate_drift_spart
(
ci
,
s
);
if
(
cj
->
nodeID
==
engine_rank
)
cell_activate_drift_part
(
cj
,
s
);
if
(
cj
->
nodeID
==
engine_rank
)
cell_activate_drift_part
(
cj
,
s
);
if
(
cj
->
nodeID
==
engine_rank
)
cell_activate_sync_part
(
cj
,
s
);
if
(
cj
->
nodeID
==
engine_rank
&&
with_limiter
)
cell_activate_sync_part
(
cj
,
s
);
/* Do we need to sort the cells? */
/* Do we need to sort the cells? */
cell_activate_hydro_sorts
(
cj
,
sid
,
s
);
cell_activate_hydro_sorts
(
cj
,
sid
,
s
);
...
@@ -3120,7 +3122,8 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
...
@@ -3120,7 +3122,8 @@ void cell_activate_subcell_stars_tasks(struct cell *ci, struct cell *cj,
/* Activate the drifts if the cells are local. */
/* Activate the drifts if the cells are local. */
if
(
ci
->
nodeID
==
engine_rank
)
cell_activate_drift_part
(
ci
,
s
);
if
(
ci
->
nodeID
==
engine_rank
)
cell_activate_drift_part
(
ci
,
s
);
if
(
cj
->
nodeID
==
engine_rank
)
cell_activate_drift_spart
(
cj
,
s
);
if
(
cj
->
nodeID
==
engine_rank
)
cell_activate_drift_spart
(
cj
,
s
);
if
(
ci
->
nodeID
==
engine_rank
)
cell_activate_sync_part
(
ci
,
s
);
if
(
ci
->
nodeID
==
engine_rank
&&
with_limiter
)
cell_activate_sync_part
(
ci
,
s
);
/* Do we need to sort the cells? */
/* Do we need to sort the cells? */
cell_activate_hydro_sorts
(
ci
,
sid
,
s
);
cell_activate_hydro_sorts
(
ci
,
sid
,
s
);
...
@@ -3784,6 +3787,7 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
...
@@ -3784,6 +3787,7 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
const
int
with_star_formation
)
{
const
int
with_star_formation
)
{
struct
engine
*
e
=
s
->
space
->
e
;
struct
engine
*
e
=
s
->
space
->
e
;
const
int
with_limiter
=
(
e
->
policy
&
engine_policy_limiter
);
const
int
nodeID
=
e
->
nodeID
;
const
int
nodeID
=
e
->
nodeID
;
int
rebuild
=
0
;
int
rebuild
=
0
;
...
@@ -3819,7 +3823,7 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
...
@@ -3819,7 +3823,7 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
if
(
t
->
type
==
task_type_self
&&
ci_active
)
{
if
(
t
->
type
==
task_type_self
&&
ci_active
)
{
cell_activate_drift_spart
(
ci
,
s
);
cell_activate_drift_spart
(
ci
,
s
);
cell_activate_drift_part
(
ci
,
s
);
cell_activate_drift_part
(
ci
,
s
);
cell_activate_sync_part
(
ci
,
s
);
if
(
with_limiter
)
cell_activate_sync_part
(
ci
,
s
);
}
}
/* Only activate tasks that involve a local active cell. */
/* Only activate tasks that involve a local active cell. */
...
@@ -3841,7 +3845,8 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
...
@@ -3841,7 +3845,8 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
/* Activate the drift tasks. */
/* Activate the drift tasks. */
if
(
ci_nodeID
==
nodeID
)
cell_activate_drift_spart
(
ci
,
s
);
if
(
ci_nodeID
==
nodeID
)
cell_activate_drift_spart
(
ci
,
s
);
if
(
cj_nodeID
==
nodeID
)
cell_activate_drift_part
(
cj
,
s
);
if
(
cj_nodeID
==
nodeID
)
cell_activate_drift_part
(
cj
,
s
);
if
(
cj_nodeID
==
nodeID
)
cell_activate_sync_part
(
cj
,
s
);
if
(
cj_nodeID
==
nodeID
&&
with_limiter
)
cell_activate_sync_part
(
cj
,
s
);
/* Check the sorts and activate them if needed. */
/* Check the sorts and activate them if needed. */
cell_activate_stars_sorts
(
ci
,
t
->
flags
,
s
);
cell_activate_stars_sorts
(
ci
,
t
->
flags
,
s
);
...
@@ -3861,7 +3866,8 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
...
@@ -3861,7 +3866,8 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
/* Activate the drift tasks. */
/* Activate the drift tasks. */
if
(
cj_nodeID
==
nodeID
)
cell_activate_drift_spart
(
cj
,
s
);
if
(
cj_nodeID
==
nodeID
)
cell_activate_drift_spart
(
cj
,
s
);
if
(
ci_nodeID
==
nodeID
)
cell_activate_drift_part
(
ci
,
s
);
if
(
ci_nodeID
==
nodeID
)
cell_activate_drift_part
(
ci
,
s
);
if
(
ci_nodeID
==
nodeID
)
cell_activate_sync_part
(
ci
,
s
);
if
(
ci_nodeID
==
nodeID
&&
with_limiter
)
cell_activate_sync_part
(
ci
,
s
);
/* Check the sorts and activate them if needed. */
/* Check the sorts and activate them if needed. */
cell_activate_hydro_sorts
(
ci
,
t
->
flags
,
s
);
cell_activate_hydro_sorts
(
ci
,
t
->
flags
,
s
);
...
...
This diff is collapsed.
Click to expand it.
src/engine_marktasks.c
+
5
−
3
View file @
1393ecee
...
@@ -151,7 +151,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
...
@@ -151,7 +151,7 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
scheduler_activate
(
s
,
t
);
scheduler_activate
(
s
,
t
);
cell_activate_drift_part
(
ci
,
s
);
cell_activate_drift_part
(
ci
,
s
);
cell_activate_drift_spart
(
ci
,
s
);
cell_activate_drift_spart
(
ci
,
s
);
cell_activate_sync_part
(
ci
,
s
);
if
(
with_limiter
)
cell_activate_sync_part
(
ci
,
s
);
}
}
}
}
...
@@ -358,7 +358,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
...
@@ -358,7 +358,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* Activate the drift tasks. */
/* Activate the drift tasks. */
if
(
ci_nodeID
==
nodeID
)
cell_activate_drift_spart
(
ci
,
s
);
if
(
ci_nodeID
==
nodeID
)
cell_activate_drift_spart
(
ci
,
s
);
if
(
cj_nodeID
==
nodeID
)
cell_activate_drift_part
(
cj
,
s
);
if
(
cj_nodeID
==
nodeID
)
cell_activate_drift_part
(
cj
,
s
);
if
(
cj_nodeID
==
nodeID
)
cell_activate_sync_part
(
cj
,
s
);
if
(
cj_nodeID
==
nodeID
&&
with_limiter
)
cell_activate_sync_part
(
cj
,
s
);
/* Check the sorts and activate them if needed. */
/* Check the sorts and activate them if needed. */
cell_activate_hydro_sorts
(
cj
,
t
->
flags
,
s
);
cell_activate_hydro_sorts
(
cj
,
t
->
flags
,
s
);
...
@@ -379,7 +380,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
...
@@ -379,7 +380,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
/* Activate the drift tasks. */
/* Activate the drift tasks. */
if
(
ci_nodeID
==
nodeID
)
cell_activate_drift_part
(
ci
,
s
);
if
(
ci_nodeID
==
nodeID
)
cell_activate_drift_part
(
ci
,
s
);
if
(
cj_nodeID
==
nodeID
)
cell_activate_drift_spart
(
cj
,
s
);
if
(
cj_nodeID
==
nodeID
)
cell_activate_drift_spart
(
cj
,
s
);
if
(
ci_nodeID
==
nodeID
)
cell_activate_sync_part
(
ci
,
s
);
if
(
ci_nodeID
==
nodeID
&&
with_limiter
)
cell_activate_sync_part
(
ci
,
s
);
/* Check the sorts and activate them if needed. */
/* Check the sorts and activate them if needed. */
cell_activate_hydro_sorts
(
ci
,
t
->
flags
,
s
);
cell_activate_hydro_sorts
(
ci
,
t
->
flags
,
s
);
...
...
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