Fix the GPU bonded stream with 1 PP + 1 PME rank
authorSzilárd Páll <pall.szilard@gmail.com>
Sat, 14 Dec 2019 22:15:44 +0000 (23:15 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 16 Dec 2019 16:56:20 +0000 (17:56 +0100)
WIth 1 PP + 1 PME rank the GpuBonded constructor gets passed the
non-local nonbonded stream which is nullptr and as a result the bonded
kernel launch happens in the default stream blocking concurrent
kernel execution.
This change makes sure that only when there is PP domain decomposition
is the GpuBonded constructor passed the nonlocal stream.

Fixes #3241

Change-Id: I858401b78c620adc3bea176e40e6fa179e583483

docs/release-notes/2019/2019.5.rst
src/gromacs/mdlib/forcerec.cpp

index 7bc2700155878760e18948fbe07a2364610268b3..4b5a496923c2777de2de50a3f3c53cde6102339b 100644 (file)
@@ -126,10 +126,16 @@ and expect whitespace separation will continue to work in all cases.
 :issue:`3176`
 
 Fix duplicate PDB CONECT record output
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+""""""""""""""""""""""""""""""""""""""
 
 PDB "CONECT" record output was duplicated in some instances. Since |Gromacs| does
 not use these anywhere, analysis was not affected. The behavior is now fixed.
 
 :issue:`3206`
 
+Fix performance issue with bonded interactions in wrong GPU stream
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+This could lead to a significant loss in performance.
+
+:issue:`3241`
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