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
01f51f70
Commit
01f51f70
authored
Jun 14, 2016
by
Matthieu Schaller
Browse files
Post-merge fixes
parent
24e3b63a
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
01f51f70
...
...
@@ -1265,6 +1265,23 @@ void engine_count_and_link_tasks(struct engine *e) {
}
}
/**
* @brief Creates the dependency network for the gravity tasks of a given cell.
*
* @param sched The #scheduler.
* @param gravity The gravity task to link.
* @param c The cell.
*/
static
inline
void
engine_make_gravity_dependencies
(
struct
scheduler
*
sched
,
struct
task
*
gravity
,
struct
cell
*
c
)
{
/* init --> gravity --> kick */
/* grav_up --> gravity ( --> kick) */
scheduler_addunlock
(
sched
,
c
->
super
->
init
,
gravity
);
scheduler_addunlock
(
sched
,
c
->
super
->
grav_up
,
gravity
);
scheduler_addunlock
(
sched
,
gravity
,
c
->
super
->
kick
);
}
/**
* @brief Creates all the task dependencies for the gravity
...
...
@@ -1285,6 +1302,8 @@ void engine_link_gravity_tasks(struct engine *e) {
struct
task
*
fft
=
scheduler_addtask
(
sched
,
task_type_grav_fft
,
task_subtype_none
,
0
,
0
,
NULL
,
NULL
,
0
);
scheduler_addunlock
(
sched
,
gather
,
fft
);
for
(
int
k
=
0
;
k
<
nr_tasks
;
k
++
)
{
/* Get a pointer to the task. */
...
...
@@ -1296,7 +1315,6 @@ void engine_link_gravity_tasks(struct engine *e) {
/* Multipole construction */
if
(
t
->
type
==
task_type_grav_up
)
{
scheduler_addunlock
(
sched
,
t
,
gather
);
scheduler_addunlock
(
sched
,
t
,
fft
);
}
/* Long-range interaction */
...
...
@@ -1332,15 +1350,22 @@ void engine_link_gravity_tasks(struct engine *e) {
}
/* Otherwise, sub interaction? */
else
if
(
t
->
type
==
task_type_sub
&&
t
->
subtype
==
task_subtype_grav
)
{
/* Otherwise, sub-self interaction? */
else
if
(
t
->
type
==
task_type_sub_self
&&
t
->
subtype
==
task_subtype_grav
)
{
if
(
t
->
ci
->
nodeID
==
nodeID
)
{
engine_make_gravity_dependencies
(
sched
,
t
,
t
->
ci
);
}
}
/* Otherwise, sub-pair interaction? */
else
if
(
t
->
type
==
task_type_sub_pair
&&
t
->
subtype
==
task_subtype_grav
)
{
if
(
t
->
ci
->
nodeID
==
nodeID
)
{
engine_make_gravity_dependencies
(
sched
,
t
,
t
->
ci
);
}
if
(
t
->
cj
!=
NULL
&&
t
->
cj
->
nodeID
==
nodeID
&&
t
->
ci
->
super
!=
t
->
cj
->
super
)
{
if
(
t
->
cj
->
nodeID
==
nodeID
&&
t
->
ci
->
super
!=
t
->
cj
->
super
)
{
engine_make_gravity_dependencies
(
sched
,
t
,
t
->
cj
);
}
...
...
src/partition.c
View file @
01f51f70
...
...
@@ -504,8 +504,7 @@ static void repart_edge_metis(int partweights, int bothweights, int nodeID,
}
/* Pair? */
else
if
(
t
->
type
==
task_type_pair
||
(
t
->
type
==
task_type_sub_pair
))
{
else
if
(
t
->
type
==
task_type_pair
||
(
t
->
type
==
task_type_sub_pair
))
{
/* In-cell pair? */
if
(
ci
==
cj
)
{
/* Add weight to vertex for ci. */
...
...
src/runner.c
View file @
01f51f70
...
...
@@ -1087,6 +1087,8 @@ void *runner_main(void *data) {
runner_dosub_self1_density
(
r
,
ci
,
1
);
else
if
(
t
->
subtype
==
task_subtype_force
)
runner_dosub_self2_force
(
r
,
ci
,
1
);
else
if
(
t
->
subtype
==
task_subtype_grav
)
runner_dosub_grav
(
r
,
ci
,
cj
,
1
);
else
error
(
"Unknown task subtype."
);
break
;
...
...
@@ -1095,6 +1097,8 @@ void *runner_main(void *data) {
runner_dosub_pair1_density
(
r
,
ci
,
cj
,
t
->
flags
,
1
);
else
if
(
t
->
subtype
==
task_subtype_force
)
runner_dosub_pair2_force
(
r
,
ci
,
cj
,
t
->
flags
,
1
);
else
if
(
t
->
subtype
==
task_subtype_grav
)
runner_dosub_grav
(
r
,
ci
,
cj
,
1
);
else
error
(
"Unknown task subtype."
);
break
;
...
...
src/task.c
View file @
01f51f70
...
...
@@ -142,7 +142,6 @@ void task_unlock(struct task *t) {
}
break
;
case
task_type_grav_mm
:
cell_gunlocktree
(
ci
);
break
;
...
...
@@ -218,6 +217,10 @@ int task_lock(struct task *t) {
}
break
;
case
task_type_grav_mm
:
cell_glocktree
(
ci
);
break
;
default:
break
;
}
...
...
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