int repl_ex_seed, real pforce, real cpt_period, real max_hours,
const char *deviceOptions, int imdport, unsigned long Flags)
{
- gmx_bool bForceUseGPU, bTryUseGPU;
+ gmx_bool bForceUseGPU, bTryUseGPU, bRerunMD, bCantUseGPU;
t_inputrec *inputrec;
t_state *state = NULL;
matrix box;
fplog = NULL;
}
+ bRerunMD = (Flags & MD_RERUN);
bForceUseGPU = (strncmp(nbpu_opt, "gpu", 3) == 0);
bTryUseGPU = (strncmp(nbpu_opt, "auto", 4) == 0) || bForceUseGPU;
+ /* Rerun execution time is dominated by I/O and pair search, so
+ * GPUs are not very useful, plus they do not support more than
+ * one energy group. Don't select them when they can't be used,
+ * unless the user requested it, then fatal_error is called later.
+ *
+ * TODO it would be nice to notify the user that if this check
+ * causes GPUs not to be used that this is what is happening, and
+ * why, but that will be easier to do after some future
+ * cleanup. */
+ bCantUseGPU = bRerunMD && (inputrec->opts.ngener > 1);
+ bTryUseGPU = bTryUseGPU && !(bCantUseGPU && !bForceUseGPU);
/* Detect hardware, gather information. This is an operation that is
* global for this process (MPI rank). */
);
}
- if ((Flags & MD_RERUN) &&
+ if (bRerunMD &&
(EI_ENERGY_MINIMIZATION(inputrec->eI) || eiNM == inputrec->eI))
{
gmx_fatal(FARGS, "The .mdp file specified an energy mininization or normal mode algorithm, and these are not compatible with mdrun -rerun");