From 8e8ed29da1878ef5df2d3f7a10e479a8ed428acd Mon Sep 17 00:00:00 2001 From: James Willis <james.s.willis@durham.ac.uk> Date: Thu, 16 Nov 2017 19:54:41 +0000 Subject: [PATCH] Tidied code up. --- src/runner_doiact_vec.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/runner_doiact_vec.c b/src/runner_doiact_vec.c index e61e5ef6c9..b01caa2527 100644 --- a/src/runner_doiact_vec.c +++ b/src/runner_doiact_vec.c @@ -1164,13 +1164,8 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci, TIMER_TIC; /* Check whether cells are local to the node. */ -#ifdef WITH_MPI - const int ci_local = (ci->nodeID == e->nodeID) ? 1 : 0; - const int cj_local = (cj->nodeID == e->nodeID) ? 1 : 0; -#else - const int ci_local = 1; - const int cj_local = 1; -#endif + const int ci_local = (ci->nodeID == e->nodeID); + const int cj_local = (cj->nodeID == e->nodeID); /* Get the cutoff shift. */ double rshift = 0.0; @@ -1190,8 +1185,8 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci, const double di_max = sort_i[count_i - 1].d - rshift; const double dj_min = sort_j[0].d; const float dx_max = (ci->dx_max_sort + cj->dx_max_sort); - const int active_ci = cell_is_active(ci, e) & ci_local; - const int active_cj = cell_is_active(cj, e) & cj_local; + const int active_ci = cell_is_active(ci, e) && ci_local; + const int active_cj = cell_is_active(cj, e) && cj_local; /* Count number of particles that are in range and active*/ int numActive = 0; @@ -1523,13 +1518,8 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci, TIMER_TIC; /* Check whether cells are local to the node. */ -#ifdef WITH_MPI - const int ci_local = (ci->nodeID == e->nodeID) ? 1 : 0; - const int cj_local = (cj->nodeID == e->nodeID) ? 1 : 0; -#else - const int ci_local = 1; - const int cj_local = 1; -#endif + const int ci_local = (ci->nodeID == e->nodeID); + const int cj_local = (cj->nodeID == e->nodeID); /* Get the cutoff shift. */ double rshift = 0.0; @@ -1551,8 +1541,8 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci, const double di_max = sort_i[count_i - 1].d - rshift; const double dj_min = sort_j[0].d; const float dx_max = (ci->dx_max_sort + cj->dx_max_sort); - const int active_ci = cell_is_active(ci, e) & ci_local; - const int active_cj = cell_is_active(cj, e) & cj_local; + const int active_ci = cell_is_active(ci, e) && ci_local; + const int active_cj = cell_is_active(cj, e) && cj_local; /* Check if any particles are active and in range */ int numActive = 0; -- GitLab