*******>Bugfix.12: Author: Ross Walker and Scott Le Grand Date: Oct. 13, 2012 Program: pmemd.cuda.MPI Description: Fixes race condition in the GPU MPI code which could cause simulations run using MPI across multiple GPUs to fail or give incorrect results. This includes failures observed when trying to run the JAC NVE or FactorIX NVE production benchmarks across multiple GPUs. -------------------------------------------------------------------------- src/pmemd/src/cuda/gpu.cpp | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git src/pmemd/src/cuda/gpu.cpp src/pmemd/src/cuda/gpu.cpp index 605c8c3..b232d91 100644 --- src/pmemd/src/cuda/gpu.cpp +++ src/pmemd/src/cuda/gpu.cpp @@ -5969,6 +5969,9 @@ PRINTMETHOD("gpu_pme_ene"); #endif kPMEGradSum(gpu); +#ifdef MPI + cudaThreadSynchronize(); +#endif } #ifdef MPI else @@ -6320,7 +6323,10 @@ PRINTMETHOD("gpu_pme_force"); #else cufftExecC2R(gpu->backwardPlan, gpu->sim.pXYZ_qt, gpu->sim.pXYZ_q); #endif - kPMEGradSum(gpu); + kPMEGradSum(gpu); +#ifdef MPI + cudaThreadSynchronize(); +#endif } #ifdef MPI else