#include "forcerec.h"
-#include "config.h"
-
#include <cassert>
#include <cmath>
#include <cstdlib>
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/strconvert.h"
-/*! \brief environment variable to enable GPU P2P communication */
-static const bool c_enableGpuPmePpComms =
- (getenv("GMX_GPU_PME_PP_COMMS") != nullptr) && GMX_THREAD_MPI && (GMX_GPU == GMX_GPU_CUDA);
-
static std::vector<real> mk_nbfp(const gmx_ffparams_t* idef, gmx_bool bBHAM)
{
std::vector<real> nbfp;
const char* tabfn,
const char* tabpfn,
gmx::ArrayRef<const std::string> tabbfnm,
- const bool pmeOnlyRankUsesGpu,
real print_force)
{
/* By default we turn SIMD kernels on, but it might be turned off further down... */
*/
fprintf(fp, "\n");
}
-
- if (pmeOnlyRankUsesGpu && c_enableGpuPmePpComms)
- {
- fr->pmePpCommGpu = std::make_unique<gmx::PmePpCommGpu>(cr->mpi_comm_mysim, cr->dd->pme_nodeid);
- }
}
t_forcerec::t_forcerec() = default;
* \param[in] tabfn Table potential file for non-bonded interactions
* \param[in] tabpfn Table potential file for pair interactions
* \param[in] tabbfnm Table potential files for bonded interactions
- * \param[in] pmeOnlyRankUsesGpu Whether there is a PME task on a GPU on a PME-only rank
* \param[in] print_force Print forces for atoms with force >= print_force
*/
void init_forcerec(FILE* fplog,
const char* tabfn,
const char* tabpfn,
gmx::ArrayRef<const std::string> tabbfnm,
- bool pmeOnlyRankUsesGpu,
real print_force);
/*! \brief Divide exclusions over threads
init_forcerec(fplog, mdlog, fr, fcd, inputrec, &mtop, cr, box,
opt2fn("-table", filenames.size(), filenames.data()),
opt2fn("-tablep", filenames.size(), filenames.data()),
- opt2fns("-tableb", filenames.size(), filenames.data()),
- pmeRunMode == PmeRunMode::GPU && !thisRankHasDuty(cr, DUTY_PME), pforce);
+ opt2fns("-tableb", filenames.size(), filenames.data()), pforce);
+
+ if (devFlags.enableGpuPmePPComm && !thisRankHasDuty(cr, DUTY_PME))
+ {
+ fr->pmePpCommGpu = std::make_unique<gmx::PmePpCommGpu>(cr->mpi_comm_mysim, cr->dd->pme_nodeid);
+ }
fr->nbv = Nbnxm::init_nb_verlet(mdlog, inputrec, fr, cr, *hwinfo, nonbondedDeviceInfo,
&mtop, box, wcycle);