Skip to content
Snippets Groups Projects
Commit 8e8ed29d authored by James Willis's avatar James Willis
Browse files

Tidied code up.

parent fa153c4c
No related branches found
No related tags found
1 merge request!456Dopair vec mpi
...@@ -1164,13 +1164,8 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci, ...@@ -1164,13 +1164,8 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
TIMER_TIC; TIMER_TIC;
/* Check whether cells are local to the node. */ /* Check whether cells are local to the node. */
#ifdef WITH_MPI const int ci_local = (ci->nodeID == e->nodeID);
const int ci_local = (ci->nodeID == e->nodeID) ? 1 : 0; const int cj_local = (cj->nodeID == e->nodeID);
const int cj_local = (cj->nodeID == e->nodeID) ? 1 : 0;
#else
const int ci_local = 1;
const int cj_local = 1;
#endif
/* Get the cutoff shift. */ /* Get the cutoff shift. */
double rshift = 0.0; double rshift = 0.0;
...@@ -1190,8 +1185,8 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci, ...@@ -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 di_max = sort_i[count_i - 1].d - rshift;
const double dj_min = sort_j[0].d; const double dj_min = sort_j[0].d;
const float dx_max = (ci->dx_max_sort + cj->dx_max_sort); 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_ci = cell_is_active(ci, e) && ci_local;
const int active_cj = cell_is_active(cj, e) & cj_local; const int active_cj = cell_is_active(cj, e) && cj_local;
/* Count number of particles that are in range and active*/ /* Count number of particles that are in range and active*/
int numActive = 0; int numActive = 0;
...@@ -1523,13 +1518,8 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci, ...@@ -1523,13 +1518,8 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci,
TIMER_TIC; TIMER_TIC;
/* Check whether cells are local to the node. */ /* Check whether cells are local to the node. */
#ifdef WITH_MPI const int ci_local = (ci->nodeID == e->nodeID);
const int ci_local = (ci->nodeID == e->nodeID) ? 1 : 0; const int cj_local = (cj->nodeID == e->nodeID);
const int cj_local = (cj->nodeID == e->nodeID) ? 1 : 0;
#else
const int ci_local = 1;
const int cj_local = 1;
#endif
/* Get the cutoff shift. */ /* Get the cutoff shift. */
double rshift = 0.0; double rshift = 0.0;
...@@ -1551,8 +1541,8 @@ void runner_dopair2_force_vec(struct runner *r, struct cell *ci, ...@@ -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 di_max = sort_i[count_i - 1].d - rshift;
const double dj_min = sort_j[0].d; const double dj_min = sort_j[0].d;
const float dx_max = (ci->dx_max_sort + cj->dx_max_sort); 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_ci = cell_is_active(ci, e) && ci_local;
const int active_cj = cell_is_active(cj, e) & cj_local; const int active_cj = cell_is_active(cj, e) && cj_local;
/* Check if any particles are active and in range */ /* Check if any particles are active and in range */
int numActive = 0; int numActive = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment