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
de03f318
Commit
de03f318
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Also optimize out the cell nodeID lookup in the hydro unskipping
parent
9a80921e
No related branches found
No related tags found
1 merge request
!589
Mpi periodic gravity
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cell.c
+22
-15
22 additions, 15 deletions
src/cell.c
with
22 additions
and
15 deletions
src/cell.c
+
22
−
15
View file @
de03f318
...
...
@@ -2072,15 +2072,22 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
struct
cell
*
cj
=
t
->
cj
;
const
int
ci_active
=
cell_is_active_hydro
(
ci
,
e
);
const
int
cj_active
=
(
cj
!=
NULL
)
?
cell_is_active_hydro
(
cj
,
e
)
:
0
;
#ifdef WITH_MPI
const
int
ci_nodeID
=
ci
->
nodeID
;
const
int
cj_nodeID
=
(
cj
!=
NULL
)
?
cj
->
nodeID
:
-
1
;
#else
const
int
ci_nodeID
=
nodeID
;
const
int
cj_nodeID
=
nodeID
;
#endif
/* Only activate tasks that involve a local active cell. */
if
((
ci_active
&&
ci
->
nodeID
==
nodeID
)
||
(
cj_active
&&
cj
->
nodeID
==
nodeID
))
{
if
((
ci_active
&&
ci
_
nodeID
==
nodeID
)
||
(
cj_active
&&
cj
_
nodeID
==
nodeID
))
{
scheduler_activate
(
s
,
t
);
/* Activate hydro drift */
if
(
t
->
type
==
task_type_self
)
{
if
(
ci
->
nodeID
==
nodeID
)
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 */
...
...
@@ -2092,8 +2099,8 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
cj
->
dx_max_sort_old
=
cj
->
dx_max_sort
;
/* Activate the drift tasks. */
if
(
ci
->
nodeID
==
nodeID
)
cell_activate_drift_part
(
ci
,
s
);
if
(
cj
->
nodeID
==
nodeID
)
cell_activate_drift_part
(
cj
,
s
);
if
(
ci
_
nodeID
==
nodeID
)
cell_activate_drift_part
(
ci
,
s
);
if
(
cj
_
nodeID
==
nodeID
)
cell_activate_drift_part
(
cj
,
s
);
/* Check the sorts and activate them if needed. */
cell_activate_sorts
(
ci
,
t
->
flags
,
s
);
...
...
@@ -2114,7 +2121,7 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
#ifdef WITH_MPI
/* Activate the send/recv tasks. */
if
(
ci
->
nodeID
!=
nodeID
)
{
if
(
ci
_
nodeID
!=
nodeID
)
{
/* If the local cell is active, receive data from the foreign cell. */
if
(
cj_active
)
{
...
...
@@ -2134,7 +2141,7 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
/* Is the foreign cell active and will need stuff from us? */
if
(
ci_active
)
{
scheduler_activate_send
(
s
,
cj
->
send_xv
,
ci
->
nodeID
);
scheduler_activate_send
(
s
,
cj
->
send_xv
,
ci
_
nodeID
);
/* Drift the cell which will be sent; note that not all sent
particles will be drifted, only those that are needed. */
...
...
@@ -2142,18 +2149,18 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
/* If the local cell is also active, more stuff will be needed. */
if
(
cj_active
)
{
scheduler_activate_send
(
s
,
cj
->
send_rho
,
ci
->
nodeID
);
scheduler_activate_send
(
s
,
cj
->
send_rho
,
ci
_
nodeID
);
#ifdef EXTRA_HYDRO_LOOP
scheduler_activate_send
(
s
,
cj
->
send_gradient
,
ci
->
nodeID
);
scheduler_activate_send
(
s
,
cj
->
send_gradient
,
ci
_
nodeID
);
#endif
}
}
/* 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
!=
nodeID
)
{
}
else
if
(
cj
_
nodeID
!=
nodeID
)
{
/* If the local cell is active, receive data from the foreign cell. */
if
(
ci_active
)
{
...
...
@@ -2173,7 +2180,7 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
/* Is the foreign cell active and will need stuff from us? */
if
(
cj_active
)
{
scheduler_activate_send
(
s
,
ci
->
send_xv
,
cj
->
nodeID
);
scheduler_activate_send
(
s
,
ci
->
send_xv
,
cj
_
nodeID
);
/* Drift the cell which will be sent; note that not all sent
particles will be drifted, only those that are needed. */
...
...
@@ -2182,16 +2189,16 @@ int cell_unskip_hydro_tasks(struct cell *c, struct scheduler *s) {
/* If the local cell is also active, more stuff will be needed. */
if
(
ci_active
)
{
scheduler_activate_send
(
s
,
ci
->
send_rho
,
cj
->
nodeID
);
scheduler_activate_send
(
s
,
ci
->
send_rho
,
cj
_
nodeID
);
#ifdef EXTRA_HYDRO_LOOP
scheduler_activate_send
(
s
,
ci
->
send_gradient
,
cj
->
nodeID
);
scheduler_activate_send
(
s
,
ci
->
send_gradient
,
cj
_
nodeID
);
#endif
}
}
/* If the local cell is active, send its ti_end values. */
if
(
ci_active
)
scheduler_activate_send
(
s
,
ci
->
send_ti
,
cj
->
nodeID
);
if
(
ci_active
)
scheduler_activate_send
(
s
,
ci
->
send_ti
,
cj
_
nodeID
);
}
#endif
}
...
...
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