Avoid using function calls in OpenMP directives
[alexxy/gromacs.git] / src / gromacs / mdlib / mdatom.c
index b3d6475c531fe5b6e9cae6b2a1d78c853ae28bbf..b8d51a76da80566855c2088a159bc843d3a78e4e 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "typedefs.h"
 #include "mdatoms.h"
-#include "smalloc.h"
+#include "gromacs/utility/smalloc.h"
 #include "main.h"
 #include "qmmm.h"
 #include "mtop_util.h"
@@ -121,6 +121,7 @@ void atoms2md(gmx_mtop_t *mtop, t_inputrec *ir,
     t_grpopts            *opts;
     gmx_groups_t         *groups;
     gmx_molblock_t       *molblock;
+    int                   nthreads gmx_unused;
 
     bLJPME = EVDW_PME(ir->vdwtype);
 
@@ -233,7 +234,8 @@ void atoms2md(gmx_mtop_t *mtop, t_inputrec *ir,
 
     alook = gmx_mtop_atomlookup_init(mtop);
 
-#pragma omp parallel for num_threads(gmx_omp_nthreads_get(emntDefault)) schedule(static)
+    nthreads = gmx_omp_nthreads_get(emntDefault);
+#pragma omp parallel for num_threads(nthreads) schedule(static)
     for (i = 0; i < md->nr; i++)
     {
         int      g, ag, molb;