From 850b9a194ef1969823664f3a1950eabbc6821836 Mon Sep 17 00:00:00 2001 From: James Willis <james.s.willis@durham.ac.uk> Date: Sun, 22 Jan 2017 15:28:58 +0000 Subject: [PATCH] Added statistics to runner_self1_vec to find the total number of interactions. --- src/runner_doiact_vec.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runner_doiact_vec.c b/src/runner_doiact_vec.c index 7e9263ad7e..127c9aa168 100644 --- a/src/runner_doiact_vec.c +++ b/src/runner_doiact_vec.c @@ -304,6 +304,8 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec( int count_align; int num_vec_proc = NUM_VEC_PROC; + int intCount = 0; + struct part *restrict parts = c->parts; const int count = c->count; @@ -526,10 +528,14 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec( VEC_HADD(curlvySum, pi->density.rot_v[1]); VEC_HADD(curlvzSum, pi->density.rot_v[2]); + intCount += icount; + /* Reset interaction count. */ icount = 0; } /* loop over all particles. */ + message("Total number of self interactions: %d, average per particle: %f.", intCount, ((float)intCount) / ((float)count)); + TIMER_TOC(timer_doself_density); #endif /* WITH_VECTORIZATION */ } -- GitLab