Fix the GPU bonded stream with 1 PP + 1 PME rank
[alexxy/gromacs.git] / src / gromacs / mdlib / forcerec.cpp
index 9920198b773ee5180616eeb49016fe60e2920561..e3fad65f76c6f4439e1bf49ce45c9d84f9d66829 100644 (file)
@@ -3087,7 +3087,8 @@ void init_forcerec(FILE                             *fp,
 
         if (useGpuForBonded)
         {
-            auto stream = DOMAINDECOMP(cr) ?
+            // TODO use havePPDomainDecomposition here to simplify the code.
+            auto stream = (DOMAINDECOMP(cr) && (cr->nnodes - cr->npmenodes > 1)) ?
                 nbnxn_gpu_get_command_stream(fr->nbv->gpu_nbv, eintNonlocal) :
                 nbnxn_gpu_get_command_stream(fr->nbv->gpu_nbv, eintLocal);
             // TODO the heap allocation is only needed while