Commit 90392be8 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Better choices of limits to switch to PP instead of M2L

parent d32a8b8c
......@@ -6395,8 +6395,8 @@ int cell_can_use_pair_mm(const struct cell *ci, const struct cell *cj,
const double dim[3] = {s->dim[0], s->dim[1], s->dim[2]};
/* Check for trivial cases */
if (ci->grav.count < VEC_SIZE) return 0;
if (cj->grav.count < VEC_SIZE) return 0;
if (ci->grav.count <= 1) return 0;
if (cj->grav.count <= 1) return 0;
/* Recover the multipole information */
const struct gravity_tensors *const multi_i = ci->grav.multipole;
......
......@@ -1147,8 +1147,8 @@ void runner_dopair_grav_pp(struct runner *r, struct cell *ci, struct cell *cj,
gcount_j);
#endif
const int allow_multipole_i = allow_mpole && ci->grav.count > VEC_SIZE;
const int allow_multipole_j = allow_mpole && cj->grav.count > VEC_SIZE;
const int allow_multipole_i = allow_mpole && ci->grav.count > 1;
const int allow_multipole_j = allow_mpole && cj->grav.count > 1;
/* Fill the caches */
gravity_cache_populate(e->max_active_bin, allow_multipole_j, periodic, dim,
......@@ -2104,7 +2104,7 @@ void runner_dopair_recursive_grav(struct runner *r, struct cell *ci,
/* OK, we actually need to compute this pair. Let's find the cheapest
* option... */
if (ci->grav.count < VEC_SIZE || cj->grav.count < VEC_SIZE) {
if (ci->grav.count <= 1 || cj->grav.count <= 1) {
/* We have two cheap cells. Go P-P. */
runner_dopair_grav_pp_no_cache(r, ci, cj);
......
Supports Markdown
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