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
70a89bf0
Commit
70a89bf0
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Correct link between gravity ghost tasks and self/pair tasks
parent
d8f4e566
No related branches found
No related tags found
1 merge request
!340
Split the drift into hydro and gravity drift tasks. Implement FFT task and dependencies
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/engine.c
+18
-14
18 additions, 14 deletions
src/engine.c
src/space.c
+0
-2
0 additions, 2 deletions
src/space.c
with
18 additions
and
16 deletions
src/engine.c
+
18
−
14
View file @
70a89bf0
...
...
@@ -1696,14 +1696,13 @@ void engine_make_self_gravity_tasks(struct engine *e) {
if
(
ci
->
nodeID
!=
nodeID
)
continue
;
/* If the cells is local build a self-interaction */
s
truct
task
*
self
=
scheduler_addtask
(
sched
,
task_type_self
,
task_subtype_grav
,
0
,
0
,
ci
,
NULL
);
s
cheduler_addtask
(
sched
,
task_type_self
,
task_subtype_grav
,
0
,
0
,
ci
,
NULL
);
/* Deal with periodicity dependencies */
const
int
ghost_id
=
cell_getid
(
cdim_ghost
,
i
/
4
,
j
/
4
,
k
/
4
);
if
(
ghost_id
>
n_ghosts
)
error
(
"Invalid ghost_id"
);
if
(
periodic
)
{
scheduler_addunlock
(
sched
,
ghosts
[
2
*
ghost_id
+
1
],
self
);
ci
->
grav_ghost
[
0
]
=
ghosts
[
2
*
ghost_id
+
0
];
ci
->
grav_ghost
[
1
]
=
ghosts
[
2
*
ghost_id
+
1
];
}
...
...
@@ -1715,8 +1714,6 @@ void engine_make_self_gravity_tasks(struct engine *e) {
/* Get the cell */
const
int
cjd
=
cell_getid
(
cdim
,
ii
,
jj
,
kk
);
const
int
ghost_jd
=
cell_getid
(
cdim_ghost
,
ii
/
4
,
jj
/
4
,
kk
/
4
);
struct
cell
*
cj
=
&
cells
[
cjd
];
/* Avoid duplicates */
...
...
@@ -1732,15 +1729,8 @@ void engine_make_self_gravity_tasks(struct engine *e) {
if
(
!
gravity_multipole_accept
(
ci
->
multipole
,
cj
->
multipole
,
theta_crit_inv
,
1
))
{
struct
task
*
pair
=
scheduler_addtask
(
sched
,
task_type_pair
,
task_subtype_grav
,
0
,
0
,
ci
,
cj
);
/* Deal with periodicity dependencies */
if
(
periodic
)
{
scheduler_addunlock
(
sched
,
ghosts
[
2
*
ghost_id
+
1
],
pair
);
if
(
ghost_id
!=
ghost_jd
)
scheduler_addunlock
(
sched
,
ghosts
[
2
*
ghost_jd
+
1
],
pair
);
}
scheduler_addtask
(
sched
,
task_type_pair
,
task_subtype_grav
,
0
,
0
,
ci
,
cj
);
}
}
}
...
...
@@ -1956,6 +1946,11 @@ static inline void engine_make_self_gravity_dependencies(
/* init --> gravity --> grav_down --> kick */
scheduler_addunlock
(
sched
,
c
->
super
->
init_grav
,
gravity
);
scheduler_addunlock
(
sched
,
gravity
,
c
->
super
->
grav_down
);
if
(
gravity
->
type
==
task_type_self
||
(
gravity
->
type
==
task_type_pair
&&
gravity
->
ci
->
super
<
gravity
->
cj
->
super
))
scheduler_addunlock
(
sched
,
c
->
super
->
grav_ghost
[
1
],
gravity
);
}
/**
...
...
@@ -1984,6 +1979,7 @@ void engine_link_gravity_tasks(struct engine *e) {
struct
scheduler
*
sched
=
&
e
->
sched
;
const
int
nodeID
=
e
->
nodeID
;
const
int
nr_tasks
=
sched
->
nr_tasks
;
// const int periodic = e->s->periodic;
for
(
int
k
=
0
;
k
<
nr_tasks
;
k
++
)
{
...
...
@@ -1994,6 +1990,8 @@ void engine_link_gravity_tasks(struct engine *e) {
if
(
t
->
type
==
task_type_self
&&
t
->
subtype
==
task_subtype_grav
)
{
engine_make_self_gravity_dependencies
(
sched
,
t
,
t
->
ci
);
// if (periodic) scheduler_addunlock(sched, t->ci->super->grav_ghost[1],
// t);
}
/* Self-interaction for external gravity ? */
...
...
@@ -2009,11 +2007,15 @@ void engine_link_gravity_tasks(struct engine *e) {
if
(
t
->
ci
->
nodeID
==
nodeID
)
{
engine_make_self_gravity_dependencies
(
sched
,
t
,
t
->
ci
);
// if (periodic && (t->ci < t->cj))
// scheduler_addunlock(sched, t->ci->super->grav_ghost[1], t);
}
if
(
t
->
cj
->
nodeID
==
nodeID
&&
t
->
ci
->
super
!=
t
->
cj
->
super
)
{
engine_make_self_gravity_dependencies
(
sched
,
t
,
t
->
cj
);
// if (periodic && (t->ci < t->cj))
// scheduler_addunlock(sched, t->cj->super->grav_ghost[1], t);
}
}
...
...
@@ -2023,6 +2025,8 @@ void engine_link_gravity_tasks(struct engine *e) {
if
(
t
->
ci
->
nodeID
==
nodeID
)
{
engine_make_self_gravity_dependencies
(
sched
,
t
,
t
->
ci
);
// if (periodic)
// scheduler_addunlock(sched, t->ci->super->grav_ghost[1], t);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/space.c
+
0
−
2
View file @
70a89bf0
...
...
@@ -2592,8 +2592,6 @@ void space_init(struct space *s, const struct swift_params *params,
s
->
sparts
=
sparts
;
s
->
nr_queues
=
1
;
/* Temporary value until engine construction */
s
->
periodic
=
0
;
/* Are we replicating the space ? */
if
(
replicate
<
1
)
error
(
"Value of 'InitialConditions:replicate' (%d) is too small"
,
...
...
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