* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2015,2016,2017,2018,2019 by the GROMACS development team.
- * Copyright (c) 2020, by the GROMACS development team, led by
+ * Copyright (c) 2020,2021, 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.
// is AMD OpenCL, which offers this variable.
"GPU_DEVICE_ORDINAL"
# elif GMX_GPU_SYCL
- // SYCL-TODO:
- "How to restrict visible devices in SYCL?"
+ // As with OpenCL, there are no portable way to do it.
+ // Intel reference: https://github.com/intel/llvm/blob/sycl/sycl/doc/EnvironmentVariables.md
+ // While SYCL_DEVICE_FILTER is a better option, as of 2021.1-beta10 it is not yet supported.
+ "SYCL_DEVICE_ALLOWLIST"
# else
# error "Unreachable branch"
# endif
bool decideWhetherToUseGpusForPmeWithThreadMpi(const bool useGpuForNonbonded,
const TaskTarget pmeTarget,
+ const TaskTarget pmeFftTarget,
const int numDevicesToUse,
const std::vector<int>& userGpuTaskAssignment,
const gmx_hw_info_t& hardwareInfo,
if ((pmeTarget == TaskTarget::Cpu) || !useGpuForNonbonded || !pme_gpu_supports_build(nullptr)
|| !pme_gpu_supports_hardware(hardwareInfo, nullptr) || !pme_gpu_supports_input(inputrec, nullptr))
{
- // PME can't run on a GPU. If the user required that, we issue
- // an error later.
+ // PME can't run on a GPU. If the user required that, we issue an error later.
+ return false;
+ }
+
+ if (pmeFftTarget == TaskTarget::Cpu && !pme_gpu_mixed_mode_supports_input(inputrec, nullptr))
+ {
+ /* User requested PME FFT on CPU, but the current system is not compatible with Mixed mode,
+ * so we don't use GPUs at all.
+ * If the user had -pme gpu, we issue an error later. */
return false;
}
bool decideWhetherToUseGpusForPme(const bool useGpuForNonbonded,
const TaskTarget pmeTarget,
+ const TaskTarget pmeFftTarget,
const std::vector<int>& userGpuTaskAssignment,
const gmx_hw_info_t& hardwareInfo,
const t_inputrec& inputrec,
}
return false;
}
+ if (pmeFftTarget == TaskTarget::Cpu && !pme_gpu_mixed_mode_supports_input(inputrec, &message))
+ {
+ /* User requested PME FFT on CPU, but the current system is not compatible with Mixed mode,
+ * so we don't use GPUs at all. */
+ if (pmeTarget == TaskTarget::Gpu)
+ {
+ GMX_THROW(NotImplementedError("Cannot compute PME interactions in Mixed mode, because " + message));
+ }
+ return false;
+ }
if (pmeTarget == TaskTarget::Cpu)
{
const bool useEssentialDynamics,
const bool doOrientationRestraints,
const bool useReplicaExchange,
+ const bool haveFrozenAtoms,
const bool doRerun,
const DevelopmentFeatureFlags& devFlags,
const gmx::MDLogger& mdlog)
if (isDomainDecomposition)
{
- if (!devFlags.enableGpuHaloExchange)
+ if (hasAnyConstraints && !useUpdateGroups)
{
- errorMessage += "Domain decomposition without GPU halo exchange is not supported.\n ";
- }
- else
- {
- if (hasAnyConstraints && !useUpdateGroups)
- {
- errorMessage +=
- "Domain decomposition is only supported with constraints when update "
- "groups "
- "are used. This means constraining all bonds is not supported, except for "
- "small molecules, and box sizes close to half the pair-list cutoff are not "
- "supported.\n ";
- }
-
- if (pmeUsesCpu)
- {
- errorMessage += "With domain decomposition, PME must run fully on the GPU.\n";
- }
+ errorMessage +=
+ "Domain decomposition is only supported with constraints when update "
+ "groups "
+ "are used. This means constraining all bonds is not supported, except for "
+ "small molecules, and box sizes close to half the pair-list cutoff are not "
+ "supported.\n ";
}
}
{
errorMessage += "With separate PME rank(s), PME must run fully on the GPU.\n";
}
-
- if (!devFlags.enableGpuPmePPComm)
- {
- errorMessage += "With separate PME rank(s), PME must use direct communication.\n";
- }
}
if (inputrec.useMts)
// The graph is needed, but not supported
errorMessage += "Orientation restraints are not supported.\n";
}
- if (inputrec.efep != efepNO
- && (haveFreeEnergyType(inputrec, efptBONDED) || haveFreeEnergyType(inputrec, efptMASS)))
+ if (inputrec.efep != efepNO && (haveFepPerturbedMasses(mtop) || havePerturbedConstraints(mtop)))
{
errorMessage += "Free energy perturbation for mass and constraints are not supported.\n";
}
"The number of coupled constraints is higher than supported in the GPU LINCS "
"code.\n";
}
+ if (haveFrozenAtoms)
+ {
+ // There is a known bug with frozen atoms and GPU update, see Issue #3920.
+ errorMessage += "Frozen atoms not supported.\n";
+ }
if (!errorMessage.empty())
{