The short code diff below has a simple fix for a nasty bug in the domdec_gpu code, which manifests when more than one GPU is used for MD simulations with the NPT ensemble. The bug shown below trashes the virial tensor, resulting in a bad pressure tensor and inconsistent changes in the unit cell size (and shape). Changing the variable name ncoord_home to ncoord is all that is needed to fix source/domdec/MDsim.cu and get working code. The code in the c41b2 release (Feb 2017) has been fixed, but this bug exists in CHARMM releases c40b1, c40b2, and c41b1

Code:
--- MDsim.cu.ORIG	
+++ MDsim.cu
@@ -192,7 +192,7 @@
   // Calculate direct-space virial
   // NOTE: reciprocal-space virial is calculated on the fly in "scalar_sum" -function
   if (cur_calc_virial && nbdirect != NULL) {
-    nbdirect->calc_virial(ncoord_home, boxx, boxy, boxz, xyzq, force, mdsim_stream);
+    nbdirect->calc_virial(ncoord, boxx, boxy, boxz, xyzq, force, mdsim_stream);
   }
 }


Rick Venable
computational chemist