/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018,2019 by the GROMACS development team.
+ * Copyright (c) 2020, 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.
#include "gromacs/hardware/hardwaretopology.h"
#include "gromacs/hardware/hw_info.h"
#include "gromacs/mdlib/gmx_omp_nthreads.h"
-#include "gromacs/mdlib/update_constrain_cuda.h"
+#include "gromacs/mdlib/update_constrain_gpu.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/md_enums.h"
const char* g_specifyEverythingFormatString =
"When you use mdrun -gputasks, %s must be set to non-default "
"values, so that the device IDs can be interpreted correctly."
-#if GMX_GPU != GMX_GPU_NONE
+#if GMX_GPU
" If you simply want to restrict which GPUs are used, then it is "
"better to use mdrun -gpu_id. Otherwise, setting the "
-# if GMX_GPU == GMX_GPU_CUDA
+# if GMX_GPU_CUDA
"CUDA_VISIBLE_DEVICES"
-# elif GMX_GPU == GMX_GPU_OPENCL
+# elif GMX_GPU_OPENCL
// Technically there is no portable way to do this offered by the
// OpenCL standard, but the only current relevant case for GROMACS
// is AMD OpenCL, which offers this variable.
const std::vector<int>& userGpuTaskAssignment,
const gmx_hw_info_t& hardwareInfo,
const t_inputrec& inputrec,
- const gmx_mtop_t& mtop,
const int numRanksPerSimulation,
const int numPmeRanksPerSimulation)
{
// First, exclude all cases where we can't run PME on GPUs.
if ((pmeTarget == TaskTarget::Cpu) || !useGpuForNonbonded || !pme_gpu_supports_build(nullptr)
- || !pme_gpu_supports_hardware(hardwareInfo, nullptr)
- || !pme_gpu_supports_input(inputrec, mtop, 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.
const std::vector<int>& userGpuTaskAssignment,
const gmx_hw_info_t& hardwareInfo,
const t_inputrec& inputrec,
- const gmx_mtop_t& mtop,
const int numRanksPerSimulation,
const int numPmeRanksPerSimulation,
const bool gpusWereDetected)
}
return false;
}
- if (!pme_gpu_supports_input(inputrec, mtop, &message))
+ if (!pme_gpu_supports_input(inputrec, &message))
{
if (pmeTarget == TaskTarget::Gpu)
{
{
errorMessage += "Compatible GPUs must have been found.\n";
}
- if (GMX_GPU != GMX_GPU_CUDA)
+ if (!GMX_GPU_CUDA)
{
errorMessage += "Only a CUDA build is supported.\n";
}
// The graph is needed, but not supported
errorMessage += "Orientation restraints are not supported.\n";
}
- if (inputrec.efep != efepNO)
+ if (inputrec.efep != efepNO
+ && (haveFreeEnergyType(inputrec, efptBONDED) || haveFreeEnergyType(inputrec, efptMASS)))
{
- // Actually all free-energy options except for mass and constraint perturbation are supported
- errorMessage += "Free energy perturbations are not supported.\n";
+ errorMessage += "Free energy perturbation for mass and constraints are not supported.\n";
}
const auto particleTypes = gmx_mtop_particletype_count(mtop);
if (particleTypes[eptShell] > 0)
{
errorMessage += "Non-connecting constraints are not supported\n";
}
- if (!UpdateConstrainCuda::isNumCoupledConstraintsSupported(mtop))
+ if (!UpdateConstrainGpu::isNumCoupledConstraintsSupported(mtop))
{
errorMessage +=
- "The number of coupled constraints is higher than supported in the CUDA LINCS "
+ "The number of coupled constraints is higher than supported in the GPU LINCS "
"code.\n";
}