Fix LINCS triangle constraining with OpenMP
authorBerk Hess <hess@kth.se>
Thu, 13 Dec 2018 10:59:49 +0000 (11:59 +0100)
committerPaul Bauer <paul.bauer.q@gmail.com>
Fri, 14 Dec 2018 13:23:20 +0000 (14:23 +0100)
LINCS would only apply double the iterations to constraints
in triangles when the last OpenMP task contained at least one such
triangle.

Fixes #2808

Change-Id: I37a3d61c868f60387e536d3db3a4079deb6ae504

src/gromacs/mdlib/lincs.cpp

index 0e15e5c8ede23a5cc9e5be756951908e2bcf0609..543c1848dd2a2239f1848676de5e3aa04f22f474 100644 (file)
@@ -1377,7 +1377,7 @@ static void set_lincs_matrix(Lincs *li, real *invmass, real lambda)
         {
             set_lincs_matrix_task(li, &li->task[th], invmass,
                                   &ncc_triangle, &nCrossTaskTriangles);
-            ntriangle = li->task[th].ntriangle;
+            ntriangle += li->task[th].ntriangle;
         }
         GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
     }