return gpusWereDetected && usingOurCpuForPmeOrEwald;
}
-bool decideWhetherToUseGpuForUpdate(const bool forceGpuUpdateDefaultWithDD,
+bool decideWhetherToUseGpuForUpdate(const bool forceGpuUpdateDefault,
const bool isDomainDecomposition,
const bool useUpdateGroups,
const bool useGpuForPme,
const bool doRerun)
{
- if (updateTarget == TaskTarget::Cpu)
+ // '-update cpu' overrides the environment variable, '-update auto' does not
+ if (updateTarget == TaskTarget::Cpu || (updateTarget == TaskTarget::Auto && !forceGpuUpdateDefault))
{
return false;
}
if (isDomainDecomposition)
{
- if (!forceGpuUpdateDefaultWithDD)
+ if (!forceGpuUpdateDefault)
{
errorMessage += "Domain decomposition is not supported.\n ";
}
if (isDomainDecomposition)
{
- return forceGpuUpdateDefaultWithDD;
+ return forceGpuUpdateDefault;
+ }
+ else
+ {
+ return (updateTarget == TaskTarget::Gpu || forceGpuUpdateDefault);
}
-
- return true;
}
} // namespace gmx