Gromacs  2024.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions | Variables
#include "gmxpre.h"
#include "gromacs/taskassignment/decidegpuusage.h"
#include "config.h"
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include "gromacs/ewald/pme.h"
#include "gromacs/hardware/cpuinfo.h"
#include "gromacs/hardware/detecthardware.h"
#include "gromacs/hardware/hardwaretopology.h"
#include "gromacs/hardware/hw_info.h"
#include "gromacs/listed_forces/listed_forces_gpu.h"
#include "gromacs/mdlib/constr.h"
#include "gromacs/mdlib/gmx_omp_nthreads.h"
#include "gromacs/mdlib/update_constrain_gpu.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/mdtypes/mdrunoptions.h"
#include "gromacs/pulling/pull.h"
#include "gromacs/taskassignment/taskassignment.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/baseversion.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/logger.h"
#include "gromacs/utility/message_string_collector.h"
#include "gromacs/utility/stringutil.h"
+ Include dependency graph for decidegpuusage.cpp:

Description

Defines functionality for deciding whether tasks will run on GPUs.

Author
Mark Abraham mark..nosp@m.j.ab.nosp@m.raham.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Functions

bool gmx::decideWhetherToUseGpusForNonbondedWithThreadMpi (TaskTarget nonbondedTarget, bool haveAvailableDevices, const std::vector< int > &userGpuTaskAssignment, EmulateGpuNonbonded emulateGpuNonbonded, bool buildSupportsNonbondedOnGpu, bool nonbondedOnGpuIsUseful, bool binaryReproducibilityRequested, int numRanksPerSimulation)
 Decide whether this thread-MPI simulation will run nonbonded tasks on GPUs. More...
 
static bool gmx::decideWhetherToUseGpusForPmeFft (const TaskTarget pmeFftTarget)
 
static bool gmx::canUseGpusForPme (const bool useGpuForNonbonded, const TaskTarget pmeTarget, const TaskTarget pmeFftTarget, const t_inputrec &inputrec, std::string *errorMessage)
 
bool gmx::decideWhetherToUseGpusForPmeWithThreadMpi (bool useGpuForNonbonded, TaskTarget pmeTarget, TaskTarget pmeFftTarget, int numDevicesToUse, const std::vector< int > &userGpuTaskAssignment, const t_inputrec &inputrec, int numRanksPerSimulation, int numPmeRanksPerSimulation)
 Decide whether this thread-MPI simulation will run PME tasks on GPUs. More...
 
bool gmx::decideWhetherToUseGpusForNonbonded (TaskTarget nonbondedTarget, const std::vector< int > &userGpuTaskAssignment, EmulateGpuNonbonded emulateGpuNonbonded, bool buildSupportsNonbondedOnGpu, bool nonbondedOnGpuIsUseful, bool binaryReproducibilityRequested, bool gpusWereDetected)
 Decide whether the simulation will try to run nonbonded tasks on GPUs. More...
 
bool gmx::decideWhetherToUseGpusForPme (bool useGpuForNonbonded, TaskTarget pmeTarget, TaskTarget pmeFftTarget, const std::vector< int > &userGpuTaskAssignment, const t_inputrec &inputrec, int numRanksPerSimulation, int numPmeRanksPerSimulation, bool gpusWereDetected)
 Decide whether the simulation will try to run tasks of different types on GPUs. More...
 
PmeRunMode gmx::determinePmeRunMode (bool useGpuForPme, const TaskTarget &pmeFftTarget, const t_inputrec &inputrec)
 Determine PME run mode. More...
 
bool gmx::decideWhetherToUseGpusForBonded (bool useGpuForNonbonded, bool useGpuForPme, TaskTarget bondedTarget, const t_inputrec &inputrec, const gmx_mtop_t &mtop, int numPmeRanksPerSimulation, bool gpusWereDetected)
 Decide whether the simulation will try to run bonded tasks on GPUs. More...
 
bool gmx::decideWhetherToUseGpuForUpdate (bool isDomainDecomposition, bool useUpdateGroups, PmeRunMode pmeRunMode, bool havePmeOnlyRank, bool useGpuForNonbonded, TaskTarget updateTarget, bool gpusWereDetected, const t_inputrec &inputrec, const gmx_mtop_t &mtop, bool useEssentialDynamics, bool doOrientationRestraints, bool haveFrozenAtoms, bool useModularSimulator, bool doRerun, const gmx::MDLogger &mdlog)
 Decide whether to use GPU for update. More...
 
bool gmx::decideWhetherDirectGpuCommunicationCanBeUsed (const DevelopmentFeatureFlags &devFlags, bool haveMts, bool haveSwapCoords, const gmx::MDLogger &mdlog)
 Decide whether direct GPU communication can be used. More...
 
bool gmx::decideWhetherToUseGpuForHalo (bool havePPDomainDecomposition, bool useGpuForNonbonded, bool canUseDirectGpuComm, bool useModularSimulator, bool doRerun, bool haveEnergyMinimization, const gmx::MDLogger &mdlog)
 Decide whether to use GPU for halo exchange. More...
 

Variables

const char *const gmx::anonymous_namespace{decidegpuusage.cpp}::g_specifyEverythingFormatString
 Helper variable to localise the text of an often repeated message. More...
 
constexpr bool gmx::c_gpuBuildSyclWithoutGpuFft