}
+static void remove_if_exists(const char *fn)
+{
+ if (gmx_fexist(fn))
+ {
+ fprintf(stdout, "Deleting %s\n", fn);
+ remove(fn);
+ }
+}
+
+
static void finalize(const char *fn_out)
{
char buf[STRLEN];
const char matchstring[] = "R E A L C Y C L E A N D T I M E A C C O U N T I N G";
const char errSIG[] = "signal, stopping at the next";
int iFound;
- int procs;
float dum1, dum2, dum3, dum4;
int ndum;
int npme;
/* Already found matchstring - look for cycle data */
if (str_starts(line, "Total "))
{
- sscanf(line, "Total %d %lf", &procs, &(perfdata->Gcycles[test_nr]));
+ sscanf(line, "Total %lf", &(perfdata->Gcycles[test_nr]));
iFound = eFoundCycleStr;
}
break;
/* This string should always be identical to the one in copyrite.c,
* gmx_print_version_info() in the defined(GMX_MPI) section */
const char match_mpi[] = "MPI library: MPI";
- const char match_mdrun[] = "Program: ";
+ const char match_mdrun[] = "Executable: ";
gmx_bool bMdrun = FALSE;
gmx_bool bMPI = FALSE;
/* Delete the files which are created for each benchmark run: (options -b*) */
else if ( (0 == strncmp(opt, "-b", 2)) && (opt2bSet(opt, nfile, fnm) || !is_optional(&fnm[i])) )
{
- fn = opt2fn(opt, nfile, fnm);
- if (gmx_fexist(fn))
- {
- fprintf(stdout, "Deleting %s\n", fn);
- remove(fn);
- }
+ remove_if_exists(opt2fn(opt, nfile, fnm));
}
}
}
/* Check for errors on mdrun -h */
-static void make_sure_it_runs(char *mdrun_cmd_line, int length, FILE *fp)
+static void make_sure_it_runs(char *mdrun_cmd_line, int length, FILE *fp,
+ const t_filenm *fnm, int nfile)
{
- char *command, *msg;
- int ret;
+ const char *fn = NULL;
+ char *command, *msg;
+ int ret;
snew(command, length + 15);
snew(msg, length + 500);
- fprintf(stdout, "Making sure the benchmarks can be executed ...\n");
- /* FIXME: mdrun -h no longer actually does anything useful.
- * It unconditionally prints the help, ignoring all other options. */
- sprintf(command, "%s-h -quiet", mdrun_cmd_line);
+ fprintf(stdout, "Making sure the benchmarks can be executed by running just 1 step...\n");
+ sprintf(command, "%s -nsteps 1 -quiet", mdrun_cmd_line);
+ fprintf(stdout, "Executing '%s' ...\n", command);
ret = gmx_system_call(command);
if (0 != ret)
exit(ret);
}
+ fprintf(stdout, "Benchmarks can be executed!\n");
+
+ /* Clean up the benchmark output files we just created */
+ fprintf(stdout, "Cleaning up ...\n");
+ remove_if_exists(opt2fn("-bc", nfile, fnm));
+ remove_if_exists(opt2fn("-be", nfile, fnm));
+ remove_if_exists(opt2fn("-bcpo", nfile, fnm));
+ remove_if_exists(opt2fn("-bg", nfile, fnm));
sfree(command);
sfree(msg );
cmd_stub, pd->nPMEnodes, tpr_names[k], cmd_args_bench);
/* To prevent that all benchmarks fail due to a show-stopper argument
- * on the mdrun command line, we make a quick check with mdrun -h first */
+ * on the mdrun command line, we make a quick check first */
if (bFirst)
{
- make_sure_it_runs(pd->mdrun_cmd_line, cmdline_length, fp);
+ make_sure_it_runs(pd->mdrun_cmd_line, cmdline_length, fp, fnm, nfile);
}
bFirst = FALSE;