Fixed PME bug with high OpenMP thread count
authorBerk Hess <hess@kth.se>
Sat, 2 Aug 2014 08:53:31 +0000 (10:53 +0200)
committerBerk Hess <hess@kth.se>
Sat, 2 Aug 2014 11:55:43 +0000 (13:55 +0200)
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

index 9ca121ca765f9d81f815a7ac78f0643f2ce78861..494bc1a9883a7bcec5a542d84c5dcb072f99dcd1 100644 (file)
@@ -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 */