Merge branch release-5-1 into release-2016
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 8 Sep 2016 10:40:51 +0000 (12:40 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 8 Sep 2016 10:44:55 +0000 (12:44 +0200)
Trivial conflicts in minimize.cpp from bug fix in same region that now
has exceptions caught within an OpenMP region.

Change-Id: I8b3c269a2afd7d4967e0f7310c96af6022533ddd

1  2 
src/gromacs/mdlib/minimize.cpp

index 591e20a7dc88cbfa338f971b35b97ed014b2a718,a6ffb5c793f445ef6779c929ac1548b8888f1648..2d5290d4b9502a9d1f900089717a5b1578c490ed
@@@ -631,43 -590,39 +626,44 @@@ static bool do_em_step(t_commrec *cr, t
      nthreads = gmx_omp_nthreads_get(emntUpdate);
  #pragma omp parallel num_threads(nthreads)
      {
-         int gf, i, m;
+         rvec *x1 = s1->x;
+         rvec *x2 = s2->x;
  
-         gf = 0;
+         int   gf = 0;
  #pragma omp for schedule(static) nowait
-         for (i = start; i < end; i++)
+         for (int i = start; i < end; i++)
          {
 -            if (md->cFREEZE)
 -            {
 -                gf = md->cFREEZE[i];
 -            }
 -            for (int m = 0; m < DIM; m++)
 +            try
              {
 -                if (ir->opts.nFreeze[gf][m])
 +                if (md->cFREEZE)
                  {
 -                    x2[i][m] = x1[i][m];
 +                    gf = md->cFREEZE[i];
                  }
-                 for (m = 0; m < DIM; m++)
 -                else
++                for (int m = 0; m < DIM; m++)
                  {
 -                    x2[i][m] = x1[i][m] + a*f[i][m];
 +                    if (ir->opts.nFreeze[gf][m])
 +                    {
 +                        x2[i][m] = x1[i][m];
 +                    }
 +                    else
 +                    {
 +                        x2[i][m] = x1[i][m] + a*f[i][m];
 +                    }
                  }
              }
 +            GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
          }
  
          if (s2->flags & (1<<estCGP))
          {
              /* Copy the CG p vector */
-             x1 = s1->cg_p;
-             x2 = s2->cg_p;
+             rvec *p1 = s1->cg_p;
+             rvec *p2 = s2->cg_p;
  #pragma omp for schedule(static) nowait
-             for (i = start; i < end; i++)
+             for (int i = start; i < end; i++)
              {
-                 copy_rvec(x1[i], x2[i]);
 +                // Trivial OpenMP block that does not throw
+                 copy_rvec(p1[i], p2[i]);
              }
          }