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
0eb2abd8
Commit
0eb2abd8
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Separate the creation and the linking of the gravity tasks
parent
30c4cf40
No related branches found
No related tags found
1 merge request
!143
Gravity particles
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/engine.c
+20
-14
20 additions, 14 deletions
src/engine.c
with
20 additions
and
14 deletions
src/engine.c
+
20
−
14
View file @
0eb2abd8
...
...
@@ -105,6 +105,9 @@ void engine_make_ghost_tasks(struct engine *e, struct cell *c,
struct
cell
*
super
)
{
struct
scheduler
*
s
=
&
e
->
sched
;
const
int
is_with_external_gravity
=
(
e
->
policy
&
engine_policy_external_gravity
)
==
engine_policy_external_gravity
;
/* Am I the super-cell? */
if
(
super
==
NULL
&&
(
c
->
count
>
0
||
c
->
gcount
>
0
))
{
...
...
@@ -115,12 +118,6 @@ void engine_make_ghost_tasks(struct engine *e, struct cell *c,
/* Local tasks only... */
if
(
c
->
nodeID
==
e
->
nodeID
)
{
if
(
c
->
count
>
0
)
{
/* Generate the ghost task. */
c
->
ghost
=
scheduler_addtask
(
s
,
task_type_ghost
,
task_subtype_none
,
0
,
0
,
c
,
NULL
,
0
);
}
/* Add the init task. */
c
->
init
=
scheduler_addtask
(
s
,
task_type_init
,
task_subtype_none
,
0
,
0
,
c
,
NULL
,
0
);
...
...
@@ -133,16 +130,19 @@ void engine_make_ghost_tasks(struct engine *e, struct cell *c,
c
->
kick
=
scheduler_addtask
(
s
,
task_type_kick
,
task_subtype_none
,
0
,
0
,
c
,
NULL
,
0
);
if
(
c
->
gcount
>
0
)
{
/* Add the gravity tasks */
c
->
grav_external
=
scheduler_addtask
(
s
,
task_type_grav_external
,
task_subtype_none
,
0
,
0
,
c
,
NULL
,
0
);
if
(
c
->
count
>
0
)
{
/* Enforce gravity calculated before kick */
scheduler_addunlock
(
s
,
c
->
grav_external
,
c
->
kick
);
/* Generate the ghost task. */
c
->
ghost
=
scheduler_addtask
(
s
,
task_type_ghost
,
task_subtype_none
,
0
,
0
,
c
,
NULL
,
0
);
}
/* Enforce gravity calculated after init */
scheduler_addunlock
(
s
,
c
->
init
,
c
->
grav_external
);
if
(
c
->
gcount
>
0
)
{
/* Add the external gravity tasks */
if
(
is_with_external_gravity
)
c
->
grav_external
=
scheduler_addtask
(
s
,
task_type_grav_external
,
task_subtype_none
,
0
,
0
,
c
,
NULL
,
0
);
}
}
}
...
...
@@ -1297,6 +1297,12 @@ void engine_make_extra_hydroloop_tasks(struct engine *e) {
/* /\* Kick tasks should rely on the grav_down tasks of their cell. *\/ */
/* else if (t->type == task_type_kick && t->ci->grav_down != NULL) */
/* scheduler_addunlock(sched, t->ci->grav_down, t); */
/* External gravity tasks should depend on init and unlock the kick */
else
if
(
t
->
type
==
task_type_grav_external
)
{
scheduler_addunlock
(
sched
,
t
->
ci
->
init
,
t
);
scheduler_addunlock
(
sched
,
t
,
t
->
ci
->
kick
);
}
}
}
...
...
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