Skip to content
GitLab
Menu
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
6acc97f1
Commit
6acc97f1
authored
Nov 02, 2017
by
Matthieu Schaller
Browse files
Use engine->nodeID and not engine_rank in cell_unskip_tasks()
parent
418e773c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
6acc97f1
...
@@ -1863,6 +1863,7 @@ void cell_activate_subcell_external_grav_tasks(struct cell *ci,
...
@@ -1863,6 +1863,7 @@ void cell_activate_subcell_external_grav_tasks(struct cell *ci,
int
cell_unskip_tasks
(
struct
cell
*
c
,
struct
scheduler
*
s
)
{
int
cell_unskip_tasks
(
struct
cell
*
c
,
struct
scheduler
*
s
)
{
struct
engine
*
e
=
s
->
space
->
e
;
struct
engine
*
e
=
s
->
space
->
e
;
const
int
nodeID
=
e
->
nodeID
;
int
rebuild
=
0
;
int
rebuild
=
0
;
/* Un-skip the density tasks involved with this cell. */
/* Un-skip the density tasks involved with this cell. */
...
@@ -1874,13 +1875,13 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
...
@@ -1874,13 +1875,13 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
const
int
cj_active
=
(
cj
!=
NULL
)
?
cell_is_active
(
cj
,
e
)
:
0
;
const
int
cj_active
=
(
cj
!=
NULL
)
?
cell_is_active
(
cj
,
e
)
:
0
;
/* Only activate tasks that involve a local active cell. */
/* Only activate tasks that involve a local active cell. */
if
((
ci_active
&&
ci
->
nodeID
==
engine_rank
)
||
if
((
ci_active
&&
ci
->
nodeID
==
nodeID
)
||
(
cj_active
&&
cj
->
nodeID
==
engine_rank
))
{
(
cj_active
&&
cj
->
nodeID
==
nodeID
))
{
scheduler_activate
(
s
,
t
);
scheduler_activate
(
s
,
t
);
/* Activate hydro drift */
/* Activate hydro drift */
if
(
t
->
type
==
task_type_self
)
{
if
(
t
->
type
==
task_type_self
)
{
if
(
ci
->
nodeID
==
engine_rank
)
cell_activate_drift_part
(
ci
,
s
);
if
(
ci
->
nodeID
==
nodeID
)
cell_activate_drift_part
(
ci
,
s
);
}
}
/* Set the correct sorting flags and activate hydro drifts */
/* Set the correct sorting flags and activate hydro drifts */
...
@@ -1892,8 +1893,8 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
...
@@ -1892,8 +1893,8 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
cj
->
dx_max_sort_old
=
cj
->
dx_max_sort
;
cj
->
dx_max_sort_old
=
cj
->
dx_max_sort
;
/* Activate the drift tasks. */
/* Activate the drift tasks. */
if
(
ci
->
nodeID
==
engine_rank
)
cell_activate_drift_part
(
ci
,
s
);
if
(
ci
->
nodeID
==
nodeID
)
cell_activate_drift_part
(
ci
,
s
);
if
(
cj
->
nodeID
==
engine_rank
)
cell_activate_drift_part
(
cj
,
s
);
if
(
cj
->
nodeID
==
nodeID
)
cell_activate_drift_part
(
cj
,
s
);
/* Check the sorts and activate them if needed. */
/* Check the sorts and activate them if needed. */
cell_activate_sorts
(
ci
,
t
->
flags
,
s
);
cell_activate_sorts
(
ci
,
t
->
flags
,
s
);
...
@@ -1914,7 +1915,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
...
@@ -1914,7 +1915,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
#ifdef WITH_MPI
#ifdef WITH_MPI
/* Activate the send/recv tasks. */
/* 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 the local cell is active, receive data from the foreign cell. */
if
(
cj_active
)
{
if
(
cj_active
)
{
...
@@ -1952,7 +1953,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
...
@@ -1952,7 +1953,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
/* If the local cell is active, send its ti_end values. */
/* If the local cell is active, send its ti_end values. */
if
(
cj_active
)
scheduler_activate_send
(
s
,
cj
->
send_ti
,
ci
->
nodeID
);
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 the local cell is active, receive data from the foreign cell. */
if
(
ci_active
)
{
if
(
ci_active
)
{
...
@@ -2002,8 +2003,8 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
...
@@ -2002,8 +2003,8 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
struct
cell
*
cj
=
t
->
cj
;
struct
cell
*
cj
=
t
->
cj
;
/* Only activate tasks that involve a local active cell. */
/* Only activate tasks that involve a local active cell. */
if
((
cell_is_active
(
ci
,
e
)
&&
ci
->
nodeID
==
engine_rank
)
||
if
((
cell_is_active
(
ci
,
e
)
&&
ci
->
nodeID
==
nodeID
)
||
(
cj
!=
NULL
&&
cell_is_active
(
cj
,
e
)
&&
cj
->
nodeID
==
engine_rank
))
{
(
cj
!=
NULL
&&
cell_is_active
(
cj
,
e
)
&&
cj
->
nodeID
==
nodeID
))
{
scheduler_activate
(
s
,
t
);
scheduler_activate
(
s
,
t
);
/* Set the drifting flags */
/* Set the drifting flags */
...
@@ -2019,7 +2020,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
...
@@ -2019,7 +2020,7 @@ int cell_unskip_tasks(struct cell *c, struct scheduler *s) {
}
}
/* Unskip all the other task types. */
/* Unskip all the other task types. */
if
(
c
->
nodeID
==
engine_rank
&&
cell_is_active
(
c
,
e
))
{
if
(
c
->
nodeID
==
nodeID
&&
cell_is_active
(
c
,
e
))
{
for
(
struct
link
*
l
=
c
->
gradient
;
l
!=
NULL
;
l
=
l
->
next
)
for
(
struct
link
*
l
=
c
->
gradient
;
l
!=
NULL
;
l
=
l
->
next
)
scheduler_activate
(
s
,
l
->
t
);
scheduler_activate
(
s
,
l
->
t
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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