for (auto& listedForces : fr->listedForces)
{
- listedForces.setup(top->idef, fr->natoms_force, fr->gpuBonded != nullptr);
+ listedForces.setup(top->idef, fr->natoms_force, fr->listedForcesGpu != nullptr);
}
if (EEL_PME(fr->ic->eeltype) && (cr->duty & DUTY_PME))
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2014,2015,2016,2018,2019,2020, by the GROMACS development team, led by
+# Copyright (c) 2014,2015,2016,2018,2019,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.
gmx_add_libgromacs_sources(
bonded.cpp
disre.cpp
- gpubonded_impl.cpp
+ listed_forces_gpu_impl.cpp
listed_forces.cpp
listed_internal.cpp
manage_threading.cpp
if(GMX_GPU_CUDA)
gmx_add_libgromacs_sources(
- gpubonded_impl.cu
- gpubondedkernels.cu
+ listed_forces_gpu_impl.cu
+ listed_forces_gpu_internal.cu
)
endif()
const int nat1 = interaction_function[ftype].nratoms + 1;
const int nbonds = iatoms.ssize() / nat1;
- GMX_ASSERT(fr->gpuBonded != nullptr || workDivision.end(ftype) == iatoms.ssize(),
+ GMX_ASSERT(fr->listedForcesGpu != nullptr || workDivision.end(ftype) == iatoms.ssize(),
"The thread division should match the topology");
const int nb0 = workDivision.bound(ftype, thread);
* \inlibraryapi
* \ingroup module_listed_forces
*/
-#ifndef GMX_LISTED_FORCES_GPUBONDED_H
-#define GMX_LISTED_FORCES_GPUBONDED_H
+#ifndef GMX_LISTED_FORCES_LISTED_FORCES_GPU_H
+#define GMX_LISTED_FORCES_LISTED_FORCES_GPU_H
#include <memory>
*
* \throws std::bad_alloc when out of memory.
*/
-bool buildSupportsGpuBondeds(std::string* error);
+bool buildSupportsListedForcesGpu(std::string* error);
/*! \brief Checks whether the input system allows to compute bonded interactions on a GPU.
*
*
* \returns true if PME can run on GPU with this input, false otherwise.
*/
-bool inputSupportsGpuBondeds(const t_inputrec& ir, const gmx_mtop_t& mtop, std::string* error);
+bool inputSupportsListedForcesGpu(const t_inputrec& ir, const gmx_mtop_t& mtop, std::string* error);
-class GpuBonded
+class ListedForcesGpu
{
public:
/*! \brief Construct the manager with constant data and the stream to use.
* \param[in] wcycle The wallclock counter.
*
*/
- GpuBonded(const gmx_ffparams_t& ffparams,
- float electrostaticsScaleFactor,
- const DeviceContext& deviceContext,
- const DeviceStream& deviceStream,
- gmx_wallcycle* wcycle);
+ ListedForcesGpu(const gmx_ffparams_t& ffparams,
+ float electrostaticsScaleFactor,
+ const DeviceContext& deviceContext,
+ const DeviceStream& deviceStream,
+ gmx_wallcycle* wcycle);
//! Destructor
- ~GpuBonded();
+ ~ListedForcesGpu();
/*! \brief Update lists of interactions from idef suitable for the GPU,
* using the data structures prepared for PP work.
} // namespace gmx
-#endif
+#endif // GMX_LISTED_FORCES_LISTED_FORCES_GPU_H
#include <algorithm>
#include <string>
-#include "gromacs/listed_forces/gpubonded.h"
+#include "gromacs/listed_forces/listed_forces_gpu.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/message_string_collector.h"
return false;
}
-bool buildSupportsGpuBondeds(std::string* error)
+bool buildSupportsListedForcesGpu(std::string* error)
{
MessageStringCollector errorReasons;
// Before changing the prefix string, make sure that it is not searched for in regression tests.
return errorReasons.isEmpty();
}
-bool inputSupportsGpuBondeds(const t_inputrec& ir, const gmx_mtop_t& mtop, std::string* error)
+bool inputSupportsListedForcesGpu(const t_inputrec& ir, const gmx_mtop_t& mtop, std::string* error)
{
MessageStringCollector errorReasons;
// Before changing the prefix string, make sure that it is not searched for in regression tests.
#if !GMX_GPU_CUDA
-class GpuBonded::Impl
+class ListedForcesGpu::Impl
{
};
-GpuBonded::GpuBonded(const gmx_ffparams_t& /* ffparams */,
- const float /* electrostaticsScaleFactor */,
- const DeviceContext& /* deviceContext */,
- const DeviceStream& /* deviceStream */,
- gmx_wallcycle* /* wcycle */) :
+ListedForcesGpu::ListedForcesGpu(const gmx_ffparams_t& /* ffparams */,
+ const float /* electrostaticsScaleFactor */,
+ const DeviceContext& /* deviceContext */,
+ const DeviceStream& /* deviceStream */,
+ gmx_wallcycle* /* wcycle */) :
impl_(nullptr)
{
}
-GpuBonded::~GpuBonded() = default;
+ListedForcesGpu::~ListedForcesGpu() = default;
-void GpuBonded::updateInteractionListsAndDeviceBuffers(ArrayRef<const int> /* nbnxnAtomOrder */,
- const InteractionDefinitions& /* idef */,
- void* /* xqDevice */,
- DeviceBuffer<RVec> /* forceDevice */,
- DeviceBuffer<RVec> /* fshiftDevice */)
+void ListedForcesGpu::updateInteractionListsAndDeviceBuffers(ArrayRef<const int> /* nbnxnAtomOrder */,
+ const InteractionDefinitions& /* idef */,
+ void* /* xqDevice */,
+ DeviceBuffer<RVec> /* forceDevice */,
+ DeviceBuffer<RVec> /* fshiftDevice */)
{
}
-void GpuBonded::setPbc(PbcType /* pbcType */, const matrix /* box */, bool /* canMoleculeSpanPbc */)
+void ListedForcesGpu::setPbc(PbcType /* pbcType */, const matrix /* box */, bool /* canMoleculeSpanPbc */)
{
}
-bool GpuBonded::haveInteractions() const
+bool ListedForcesGpu::haveInteractions() const
{
return !impl_;
}
-void GpuBonded::launchKernel(const gmx::StepWorkload& /* stepWork */) {}
+void ListedForcesGpu::launchKernel(const gmx::StepWorkload& /* stepWork */) {}
-void GpuBonded::setPbcAndlaunchKernel(PbcType /* pbcType */,
- const matrix /* box */,
- bool /* canMoleculeSpanPbc */,
- const gmx::StepWorkload& /* stepWork */)
+void ListedForcesGpu::setPbcAndlaunchKernel(PbcType /* pbcType */,
+ const matrix /* box */,
+ bool /* canMoleculeSpanPbc */,
+ const gmx::StepWorkload& /* stepWork */)
{
}
-void GpuBonded::launchEnergyTransfer() {}
+void ListedForcesGpu::launchEnergyTransfer() {}
-void GpuBonded::waitAccumulateEnergyTerms(gmx_enerdata_t* /* enerd */) {}
+void ListedForcesGpu::waitAccumulateEnergyTerms(gmx_enerdata_t* /* enerd */) {}
-void GpuBonded::clearEnergies() {}
+void ListedForcesGpu::clearEnergies() {}
#endif // !GMX_GPU_CUDA
#include "gmxpre.h"
-#include "gpubonded_impl.h"
+#include "listed_forces_gpu_impl.h"
#include "gromacs/gpu_utils/cuda_arch_utils.cuh"
#include "gromacs/gpu_utils/cudautils.cuh"
// Number of CUDA threads in a block
constexpr static int c_threadsPerBlock = 256;
-// ---- GpuBonded::Impl
+// ---- ListedForcesGpu::Impl
-GpuBonded::Impl::Impl(const gmx_ffparams_t& ffparams,
- const float electrostaticsScaleFactor,
- const DeviceContext& deviceContext,
- const DeviceStream& deviceStream,
- gmx_wallcycle* wcycle) :
+ListedForcesGpu::Impl::Impl(const gmx_ffparams_t& ffparams,
+ const float electrostaticsScaleFactor,
+ const DeviceContext& deviceContext,
+ const DeviceStream& deviceStream,
+ gmx_wallcycle* wcycle) :
deviceContext_(deviceContext), deviceStream_(deviceStream)
{
GMX_RELEASE_ASSERT(deviceStream.isValid(),
c_numShiftVectors * sizeof(float3) + (c_threadsPerBlock / warp_size) * 3 * sizeof(float);
}
-GpuBonded::Impl::~Impl()
+ListedForcesGpu::Impl::~Impl()
{
for (int fType : fTypesOnGpu)
{
// TODO Consider whether this function should be a factory method that
// makes an object that is the only one capable of the device
// operations needed for the lifetime of an interaction list. This
-// would be harder to misuse than GpuBonded, and exchange the problem
+// would be harder to misuse than ListedForcesGpu, and exchange the problem
// of naming this method for the problem of what to name the
// BondedDeviceInteractionListHandler type.
*
* \todo Use DeviceBuffer for the d_xqPtr.
*/
-void GpuBonded::Impl::updateInteractionListsAndDeviceBuffers(ArrayRef<const int> nbnxnAtomOrder,
- const InteractionDefinitions& idef,
- void* d_xqPtr,
- DeviceBuffer<RVec> d_fPtr,
- DeviceBuffer<RVec> d_fShiftPtr)
+void ListedForcesGpu::Impl::updateInteractionListsAndDeviceBuffers(ArrayRef<const int> nbnxnAtomOrder,
+ const InteractionDefinitions& idef,
+ void* d_xqPtr,
+ DeviceBuffer<RVec> d_fPtr,
+ DeviceBuffer<RVec> d_fShiftPtr)
{
// TODO wallcycle sub start
haveInteractions_ = false;
// TODO wallcycle sub stop
}
-void GpuBonded::Impl::setPbc(PbcType pbcType, const matrix box, bool canMoleculeSpanPbc)
+void ListedForcesGpu::Impl::setPbc(PbcType pbcType, const matrix box, bool canMoleculeSpanPbc)
{
PbcAiuc pbcAiuc;
setPbcAiuc(canMoleculeSpanPbc ? numPbcDimensions(pbcType) : 0, box, &pbcAiuc);
kernelParams_.pbcAiuc = pbcAiuc;
}
-bool GpuBonded::Impl::haveInteractions() const
+bool ListedForcesGpu::Impl::haveInteractions() const
{
return haveInteractions_;
}
-void GpuBonded::Impl::launchEnergyTransfer()
+void ListedForcesGpu::Impl::launchEnergyTransfer()
{
GMX_ASSERT(haveInteractions_,
"No GPU bonded interactions, so no energies will be computed, so transfer should "
wallcycle_sub_stop(wcycle_, WallCycleSubCounter::LaunchGpuBonded);
}
-void GpuBonded::Impl::waitAccumulateEnergyTerms(gmx_enerdata_t* enerd)
+void ListedForcesGpu::Impl::waitAccumulateEnergyTerms(gmx_enerdata_t* enerd)
{
GMX_ASSERT(haveInteractions_,
"No GPU bonded interactions, so no energies will be computed or transferred, so "
grppener->energyGroupPairTerms[NonBondedEnergyTerms::Coulomb14][0] += vTot_[F_COUL14];
}
-void GpuBonded::Impl::clearEnergies()
+void ListedForcesGpu::Impl::clearEnergies()
{
wallcycle_start_nocount(wcycle_, WallCycleCounter::LaunchGpu);
wallcycle_sub_start_nocount(wcycle_, WallCycleSubCounter::LaunchGpuBonded);
wallcycle_stop(wcycle_, WallCycleCounter::LaunchGpu);
}
-// ---- GpuBonded
+// ---- ListedForcesGpu
-GpuBonded::GpuBonded(const gmx_ffparams_t& ffparams,
- const float electrostaticsScaleFactor,
- const DeviceContext& deviceContext,
- const DeviceStream& deviceStream,
- gmx_wallcycle* wcycle) :
+ListedForcesGpu::ListedForcesGpu(const gmx_ffparams_t& ffparams,
+ const float electrostaticsScaleFactor,
+ const DeviceContext& deviceContext,
+ const DeviceStream& deviceStream,
+ gmx_wallcycle* wcycle) :
impl_(new Impl(ffparams, electrostaticsScaleFactor, deviceContext, deviceStream, wcycle))
{
}
-GpuBonded::~GpuBonded() = default;
+ListedForcesGpu::~ListedForcesGpu() = default;
-void GpuBonded::updateInteractionListsAndDeviceBuffers(ArrayRef<const int> nbnxnAtomOrder,
- const InteractionDefinitions& idef,
- void* d_xq,
- DeviceBuffer<RVec> d_f,
- DeviceBuffer<RVec> d_fShift)
+void ListedForcesGpu::updateInteractionListsAndDeviceBuffers(ArrayRef<const int> nbnxnAtomOrder,
+ const InteractionDefinitions& idef,
+ void* d_xq,
+ DeviceBuffer<RVec> d_f,
+ DeviceBuffer<RVec> d_fShift)
{
impl_->updateInteractionListsAndDeviceBuffers(nbnxnAtomOrder, idef, d_xq, d_f, d_fShift);
}
-void GpuBonded::setPbc(PbcType pbcType, const matrix box, bool canMoleculeSpanPbc)
+void ListedForcesGpu::setPbc(PbcType pbcType, const matrix box, bool canMoleculeSpanPbc)
{
impl_->setPbc(pbcType, box, canMoleculeSpanPbc);
}
-bool GpuBonded::haveInteractions() const
+bool ListedForcesGpu::haveInteractions() const
{
return impl_->haveInteractions();
}
-void GpuBonded::setPbcAndlaunchKernel(PbcType pbcType,
- const matrix box,
- bool canMoleculeSpanPbc,
- const gmx::StepWorkload& stepWork)
+void ListedForcesGpu::setPbcAndlaunchKernel(PbcType pbcType,
+ const matrix box,
+ bool canMoleculeSpanPbc,
+ const gmx::StepWorkload& stepWork)
{
setPbc(pbcType, box, canMoleculeSpanPbc);
launchKernel(stepWork);
}
-void GpuBonded::launchEnergyTransfer()
+void ListedForcesGpu::launchEnergyTransfer()
{
impl_->launchEnergyTransfer();
}
-void GpuBonded::waitAccumulateEnergyTerms(gmx_enerdata_t* enerd)
+void ListedForcesGpu::waitAccumulateEnergyTerms(gmx_enerdata_t* enerd)
{
impl_->waitAccumulateEnergyTerms(enerd);
}
-void GpuBonded::clearEnergies()
+void ListedForcesGpu::clearEnergies()
{
impl_->clearEnergies();
}
*
* \ingroup module_listed_forces
*/
-#ifndef GMX_LISTED_FORCES_GPUBONDED_IMPL_H
-#define GMX_LISTED_FORCES_GPUBONDED_IMPL_H
+#ifndef GMX_LISTED_FORCES_LISTED_FORCES_GPU_IMPL_H
+#define GMX_LISTED_FORCES_LISTED_FORCES_GPU_IMPL_H
#include "gromacs/gpu_utils/device_context.h"
#include "gromacs/gpu_utils/gputraits.cuh"
#include "gromacs/gpu_utils/hostallocator.h"
-#include "gromacs/listed_forces/gpubonded.h"
+#include "gromacs/listed_forces/listed_forces_gpu.h"
#include "gromacs/pbcutil/pbc_aiuc.h"
struct gmx_ffparams_t;
};
/*! \internal \brief Implements GPU bondeds */
-class GpuBonded::Impl
+class ListedForcesGpu::Impl
{
public:
//! Constructor
} // namespace gmx
-#endif
+#endif // GMX_LISTED_FORCES_LISTED_FORCES_GPU_IMPL_H
#include "gromacs/gpu_utils/cudautils.cuh"
#include "gromacs/gpu_utils/typecasts.cuh"
#include "gromacs/gpu_utils/vectype_ops.cuh"
-#include "gromacs/listed_forces/gpubonded.h"
+#include "gromacs/listed_forces/listed_forces_gpu.h"
#include "gromacs/math/units.h"
#include "gromacs/mdlib/force_flags.h"
#include "gromacs/mdtypes/interaction_const.h"
#include "gromacs/timing/wallcycle.h"
#include "gromacs/utility/gmxassert.h"
-#include "gpubonded_impl.h"
+#include "listed_forces_gpu_impl.h"
#if defined(_MSVC)
# include <limits>
template<bool calcVir, bool calcEner>
-void GpuBonded::Impl::launchKernel()
+void ListedForcesGpu::Impl::launchKernel()
{
GMX_ASSERT(haveInteractions_,
"Cannot launch bonded GPU kernels unless bonded GPU work was scheduled");
wallcycle_stop(wcycle_, WallCycleCounter::LaunchGpu);
}
-void GpuBonded::launchKernel(const gmx::StepWorkload& stepWork)
+void ListedForcesGpu::launchKernel(const gmx::StepWorkload& stepWork)
{
if (stepWork.computeEnergy)
{
#include <algorithm>
#include <string>
-#include "gromacs/listed_forces/gpubonded.h"
+#include "gromacs/listed_forces/listed_forces_gpu.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/topology/ifunc.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/gmxlib/nonbonded/nonbonded.h"
#include "gromacs/gpu_utils/gpu_utils.h"
#include "gromacs/hardware/hw_info.h"
-#include "gromacs/listed_forces/gpubonded.h"
+#include "gromacs/listed_forces/listed_forces_gpu.h"
#include "gromacs/listed_forces/listed_forces.h"
#include "gromacs/listed_forces/pairs.h"
#include "gromacs/math/functions.h"
#include "gromacs/gpu_utils/gpu_utils.h"
#include "gromacs/imd/imd.h"
#include "gromacs/listed_forces/disre.h"
-#include "gromacs/listed_forces/gpubonded.h"
+#include "gromacs/listed_forces/listed_forces_gpu.h"
#include "gromacs/listed_forces/listed_forces.h"
#include "gromacs/listed_forces/orires.h"
#include "gromacs/math/arrayrefwithpadding.h"
domainWork.haveCpuBondedWork = true;
}
}
- domainWork.haveGpuBondedWork = ((fr.gpuBonded != nullptr) && fr.gpuBonded->haveInteractions());
+ domainWork.haveGpuBondedWork =
+ ((fr.listedForcesGpu != nullptr) && fr.listedForcesGpu->haveInteractions());
// Note that haveFreeEnergyWork is constant over the whole run
domainWork.haveFreeEnergyWork =
(fr.efep != FreeEnergyPerturbationType::No && mdatoms.nPerturbed != 0);
*
*/
static void launchGpuEndOfStepTasks(nonbonded_verlet_t* nbv,
- gmx::GpuBonded* gpuBonded,
+ gmx::ListedForcesGpu* listedForcesGpu,
gmx_pme_t* pmedata,
gmx_enerdata_t* enerd,
const gmx::MdrunScheduleWorkload& runScheduleWork,
// in principle this should be included in the DD balancing region,
// but generally it is infrequent so we'll omit it for the sake of
// simpler code
- gpuBonded->waitAccumulateEnergyTerms(enerd);
+ listedForcesGpu->waitAccumulateEnergyTerms(enerd);
- gpuBonded->clearEnergies();
+ listedForcesGpu->clearEnergies();
}
}
/* initialize the GPU nbnxm atom data and bonded data structures */
if (simulationWork.useGpuNonbonded)
{
- // Note: cycle counting only nononbondeds, gpuBonded counts internally
+ // Note: cycle counting only nononbondeds, GPU listed forces counts internally
wallcycle_start_nocount(wcycle, WallCycleCounter::LaunchGpu);
wallcycle_sub_start_nocount(wcycle, WallCycleSubCounter::LaunchGpuNonBonded);
Nbnxm::gpu_init_atomdata(nbv->gpu_nbv, nbv->nbat.get());
wallcycle_sub_stop(wcycle, WallCycleSubCounter::LaunchGpuNonBonded);
wallcycle_stop(wcycle, WallCycleCounter::LaunchGpu);
- if (fr->gpuBonded)
+ if (fr->listedForcesGpu)
{
/* Now we put all atoms on the grid, we can assign bonded
* interactions to the GPU, where the grid order is
// TODO the xq, f, and fshift buffers are now shared
// resources, so they should be maintained by a
// higher-level object than the nb module.
- fr->gpuBonded->updateInteractionListsAndDeviceBuffers(nbv->getGridIndices(),
- top->idef,
- Nbnxm::gpu_get_xq(nbv->gpu_nbv),
- Nbnxm::gpu_get_f(nbv->gpu_nbv),
- Nbnxm::gpu_get_fshift(nbv->gpu_nbv));
+ fr->listedForcesGpu->updateInteractionListsAndDeviceBuffers(
+ nbv->getGridIndices(),
+ top->idef,
+ Nbnxm::gpu_get_xq(nbv->gpu_nbv),
+ Nbnxm::gpu_get_f(nbv->gpu_nbv),
+ Nbnxm::gpu_get_fshift(nbv->gpu_nbv));
}
}
/* Note that with a GPU the launch overhead of the list transfer is not timed separately */
nbv->constructPairlist(InteractionLocality::Local, top->excls, step, nrnb);
- nbv->setupGpuShortRangeWork(fr->gpuBonded, InteractionLocality::Local);
+ nbv->setupGpuShortRangeWork(fr->listedForcesGpu, InteractionLocality::Local);
wallcycle_sub_stop(wcycle, WallCycleSubCounter::NBSSearchLocal);
wallcycle_stop(wcycle, WallCycleCounter::NS);
// we can only launch the kernel after non-local coordinates have been received.
if (domainWork.haveGpuBondedWork && !havePPDomainDecomposition(cr))
{
- fr->gpuBonded->setPbcAndlaunchKernel(fr->pbcType, box, fr->bMolPBC, stepWork);
+ fr->listedForcesGpu->setPbcAndlaunchKernel(fr->pbcType, box, fr->bMolPBC, stepWork);
}
/* launch local nonbonded work on GPU */
/* Note that with a GPU the launch overhead of the list transfer is not timed separately */
nbv->constructPairlist(InteractionLocality::NonLocal, top->excls, step, nrnb);
- nbv->setupGpuShortRangeWork(fr->gpuBonded, InteractionLocality::NonLocal);
+ nbv->setupGpuShortRangeWork(fr->listedForcesGpu, InteractionLocality::NonLocal);
wallcycle_sub_stop(wcycle, WallCycleSubCounter::NBSSearchNonLocal);
wallcycle_stop(wcycle, WallCycleCounter::NS);
// TODO refactor this GPU halo exchange re-initialisation
if (domainWork.haveGpuBondedWork)
{
- fr->gpuBonded->setPbcAndlaunchKernel(fr->pbcType, box, fr->bMolPBC, stepWork);
+ fr->listedForcesGpu->setPbcAndlaunchKernel(fr->pbcType, box, fr->bMolPBC, stepWork);
}
/* launch non-local nonbonded tasks on GPU */
if (domainWork.haveGpuBondedWork && stepWork.computeEnergy)
{
- fr->gpuBonded->launchEnergyTransfer();
+ fr->listedForcesGpu->launchEnergyTransfer();
}
wallcycle_stop(wcycle, WallCycleCounter::LaunchGpu);
}
}
}
- launchGpuEndOfStepTasks(nbv, fr->gpuBonded, fr->pmedata, enerd, *runScheduleWork, step, wcycle);
+ launchGpuEndOfStepTasks(nbv, fr->listedForcesGpu, fr->pmedata, enerd, *runScheduleWork, step, wcycle);
if (DOMAINDECOMP(cr))
{
#include "gromacs/hardware/printhardware.h"
#include "gromacs/imd/imd.h"
#include "gromacs/listed_forces/disre.h"
-#include "gromacs/listed_forces/gpubonded.h"
+#include "gromacs/listed_forces/listed_forces_gpu.h"
#include "gromacs/listed_forces/listed_forces.h"
#include "gromacs/listed_forces/orires.h"
#include "gromacs/math/functions.h"
const bool thisRankHasPmeGpuTask = gpuTaskAssignments.thisRankHasPmeGpuTask();
std::unique_ptr<MDAtoms> mdAtoms;
std::unique_ptr<VirtualSitesHandler> vsite;
- std::unique_ptr<GpuBonded> gpuBonded;
+ std::unique_ptr<ListedForcesGpu> listedForcesGpu;
t_nrnb nrnb;
if (thisRankHasDuty(cr, DUTY_PP))
GMX_RELEASE_ASSERT(deviceStreamManager != nullptr,
"GPU device stream manager should be valid in order to use GPU "
"version of bonded forces.");
- gpuBonded = std::make_unique<GpuBonded>(
+ listedForcesGpu = std::make_unique<ListedForcesGpu>(
mtop.ffparams,
fr->ic->epsfac * fr->fudgeQQ,
deviceStreamManager->context(),
deviceStreamManager->bondedStream(havePPDomainDecomposition(cr)),
wcycle.get());
- fr->gpuBonded = gpuBonded.get();
+ fr->listedForcesGpu = listedForcesGpu.get();
}
/* Initialize the mdAtoms structure.
mdAtoms.reset(nullptr);
globalState.reset(nullptr);
mdModules_.reset(nullptr); // destruct force providers here as they might also use the GPU
- gpuBonded.reset(nullptr);
+ listedForcesGpu.reset(nullptr);
fr.reset(nullptr); // destruct forcerec before gpu
// TODO convert to C++ so we can get rid of these frees
sfree(disresdata);
namespace gmx
{
class DeviceStreamManager;
-class GpuBonded;
+class ListedForcesGpu;
class GpuForceReduction;
class ForceProviders;
class StatePropagatorDataGpu;
std::vector<ListedForces> listedForces;
/* TODO: Replace the pointer by an object once we got rid of C */
- gmx::GpuBonded* gpuBonded = nullptr;
+ gmx::ListedForcesGpu* listedForcesGpu = nullptr;
/* Ewald correction thread local virial and energy data */
int nthread_ewc = 0;
namespace gmx
{
-class GpuBonded;
+class ListedForcesGpu;
}
namespace Nbnxm
#ifndef GMX_NBNXM_GPU_COMMON_UTILS_H
#define GMX_NBNXM_GPU_COMMON_UTILS_H
-#include "gromacs/listed_forces/gpubonded.h"
+#include "gromacs/listed_forces/listed_forces_gpu.h"
#include "gromacs/mdtypes/locality.h"
#include "gromacs/nbnxm/gpu_types_common.h"
#include "gromacs/utility/exceptions.h"
pairlistSets_->changePairlistRadii(rlistOuter, rlistInner);
}
-void nonbonded_verlet_t::setupGpuShortRangeWork(const gmx::GpuBonded* gpuBonded,
+void nonbonded_verlet_t::setupGpuShortRangeWork(const gmx::ListedForcesGpu* listedForcesGpu,
const gmx::InteractionLocality iLocality) const
{
if (useGpu() && !emulateGpu())
{
- Nbnxm::setupGpuShortRangeWork(gpu_nbv, gpuBonded, iLocality);
+ Nbnxm::setupGpuShortRangeWork(gpu_nbv, listedForcesGpu, iLocality);
}
}
{
class DeviceStreamManager;
class ForceWithShiftForces;
-class GpuBonded;
+class ListedForcesGpu;
template<typename>
class ListOfLists;
class MDLogger;
void changePairlistRadii(real rlistOuter, real rlistInner) const;
//! Set up internal flags that indicate what type of short-range work there is.
- void setupGpuShortRangeWork(const gmx::GpuBonded* gpuBonded, gmx::InteractionLocality iLocality) const;
+ void setupGpuShortRangeWork(const gmx::ListedForcesGpu* listedForcesGpu,
+ gmx::InteractionLocality iLocality) const;
// TODO: Make all data members private
//! All data related to the pair lists
namespace gmx
{
-class GpuBonded;
+class ListedForcesGpu;
class StepWorkload;
} // namespace gmx
* This function is expected to be called every time the work-distribution
* can change (i.e. at search/domain decomposition steps).
*
- * \param[inout] nb Pointer to the nonbonded GPU data structure
- * \param[in] gpuBonded Pointer to the GPU bonded data structure
- * \param[in] iLocality Interaction locality identifier
+ * \param[inout] nb Pointer to the nonbonded GPU data structure
+ * \param[in] listedForcesGpu Pointer to the GPU bonded data structure
+ * \param[in] iLocality Interaction locality identifier
*/
GPU_FUNC_QUALIFIER
-void setupGpuShortRangeWork(NbnxmGpu gmx_unused* nb,
- const gmx::GpuBonded gmx_unused* gpuBonded,
- gmx::InteractionLocality gmx_unused iLocality) GPU_FUNC_TERM;
+void setupGpuShortRangeWork(NbnxmGpu gmx_unused* nb,
+ const gmx::ListedForcesGpu gmx_unused* listedForcesGpu,
+ gmx::InteractionLocality gmx_unused iLocality) GPU_FUNC_TERM;
/*! \brief Returns true if there is GPU short-range work for the given interaction locality.
*
|| (nb->nbparam->elecType == ElecType::EwaldAnaTwin));
}
-void setupGpuShortRangeWork(NbnxmGpu* nb, const gmx::GpuBonded* gpuBonded, const gmx::InteractionLocality iLocality)
+void setupGpuShortRangeWork(NbnxmGpu* nb,
+ const gmx::ListedForcesGpu* listedForcesGpu,
+ const gmx::InteractionLocality iLocality)
{
GMX_ASSERT(nb, "Need a valid nbnxn_gpu object");
// interaction locality contains entries or if there is any
// bonded work (as this is not split into local/nonlocal).
nb->haveWork[iLocality] = ((nb->plist[iLocality]->nsci != 0)
- || (gpuBonded != nullptr && gpuBonded->haveInteractions()));
+ || (listedForcesGpu != nullptr && listedForcesGpu->haveInteractions()));
}
bool haveGpuShortRangeWork(const NbnxmGpu* nb, const gmx::InteractionLocality interactionLocality)
* \todo This routine uses CUDA float4 types for input coordinates and
* returns in rvec data-type. Other than that, it does essentially
* the same thing as the version below, as well as SIMD and CPU
- * versions. This routine is used in gpubonded module.
+ * versions. This routine is used in GPU listed forces module.
* To avoid code duplication, these implementations should be
* unified. See Issue #2863:
* https://gitlab.com/gromacs/gromacs/-/issues/2863
#include "gromacs/hardware/detecthardware.h"
#include "gromacs/hardware/hardwaretopology.h"
#include "gromacs/hardware/hw_info.h"
-#include "gromacs/listed_forces/gpubonded.h"
+#include "gromacs/listed_forces/listed_forces_gpu.h"
#include "gromacs/mdlib/gmx_omp_nthreads.h"
#include "gromacs/mdlib/update_constrain_gpu.h"
#include "gromacs/mdtypes/commrec.h"
std::string errorMessage;
- if (!buildSupportsGpuBondeds(&errorMessage))
+ if (!buildSupportsListedForcesGpu(&errorMessage))
{
if (bondedTarget == TaskTarget::Gpu)
{
return false;
}
- if (!inputSupportsGpuBondeds(inputrec, mtop, &errorMessage))
+ if (!inputSupportsListedForcesGpu(inputrec, mtop, &errorMessage))
{
if (bondedTarget == TaskTarget::Gpu)
{