devFlags.forceGpuUpdateDefault, useDomainDecomposition, useUpdateGroups, pmeRunMode,
domdecOptions.numPmeRanks > 0, useGpuForNonbonded, updateTarget, gpusWereDetected,
*inputrec, mtop, doEssentialDynamics, gmx_mtop_ftype_count(mtop, F_ORIRES) > 0,
- replExParams.exchangeInterval > 0, doRerun);
+ replExParams.exchangeInterval > 0, doRerun, mdlog);
}
GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR
return gpusWereDetected && usingOurCpuForPmeOrEwald;
}
-bool decideWhetherToUseGpuForUpdate(const bool forceGpuUpdateDefault,
- const bool isDomainDecomposition,
- const bool useUpdateGroups,
- const PmeRunMode pmeRunMode,
- const bool havePmeOnlyRank,
- const bool useGpuForNonbonded,
- const TaskTarget updateTarget,
- const bool gpusWereDetected,
- const t_inputrec& inputrec,
- const gmx_mtop_t& mtop,
- const bool useEssentialDynamics,
- const bool doOrientationRestraints,
- const bool useReplicaExchange,
- const bool doRerun)
+bool decideWhetherToUseGpuForUpdate(const bool forceGpuUpdateDefault,
+ const bool isDomainDecomposition,
+ const bool useUpdateGroups,
+ const PmeRunMode pmeRunMode,
+ const bool havePmeOnlyRank,
+ const bool useGpuForNonbonded,
+ const TaskTarget updateTarget,
+ const bool gpusWereDetected,
+ const t_inputrec& inputrec,
+ const gmx_mtop_t& mtop,
+ const bool useEssentialDynamics,
+ const bool doOrientationRestraints,
+ const bool useReplicaExchange,
+ const bool doRerun,
+ const gmx::MDLogger& mdlog)
{
// '-update cpu' overrides the environment variable, '-update auto' does not
if (!errorMessage.empty())
{
- if (updateTarget == TaskTarget::Gpu)
+ if (updateTarget != TaskTarget::Gpu && forceGpuUpdateDefault)
+ {
+ GMX_LOG(mdlog.warning)
+ .asParagraph()
+ .appendText(
+ "Update task on the GPU was required, by the "
+ "GMX_FORCE_UPDATE_DEFAULT_GPU environment variable, but the following "
+ "condition(s) were not satisfied:");
+ GMX_LOG(mdlog.warning).asParagraph().appendText(errorMessage.c_str());
+ GMX_LOG(mdlog.warning).asParagraph().appendText("Will use CPU version of update.");
+ }
+ else if (updateTarget == TaskTarget::Gpu)
{
std::string prefix = gmx::formatString(
"Update task on the GPU was required,\n"
namespace gmx
{
+class MDLogger;
+
//! Record where a compute task is targetted.
enum class TaskTarget : int
{
* \param[in] doOrientationRestraints If orientation restraints are enabled.
* \param[in] useReplicaExchange If this is a REMD simulation.
* \param[in] doRerun It this is a rerun.
+ * \param[in] mdlog MD logger.
*
* \returns Whether complete simulation can be run on GPU.
* \throws std::bad_alloc If out of memory
* InconsistentInputError If the user requirements are inconsistent.
*/
-bool decideWhetherToUseGpuForUpdate(bool forceGpuUpdateDefault,
- bool isDomainDecomposition,
- bool useUpdateGroups,
- PmeRunMode pmeRunMode,
- bool havePmeOnlyRank,
- bool useGpuForNonbonded,
- TaskTarget updateTarget,
- bool gpusWereDetected,
- const t_inputrec& inputrec,
- const gmx_mtop_t& mtop,
- bool useEssentialDynamics,
- bool doOrientationRestraints,
- bool useReplicaExchange,
- bool doRerun);
+bool decideWhetherToUseGpuForUpdate(bool forceGpuUpdateDefault,
+ bool isDomainDecomposition,
+ bool useUpdateGroups,
+ PmeRunMode pmeRunMode,
+ bool havePmeOnlyRank,
+ bool useGpuForNonbonded,
+ TaskTarget updateTarget,
+ bool gpusWereDetected,
+ const t_inputrec& inputrec,
+ const gmx_mtop_t& mtop,
+ bool useEssentialDynamics,
+ bool doOrientationRestraints,
+ bool useReplicaExchange,
+ bool doRerun,
+ const gmx::MDLogger& mdlog);
} // namespace gmx