*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
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;
double nodetime = 0, realtime;
t_inputrec *inputrec;
t_state *state = NULL;
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");