From 8b7bd9d88eb491d1479ed698c7ac98ab7bc7ebde Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer <akohlmey@gmail.com> Date: Thu, 26 Jan 2017 14:59:10 -0500 Subject: [PATCH] fix bug where per atom data for USER-OMP was reducing the wrong arrays with hybrid styles --- src/USER-OMP/thr_omp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/USER-OMP/thr_omp.cpp b/src/USER-OMP/thr_omp.cpp index 1744a77387..4eaf09fb9a 100644 --- a/src/USER-OMP/thr_omp.cpp +++ b/src/USER-OMP/thr_omp.cpp @@ -170,9 +170,8 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag, switch (thr_style) { case THR_PAIR: { - Pair * const pair = lmp->force->pair; - if (pair->vflag_fdotr) { + if (lmp->force->pair->vflag_fdotr) { // this is a non-hybrid pair style. compute per thread fdotr if (fix->last_pair_hybrid == NULL) { @@ -192,6 +191,8 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag, } if (evflag) { + Pair * const pair = (Pair *)style; + #if defined(_OPENMP) #pragma omp critical #endif -- GitLab