diff --git a/src/runner.c b/src/runner.c index d296cb8aded2efae35e73cb7507ef6f4ff43a0db..228db84a69324852a480c9db61c4398133f1afb5 100644 --- a/src/runner.c +++ b/src/runner.c @@ -423,13 +423,17 @@ void runner_do_sort(struct runner *r, struct cell *c, int flags, int clock) { /* Otherwise, just sort. */ else { - /* Fill the sort array. */ - for (int k = 0; k < count; k++) { - if (xparts != NULL) { + /* Reset the sort distance if we are in a local cell */ + if (xparts != NULL) { + for (int k = 0; k < count; k++) { xparts[k].x_diff_sort[0] = 0.0f; xparts[k].x_diff_sort[1] = 0.0f; xparts[k].x_diff_sort[2] = 0.0f; } + } + + /* Fill the sort array. */ + for (int k = 0; k < count; k++) { const double px[3] = {parts[k].x[0], parts[k].x[1], parts[k].x[2]}; for (int j = 0; j < 13; j++) if (flags & (1 << j)) { diff --git a/src/runner_doiact.h b/src/runner_doiact.h index bf8b1d6bdf578f4293080eebaa67a31eea20a531..cf8174e485503427d0622e2457895797a82de4bc 100644 --- a/src/runner_doiact.h +++ b/src/runner_doiact.h @@ -110,8 +110,6 @@ #define _TIMER_DOPAIR_SUBSET(f) PASTE(timer_dopair_subset, f) #define TIMER_DOPAIR_SUBSET _TIMER_DOPAIR_SUBSET(FUNCTION) -#include "runner_doiact_nosort.h" - /** * @brief Compute the interactions between a cell pair (non-symmetric). * @@ -572,13 +570,6 @@ void DOPAIR_SUBSET(struct runner *r, struct cell *restrict ci, struct engine *e = r->e; -#ifdef WITH_MPI - if (ci->nodeID != cj->nodeID) { - DOPAIR_SUBSET_NOSORT(r, ci, parts_i, ind, count, cj); - return; - } -#endif - #ifdef WITH_OLD_VECTORIZATION int icount = 0; float r2q[VEC_SIZE] __attribute__((aligned(16))); @@ -1103,13 +1094,6 @@ void DOPAIR2(struct runner *r, struct cell *ci, struct cell *cj) { struct engine *restrict e = r->e; -#ifdef WITH_MPI - if (ci->nodeID != cj->nodeID) { - DOPAIR2_NOSORT(r, ci, cj); - return; - } -#endif - #ifdef WITH_OLD_VECTORIZATION int icount1 = 0; float r2q1[VEC_SIZE] __attribute__((aligned(16))); diff --git a/src/task.c b/src/task.c index 5d98fbe77a082a5267a3790530684421c8db8523..e8c35e49a57595a6415c60ce7071ae1c0e3f09b7 100644 --- a/src/task.c +++ b/src/task.c @@ -283,10 +283,6 @@ void task_unlock(struct task *t) { /* Act based on task type. */ switch (type) { - case task_type_init_grav: - cell_munlocktree(ci); - break; - case task_type_kick1: case task_type_kick2: case task_type_timestep: @@ -373,11 +369,6 @@ int task_lock(struct task *t) { #endif break; - case task_type_init_grav: - if (ci->mhold) return 0; - if (cell_mlocktree(ci) != 0) return 0; - break; - case task_type_kick1: case task_type_kick2: case task_type_timestep: