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]);
}
}