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
c6011947
Commit
c6011947
authored
Jul 26, 2017
by
Pedro Gonnet
Committed by
Matthieu Schaller
Aug 02, 2017
Browse files
split gravity self tasks if they are larger than a given size.
parent
7a43020f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scheduler.c
View file @
c6011947
...
...
@@ -619,53 +619,36 @@ static void scheduler_splittask_gravity(struct task *t, struct scheduler *s) {
break
;
}
/* Is this cell even split? */
if
(
ci
->
split
)
{
/* Make a sub? */
if
(
scheduler_dosub
&&
ci
->
gcount
<
space_subsize_self
)
{
/* convert to a self-subtask. */
t
->
type
=
task_type_sub_self
;
/* Make sure we have a drift task */
lock_lock
(
&
ci
->
lock
);
if
(
ci
->
drift_gpart
==
NULL
)
ci
->
drift_gpart
=
scheduler_addtask
(
s
,
task_type_drift_gpart
,
task_subtype_none
,
0
,
0
,
ci
,
NULL
);
lock_unlock_blind
(
&
ci
->
lock
);
/* Otherwise, make tasks explicitly. */
}
else
{
/* Take a step back (we're going to recycle the current task)... */
redo
=
1
;
/* Add the self tasks. */
int
first_child
=
0
;
while
(
ci
->
progeny
[
first_child
]
==
NULL
)
first_child
++
;
t
->
ci
=
ci
->
progeny
[
first_child
];
for
(
int
k
=
first_child
+
1
;
k
<
8
;
k
++
)
if
(
ci
->
progeny
[
k
]
!=
NULL
)
scheduler_splittask_gravity
(
scheduler_addtask
(
s
,
task_type_self
,
t
->
subtype
,
0
,
0
,
ci
->
progeny
[
k
],
NULL
),
s
);
/* Make a task for each pair of progeny */
if
(
t
->
subtype
!=
task_subtype_external_grav
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
if
(
ci
->
progeny
[
j
]
!=
NULL
)
for
(
int
k
=
j
+
1
;
k
<
8
;
k
++
)
if
(
ci
->
progeny
[
k
]
!=
NULL
)
scheduler_splittask_gravity
(
scheduler_addtask
(
s
,
task_type_pair
,
t
->
subtype
,
sub_sid_flag
[
j
][
k
],
0
,
ci
->
progeny
[
j
],
ci
->
progeny
[
k
]),
s
);
}
/* Should we split this task? */
if
(
ci
->
split
&&
ci
->
gcount
>
space_subsize_self_grav
)
{
/* Take a step back (we're going to recycle the current task)... */
redo
=
1
;
/* Add the self tasks. */
int
first_child
=
0
;
while
(
ci
->
progeny
[
first_child
]
==
NULL
)
first_child
++
;
t
->
ci
=
ci
->
progeny
[
first_child
];
for
(
int
k
=
first_child
+
1
;
k
<
8
;
k
++
)
if
(
ci
->
progeny
[
k
]
!=
NULL
)
scheduler_splittask_gravity
(
scheduler_addtask
(
s
,
task_type_self
,
t
->
subtype
,
0
,
0
,
ci
->
progeny
[
k
],
NULL
),
s
);
/* Make a task for each pair of progeny */
if
(
t
->
subtype
!=
task_subtype_external_grav
)
{
for
(
int
j
=
0
;
j
<
8
;
j
++
)
if
(
ci
->
progeny
[
j
]
!=
NULL
)
for
(
int
k
=
j
+
1
;
k
<
8
;
k
++
)
if
(
ci
->
progeny
[
k
]
!=
NULL
)
scheduler_splittask_gravity
(
scheduler_addtask
(
s
,
task_type_pair
,
t
->
subtype
,
sub_sid_flag
[
j
][
k
],
0
,
ci
->
progeny
[
j
],
ci
->
progeny
[
k
]),
s
);
}
}
/* Cell is split */
}
/* Otherwise, make sure the self task has a drift task */
else
{
...
...
@@ -693,7 +676,7 @@ static void scheduler_splittask_gravity(struct task *t, struct scheduler *s) {
}
/* Should this task be split-up? */
if
(
ci
->
split
&&
cj
->
split
)
{
if
(
0
&&
ci
->
split
&&
cj
->
split
)
{
// MATTHIEU: nothing here for now
...
...
@@ -1363,6 +1346,11 @@ void scheduler_enqueue(struct scheduler *s, struct task *t) {
}
else
if
(
t
->
subtype
==
task_subtype_xv
||
t
->
subtype
==
task_subtype_rho
||
t
->
subtype
==
task_subtype_gradient
)
{
#ifdef SWIFT_DEBUG_CHECKS
for
(
int
k
=
0
;
k
<
t
->
ci
->
count
;
k
++
)
if
(
t
->
ci
->
parts
[
k
].
ti_drift
!=
s
->
space
->
e
->
ti_current
)
error
(
"Sending un-drifted particle !"
);
#endif
err
=
MPI_Isend
(
t
->
ci
->
parts
,
t
->
ci
->
count
,
part_mpi_type
,
t
->
cj
->
nodeID
,
t
->
flags
,
MPI_COMM_WORLD
,
&
t
->
req
);
// message( "sending %i parts with tag=%i from %i to %i." ,
...
...
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