Merge release-4-6 into master
[alexxy/gromacs.git] / src / programs / mdrun / runner.c
index 86db8f722534ce8ec808b8ff59db8c6dde2a3f28..40b48cd6914f1679bfd31959a783fa7cce749660 100644 (file)
 #include "corewrap.h"
 #endif
 
-#ifdef GMX_OPENMM
-#include "md_openmm.h"
-#endif
-
 #include "gpu_utils.h"
 #include "nbnxn_cuda_data_mgmt.h"
 
@@ -112,11 +108,7 @@ typedef struct {
 } gmx_intp_t;
 
 /* The array should match the eI array in include/types/enums.h */
-#ifdef GMX_OPENMM  /* FIXME do_md_openmm needs fixing */
-const gmx_intp_t integrator[eiNR] = { {do_md_openmm}, {do_md_openmm}, {do_md_openmm}, {do_md_openmm}, {do_md_openmm}, {do_md_openmm}, {do_md_openmm}, {do_md_openmm}, {do_md_openmm}, {do_md_openmm}, {do_md_openmm},{do_md_openmm}};
-#else
 const gmx_intp_t integrator[eiNR] = { {do_md}, {do_steep}, {do_cg}, {do_md}, {do_md}, {do_nm}, {do_lbfgs}, {do_tpi}, {do_tpi}, {do_md}, {do_md},{do_md}};
-#endif
 
 gmx_large_int_t     deform_init_init_step_tpx;
 matrix              deform_init_box_tpx;
@@ -1080,9 +1072,10 @@ static void set_cpu_affinity(FILE *fplog,
 
 
 static void check_and_update_hw_opt(gmx_hw_opt_t *hw_opt,
-                                    int cutoff_scheme)
+                                    int cutoff_scheme,
+                                    gmx_bool bIsSimMaster)
 {
-    gmx_omp_nthreads_read_env(&hw_opt->nthreads_omp);
+    gmx_omp_nthreads_read_env(&hw_opt->nthreads_omp, bIsSimMaster);
 
 #ifndef GMX_THREAD_MPI
     if (hw_opt->nthreads_tot > 0)
@@ -1343,7 +1336,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     if (SIMMASTER(cr))
 #endif
     {
-        check_and_update_hw_opt(hw_opt,minf.cutoff_scheme);
+        check_and_update_hw_opt(hw_opt,minf.cutoff_scheme,SIMMASTER(cr));
 
 #ifdef GMX_THREAD_MPI
         /* Early check for externally set process affinity. Can't do over all
@@ -1530,7 +1523,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     snew(fcd,1);
 
     /* This needs to be called before read_checkpoint to extend the state */
-    init_disres(fplog,mtop,inputrec,cr,Flags & MD_PARTDEC,fcd,state);
+    init_disres(fplog,mtop,inputrec,cr,Flags & MD_PARTDEC,fcd,state, repl_ex_nst > 0);
 
     if (gmx_mtop_ftype_count(mtop,F_ORIRES) > 0)
     {
@@ -1848,12 +1841,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     }
 
 
-    if (integrator[inputrec->eI].func == do_md
-#ifdef GMX_OPENMM
-        ||
-        integrator[inputrec->eI].func == do_md_openmm
-#endif
-        )
+    if (integrator[inputrec->eI].func == do_md)
     {
         /* Turn on signal handling on all nodes */
         /*