Commit 861e5f8b authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Better name for the new parameter of cell_can_use_pair_mm()

parent 48917836
......@@ -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_top_level) {
const int is_tree_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_top_level && ci->grav.count <= 1) return 0;
if (!is_top_level && cj->grav.count <= 1) return 0;
if (is_tree_walk && ci->grav.count <= 1) return 0;
if (is_tree_walk && cj->grav.count <= 1) return 0;
/* Recover the multipole information */
const struct gravity_tensors *restrict multi_i = ci->grav.multipole;
......
......@@ -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_top_level);
const int use_rebuild_data, const int is_tree_walk);
/**
* @brief Compute the square of the minimal distance between any two points in
......
......@@ -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_top_level=*/1)) {
/*is_tree_walk=*/0)) {
/* Ok, we need to add a direct pair calculation */
scheduler_addtask(sched, task_type_pair, task_subtype_grav, 0, 0,
......
......@@ -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_top_level=*/1)) {
/*is_tree_walk=*/0)) {
/* Call the PM interaction fucntion on the active sub-cells of ci */
runner_dopair_grav_mm_nonsym(r, ci, cj);
......
......@@ -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_top_level=*/0)) {
/*is_tree_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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment