From 27189bbaad21147893b239b2457843f515e69d77 Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Sat, 2 Aug 2014 10:53:31 +0200 Subject: [PATCH] Fixed PME bug with high OpenMP thread count PME energies and forces could be incorrect with combined MPI+OpenMP parallelization. This would, only, happen when pmegrids->nthread_comm[YY] >= 2, which can only occur with high OpenMP thread count with multiple large prime factors. It's unlikely that this issue affected production runs. Fixes #1572. Change-Id: I03b38c279c8f8ab2e111dad0976edad88b3ea93b --- src/mdlib/pme.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mdlib/pme.c b/src/mdlib/pme.c index 9ca121ca76..494bc1a988 100644 --- a/src/mdlib/pme.c +++ b/src/mdlib/pme.c @@ -3746,7 +3746,8 @@ reduce_threadgrid_overlap(gmx_pme_t pme, if (bCommY) { commbuf = commbuf_y; - buf_my = ty1 - offy; + /* The y-size of the communication buffer is order-1 */ + buf_my = pmegrid->order - 1; if (bCommX) { /* We index commbuf modulo the local grid size */ -- 2.22.0