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
861e5f8b
Commit
861e5f8b
authored
May 26, 2020
by
Matthieu Schaller
Browse files
Better name for the new parameter of cell_can_use_pair_mm()
parent
48917836
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
861e5f8b
...
...
@@ -3329,7 +3329,8 @@ void cell_activate_subcell_grav_tasks(struct cell *ci, struct cell *cj,
/* Can we use multipoles ? */
if
(
cell_can_use_pair_mm
(
ci
,
cj
,
e
,
sp
,
/*use_rebuild_data=*/
0
,
/*is_top_level=*/
0
))
{
/*is_tree_walk=*/
1
))
{
/* Ok, no need to drift anything */
return
;
}
...
...
@@ -6388,19 +6389,21 @@ void cell_reorder_extra_gparts(struct cell *c, struct part *parts,
* @param s The #space.
* @param use_rebuild_data Are we considering the data at the last tree-build
* (1) or current data (0)?
* @param is_tree_walk Are we calling this in the tree walk (1) or for the
* top-level task construction (0)?
*/
int
cell_can_use_pair_mm
(
const
struct
cell
*
restrict
ci
,
const
struct
cell
*
restrict
cj
,
const
struct
engine
*
e
,
const
struct
space
*
s
,
const
int
use_rebuild_data
,
const
int
is_t
op_level
)
{
const
int
is_t
ree_walk
)
{
const
struct
gravity_props
*
props
=
e
->
gravity_properties
;
const
int
periodic
=
s
->
periodic
;
const
double
dim
[
3
]
=
{
s
->
dim
[
0
],
s
->
dim
[
1
],
s
->
dim
[
2
]};
/* Check for trivial cases */
if
(
!
is_t
op_level
&&
ci
->
grav
.
count
<=
1
)
return
0
;
if
(
!
is_t
op_level
&&
cj
->
grav
.
count
<=
1
)
return
0
;
if
(
is_t
ree_walk
&&
ci
->
grav
.
count
<=
1
)
return
0
;
if
(
is_t
ree_walk
&&
cj
->
grav
.
count
<=
1
)
return
0
;
/* Recover the multipole information */
const
struct
gravity_tensors
*
restrict
multi_i
=
ci
->
grav
.
multipole
;
...
...
src/cell.h
View file @
861e5f8b
...
...
@@ -960,7 +960,7 @@ void cell_reorder_extra_gparts(struct cell *c, struct part *parts,
void
cell_reorder_extra_sparts
(
struct
cell
*
c
,
const
ptrdiff_t
sparts_offset
);
int
cell_can_use_pair_mm
(
const
struct
cell
*
ci
,
const
struct
cell
*
cj
,
const
struct
engine
*
e
,
const
struct
space
*
s
,
const
int
use_rebuild_data
,
const
int
is_t
op_level
);
const
int
use_rebuild_data
,
const
int
is_t
ree_walk
);
/**
* @brief Compute the square of the minimal distance between any two points in
...
...
src/engine_maketasks.c
View file @
861e5f8b
...
...
@@ -1382,7 +1382,7 @@ void engine_make_self_gravity_tasks_mapper(void *map_data, int num_elements,
/* Are the cells too close for a MM interaction ? */
if
(
!
cell_can_use_pair_mm
(
ci
,
cj
,
e
,
s
,
/*use_rebuild_data=*/
1
,
/*is_t
op_level
=*/
1
))
{
/*is_t
ree_walk
=*/
0
))
{
/* Ok, we need to add a direct pair calculation */
scheduler_addtask
(
sched
,
task_type_pair
,
task_subtype_grav
,
0
,
0
,
...
...
src/runner_doiact_grav.c
View file @
861e5f8b
...
...
@@ -2402,7 +2402,7 @@ void runner_do_grav_long_range(struct runner *r, struct cell *ci,
}
if
(
cell_can_use_pair_mm
(
top
,
cj
,
e
,
e
->
s
,
/*use_rebuild_data=*/
1
,
/*is_t
op_level
=*/
1
))
{
/*is_t
ree_walk
=*/
0
))
{
/* Call the PM interaction fucntion on the active sub-cells of ci */
runner_dopair_grav_mm_nonsym
(
r
,
ci
,
cj
);
...
...
src/scheduler.c
View file @
861e5f8b
...
...
@@ -874,7 +874,7 @@ static void scheduler_splittask_gravity(struct task *t, struct scheduler *s) {
/* Can we use a M-M interaction here? */
if
(
cell_can_use_pair_mm
(
ci
->
progeny
[
i
],
cj
->
progeny
[
j
],
e
,
sp
,
/*use_rebuild_data=*/
1
,
/*is_t
op_level
=*/
0
))
{
/*is_t
ree_walk
=*/
1
))
{
/* Flag this pair as being treated by the M-M task.
* We use the 64 bits in the task->flags field to store
...
...
Matthieu Schaller
@matthieu
mentioned in commit
6f6c3499
·
Jun 07, 2020
mentioned in commit
6f6c3499
mentioned in commit 6f6c3499f88dd583de1e01fe709d95a95a142e75
Toggle commit list
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