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
a5f1bc2f
Commit
a5f1bc2f
authored
Nov 23, 2017
by
Matthieu Schaller
Browse files
Only activate the FFT task if there is at least one active task on that rank.
parent
670f8b6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
a5f1bc2f
...
...
@@ -2069,8 +2069,8 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
const
int
cj_active
=
(
cj
!=
NULL
)
?
cell_is_active
(
cj
,
e
)
:
0
;
/* Only activate tasks that involve a local active cell. */
if
((
ci_active
&&
ci
->
nodeID
==
engine_rank
)
||
(
cj_active
&&
cj
->
nodeID
==
engine_rank
))
{
if
((
ci_active
&&
ci
->
nodeID
==
nodeID
)
||
(
cj_active
&&
cj
->
nodeID
==
nodeID
))
{
scheduler_activate
(
s
,
t
);
/* Set the drifting flags */
...
...
@@ -2088,7 +2088,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
#ifdef WITH_MPI
/* Activate the send/recv tasks. */
if
(
ci
->
nodeID
!=
engine_rank
)
{
if
(
ci
->
nodeID
!=
nodeID
)
{
/* If the local cell is active, receive data from the foreign cell. */
if
(
cj_active
)
{
...
...
@@ -2112,7 +2112,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
/* If the local cell is active, send its ti_end values. */
if
(
cj_active
)
scheduler_activate_send
(
s
,
cj
->
send_ti
,
ci
->
nodeID
);
}
else
if
(
cj
->
nodeID
!=
engine_rank
)
{
}
else
if
(
cj
->
nodeID
!=
nodeID
)
{
/* If the local cell is active, receive data from the foreign cell. */
if
(
ci_active
)
{
...
...
@@ -2156,8 +2156,6 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
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->grav_ghost[0] != NULL) scheduler_activate(s, c->grav_ghost[0]);
// if (c->grav_ghost[1] != NULL) scheduler_activate(s, c->grav_ghost[1]);
if
(
c
->
grav_down
!=
NULL
)
scheduler_activate
(
s
,
c
->
grav_down
);
if
(
c
->
grav_long_range
!=
NULL
)
scheduler_activate
(
s
,
c
->
grav_long_range
);
if
(
c
->
cooling
!=
NULL
)
scheduler_activate
(
s
,
c
->
cooling
);
...
...
src/engine.c
View file @
a5f1bc2f
...
...
@@ -4314,12 +4314,14 @@ void engine_unskip(struct engine *e) {
/* Activate all the regular tasks */
threadpool_map
(
&
e
->
threadpool
,
runner_do_unskip_mapper
,
e
->
s
->
local_cells_top
,
e
->
s
->
nr_local_cells
,
sizeof
(
int
),
1
,
e
);
// threadpool_map(&e->threadpool, runner_do_unskip_mapper, e->s->cells_top,
// e->s->nr_cells, sizeof(int), 1, e);
/* And the top level gravity FFT one */
if
(
e
->
s
->
periodic
&&
(
e
->
policy
&
engine_policy_self_gravity
))
scheduler_activate
(
&
e
->
sched
,
e
->
s
->
grav_top_level
);
/* And the top level gravity FFT one when periodicity is on.*/
if
(
e
->
s
->
periodic
&&
(
e
->
policy
&
engine_policy_self_gravity
))
{
/* But only if there are other tasks (i.e. something happens on this node) */
if
(
e
->
sched
.
active_count
>
0
)
scheduler_activate
(
&
e
->
sched
,
e
->
s
->
grav_top_level
);
}
if
(
e
->
verbose
)
message
(
"took %.3f %s."
,
clocks_from_ticks
(
getticks
()
-
tic
),
...
...
src/gravity/Default/gravity.h
View file @
a5f1bc2f
...
...
@@ -78,7 +78,7 @@ gravity_compute_timestep_self(const struct gpart* const gp,
const
float
epsilon
=
gravity_get_softening
(
gp
);
/* Note that 0.66666667 = 2. (from Gadget) / 3. (Plummer softening) */
float
dt
=
sqrtf
(
0
.
66666667
f
*
grav_props
->
eta
*
epsilon
*
ac_inv
);
const
float
dt
=
sqrtf
(
0
.
66666667
f
*
grav_props
->
eta
*
epsilon
*
ac_inv
);
return
dt
;
}
...
...
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