Merge release-4-5-patches into release-4-6
authorRoland Schulz <roland@utk.edu>
Tue, 20 Nov 2012 02:17:30 +0000 (21:17 -0500)
committerRoland Schulz <roland@utk.edu>
Tue, 20 Nov 2012 02:17:30 +0000 (21:17 -0500)
Conflicts:
src/tools/gmx_tune_pme.c

Change-Id: I924851995261a7777def8a5dea168597aabf0e0d

cmake/gmxCFlags.cmake
src/tools/gmx_tune_pme.c

index 061607f19048d1e1e77be40c4c5d47159f6a4b20..159014175f76a457808692de49c71d420ecb139f 100644 (file)
@@ -137,7 +137,7 @@ MACRO(gmx_c_flags)
         GMX_TEST_CFLAG(CFLAGS_LANG "-qlanglvl=extc99" GMXC_CFLAGS)
     endif()
     if (CMAKE_CXX_COMPILER_ID MATCHES "XL")
-        GMX_TEST_CXXFLAG(CFLAGS_OPT "-qarch=auto -qtune=auto" GMXC_CXXFLAGS)
+        GMX_TEST_CXXFLAG(CXXFLAGS_OPT "-qarch=auto -qtune=auto" GMXC_CXXFLAGS)
     endif()
 
     #msvc
@@ -145,7 +145,7 @@ MACRO(gmx_c_flags)
         # disable warnings for: 
         #      inconsistent dll linkage
         GMX_TEST_CFLAG(CFLAGS_WARN "/wd4273" GMXC_CFLAGS)
-        GMX_TEST_CFLAG(CXXFLAGS_WARN "/wd4273" GMXC_CXXFLAGS)
+        GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/wd4273" GMXC_CXXFLAGS)
     endif()
 
     if (CMAKE_C_COMPILER_ID MATCHES "Clang")
index 49a1033733b6b38ea1b578deb479664c64da0326..d2d7a4b215d2ec3077db76e5a49cfb27e48a2bd1 100644 (file)
@@ -96,6 +96,7 @@ typedef struct
 {
     int  nr_inputfiles;         /* The number of tpr and mdp input files */
     gmx_large_int_t orig_sim_steps;  /* Number of steps to be done in the real simulation */
+    gmx_large_int_t orig_init_step;  /* Init step for the real simulation */
     real *rcoulomb;             /* The coulomb radii [0...nr_inputfiles] */
     real *rvdw;                 /* The vdW radii */
     real *rlist;                /* Neighbourlist cutoff radius */
@@ -688,6 +689,7 @@ static void launch_simulation(
 
 static void modify_PMEsettings(
         gmx_large_int_t simsteps,  /* Set this value as number of time steps */
+        gmx_large_int_t init_step, /* Set this value as init_step */
         const char *fn_best_tpr,   /* tpr file with the best performance */
         const char *fn_sim_tpr)    /* name of tpr file to be launched */
 {
@@ -699,8 +701,9 @@ static void modify_PMEsettings(
     snew(ir,1);
     read_tpx_state(fn_best_tpr,ir,&state,NULL,&mtop);
 
-    /* Set nsteps to the right value */
+    /* Reset nsteps and init_step to the value of the input .tpr file */
     ir->nsteps = simsteps;
+    ir->init_step = init_step;
 
     /* Write the tpr file which will be launched */
     sprintf(buf, "Writing optimized simulation file %s with nsteps=%s.\n", fn_sim_tpr, gmx_large_int_pfmt);
@@ -785,6 +788,9 @@ static void make_benchmark_tprs(
     /* Reduce the number of steps for the benchmarks */
     info->orig_sim_steps = ir->nsteps;
     ir->nsteps           = benchsteps;
+    /* We must not use init_step from the input tpr file for the benchmarks */
+    info->orig_init_step = ir->init_step;
+    ir->init_step        = 0;
 
     /* For PME-switch potentials, keep the radial distance of the buffer region */
     nlist_buffer   = ir->rlist - ir->rcoulomb;
@@ -2248,9 +2254,8 @@ int gmx_tune_pme(int argc,char *argv[])
         else
         {
             simulation_tpr = opt2fn("-so",NFILE,fnm);
-            modify_PMEsettings(bOverwrite? (new_sim_nsteps+cpt_steps) :
-                    info->orig_sim_steps, tpr_names[best_tpr],
-                    simulation_tpr);
+            modify_PMEsettings(bOverwrite? (new_sim_nsteps+cpt_steps) : info->orig_sim_steps,
+                info->orig_init_step, tpr_names[best_tpr], simulation_tpr);
         }
 
         /* Let's get rid of the temporary benchmark input files */