introduce gmx_omp wrapper for the OpenMP API
[alexxy/gromacs.git] / src / tools / gmx_sans.c
index 2cae68baa5c3d37628331e7b544e81541d72e812..fcf99c8e752bd9292b7f5080ce4b787f704894a6 100644 (file)
 #include "matio.h"
 #include "gmx_ana.h"
 #include "nsfactor.h"
-
-#ifdef GMX_OPENMP
-#include <omp.h>
-#endif
-
+#include "gmx_omp.h"
 
 int gmx_sans(int argc,char *argv[])
 {
@@ -153,9 +149,7 @@ int gmx_sans(int argc,char *argv[])
       { efXVG, "-pr",         "pr",   ffWRITE }
   };
 
-#ifdef GMX_OPENMP
-    nthreads = omp_get_max_threads();
-#endif
+  nthreads = gmx_omp_get_max_threads();
 
   CopyRight(stderr,argv[0]);
   parse_common_args(&argc,argv,PCA_BE_NICE,
@@ -166,9 +160,8 @@ int gmx_sans(int argc,char *argv[])
   check_mcover(mcover);
 
   /* setting number of omp threads globaly */
-#ifdef GMX_OPENMP
-  omp_set_num_threads(nthreads);
-#endif
+  gmx_omp_set_num_threads(nthreads);
+
   /* Now try to parse opts for modes */
   switch(emethod[0][0]) {
   case 'd':