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
ca2a471f
Commit
ca2a471f
authored
Jul 02, 2020
by
Matthieu Schaller
Browse files
Do the same change for the kick1/time-step/kick2 combo
parent
d6d1fdb3
Changes
11
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
ca2a471f
...
...
@@ -2657,6 +2657,62 @@ void cell_activate_cooling(struct cell *c, struct scheduler *s,
cell_recursively_activate_cooling
(
c
,
s
,
e
);
}
/**
* @brief Recursively activate the kick and timestep tasks (and implicit links)
* in a cell hierarchy.
*
* @param c The #cell.
* @param s The #scheduler.
* @param e The #engine.
*/
void
cell_recursively_activate_kicks
(
struct
cell
*
c
,
struct
scheduler
*
s
,
const
struct
engine
*
e
)
{
/* Early abort? */
if
((
c
->
hydro
.
count
==
0
)
&&
(
c
->
grav
.
count
==
0
)
&&
(
c
->
stars
.
count
==
0
)
&&
c
->
black_holes
.
count
==
0
)
return
;
if
(
!
cell_is_active_hydro
(
c
,
e
)
&&
!
cell_is_active_gravity
(
c
,
e
)
&&
!
cell_is_active_stars
(
c
,
e
)
&&
!
cell_is_active_black_holes
(
c
,
e
))
return
;
/* Is the ghost at this level? */
if
(
c
->
kick1
!=
NULL
)
{
scheduler_activate
(
s
,
c
->
kick1
);
scheduler_activate
(
s
,
c
->
kick2
);
scheduler_activate
(
s
,
c
->
timestep
);
}
else
{
#ifdef SWIFT_DEBUG_CHECKS
if
(
!
c
->
split
)
error
(
"Reached the leaf level without finding a kick task!"
);
#endif
/* Keep recursing */
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
cell_recursively_activate_kicks
(
c
->
progeny
[
k
],
s
,
e
);
}
}
/**
* @brief Activate the kick and time-step tasks (and implicit links) in a cell
* hierarchy.
*
* @param c The #cell.
* @param s The #scheduler.
* @param e The #engine.
*/
void
cell_activate_kicks
(
struct
cell
*
c
,
struct
scheduler
*
s
,
const
struct
engine
*
e
)
{
scheduler_activate
(
s
,
c
->
kick1_in
);
scheduler_activate
(
s
,
c
->
kick1_out
);
scheduler_activate
(
s
,
c
->
kick2_in
);
scheduler_activate
(
s
,
c
->
kick2_out
);
scheduler_activate
(
s
,
c
->
timestep_in
);
scheduler_activate
(
s
,
c
->
timestep_out
);
cell_recursively_activate_kicks
(
c
,
s
,
e
);
}
/**
* @brief Recurse down in a cell hierarchy until the hydro.super level is
* reached and activate the spart drift at that level.
...
...
@@ -3762,9 +3818,7 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
if
(
c
->
hydro
.
extra_ghost
!=
NULL
)
scheduler_activate
(
s
,
c
->
hydro
.
extra_ghost
);
if
(
c
->
hydro
.
ghost_in
!=
NULL
)
cell_activate_hydro_ghosts
(
c
,
s
,
e
);
if
(
c
->
kick1
!=
NULL
)
scheduler_activate
(
s
,
c
->
kick1
);
if
(
c
->
kick2
!=
NULL
)
scheduler_activate
(
s
,
c
->
kick2
);
if
(
c
->
timestep
!=
NULL
)
scheduler_activate
(
s
,
c
->
timestep
);
if
(
c
->
kick1_in
!=
NULL
)
cell_activate_kicks
(
c
,
s
,
e
);
if
(
c
->
hydro
.
end_force
!=
NULL
)
scheduler_activate
(
s
,
c
->
hydro
.
end_force
);
if
(
c
->
hydro
.
cooling_in
!=
NULL
)
cell_activate_cooling
(
c
,
s
,
e
);
#ifdef WITH_LOGGER
...
...
@@ -3916,9 +3970,7 @@ int cell_unskip_gravity_tasks(struct cell *c, struct scheduler *s) {
if
(
c
->
nodeID
==
nodeID
&&
cell_is_active_gravity
(
c
,
e
))
{
if
(
c
->
grav
.
init
!=
NULL
)
scheduler_activate
(
s
,
c
->
grav
.
init
);
if
(
c
->
grav
.
init_out
!=
NULL
)
scheduler_activate
(
s
,
c
->
grav
.
init_out
);
if
(
c
->
kick1
!=
NULL
)
scheduler_activate
(
s
,
c
->
kick1
);
if
(
c
->
kick2
!=
NULL
)
scheduler_activate
(
s
,
c
->
kick2
);
if
(
c
->
timestep
!=
NULL
)
scheduler_activate
(
s
,
c
->
timestep
);
if
(
c
->
kick1_in
!=
NULL
)
cell_activate_kicks
(
c
,
s
,
e
);
if
(
c
->
grav
.
down
!=
NULL
)
scheduler_activate
(
s
,
c
->
grav
.
down
);
if
(
c
->
grav
.
down_in
!=
NULL
)
scheduler_activate
(
s
,
c
->
grav
.
down_in
);
if
(
c
->
grav
.
mesh
!=
NULL
)
scheduler_activate
(
s
,
c
->
grav
.
mesh
);
...
...
@@ -4173,9 +4225,7 @@ int cell_unskip_stars_tasks(struct cell *c, struct scheduler *s,
if
(
c
->
stars
.
ghost
!=
NULL
)
scheduler_activate
(
s
,
c
->
stars
.
ghost
);
if
(
c
->
stars
.
stars_in
!=
NULL
)
scheduler_activate
(
s
,
c
->
stars
.
stars_in
);
if
(
c
->
stars
.
stars_out
!=
NULL
)
scheduler_activate
(
s
,
c
->
stars
.
stars_out
);
if
(
c
->
kick1
!=
NULL
)
scheduler_activate
(
s
,
c
->
kick1
);
if
(
c
->
kick2
!=
NULL
)
scheduler_activate
(
s
,
c
->
kick2
);
if
(
c
->
timestep
!=
NULL
)
scheduler_activate
(
s
,
c
->
timestep
);
if
(
c
->
kick1_in
!=
NULL
)
cell_activate_kicks
(
c
,
s
,
e
);
#ifdef WITH_LOGGER
if
(
c
->
logger
!=
NULL
)
scheduler_activate
(
s
,
c
->
logger
);
#endif
...
...
@@ -4455,9 +4505,7 @@ int cell_unskip_black_holes_tasks(struct cell *c, struct scheduler *s) {
scheduler_activate
(
s
,
c
->
black_holes
.
black_holes_in
);
if
(
c
->
black_holes
.
black_holes_out
!=
NULL
)
scheduler_activate
(
s
,
c
->
black_holes
.
black_holes_out
);
if
(
c
->
kick1
!=
NULL
)
scheduler_activate
(
s
,
c
->
kick1
);
if
(
c
->
kick2
!=
NULL
)
scheduler_activate
(
s
,
c
->
kick2
);
if
(
c
->
timestep
!=
NULL
)
scheduler_activate
(
s
,
c
->
timestep
);
if
(
c
->
kick1_in
!=
NULL
)
cell_activate_kicks
(
c
,
s
,
e
);
#ifdef WITH_LOGGER
if
(
c
->
logger
!=
NULL
)
scheduler_activate
(
s
,
c
->
logger
);
#endif
...
...
src/cell.h
View file @
ca2a471f
...
...
@@ -779,12 +779,30 @@ struct cell {
}
mpi
;
#endif
/*! Dependency implicit task for kick1 (in->kick1->out) */
struct
task
*
kick1_in
;
/*! Dependency implicit task for kick1 (in->kick1->out) */
struct
task
*
kick1_out
;
/*! The first kick task */
struct
task
*
kick1
;
/*! Dependency implicit task for kick2 (in->kick2->out) */
struct
task
*
kick2_in
;
/*! Dependency implicit task for kick2 (in->kick2->out) */
struct
task
*
kick2_out
;
/*! The second kick task */
struct
task
*
kick2
;
/*! Dependency implicit task for timestep (in->timestep->out) */
struct
task
*
timestep_in
;
/*! Dependency implicit task for timestep (in->timestep->out) */
struct
task
*
timestep_out
;
/*! The task to compute time-steps */
struct
task
*
timestep
;
...
...
src/engine.h
View file @
ca2a471f
...
...
@@ -115,6 +115,7 @@ enum engine_step_properties {
#define engine_max_parts_per_ghost_default 1000
#define engine_max_sparts_per_ghost_default 1000
#define engine_max_parts_per_cooling_default 200
#define engine_max_parts_per_kick_default 10000
#define engine_star_resort_task_depth_default 2
#define engine_tasks_per_cell_margin 1.2
#define engine_default_stf_subdir_per_output "."
...
...
src/engine_maketasks.c
View file @
ca2a471f
...
...
@@ -57,6 +57,7 @@ extern int engine_max_parts_per_ghost;
extern
int
engine_max_sparts_per_ghost
;
extern
int
engine_star_resort_task_depth
;
extern
int
engine_max_parts_per_cooling
;
extern
int
engine_max_parts_per_kick
;
/**
* @brief Add send tasks for the gravity pairs to a hierarchy of cells.
...
...
@@ -106,7 +107,7 @@ void engine_addtasks_send_gravity(struct engine *e, struct cell *ci,
/* Drift before you send */
scheduler_addunlock
(
s
,
ci
->
grav
.
super
->
grav
.
drift
,
t_grav
);
scheduler_addunlock
(
s
,
ci
->
super
->
timestep
,
t_ti
);
scheduler_addunlock
(
s
,
ci
->
super
->
timestep
_out
,
t_ti
);
}
/* Add them to the local cell. */
...
...
@@ -219,8 +220,9 @@ void engine_addtasks_send_hydro(struct engine *e, struct cell *ci,
/* Drift before you send */
scheduler_addunlock
(
s
,
ci
->
hydro
.
super
->
hydro
.
drift
,
t_xv
);
scheduler_addunlock
(
s
,
ci
->
super
->
timestep
,
t_ti
);
if
(
with_limiter
)
scheduler_addunlock
(
s
,
ci
->
super
->
timestep
,
t_limiter
);
scheduler_addunlock
(
s
,
ci
->
super
->
timestep_out
,
t_ti
);
if
(
with_limiter
)
scheduler_addunlock
(
s
,
ci
->
super
->
timestep_out
,
t_limiter
);
}
/* Add them to the local cell. */
...
...
@@ -315,7 +317,7 @@ void engine_addtasks_send_stars(struct engine *e, struct cell *ci,
/* Drift before you send */
scheduler_addunlock
(
s
,
ci
->
hydro
.
super
->
stars
.
drift
,
t_feedback
);
scheduler_addunlock
(
s
,
ci
->
super
->
timestep
,
t_ti
);
scheduler_addunlock
(
s
,
ci
->
super
->
timestep
_out
,
t_ti
);
}
engine_addlink
(
e
,
&
ci
->
mpi
.
send
,
t_feedback
);
...
...
@@ -422,7 +424,7 @@ void engine_addtasks_send_black_holes(struct engine *e, struct cell *ci,
scheduler_addunlock
(
s
,
t_gas_swallow
,
ci
->
hydro
.
super
->
black_holes
.
swallow_ghost
[
1
]);
scheduler_addunlock
(
s
,
ci
->
super
->
timestep
,
t_ti
);
scheduler_addunlock
(
s
,
ci
->
super
->
timestep
_out
,
t_ti
);
}
engine_addlink
(
e
,
&
ci
->
mpi
.
send
,
t_rho
);
...
...
@@ -813,6 +815,48 @@ void engine_addtasks_recv_gravity(struct engine *e, struct cell *c,
#endif
}
/**
* @brief Recursively add non-implicit kick and time-step tasks to a cell
* hierarchy.
*/
void
engine_add_kicks
(
struct
engine
*
e
,
struct
cell
*
c
,
struct
task
*
kick1_in
,
struct
task
*
kick1_out
,
struct
task
*
kick2_in
,
struct
task
*
kick2_out
,
struct
task
*
timestep_in
,
struct
task
*
timestep_out
)
{
/* Abort as there are no hydro particles here? */
if
(
c
->
hydro
.
count_total
==
0
&&
c
->
grav
.
count_total
==
0
)
return
;
/* If we have reached the leaf OR have to few particles to play with*/
if
(
!
c
->
split
||
c
->
hydro
.
count_total
+
c
->
grav
.
count_total
<
engine_max_parts_per_kick
)
{
/* Add the cooling task and its dependencies */
struct
scheduler
*
s
=
&
e
->
sched
;
c
->
kick1
=
scheduler_addtask
(
s
,
task_type_kick1
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
scheduler_addunlock
(
s
,
kick1_in
,
c
->
kick1
);
scheduler_addunlock
(
s
,
c
->
kick1
,
kick1_out
);
c
->
kick2
=
scheduler_addtask
(
s
,
task_type_kick2
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
scheduler_addunlock
(
s
,
kick2_in
,
c
->
kick2
);
scheduler_addunlock
(
s
,
c
->
kick2
,
kick2_out
);
c
->
timestep
=
scheduler_addtask
(
s
,
task_type_timestep
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
scheduler_addunlock
(
s
,
timestep_in
,
c
->
timestep
);
scheduler_addunlock
(
s
,
c
->
timestep
,
timestep_out
);
}
else
{
/* Keep recursing */
for
(
int
k
=
0
;
k
<
8
;
k
++
)
if
(
c
->
progeny
[
k
]
!=
NULL
)
engine_add_kicks
(
e
,
c
->
progeny
[
k
],
kick1_in
,
kick1_out
,
kick2_in
,
kick2_out
,
timestep_in
,
timestep_out
);
}
}
/**
* @brief Generate the hydro hierarchical tasks for a hierarchy of cells -
* i.e. all the O(Npart) tasks -- timestep version
...
...
@@ -851,13 +895,37 @@ void engine_make_hierarchical_tasks_common(struct engine *e, struct cell *c) {
/* Local tasks only... */
if
(
c
->
nodeID
==
e
->
nodeID
)
{
/* Add the two half kicks */
c
->
kick1
=
scheduler_addtask
(
s
,
task_type_kick1
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
/* Add the two half kicks dependency tasks */
c
->
kick1_in
=
scheduler_addtask
(
s
,
task_type_kick1_in
,
task_subtype_none
,
0
,
/*implicit=*/
1
,
c
,
NULL
);
c
->
kick1_out
=
scheduler_addtask
(
s
,
task_type_kick1_out
,
task_subtype_none
,
0
,
/*implicit=*/
1
,
c
,
NULL
);
c
->
kick2
=
scheduler_addtask
(
s
,
task_type_kick2
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
c
->
kick2_in
=
scheduler_addtask
(
s
,
task_type_kick2_in
,
task_subtype_none
,
0
,
/*implicit=*/
1
,
c
,
NULL
);
c
->
kick2_out
=
scheduler_addtask
(
s
,
task_type_kick2_out
,
task_subtype_none
,
0
,
/*implicit=*/
1
,
c
,
NULL
);
/* Add the time-step dependency tasks */
c
->
timestep_in
=
scheduler_addtask
(
s
,
task_type_timestep_in
,
task_subtype_none
,
0
,
/*implicit=*/
1
,
c
,
NULL
);
c
->
timestep_out
=
scheduler_addtask
(
s
,
task_type_timestep_out
,
task_subtype_none
,
0
,
/*implicit=*/
1
,
c
,
NULL
);
/* Add the real tasks */
engine_add_kicks
(
e
,
c
,
c
->
kick1_in
,
c
->
kick1_out
,
c
->
kick2_in
,
c
->
kick2_out
,
c
->
timestep_in
,
c
->
timestep_out
);
/* Add the dependencies */
#if defined(WITH_LOGGER)
struct
task
*
kick2_or_logger
;
if
(
with_logger
)
{
...
...
@@ -866,28 +934,23 @@ void engine_make_hierarchical_tasks_common(struct engine *e, struct cell *c) {
0
,
c
,
NULL
);
/* Add the kick2 dependency */
scheduler_addunlock
(
s
,
c
->
kick2
,
c
->
logger
);
scheduler_addunlock
(
s
,
c
->
kick2
_out
,
c
->
logger
);
/* Create a variable in order to avoid to many ifdef */
kick2_or_logger
=
c
->
logger
;
}
else
{
kick2_or_logger
=
c
->
kick2
;
kick2_or_logger
=
c
->
kick2
_out
;
}
#else
struct
task
*
kick2_or_logger
=
c
->
kick2
;
struct
task
*
kick2_or_logger
=
c
->
kick2
_out
;
#endif
/* Add the time-step calculation task and its dependency */
c
->
timestep
=
scheduler_addtask
(
s
,
task_type_timestep
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
scheduler_addunlock
(
s
,
kick2_or_logger
,
c
->
timestep
);
scheduler_addunlock
(
s
,
c
->
timestep
,
c
->
kick1
);
scheduler_addunlock
(
s
,
kick2_or_logger
,
c
->
timestep_in
);
scheduler_addunlock
(
s
,
c
->
timestep_out
,
c
->
kick1_in
);
/* Subgrid tasks: star formation */
if
(
with_star_formation
&&
c
->
hydro
.
count
>
0
)
{
scheduler_addunlock
(
s
,
kick2_or_logger
,
c
->
top
->
hydro
.
star_formation
);
scheduler_addunlock
(
s
,
c
->
top
->
hydro
.
star_formation
,
c
->
timestep
);
scheduler_addunlock
(
s
,
c
->
top
->
hydro
.
star_formation
,
c
->
timestep
_in
);
}
/* Time-step limiter */
...
...
@@ -896,8 +959,8 @@ void engine_make_hierarchical_tasks_common(struct engine *e, struct cell *c) {
c
->
timestep_limiter
=
scheduler_addtask
(
s
,
task_type_timestep_limiter
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
scheduler_addunlock
(
s
,
c
->
timestep
,
c
->
timestep_limiter
);
scheduler_addunlock
(
s
,
c
->
timestep_limiter
,
c
->
kick1
);
scheduler_addunlock
(
s
,
c
->
timestep
_out
,
c
->
timestep_limiter
);
scheduler_addunlock
(
s
,
c
->
timestep_limiter
,
c
->
kick1
_in
);
}
/* Time-step synchronization */
...
...
@@ -906,8 +969,8 @@ void engine_make_hierarchical_tasks_common(struct engine *e, struct cell *c) {
c
->
timestep_sync
=
scheduler_addtask
(
s
,
task_type_timestep_sync
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
scheduler_addunlock
(
s
,
c
->
timestep
,
c
->
timestep_sync
);
scheduler_addunlock
(
s
,
c
->
timestep_sync
,
c
->
kick1
);
scheduler_addunlock
(
s
,
c
->
timestep
_out
,
c
->
timestep_sync
);
scheduler_addunlock
(
s
,
c
->
timestep_sync
,
c
->
kick1
_in
);
}
if
(
with_timestep_limiter
&&
with_timestep_sync
)
{
...
...
@@ -954,7 +1017,7 @@ void engine_make_hierarchical_tasks_gravity(struct engine *e, struct cell *c) {
c
->
grav
.
end_force
=
scheduler_addtask
(
s
,
task_type_end_grav_force
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
scheduler_addunlock
(
s
,
c
->
grav
.
end_force
,
c
->
super
->
kick2
);
scheduler_addunlock
(
s
,
c
->
grav
.
end_force
,
c
->
super
->
kick2
_in
);
if
(
is_self_gravity
)
{
...
...
@@ -1178,14 +1241,14 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c,
if
(
with_stars
)
{
c
->
stars
.
drift
=
scheduler_addtask
(
s
,
task_type_drift_spart
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
scheduler_addunlock
(
s
,
c
->
stars
.
drift
,
c
->
super
->
kick2
);
scheduler_addunlock
(
s
,
c
->
stars
.
drift
,
c
->
super
->
kick2
_in
);
}
/* Black holes */
if
(
with_black_holes
)
{
c
->
black_holes
.
drift
=
scheduler_addtask
(
s
,
task_type_drift_bpart
,
task_subtype_none
,
0
,
0
,
c
,
NULL
);
scheduler_addunlock
(
s
,
c
->
black_holes
.
drift
,
c
->
super
->
kick2
);
scheduler_addunlock
(
s
,
c
->
black_holes
.
drift
,
c
->
super
->
kick2
_in
);
}
/* Subgrid tasks: cooling */
...
...
@@ -1201,10 +1264,10 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c,
engine_add_cooling
(
e
,
c
,
c
->
hydro
.
cooling_in
,
c
->
hydro
.
cooling_out
);
scheduler_addunlock
(
s
,
c
->
hydro
.
end_force
,
c
->
hydro
.
cooling_in
);
scheduler_addunlock
(
s
,
c
->
hydro
.
cooling_out
,
c
->
super
->
kick2
);
scheduler_addunlock
(
s
,
c
->
hydro
.
cooling_out
,
c
->
super
->
kick2
_in
);
}
else
{
scheduler_addunlock
(
s
,
c
->
hydro
.
end_force
,
c
->
super
->
kick2
);
scheduler_addunlock
(
s
,
c
->
hydro
.
end_force
,
c
->
super
->
kick2
_in
);
}
/* Subgrid tasks: feedback */
...
...
@@ -1225,12 +1288,12 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c,
if
(
with_logger
)
{
scheduler_addunlock
(
s
,
c
->
super
->
logger
,
c
->
stars
.
stars_in
);
}
else
{
scheduler_addunlock
(
s
,
c
->
super
->
kick2
,
c
->
stars
.
stars_in
);
scheduler_addunlock
(
s
,
c
->
super
->
kick2
_out
,
c
->
stars
.
stars_in
);
}
#else
scheduler_addunlock
(
s
,
c
->
super
->
kick2
,
c
->
stars
.
stars_in
);
scheduler_addunlock
(
s
,
c
->
super
->
kick2
_out
,
c
->
stars
.
stars_in
);
#endif
scheduler_addunlock
(
s
,
c
->
stars
.
stars_out
,
c
->
super
->
timestep
);
scheduler_addunlock
(
s
,
c
->
stars
.
stars_out
,
c
->
super
->
timestep
_in
);
if
(
with_feedback
&&
with_star_formation
&&
c
->
hydro
.
count
>
0
)
{
task_order_addunlock_star_formation_feedback
(
s
,
c
,
star_resort_cell
);
...
...
@@ -1263,14 +1326,15 @@ void engine_make_hierarchical_tasks_hydro(struct engine *e, struct cell *c,
scheduler_addunlock
(
s
,
c
->
super
->
logger
,
c
->
black_holes
.
black_holes_in
);
}
else
{
scheduler_addunlock
(
s
,
c
->
super
->
kick2
,
scheduler_addunlock
(
s
,
c
->
super
->
kick2
_out
,
c
->
black_holes
.
black_holes_in
);
}
#else
scheduler_addunlock
(
s
,
c
->
super
->
kick2
,
c
->
black_holes
.
black_holes_in
);
scheduler_addunlock
(
s
,
c
->
super
->
kick2_out
,
c
->
black_holes
.
black_holes_in
);
#endif
scheduler_addunlock
(
s
,
c
->
black_holes
.
black_holes_out
,
c
->
super
->
timestep
);
c
->
super
->
timestep
_in
);
}
if
(
with_black_holes
&&
with_feedback
)
{
...
...
@@ -2065,9 +2129,9 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
}
if
(
with_timestep_limiter
)
{
scheduler_addunlock
(
sched
,
ci
->
super
->
timestep
,
t_limiter
);
scheduler_addunlock
(
sched
,
ci
->
super
->
timestep
_out
,
t_limiter
);
scheduler_addunlock
(
sched
,
ci
->
hydro
.
super
->
hydro
.
drift
,
t_limiter
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
kick1
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
kick1
_in
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
timestep_limiter
);
}
...
...
@@ -2266,8 +2330,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
if
(
with_timestep_limiter
)
{
scheduler_addunlock
(
sched
,
ci
->
hydro
.
super
->
hydro
.
drift
,
t_limiter
);
scheduler_addunlock
(
sched
,
ci
->
super
->
timestep
,
t_limiter
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
kick1
);
scheduler_addunlock
(
sched
,
ci
->
super
->
timestep
_out
,
t_limiter
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
kick1
_in
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
timestep_limiter
);
}
...
...
@@ -2359,8 +2423,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
if
(
ci
->
super
!=
cj
->
super
)
{
if
(
with_timestep_limiter
)
{
scheduler_addunlock
(
sched
,
cj
->
super
->
timestep
,
t_limiter
);
scheduler_addunlock
(
sched
,
t_limiter
,
cj
->
super
->
kick1
);
scheduler_addunlock
(
sched
,
cj
->
super
->
timestep
_out
,
t_limiter
);
scheduler_addunlock
(
sched
,
t_limiter
,
cj
->
super
->
kick1
_in
);
scheduler_addunlock
(
sched
,
t_limiter
,
cj
->
super
->
timestep_limiter
);
}
...
...
@@ -2538,8 +2602,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
if
(
with_timestep_limiter
)
{
scheduler_addunlock
(
sched
,
ci
->
hydro
.
super
->
hydro
.
drift
,
t_limiter
);
scheduler_addunlock
(
sched
,
ci
->
super
->
timestep
,
t_limiter
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
kick1
);
scheduler_addunlock
(
sched
,
ci
->
super
->
timestep
_out
,
t_limiter
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
kick1
_in
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
timestep_limiter
);
}
...
...
@@ -2741,8 +2805,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
if
(
with_timestep_limiter
)
{
scheduler_addunlock
(
sched
,
ci
->
hydro
.
super
->
hydro
.
drift
,
t_limiter
);
scheduler_addunlock
(
sched
,
ci
->
super
->
timestep
,
t_limiter
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
kick1
);
scheduler_addunlock
(
sched
,
ci
->
super
->
timestep
_out
,
t_limiter
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
kick1
_in
);
scheduler_addunlock
(
sched
,
t_limiter
,
ci
->
super
->
timestep_limiter
);
}
...
...
@@ -2835,8 +2899,8 @@ void engine_make_extra_hydroloop_tasks_mapper(void *map_data, int num_elements,
if
(
ci
->
super
!=
cj
->
super
)
{
if
(
with_timestep_limiter
)
{
scheduler_addunlock
(
sched
,
cj
->
super
->
timestep
,
t_limiter
);
scheduler_addunlock
(
sched
,
t_limiter
,
cj
->
super
->
kick1
);
scheduler_addunlock
(
sched
,
cj
->
super
->
timestep
_out
,
t_limiter
);
scheduler_addunlock
(
sched
,
t_limiter
,
cj
->
super
->
kick1
_in
);
scheduler_addunlock
(
sched
,
t_limiter
,
cj
->
super
->
timestep_limiter
);
}
...
...
src/engine_marktasks.c
View file @
ca2a471f
...
...
@@ -886,7 +886,9 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
}
/* Kick ? */
else
if
(
t_type
==
task_type_kick1
||
t_type
==
task_type_kick2
)
{
else
if
(
t_type
==
task_type_kick1
||
t_type
==
task_type_kick2
||
t_type
==
task_type_kick1_in
||
t_type
==
task_type_kick2_in
||
t_type
==
task_type_kick1_out
||
t_type
==
task_type_kick2_out
)
{
if
(
cell_is_active_hydro
(
t
->
ci
,
e
)
||
cell_is_active_gravity
(
t
->
ci
,
e
)
||
cell_is_active_stars
(
t
->
ci
,
e
)
||
...
...
@@ -966,7 +968,8 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
}
/* Time-step? */
else
if
(
t_type
==
task_type_timestep
)
{
else
if
(
t_type
==
task_type_timestep
||
t_type
==
task_type_timestep_in
||
t_type
==
task_type_timestep_out
)
{
t
->
ci
->
hydro
.
updated
=
0
;
t
->
ci
->
grav
.
updated
=
0
;
t
->
ci
->
stars
.
updated
=
0
;
...
...
src/space.c
View file @
ca2a471f
...
...
@@ -95,6 +95,7 @@ int space_extra_gparts = space_extra_gparts_default;
int
engine_max_parts_per_ghost
=
engine_max_parts_per_ghost_default
;
int
engine_max_sparts_per_ghost
=
engine_max_sparts_per_ghost_default
;
int
engine_max_parts_per_cooling
=
engine_max_parts_per_cooling_default
;
int
engine_max_parts_per_kick
=
engine_max_parts_per_kick_default
;
/*! Maximal depth at which the stars resort task can be pushed */
int
engine_star_resort_task_depth
=
engine_star_resort_task_depth_default
;
...
...
@@ -238,8 +239,14 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements,
c
->
black_holes
.
do_gas_swallow
=
NULL
;
c
->
black_holes
.
do_bh_swallow
=
NULL
;
c
->
black_holes
.
feedback
=
NULL
;
c
->
kick1_in
=
NULL
;
c
->
kick1_out
=
NULL
;
c
->
kick1
=
NULL
;
c
->
kick2_in
=
NULL
;
c
->
kick2_out
=
NULL
;
c
->
kick2
=
NULL
;
c
->
timestep_in
=
NULL
;
c
->
timestep_out
=
NULL
;
c
->
timestep
=
NULL
;
c
->
timestep_limiter
=
NULL
;
c
->
timestep_sync
=
NULL
;
...
...
@@ -4988,10 +4995,12 @@ void space_init(struct space *s, struct swift_params *params,
engine_max_sparts_per_ghost
=
parser_get_opt_param_int
(
params
,
"Scheduler:engine_max_sparts_per_ghost"
,
engine_max_sparts_per_ghost_default
);
engine_max_parts_per_cooling
=
parser_get_opt_param_int
(
params
,
"Scheduler:engine_max_parts_per_cooling"
,
engine_max_parts_per_cooling_default
);
engine_max_parts_per_kick
=
parser_get_opt_param_int
(
params
,
"Scheduler:engine_max_parts_per_kick"
,
engine_max_parts_per_kick_default
);
if
(
verbose
)
{
message
(
"max_size set to %d split_size set to %d"
,
space_maxsize
,
...
...
@@ -5863,6 +5872,9 @@ void space_struct_dump(struct space *s, FILE *stream) {
restart_write_blocks
(
&
engine_max_parts_per_cooling
,
sizeof
(
int
),
1
,
stream
,
"engine_max_parts_per_cooling"
,
"engine_max_parts_per_cooling"
);
restart_write_blocks
(
&
engine_max_parts_per_kick
,
sizeof
(
int
),
1
,
stream
,
"engine_max_parts_per_kick"
,
"engine_max_parts_per_kick"
);
restart_write_blocks
(
&
engine_star_resort_task_depth
,
sizeof
(
int
),
1
,
stream
,
"engine_star_resort_task_depth"
,
"engine_star_resort_task_depth"
);
...
...
@@ -5932,6 +5944,8 @@ void space_struct_restore(struct space *s, FILE *stream) {
NULL
,
"engine_max_sparts_per_ghost"
);
restart_read_blocks
(
&
engine_max_parts_per_cooling
,
sizeof
(
int
),
1
,
stream
,
NULL
,
"engine_max_parts_per_cooling"
);
restart_read_blocks
(
&
engine_max_parts_per_kick
,
sizeof
(
int
),
1
,
stream
,
NULL
,
"engine_max_parts_per_kick"
);
restart_read_blocks
(
&
engine_star_resort_task_depth
,
sizeof
(
int
),
1
,
stream
,
NULL
,
"engine_star_resort_task_depth"
);
...
...
src/task.c
View file @
ca2a471f
...
...
@@ -67,9 +67,15 @@ const char *taskID_names[task_type_count] = {"none",
"drift_gpart"
,
"drift_gpart_out"
,
"end_hydro_force"
,
"kick1_in"
,
"kick1"
,
"kick1_out"
,
"kick2_in"
,
"kick2"
,
"kick2_out"
,
"timestep_in"
,
"timestep"
,
"timestep_out"
,
"timestep_limiter"
,
"timestep_sync"
,
"send"
,
...
...
src/task.h
View file @
ca2a471f
...
...
@@ -61,9 +61,15 @@ enum task_types {
task_type_drift_gpart
,
task_type_drift_gpart_out
,
/* Implicit */
task_type_end_hydro_force
,
task_type_kick1_in
,
/* Implicit */
task_type_kick1
,
task_type_kick1_out
,
/* Implicit */
task_type_kick2_in
,
/* Implicit */
task_type_kick2
,
task_type_kick2_out
,
/* Implicit */
task_type_timestep_in
,
/* Implicit */
task_type_timestep
,
task_type_timestep_out
,
/* Implicit */
task_type_timestep_limiter
,
task_type_timestep_sync
,
task_type_send
,
...
...
tools/task_plots/analyse_tasks.py
View file @
ca2a471f
...
...
@@ -89,9 +89,15 @@ TASKTYPES = [
"drift_gpart"
,
"drift_gpart_out"
,
"hydro_end_force"
,
"kick1_in"
,
"kick1"
,
"kick1_out"
,
"kick2_in"
,
"kick2"
,
"kick2_out"
,
"timestep_in"
,
"timestep"
,
"timestep_out"
,
"timestep_limiter"
,
"timestep_sync"
,
"send"
,
...
...
tools/task_plots/iplot_tasks.py
View file @
ca2a471f
...
...
@@ -143,9 +143,15 @@ TASKTYPES = [
"drift_gpart"
,
"drift_gpart_out"
,
"hydro_end_force"
,
"kick1_in"
,
"kick1"
,
"kick1_out"
,
"kick2_in"
,