t_state state;
gmx_mtop_t mtop;
char buf[200];
-
+
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);
fprintf(stdout,buf,ir->nsteps);
/* Main loop over all scenarios we need to test: tpr files, PME nodes, repeats */
/********************************************************************************/
snew(perfdata, ntprs);
- do_the_tests(fp, tpr_names, maxPMEnodes, minPMEnodes, npme_fixed, npmevalues_opt[0], perfdata, &pmeentries,
- repeats, nnodes, ntprs, bThreads, cmd_mpirun, cmd_np, cmd_mdrun,
- cmd_args_bench, fnm, NFILE, sim_part, presteps, cpt_steps);
-
- fprintf(fp, "\nTuning took%8.1f minutes.\n", (gettime()-seconds)/60.0);
-
- /* Analyse the results and give a suggestion for optimal settings: */
- bKeepTPR = analyze_data(fp, opt2fn("-p", NFILE, fnm), perfdata, nnodes, ntprs, pmeentries,
- repeats, info, &best_tpr, &best_npme);
-
- /* Take the best-performing tpr file and enlarge nsteps to original value */
- if ( bKeepTPR && !bOverwrite && !(fs > 0.0) )
- {
- simulation_tpr = opt2fn("-s",NFILE,fnm);
- }
- else
+ if (bBenchmark)
{
- simulation_tpr = opt2fn("-so",NFILE,fnm);
- modify_PMEsettings(bOverwrite? (new_sim_nsteps+cpt_steps) : info->orig_sim_steps,
+ do_the_tests(fp, tpr_names, maxPMEnodes, minPMEnodes, npme_fixed, npmevalues_opt[0], perfdata, &pmeentries,
+ repeats, nnodes, ntprs, bThreads, cmd_mpirun, cmd_np, cmd_mdrun,
+ cmd_args_bench, fnm, NFILE, sim_part, presteps, cpt_steps);
+
+ fprintf(fp, "\nTuning took%8.1f minutes.\n", (gettime()-seconds)/60.0);
+
+ /* Analyse the results and give a suggestion for optimal settings: */
+ bKeepTPR = analyze_data(fp, opt2fn("-p", NFILE, fnm), perfdata, nnodes, ntprs, pmeentries,
+ repeats, info, &best_tpr, &best_npme);
+
+ /* Take the best-performing tpr file and enlarge nsteps to original value */
+ if ( bKeepTPR && !bOverwrite )
+ {
+ simulation_tpr = opt2fn("-s",NFILE,fnm);
+ }
+ 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 */
+ for (i=0; i<ntprs; i++)
+ {
+ fprintf(stdout, "Deleting temporary benchmark input file %s\n", tpr_names[i]);
+ remove(tpr_names[i]);
+ }
- /* Now start the real simulation if the user requested it ... */
- launch_simulation(bLaunch, fp, bThreads, cmd_mpirun, cmd_np, cmd_mdrun,
- cmd_args_launch, simulation_tpr, nnodes, best_npme);
+ /* Now start the real simulation if the user requested it ... */
+ launch_simulation(bLaunch, fp, bThreads, cmd_mpirun, cmd_np, cmd_mdrun,
+ cmd_args_launch, simulation_tpr, nnodes, best_npme);
+ }
ffclose(fp);
-
+
/* ... or simply print the performance results to screen: */
if (!bLaunch)
finalize(opt2fn("-p", NFILE, fnm));