Gromacs
2025.0-dev-20241011-013a99c
|
#include "gmxpre.h"
#include "pairlist_tuning.h"
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <filesystem>
#include <string>
#include "gromacs/domdec/domdec.h"
#include "gromacs/hardware/cpuinfo.h"
#include "gromacs/math/functions.h"
#include "gromacs/math/vec.h"
#include "gromacs/mdlib/calc_verletbuf.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/interaction_const.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/mdtypes/multipletimestepping.h"
#include "gromacs/mdtypes/state.h"
#include "gromacs/nbnxm/pairlistparams.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/enumerationhelpers.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/logger.h"
#include "gromacs/utility/strconvert.h"
#include "gromacs/utility/stringutil.h"
#include "nbnxm_geometry.h"
#include "pairlistsets.h"
Implements functions for tuning adjustable parameters for the nbnxn non-bonded search and interaction kernels.
Classes | |
struct | gmx::CalcVerletBufferParameters |
Struct with references for most parameters for calling calcVerletBufferSize() More... | |
Macros | |
#define | NNSTL (sizeof(nstlist_try) / sizeof(nstlist_try[0])) |
Number of elements in the neighborsearch list trials. | |
Functions | |
static bool | gmx::supportsDynamicPairlistGenerationInterval (const t_inputrec &ir) |
Returns if we can (heuristically) change nstlist and rlist. More... | |
static real | gmx::getPressureTolerance (const real inputrecVerletBufferPressureTolerance) |
Returns the Verlet buffer pressure tolerance set by an env.var. or from input. | |
void | gmx::increaseNstlist (FILE *fplog, t_commrec *cr, t_inputrec *ir, int nstlistOnCmdline, const gmx_mtop_t *mtop, const matrix box, real effectiveAtomDensity, bool useOrEmulateGpuForNonbondeds, const CpuInfo &cpuinfo) |
Try to increase nstlist when using the Verlet cut-off scheme. More... | |
static real | gmx::calcPruneVerletBufferSize (const CalcVerletBufferParameters ¶ms, const int nstlist) |
Wrapper for calcVerletBufferSize() for determining the pruning cut-off. More... | |
static void | gmx::setDynamicPairlistPruningParameters (const t_inputrec &inputrec, const gmx_mtop_t &mtop, const real effectiveAtomDensity, const bool useGpuList, const VerletbufListSetup &listSetup, const bool userSetNstlistPrune, const interaction_const_t &interactionConst, PairlistParams *listParams) |
Set the dynamic pairlist pruning parameters in ic . More... | |
static std::string | gmx::formatListSetup (const std::string &listName, int nstList, int nstListForSpacing, real rList, real interactionCutoff) |
Returns a string describing the setup of a single pair-list. More... | |
void | gmx::setupDynamicPairlistPruning (const MDLogger &mdlog, const t_inputrec &inputrec, const gmx_mtop_t &mtop, real effectiveAtomDensity, const interaction_const_t &interactionConst, PairlistParams *listParams) |
Set up the dynamic pairlist pruning. More... | |
void | gmx::printNbnxmPressureError (const MDLogger &mdlog, const t_inputrec &inputrec, const gmx_mtop_t &mtop, real effectiveAtomDensity, const PairlistParams &listParams) |
Prints an estimate of the error in the pressure due to missing interactions. More... | |
Variables | |
static const int | gmx::nbnxnReferenceNstlist = 10 |
Cost of non-bonded kernels. More... | |
const int | gmx::nstlist_try [] = { 20, 25, 40, 50, 80, 100 } |
The values to try when switching. | |
static const float | gmx::c_nbnxnListSizeFactorCpu = 1.25 |
Target pair-list size increase ratio for CPU. | |
static const float | gmx::c_nbnxnListSizeFactorIntelXeonPhi = 1.4 |
Target pair-list size increase ratio for Intel KNL. | |
static const float | gmx::c_nbnxnListSizeFactorGPU = 1.4 |
Target pair-list size increase ratio for GPU. | |
static const float | gmx::c_nbnxnListSizeFactorMargin = 0.1 |
Never increase the size of the pair-list more than the factor above plus this margin. | |
static constexpr int | gmx::c_nbnxnGpuRollingListPruningInterval = 2 |
The interval in steps at which we perform dynamic, rolling pruning on a GPU. More... | |
static const int | gmx::c_nbnxnCpuDynamicListPruningMinLifetime = 5 |
The minimum nstlist for dynamic pair list pruning on CPUs. More... | |
static constexpr int | gmx::c_nbnxnGpuDynamicListPruningMinLifetime = 4 |
The minimum nstlist for dynamic pair list pruning om GPUs. More... | |