Fixed PME bug with high OpenMP thread count
[alexxy/gromacs.git] / 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 */