Gromacs  2021.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Enumerations | Functions | Variables

Description

Generic GROMACS namespace.

Declares the integrators for energy minimization and NMA.

Convenience macro to help us avoid ifdefs each time we use sysconf.

Author
David van der Spoel david.nosp@m..van.nosp@m.dersp.nosp@m.oel@.nosp@m.icm.u.nosp@m.u.se

Classes

class  AbstractAnalysisData
 Abstract base class for all objects that provide data. More...
 
class  AnalysisData
 Parallelizable data container for raw data. More...
 
class  AnalysisDataHandle
 Handle for inserting data into AnalysisData. More...
 
class  AbstractAnalysisArrayData
 Abstract base class for data objects that present in-memory data. More...
 
class  AnalysisArrayData
 Simple in-memory data array. More...
 
class  AnalysisDataValue
 Value type for representing a single value in analysis data objects. More...
 
class  AnalysisDataFrameHeader
 Value type for storing frame-level information for analysis data. More...
 
class  AnalysisDataPointSetRef
 Value type wrapper for non-mutable access to a set of data column values. More...
 
class  AnalysisDataFrameRef
 Value type wrapper for non-mutable access to a data frame. More...
 
class  IAnalysisDataModule
 Interface for a module that gets notified whenever data is added. More...
 
class  AnalysisDataModuleSerial
 Convenience base class for serial analysis data modules. More...
 
class  AnalysisDataModuleParallel
 Convenience base class for parallel analysis data modules. More...
 
class  ArrayRef
 STL-like interface to a C array of T (or part of a std container of T). More...
 
class  AnalysisDataAverageModule
 Data module for independently averaging each column in input data. More...
 
class  AnalysisDataFrameAverageModule
 Data module for averaging of columns for each frame. More...
 
class  AnalysisDataDisplacementModule
 Data module for calculating displacements. More...
 
class  AnalysisHistogramSettingsInitializer
 Provides "named parameter" idiom for constructing histograms. More...
 
class  AnalysisHistogramSettings
 Contains parameters that specify histogram bin locations. More...
 
class  AbstractAverageHistogram
 Base class for representing histograms averaged over frames. More...
 
class  AnalysisDataSimpleHistogramModule
 Data module for per-frame histograms. More...
 
class  AnalysisDataWeightedHistogramModule
 Data module for per-frame weighted histograms. More...
 
class  AnalysisDataBinAverageModule
 Data module for bin averages. More...
 
class  AnalysisDataLifetimeModule
 Data module for computing lifetime histograms for columns in input data. More...
 
class  AnalysisDataPlotSettings
 Common settings for data plots. More...
 
class  AbstractPlotModule
 Abstract data module for writing data into a file. More...
 
class  AnalysisDataPlotModule
 Plotting module for straightforward plotting of data. More...
 
class  AnalysisDataVectorPlotModule
 Plotting module specifically for data consisting of vectors. More...
 
class  CommandLineHelpWriter
 Writes help information for Options. More...
 
class  CommandLineModuleSettings
 Settings to pass information between a module and the general runner. More...
 
class  ICommandLineModule
 Module that can be run from command line using CommandLineModuleManager. More...
 
class  ICommandLineOptionsModuleSettings
 Settings to pass information between a CommandLineOptionsModule and generic code that runs it. More...
 
class  ICommandLineOptionsModule
 Module that can be run from a command line and uses gmx::Options for argument processing. More...
 
class  CommandLineParser
 Implements command-line parsing for Options objects. More...
 
class  TrajectoryFileOpener
 Low level method to take care of only file opening and closing. More...
 
class  TrajectoryFrameWriter
 Writes coordinate frames to a sink, e.g. a trajectory file. More...
 
class  IOutputAdapter
 OutputAdapter class for handling trajectory file flag setting and processing. More...
 
class  OutputSelector
 OutputSelector class controls setting which coordinates are actually written. More...
 
class  SetAtoms
 SetAtoms class controls availability of atoms data. More...
 
class  SetBox
 Allows changing box information when writing a coordinate file. More...
 
class  SetForces
 SetForces class allows changing writing of forces to file. More...
 
class  SetPrecision
 SetPrecision class allows changing file writing precision. More...
 
class  SetStartTime
 SetStartTime class allows changing trajectory time information. More...
 
class  SetTimeStep
 SetTimeStep class allows changing trajectory time information. More...
 
class  SetVelocities
 SetVelocities class allows changing writing of velocities to file. More...
 
class  OutputRequirementOptionDirector
 Container for the user input values that will be used by the builder to determine which OutputAdapters should/could/will be registered to the coordinate file writer. More...
 
struct  OutputRequirements
 Finalized version of requirements after processing. More...
 
class  ListOfLists
 A list of lists, optimized for performance. More...
 
class  ArrayRefWithPadding
 Interface to a C array of T (or part of a std container of T), that includes padding that is suitable for the kinds of SIMD operations GROMACS uses. More...
 
struct  StaticLog2
 Evaluate log2(n) for integer n statically at compile time. More...
 
struct  StaticLog2< 1 >
 Specialization of StaticLog2<n> for n==1. More...
 
struct  StaticLog2< 0 >
 Specialization of StaticLog2<n> for n==0. More...
 
class  PaddedVector
 PaddedVector is a container of elements in contiguous storage that allocates extra memory for safe SIMD-style loads for operations used in GROMACS. More...
 
class  BasicVector
 C++ class for 3D vectors. More...
 
class  SimulationSignal
 POD-style object used by mdrun ranks to set and receive signals within and between simulations. More...
 
class  SimulationSignaller
 Object used by mdrun ranks to signal to each other at this step. More...
 
class  MembedHolder
 Membed SimulatorBuilder parameter type. More...
 
struct  SimulatorConfig
 Simulation configuation settings. More...
 
struct  SimulatorStateData
 Data for a specific simulation state. More...
 
class  SimulatorEnv
 Collection of environmental information for a simulation. More...
 
class  Profiling
 Collection of profiling information. More...
 
class  ConstraintsParam
 Collection of constraint parameters. More...
 
class  LegacyInput
 Collection of legacy input information. More...
 
class  InteractiveMD
 SimulatorBuilder parameter type for InteractiveMD. More...
 
class  IonSwapping
 Parameter type for IonSwapping SimulatorBuilder component. More...
 
class  TopologyData
 Collection of handles to topology information. More...
 
class  BoxDeformationHandle
 Handle to information about the box. More...
 
struct  IsSerializableEnum
 { More...
 
class  CheckpointData
 } More...
 
struct  MtsLevel
 Setting for a single level for multiple time step integration. More...
 
class  ElementNotFoundError
 Exception class signalling that a requested element was not found. More...
 
class  MissingElementConnectionError
 Exception class signalling that elements were not connected properly. More...
 
class  SimulationAlgorithmSetupError
 Exception class signalling that the ModularSimulatorAlgorithm was set up in an incompatible way. More...
 
class  CheckpointError
 Exception class signalling an error in reading or writing modular checkpoints. More...
 
struct  BenchmarkSystem
 Description of the system used for benchmarking. More...
 
class  Range
 Defines a range of integer numbers and accompanying operations. More...
 
class  AbstractOption
 Abstract base class for specifying option properties. More...
 
class  OptionTemplate
 Templated base class for constructing concrete option settings classes. More...
 
class  OptionInfo
 Gives information and allows modifications to an option after creation. More...
 
class  AbstractOptionSection
 Base class for specifying option section properties. More...
 
class  AbstractOptionSectionHandle
 Base class for handles to option sections. More...
 
class  BooleanOption
 Specifies an option that provides boolean values. More...
 
class  IntegerOption
 Specifies an option that provides integer values. More...
 
class  Int64Option
 Specifies an option that provides 64-bit integer values. More...
 
class  DoubleOption
 Specifies an option that provides floating-point (double) values. More...
 
class  FloatOption
 Specifies an option that provides floating-point (float) values. More...
 
class  StringOption
 Specifies an option that provides string values. More...
 
class  EnumOption
 Specifies an option that accepts an EnumerationArray of string values and writes the selected index into an enum variable. More...
 
class  LegacyEnumOption
 Specifies an option that accepts enumerated string values and writes the selected index into an enum variable. More...
 
class  BooleanOptionInfo
 Wrapper class for accessing boolean option information. More...
 
class  IntegerOptionInfo
 Wrapper class for accessing integer option information. More...
 
class  Int64OptionInfo
 Wrapper class for accessing 64-bit integer option information. More...
 
class  DoubleOptionInfo
 Wrapper class for accessing floating-point option information. More...
 
class  FloatOptionInfo
 Wrapper class for accessing floating-point option information. More...
 
class  StringOptionInfo
 Wrapper class for accessing string option information. More...
 
class  EnumOptionInfo
 Wrapper class for accessing enum option information. More...
 
class  FileNameOption
 Specifies an option that provides file names. More...
 
class  FileNameOptionInfo
 Wrapper class for accessing file name option information. More...
 
class  FileNameOptionManager
 Handles interaction of file name options with global options. More...
 
class  IOptionsBehavior
 Interface to provide extension points for options parsing. More...
 
class  IOptionsContainer
 Interface for adding input options. More...
 
class  IOptionsContainerWithSections
 Interface for adding input options with sections. More...
 
class  IOptionManager
 Base class for option managers. More...
 
class  Options
 Collection of options. More...
 
class  OptionSection
 Declares a simple option section. More...
 
class  OptionSectionHandle
 Allows adding options to an OptionSection. More...
 
class  RepeatingOptionSectionHandle
 Allows adding options to an RepeatingOptionSection. More...
 
class  RepeatingOptionSection
 Declares an option section that creates a structure for each instance. More...
 
class  TimeUnitManager
 Provides common functionality for time unit conversions. More...
 
class  TimeUnitBehavior
 Options behavior to add a time unit option. More...
 
class  ExponentialDistribution
 Exponential distribution. More...
 
class  GammaDistribution
 Gamma distribution. More...
 
class  NormalDistribution
 Normal distribution. More...
 
class  TabulatedNormalDistribution
 Tabulated normal random distribution. More...
 
class  ThreeFry2x64General
 General implementation class for ThreeFry counter-based random engines. More...
 
class  ThreeFry2x64
 ThreeFry2x64 random engine with 20 iteractions. More...
 
class  ThreeFry2x64Fast
 ThreeFry2x64 random engine with 13 iteractions. More...
 
class  UniformIntDistribution
 Uniform integer distribution. More...
 
class  UniformRealDistribution
 Uniform real distribution. More...
 
class  PotentialPointData
 Structure to hold the results of IRestraintPotential::evaluate(). More...
 
class  IRestraintPotential
 Interface for Restraint potentials. More...
 
class  AnalysisNeighborhoodPositions
 Input positions for neighborhood searching. More...
 
class  AnalysisNeighborhood
 Neighborhood searching for analysis tools. More...
 
class  AnalysisNeighborhoodPair
 Value type to represent a pair of positions found in neighborhood searching. More...
 
class  AnalysisNeighborhoodSearch
 Initialized neighborhood search with a fixed set of reference positions. More...
 
class  AnalysisNeighborhoodPairSearch
 Initialized neighborhood pair search with a fixed set of positions. More...
 
class  Selection
 Provides access to a single selection. More...
 
class  SelectionPosition
 Provides access to information about a single selected position. More...
 
class  SelectionCollection
 Collection of selections. More...
 
struct  SelectionTopologyProperties
 Describes topology properties required for selection evaluation. More...
 
class  SelectionOption
 Specifies an option that provides selection(s). More...
 
class  SelectionOptionInfo
 Wrapper class for accessing and modifying selection option information. More...
 
class  ITopologyProvider
 Provides topology information to SelectionOptionBehavior. More...
 
class  SelectionOptionBehavior
 Options behavior to allow using SelectionOptions. More...
 
class  SelectionOptionManager
 Handles interaction of selection options with other options and user input. More...
 
class  ConvertTprInfo
 Declares gmx convert-tpr. More...
 
class  RangePartitioning
 Division of a range of indices into consecutive blocks. More...
 
class  TrajectoryAnalysisModuleData
 Base class for thread-local data storage during trajectory analysis. More...
 
class  TrajectoryAnalysisModule
 Base class for trajectory analysis modules. More...
 
class  TrajectoryAnalysisSettings
 Trajectory analysis module configuration object. More...
 
class  TrajectoryAnalysisCommandLineRunner
 Runner for command-line trajectory analysis tools. More...
 
class  PrivateImplPointer
 Helper class to manage a pointer to a private implementation class. More...
 
class  DataFileOptions
 Search parameters for DataFileFinder. More...
 
struct  DataFileInfo
 Information about a data file found by DataFileFinder::enumerateFiles(). More...
 
class  DataFileFinder
 Searches data files from a set of paths. More...
 
class  ExceptionInfo
 Stores additional context information for exceptions. More...
 
class  ExceptionInitializer
 Provides information for Gromacs exception constructors. More...
 
class  GromacsException
 Base class for all exception objects in Gromacs. More...
 
class  FileIOError
 Exception class for file I/O errors. More...
 
class  UserInputError
 Exception class for user input errors. More...
 
class  InvalidInputError
 Exception class for situations where user input cannot be parsed/understood. More...
 
class  InconsistentInputError
 Exception class for situations where user input is inconsistent. More...
 
class  ToleranceError
 Exception class when a specified tolerance cannot be achieved. More...
 
class  SimulationInstabilityError
 Exception class for simulation instabilities. More...
 
class  InternalError
 Exception class for internal errors. More...
 
class  APIError
 Exception class for incorrect use of an API. More...
 
class  RangeError
 Exception class for out-of-range values or indices. More...
 
class  NotImplementedError
 Exception class for use of an unimplemented feature. More...
 
class  ParallelConsistencyError
 Exception class for use when ensuring that MPI ranks to throw in a coordinated fashion. More...
 
class  ModularSimulatorError
 Exception class for modular simulator. More...
 
class  FixedCapacityVector
 Vector that behaves likes std::vector but has fixed capacity. More...
 
class  FlagsTemplate
 Template class for typesafe handling of combination of flags. More...
 
struct  InstallationPrefixInfo
 Provides information about installation prefix (see IProgramContext::installationPrefix()). More...
 
class  IProgramContext
 Provides context information about the program that is calling the library. More...
 
class  StringFormatter
 Function object that wraps a call to formatString() that expects a single conversion argument, for use with algorithms. More...
 
class  IdentityFormatter
 Function object to implement the same interface as StringFormatter to use with strings that should not be formatted further. More...
 
class  TextLineWrapperSettings
 Stores settings for line wrapping. More...
 
class  TextLineWrapper
 Wraps lines to a predefined length. More...
 
class  NonbondedBenchmarkInfo
 Declares gmx nonbonded-bench. More...
 

Typedefs

typedef std::shared_ptr
< IAnalysisDataModule
AnalysisDataModulePointer
 Smart pointer for managing a generic analysis data module.
 
typedef ArrayRef< const
AnalysisDataValue
AnalysisDataValuesRef
 Shorthand for reference to an array of data values.
 
typedef std::shared_ptr
< AnalysisDataAverageModule
AnalysisDataAverageModulePointer
 Smart pointer to manage an AnalysisDataAverageModule object.
 
typedef std::shared_ptr
< AnalysisDataFrameAverageModule
AnalysisDataFrameAverageModulePointer
 Smart pointer to manage an AnalysisDataFrameAverageModule object.
 
typedef std::shared_ptr
< AnalysisDataDisplacementModule
AnalysisDataDisplacementModulePointer
 Smart pointer to manage an AnalysisDataDisplacementModule object.
 
typedef std::unique_ptr
< AbstractAverageHistogram
AverageHistogramPointer
 Smart pointer to manage an AbstractAverageHistogram object.
 
typedef std::shared_ptr
< AnalysisDataSimpleHistogramModule
AnalysisDataSimpleHistogramModulePointer
 Smart pointer to manage an AnalysisDataSimpleHistogramModule object.
 
typedef std::shared_ptr
< AnalysisDataWeightedHistogramModule
AnalysisDataWeightedHistogramModulePointer
 Smart pointer to manage an AnalysisDataWeightedHistogramModule object.
 
typedef std::shared_ptr
< AnalysisDataBinAverageModule
AnalysisDataBinAverageModulePointer
 Smart pointer to manage an AnalysisDataBinAverageModule object.
 
typedef std::shared_ptr
< AnalysisDataLifetimeModule
AnalysisDataLifetimeModulePointer
 Smart pointer to manage an AnalysisDataLifetimeModule object.
 
typedef std::shared_ptr
< AnalysisDataPlotModule
AnalysisDataPlotModulePointer
 Smart pointer to manage an AnalysisDataPlotModule object.
 
typedef std::shared_ptr
< AnalysisDataVectorPlotModule
AnalysisDataVectorPlotModulePointer
 Smart pointer to manage an AnalysisDataVectorPlotModule object.
 
typedef double awh_dvec [c_biasMaxNumDim]
 A real vector in AWH coordinate space.
 
typedef int awh_ivec [c_biasMaxNumDim]
 An integer vector in AWH coordinate space.
 
typedef std::unique_ptr
< ICommandLineModule
CommandLineModulePointer
 Smart pointer type for managing a ICommandLineModule.
 
typedef std::map< std::string,
CommandLineModulePointer
CommandLineModuleMap
 Container type for mapping module names to module objects.
 
typedef std::unique_ptr
< CommandLineModuleGroupData > 
CommandLineModuleGroupDataPointer
 Smart pointer type for managing a CommandLineModuleGroup.
 
typedef std::vector
< CommandLineModuleGroupDataPointer
CommandLineModuleGroupList
 Container type for keeping a list of module groups.
 
typedef std::unique_ptr
< ICommandLineOptionsModule
ICommandLineOptionsModulePointer
 Smart pointer to manage an ICommandLineOptionsModule.
 
typedef std::unique_ptr
< IExecutableEnvironment > 
ExecutableEnvironmentPointer
 Shorthand for a smart pointer to IExecutableEnvironment.
 
using TrajectoryFrameWriterPointer = std::unique_ptr< TrajectoryFrameWriter >
 Smart pointer to manage the TrajectoryFrameWriter object.
 
using OutputAdapterPointer = std::unique_ptr< IOutputAdapter >
 Smart pointer to manage the frame adapter object.
 
using OutputSelectorPointer = std::unique_ptr< OutputSelector >
 Smart pointer to manage the object.
 
using SetAtomsPointer = std::unique_ptr< SetAtoms >
 Smart pointer to manage the object.
 
using SetBoxPointer = std::unique_ptr< SetBox >
 Smart pointer to manage the object.
 
using SetForcesPointer = std::unique_ptr< SetForces >
 Smart pointer to manage the object.
 
using SetPrecisionPointer = std::unique_ptr< SetPrecision >
 Smart pointer to manage the outputselector object.
 
using SetStartTimePointer = std::unique_ptr< SetStartTime >
 Smart pointer to manage the object.
 
using SetTimeStepPointer = std::unique_ptr< SetTimeStep >
 Smart pointer to manage the object.
 
using SetVelocitiesPointer = std::unique_ptr< SetVelocities >
 Smart pointer to manage the object.
 
template<class T >
using HostAllocator = Allocator< T, HostAllocationPolicy >
 Memory allocator that uses HostAllocationPolicy. More...
 
template<class T >
using HostVector = std::vector< T, HostAllocator< T >>
 Convenience alias for std::vector that uses HostAllocator.
 
template<class T >
using PaddedHostVector = PaddedVector< T, HostAllocator< T >>
 Convenience alias for PaddedVector that uses HostAllocator.
 
typedef enum gmx::IMDType_t IMDMessageType
 Enum for types of IMD messages. More...
 
template<class ElementType >
using BasicMatrix3x3 = MultiDimArray< std::array< ElementType, 3 *3 >, extents< 3, 3 >>
 Three-by-three matrix of ElementType. More...
 
using Matrix3x3 = BasicMatrix3x3< real >
 Three-by-three real number matrix. More...
 
using Matrix3x3Span = Matrix3x3::view_type
 Convenience alias for a matrix view.
 
using Matrix3x3ConstSpan = Matrix3x3::const_view_type
 Convenience alias for a const matrix view.
 
typedef BasicVector< realRVec
 Shorthand for C++ rvec-equivalent type.
 
typedef BasicVector< double > DVec
 Shorthand for C++ dvec-equivalent type.
 
typedef BasicVector< int > IVec
 Shorthand for C++ ivec-equivalent type.
 
typedef std::array
< SimulationSignal, eglsNR > 
SimulationSignals
 Convenience typedef for the group of signals used.
 
using VirialHandling = VirtualSitesHandler::VirialHandling
 VirialHandling is often used outside VirtualSitesHandler class members.
 
typedef std::array
< std::vector< int >
, c_ftypeVsiteEnd-c_ftypeVsiteStart
VsitePbc
 Type for storing PBC atom information for all vsite types in the system.
 
using SimulatorFunctionType ) = void(
 Function type for simulator code.
 
using LogFilePtr = std::unique_ptr< t_fileio, functor_wrapper< t_fileio, closeLogFile >>
 Simple guard pointer See unique_cptr for details.
 
using dynamicExtents2D = extents< dynamic_extent, dynamic_extent >
 Convenience type for often-used two dimensional extents.
 
using dynamicExtents3D = extents< dynamic_extent, dynamic_extent, dynamic_extent >
 Convenience type for often-used three dimensional extents.
 
template<class T , ptrdiff_t... Indices>
using mdspan = basic_mdspan< T, extents< Indices...>, layout_right, accessor_basic< T >>
 basic_mdspan with wrapped indices, basic_accessor policiy and right-aligned memory layout.
 
using ReadCheckpointData = CheckpointData< CheckpointDataOperation::Read >
 Convenience shortcut for reading checkpoint data.
 
using WriteCheckpointData = CheckpointData< CheckpointDataOperation::Write >
 Convenience shortcut for writing checkpoint data.
 
typedef std::function< void()> CheckBondedInteractionsCallback
 The function type allowing to request a check of the number of bonded interactions.
 
using Step = int64_t
 Step number.
 
using Time = double
 Simulation time.
 
typedef std::function< void()> SimulatorRunFunction
 The function type that can be scheduled to be run during the simulator run.
 
typedef std::function< void(SimulatorRunFunction)> RegisterRunFunction
 The function type that allows to register run functions.
 
typedef std::function< void(Step,
Time)> 
SignallerCallback
 The function type that can be registered to signallers for callback.
 
typedef std::function< void(gmx_mdoutf
*, Step, Time, bool, bool)> 
ITrajectoryWriterCallback
 Function type for trajectory writing clients.
 
typedef std::function< void(Step)> PropagatorCallback
 Generic callback to the propagator.
 
using TemperatureCouplingType = int
 Typedef to match current use of ints as types.
 
typedef std::unique_ptr
< IHelpTopic > 
HelpTopicPointer
 Smart pointer type to manage a IHelpTopic object.
 
typedef FloatOption RealOption
 Typedef for either DoubleOption or FloatOption, depending on precision. More...
 
typedef FloatOptionInfo RealOptionInfo
 Typedef for either DoubleOptionInfo or FloatOptionInfo, depending on precision. More...
 
typedef std::shared_ptr
< IOptionsBehavior
OptionsBehaviorPointer
 Smart pointer for behaviors stored in OptionsBehaviorCollection.
 
typedef std::random_device RandomDevice
 Random device. More...
 
typedef ThreeFry2x64Fast DefaultRandomEngine
 Default fast and accurate random engine in Gromacs. More...
 
using Vector = ::gmx::RVec
 Provide a vector type name with a more stable interface than RVec and a more stable implementation than vec3<>.
 
typedef std::list
< SelectionParserValue > 
SelectionParserValueList
 Container for a list of SelectionParserValue objects.
 
typedef std::unique_ptr
< SelectionParserValueList
SelectionParserValueListPointer
 Smart pointer type for managing a SelectionParserValueList.
 
typedef std::list
< SelectionParserParameter > 
SelectionParserParameterList
 Container for a list of SelectionParserParameter objects.
 
typedef std::unique_ptr
< SelectionParserParameterList
SelectionParserParameterListPointer
 Smart pointer type for managing a SelectionParserParameterList.
 
typedef std::vector< SelectionSelectionList
 Container of selections used in public selection interfaces.
 
typedef std::unique_ptr
< internal::SelectionData > 
SelectionDataPointer
 Smart pointer for managing an internal selection data object.
 
typedef std::vector
< SelectionDataPointer
SelectionDataList
 Container for storing a list of selections internally.
 
typedef std::shared_ptr
< SelectionTreeElement > 
SelectionTreeElementPointer
 Smart pointer type for selection tree element pointers.
 
using GpuTasksOnRanks = std::vector< std::vector< GpuTask >>
 Container of compute tasks suitable to run on a GPU e.g. on each rank of a node.
 
using GpuTaskAssignment = std::vector< GpuTaskMapping >
 Container of GPU tasks on a rank, specifying the task type and GPU device ID, e.g. potentially ready for consumption by the modules on that rank.
 
using BoxMatrix = std::array< std::array< real, 3 >, 3 >
 A 3x3 matrix data type useful for simulation boxes. More...
 
typedef std::unique_ptr
< TrajectoryAnalysisModuleData
TrajectoryAnalysisModuleDataPointer
 Smart pointer to manage a TrajectoryAnalysisModuleData object.
 
typedef std::unique_ptr
< TrajectoryAnalysisModule
TrajectoryAnalysisModulePointer
 Smart pointer to manage a TrajectoryAnalysisModule.
 
template<class T >
using AlignedAllocator = Allocator< T, AlignedAllocationPolicy >
 Aligned memory allocator. More...
 
template<class T >
using PageAlignedAllocator = Allocator< T, PageAlignedAllocationPolicy >
 PageAligned memory allocator. More...
 
using index = std::ptrdiff_t
 Integer type for indexing into arrays or vectors. More...
 
typedef ExceptionInfo< struct
ExceptionInfoErrno_, int > 
ExceptionInfoErrno
 Stores errno value that triggered the exception.
 
typedef ExceptionInfo< struct
ExceptionInfoApiFunc_, const
char * > 
ExceptionInfoApiFunction
 Stores the function name that returned the errno in ExceptionInfoErrno.
 
typedef ExceptionInfo< struct
ExceptionInfoLocation_,
ThrowLocation > 
ExceptionInfoLocation
 Stores the location where the exception was thrown.
 
using FilePtr = std::unique_ptr< FILE, functor_wrapper< FILE, fclose_wrapper >>
 Simple guard pointer which calls fclose. See unique_cptr for details.
 
using MPI_Comm_ptr = gmx::unique_cptr< MPI_Comm, MPI_Comm_free_wrapper >
 Make a smart pointer for MPI communicators.
 
typedef std::shared_ptr
< TextInputStream > 
TextInputStreamPointer
 Shorthand for a smart pointer to a TextInputStream.
 
typedef std::shared_ptr
< TextOutputStream > 
TextOutputStreamPointer
 Shorthand for a smart pointer to a TextOutputStream.
 
template<typename T , void D = sfree_wrapper>
using unique_cptr = std::unique_ptr< T, functor_wrapper< T, D >>
 unique_ptr which takes function pointer (has to return void) as template argument
 
typedef unique_cptr< void > sfree_guard
 Simple guard which calls sfree. See unique_cptr for details.
 
using ClContext = ClHandle< cl_context >
 Convenience declarations.
 
using ClCommandQueue = ClHandle< cl_command_queue >
 
using ClProgram = ClHandle< cl_program >
 
using ClKernel = ClHandle< cl_kernel >
 

Enumerations

enum  AwhOutputEntryType {
  AwhOutputEntryType::MetaData, AwhOutputEntryType::CoordValue, AwhOutputEntryType::Pmf, AwhOutputEntryType::Bias,
  AwhOutputEntryType::Visits, AwhOutputEntryType::Weights, AwhOutputEntryType::Target, AwhOutputEntryType::ForceCorrelationVolume,
  AwhOutputEntryType::FrictionTensor
}
 Enum with the AWH variables to write. More...
 
enum  AwhOutputMetaData { AwhOutputMetaData::NumBlock, AwhOutputMetaData::TargetError, AwhOutputMetaData::ScaledSampleWeight, AwhOutputMetaData::Count }
 Enum with the types of metadata to write. More...
 
enum  Normalization { Normalization::None, Normalization::Coordinate, Normalization::FreeEnergy, Normalization::Distribution }
 Enum with different ways of normalizing the output. More...
 
enum  DensityFittingAmplitudeMethod : int { DensityFittingAmplitudeMethod::Unity, DensityFittingAmplitudeMethod::Mass, DensityFittingAmplitudeMethod::Charge, Count }
 The methods that determine how amplitudes are spread on a grid in density guided simulations. More...
 
enum  CoordinateFileFlags : unsigned long {
  CoordinateFileFlags::Base = 1 << 0, CoordinateFileFlags::RequireForceOutput = 1 << 1, CoordinateFileFlags::RequireVelocityOutput = 1 << 2, CoordinateFileFlags::RequireAtomConnections = 1 << 3,
  CoordinateFileFlags::RequireAtomInformation = 1 << 4, CoordinateFileFlags::RequireChangedOutputPrecision = 1 << 5, CoordinateFileFlags::RequireNewFrameStartTime = 1 << 6, CoordinateFileFlags::RequireNewFrameTimeStep = 1 << 7,
  CoordinateFileFlags::RequireNewBox = 1 << 8, CoordinateFileFlags::RequireCoordinateSelection = 1 << 9, CoordinateFileFlags::Count
}
 The enums here define the flags specifying the requirements of different outputadapter modules. More...
 
enum  ChangeSettingType : int { PreservedIfPresent, Always, Never, Count }
 Enum class for setting basic flags in a t_trxframe.
 
enum  ChangeAtomsType {
  PreservedIfPresent, AlwaysFromStructure, Never, Always,
  Count
}
 Enum class for t_atoms settings.
 
enum  ChangeFrameInfoType { PreservedIfPresent, Always, Count }
 Enum class for setting fields new or not.
 
enum  ChangeFrameTimeType {
  PreservedIfPresent, StartTime, TimeStep, Both,
  Count
}
 Enum class for setting frame time from user input.
 
enum  DdRankOrder {
  DdRankOrder::select, DdRankOrder::interleave, DdRankOrder::pp_pme, DdRankOrder::cartesian,
  DdRankOrder::Count
}
 The options for the domain decomposition MPI task ordering. More...
 
enum  DlbOption {
  DlbOption::select, DlbOption::turnOnWhenUseful, DlbOption::no, DlbOption::yes,
  DlbOption::Count
}
 The options for the dynamic load balancing. More...
 
enum  SpaceGroup : int32_t { SpaceGroup::P1 = 1 }
 Space group in three dimensions. More...
 
enum  MrcDataMode : int32_t {
  MrcDataMode::uInt8 = 0, MrcDataMode::int16 = 1, MrcDataMode::float32 = 2, MrcDataMode::complexInt32 = 3,
  MrcDataMode::complexFloat64 = 4
}
 The type of density data stored in an mrc file. As named in "EMDB Map Distribution Format Description Version 1.01 (c) emdatabank.org 2014" Modes 0-4 are defined by the standard. NOTE only mode 2 is currently implemented and used. More...
 
enum  TimeUnit : int {
  Femtoseconds, Picoseconds, Nanoseconds, Microseconds,
  Milliseconds, Seconds, Count, Default = Picoseconds
}
 Time values for TimeUnitManager and legacy oenv module.
 
enum  DeviceStreamType : int {
  DeviceStreamType::NonBondedLocal, DeviceStreamType::NonBondedNonLocal, DeviceStreamType::Pme, DeviceStreamType::PmePpTransfer,
  DeviceStreamType::UpdateAndConstraints, DeviceStreamType::Count
}
 Class enum to describe the different logical streams used for GPU work. More...
 
enum  PinningPolicy : int { CannotBePinned, PinnedIfSupported }
 Helper enum for pinning policy of the allocation of HostAllocationPolicy. More...
 
enum  Architecture { Unknown, Architecture::X86, Architecture::Arm, Architecture::PowerPC }
 Enum for GROMACS CPU hardware detection support. More...
 
enum  IMDType_t {
  IMD_DISCONNECT, IMD_ENERGIES, IMD_FCOORDS, IMD_GO,
  IMD_HANDSHAKE, IMD_KILL, IMD_MDCOMM, IMD_PAUSE,
  IMD_TRATE, IMD_IOERROR, IMD_NR
}
 Enum for types of IMD messages. More...
 
enum  DensitySimilarityMeasureMethod : int { DensitySimilarityMeasureMethod::innerProduct, DensitySimilarityMeasureMethod::relativeEntropy, DensitySimilarityMeasureMethod::crossCorrelation, Count }
 The methods that determine how two densities are compared to one another. More...
 
enum  CheckpointSignal { noSignal = 0, doCheckpoint = 1 }
 Checkpoint signals. More...
 
enum  ConstraintVariable : int {
  Positions, Velocities, Derivative, Deriv_FlexCon,
  Force, ForceDispl
}
 Describes supported flavours of constrained updates.
 
enum  FlexibleConstraintTreatment { FlexibleConstraintTreatment::Include, FlexibleConstraintTreatment::Exclude }
 Tells make_at2con how to treat flexible constraints. More...
 
enum  NumTempScaleValues { NumTempScaleValues::None = 0, NumTempScaleValues::Single = 1, NumTempScaleValues::Multiple = 2, NumTempScaleValues::Count = 3 }
 Sets the number of different temperature coupling values. More...
 
enum  VelocityScalingType { VelocityScalingType::None = 0, VelocityScalingType::Diagonal = 1, VelocityScalingType::Count = 2 }
 Different variants of the Parrinello-Rahman velocity scaling. More...
 
enum  ResetSignal { noSignal = 0, doResetCounters = 1 }
 Reset signals. More...
 
enum  StopSignal { noSignal = 0, stopAtNextNSStep = 1, stopImmediately = -1 }
 Stop signals. More...
 
enum  PbcMode { PbcMode::all, PbcMode::none }
 PBC modes for vsite construction and spreading. More...
 
enum  VirtualSiteVirialHandling : int { VirtualSiteVirialHandling::None, VirtualSiteVirialHandling::Pbc, VirtualSiteVirialHandling::NonLinear }
 Tells how to handle virial contributions due to virtual sites. More...
 
enum  StartingBehavior : int { StartingBehavior::RestartWithAppending, StartingBehavior::RestartWithoutAppending, StartingBehavior::NewSimulation, StartingBehavior::Count }
 Enumeration for describing how mdrun is (re)starting. More...
 
enum  : std::ptrdiff_t { dynamic_extent = -1 }
 Define constant that signals dynamic extent.
 
enum  {
  eawhtargetCONSTANT, eawhtargetCUTOFF, eawhtargetBOLTZMANN, eawhtargetLOCALBOLTZMANN,
  eawhtargetNR
}
 Target distribution enum.
 
enum  { eawhgrowthEXP_LINEAR, eawhgrowthLINEAR, eawhgrowthNR }
 Weight histogram growth enum.
 
enum  { eawhpotentialCONVOLVED, eawhpotentialUMBRELLA, eawhpotentialNR }
 AWH potential type enum.
 
enum  { eawhcoordproviderPULL, eawhcoordproviderFREE_ENERGY_LAMBDA, eawhcoordproviderNR }
 AWH bias reaction coordinate provider.
 
enum  CheckpointDataOperation { Read, Write, Count }
 
enum  AtomLocality : int { AtomLocality::Local = 0, AtomLocality::NonLocal = 1, AtomLocality::All = 2, AtomLocality::Count = 3 }
 Atom locality indicator: local, non-local, all. More...
 
enum  InteractionLocality : int { InteractionLocality::Local = 0, InteractionLocality::NonLocal = 1, InteractionLocality::Count = 2 }
 Interaction locality indicator: local, non-local, all. More...
 
enum  AppendingBehavior { AppendingBehavior::Auto, AppendingBehavior::Appending, AppendingBehavior::NoAppending }
 Enumeration for mdrun appending behavior. More...
 
enum  MtsForceGroups : int {
  MtsForceGroups::LongrangeNonbonded, MtsForceGroups::Nonbonded, MtsForceGroups::Pair, MtsForceGroups::Dihedral,
  MtsForceGroups::Angle, MtsForceGroups::Pull, MtsForceGroups::Awh, MtsForceGroups::Count
}
 Force group available for selection for multiple time step integration. More...
 
enum  ComputeGlobalsAlgorithm { LeapFrog, VelocityVerlet }
 The different global reduction schemes we know about.
 
enum  EnergySignallerEvent { EnergyCalculationStep, VirialCalculationStep, FreeEnergyCalculationStep }
 The energy events signalled by the EnergySignaller.
 
enum  TrajectoryEvent { StateWritingStep, EnergyWritingStep }
 The trajectory writing events.
 
enum  ModularSimulatorBuilderState { AcceptingClientRegistrations, NotAcceptingClientRegistrations }
 Enum allowing builders to store whether they can accept client registrations.
 
enum  RegisterWithThermostat { True, False }
 Whether built propagator should be registered with thermostat.
 
enum  RegisterWithBarostat { True, False }
 Whether built propagator should be registered with barostat.
 
enum  IntegrationStep {
  PositionsOnly, VelocitiesOnly, LeapFrog, VelocityVerletPositionsAndVelocities,
  Count
}
 The different integration types we know about. More...
 
enum  NumVelocityScalingValues { NumVelocityScalingValues::None, NumVelocityScalingValues::Single, NumVelocityScalingValues::Multiple, Count }
 Sets the number of different velocity scaling values. More...
 
enum  ParrinelloRahmanVelocityScaling { ParrinelloRahmanVelocityScaling::No, ParrinelloRahmanVelocityScaling::Diagonal, ParrinelloRahmanVelocityScaling::Full, Count }
 Sets the type of Parrinello-Rahman pressure scaling. More...
 
enum  UseFullStepKE { Yes, No, Count }
 Enum describing whether the thermostat is using full or half step kinetic energy.
 
enum  ReportPreviousStepConservedEnergy { Yes, No, Count }
 Enum describing whether the thermostat is reporting conserved energy from the previous step.
 
enum  OptionFileType {
  eftUnknown, eftTopology, eftRunInput, eftTrajectory,
  eftEnergy, eftPDB, eftIndex, eftPlot,
  eftGenericData, eftCsv, eftOptionFileType_NR
}
 Purpose of file(s) provided through an option.
 
enum  COMShiftType : int { Residue, Molecule, Count }
 How COM shifting should be applied.
 
enum  CenteringType : int { Triclinic, Rectangular, Zero, Count }
 Helper enum class to define centering types.
 
enum  UnitCellType : int { Triclinic, Rectangular, Compact, Count }
 Helper enum class to define Unit cell representation types.
 
enum  RandomDomain {
  RandomDomain::Other = 0x00000000, RandomDomain::MaxwellVelocities = 0x00001000, RandomDomain::TestParticleInsertion = 0x00002000, RandomDomain::UpdateCoordinates = 0x00003000,
  RandomDomain::UpdateConstraints = 0x00004000, RandomDomain::Thermostat = 0x00005000, RandomDomain::Barostat = 0x00006000, RandomDomain::ReplicaExchange = 0x00007000,
  RandomDomain::ExpandedEnsemble = 0x00008000, RandomDomain::AwhBiasing = 0x00009000
}
 Enumerated values for fixed part of random seed (domain) More...
 
enum  TaskTarget : int { Auto, Cpu, Gpu }
 Record where a compute task is targetted.
 
enum  EmulateGpuNonbonded : bool { EmulateGpuNonbonded::No, EmulateGpuNonbonded::Yes }
 Help pass GPU-emulation parameters with type safety. More...
 
enum  GpuTask : int { GpuTask::Nonbonded, GpuTask::Pme, GpuTask::Count }
 Types of compute tasks that can be run on a GPU. More...
 
enum  ErrorCode {
  eeOK, eeOutOfMemory, eeFileNotFound, eeFileIO,
  eeInvalidInput, eeInconsistentInput, eeTolerance, eeInstability,
  eeNotImplemented, eeInvalidValue, eeInvalidCall, eeInternalError,
  eeAPIError, eeRange, eeParallelConsistency, eeModularSimulator,
  eeUnknownError
}
 Possible error return codes from Gromacs functions. More...
 
enum  EndianSwapBehavior : int {
  EndianSwapBehavior::DoNotSwap, EndianSwapBehavior::Swap, EndianSwapBehavior::SwapIfHostIsBigEndian, EndianSwapBehavior::SwapIfHostIsLittleEndian,
  EndianSwapBehavior::Count
}
 Specify endian swapping behavoir. More...
 

Functions

AnalysisHistogramSettingsInitializer histogramFromRange (real min, real max)
 Initializes a histogram using a range and a bin width. More...
 
AnalysisHistogramSettingsInitializer histogramFromBins (real start, int nbins, real binwidth)
 Initializes a histogram using bin width and the number of bins. More...
 
static bool anyDimUsesProvider (const AwhBiasParams &awhBiasParams, const int awhCoordProvider)
 Checks whether any dimension uses the given coordinate provider type. More...
 
static bool anyDimUsesProvider (const AwhParams &awhParams, const int awhCoordProvider)
 Checks whether any dimension uses the given coordinate provider type. More...
 
static bool anyDimUsesPull (const ArrayRef< BiasCoupledToSystem > biasCoupledToSystem)
 Checks whether any dimension uses pulling as a coordinate provider. More...
 
std::unique_ptr< Awh > prepareAwhModule (FILE *fplog, const t_inputrec &inputRecord, t_state *stateGlobal, const t_commrec *commRecord, const gmx_multisim_t *multiSimRecord, bool startingFromCheckpoint, bool usingShellParticles, const std::string &biasInitFilename, pull_t *pull_work)
 Makes an Awh and prepares to use it if the user input requests that. More...
 
static int64_t countSamples (const std::vector< PointState > &pointState)
 Count the total number of samples / sample weight over all grid points. More...
 
static void ensureStateAndRunConsistency (const BiasParams &params, const BiasState &state)
 Check if the state (loaded from checkpoint) and the run are consistent. More...
 
double getDeviationFromPointAlongGridAxis (const BiasGrid &grid, int dimIndex, int pointIndex, double value)
 Get the deviation along one dimension from the given value to a point in the grid. More...
 
double getDeviationFromPointAlongGridAxis (const BiasGrid &grid, int dimIndex, int pointIndex1, int pointIndex2)
 Get the deviation from one point to another along one dimension in the grid. More...
 
bool pointsAlongLambdaAxis (const BiasGrid &grid, int pointIndex1, int pointIndex2)
 Checks whether two points are along a free energy lambda state axis. More...
 
bool pointsHaveDifferentLambda (const BiasGrid &grid, int pointIndex1, int pointIndex2)
 Checks whether two points are different in the free energy lambda state dimension (if any). More...
 
void linearArrayIndexToMultiDim (int indexLinear, int ndim, const awh_ivec numPointsDim, awh_ivec indexMulti)
 Convert a linear array index to a multidimensional one. More...
 
void linearGridindexToMultiDim (const BiasGrid &grid, int indexLinear, awh_ivec indexMulti)
 Convert a linear grid point index to a multidimensional one. More...
 
int multiDimArrayIndexToLinear (const awh_ivec indexMulti, int numDim, const awh_ivec numPointsDim)
 Convert multidimensional array index to a linear one. More...
 
int multiDimGridIndexToLinear (const BiasGrid &grid, const awh_ivec indexMulti)
 Convert a multidimensional grid point index to a linear one. More...
 
bool advancePointInSubgrid (const BiasGrid &grid, const awh_ivec subgridOrigin, const awh_ivec subgridNpoints, int *gridPointIndex)
 Find the next grid point in the sub-part of the grid given a starting point. More...
 
static int pointDistanceAlongAxis (const GridAxis &axis, double x, double x0)
 Returns the point distance between from value x to value x0 along the given axis. More...
 
static bool valueIsInGrid (const awh_dvec value, const std::vector< GridAxis > &axis)
 Query if a value is in range of the grid. More...
 
static int getNearestIndexInGrid (const awh_dvec value, const std::vector< GridAxis > &axis)
 Map a value to the nearest point in the grid. More...
 
void mapGridToDataGrid (std::vector< int > *gridpointToDatapoint, const double *const *data, int numDataPoints, const std::string &dataFilename, const BiasGrid &grid, const std::string &correctFormatMessage)
 Maps each point in the grid to a point in the data grid. More...
 
bool haveBiasSharingWithinSimulation (const AwhParams &awhParams)
 Returns if any bias is sharing within a simulation. More...
 
void biasesAreCompatibleForSharingBetweenSimulations (const AwhParams &awhParams, const std::vector< size_t > &pointSize, const gmx_multisim_t *multiSimComm)
 Checks if biases are compatible for sharing between simulations, throws if not. More...
 
static void normalizeFreeEnergyAndPmfSum (std::vector< PointState > *pointState)
 Normalizes the free energy and PMF sum. More...
 
static int countTrailingZeroRows (const double *const *data, int numRows, int numColumns)
 Count trailing data rows containing only zeros. More...
 
static void readUserPmfAndTargetDistribution (const std::vector< DimParams > &dimParams, const BiasGrid &grid, const std::string &filename, int numBias, int biasIndex, std::vector< PointState > *pointState)
 Initializes the PMF and target with data read from an input table. More...
 
static void normalizeBlock (AwhEnergyBlock *block, const Bias &bias)
 Normalizes block data for output. More...
 
void initCorrelationGridHistory (CorrelationGridHistory *correlationGridHistory, int numCorrelationTensors, int tensorSize, int blockDataListSize)
 Initialize correlation grid history, sets all sizes. More...
 
CorrelationGridHistory initCorrelationGridHistoryFromState (const CorrelationGrid &corrGrid)
 Allocate a correlation grid history with the same structure as the given correlation grid. More...
 
void updateCorrelationGridHistory (CorrelationGridHistory *corrGridHist, const CorrelationGrid &corrGrid)
 Update the correlation grid history for checkpointing. More...
 
void restoreCorrelationGridStateFromHistory (const CorrelationGridHistory &corrGridHist, CorrelationGrid *corrGrid)
 Restores the correlation grid state from the correlation grid history. More...
 
AwhParams * readAwhParams (std::vector< t_inpfile > *inp, warninp_t wi)
 Allocate and initialize the AWH parameters with values from the input file. More...
 
void checkAwhParams (const AwhParams *awhParams, const t_inputrec *inputrec, warninp_t wi)
 Check the AWH parameters. More...
 
static double get_pull_coord_period (const t_pull_coord &pullCoordParams, const t_pbc &pbc, const real intervalLength)
 Gets the period of a pull coordinate. More...
 
static bool intervalIsInPeriodicInterval (double origin, double end, double period)
 Checks if the given interval is defined in the correct periodic interval. More...
 
static bool valueIsInInterval (double origin, double end, double period, double value)
 Checks if a value is within an interval. More...
 
static void checkInputConsistencyInterval (const AwhParams *awhParams, warninp_t wi)
 Check if the starting configuration is consistent with the given interval. More...
 
static void setStateDependentAwhPullDimParams (AwhDimParams *dimParams, const int biasIndex, const int dimIndex, const pull_params_t *pull_params, pull_t *pull_work, const t_pbc &pbc, const tensor &compressibility, warninp_t wi)
 Sets AWH parameters, for one AWH pull dimension. More...
 
void setStateDependentAwhParams (AwhParams *awhParams, const pull_params_t &pull_params, pull_t *pull_work, const matrix box, PbcType pbcType, const tensor &compressibility, const t_grpopts *inputrecGroupOptions, real initLambda, const gmx_mtop_t &mtop, warninp_t wi)
 Sets AWH parameters that need state parameters such as the box vectors. More...
 
bool operator== (const DensityFittingParameters &lhs, const DensityFittingParameters &rhs)
 Check if two structs holding density fitting parameters are equal. More...
 
bool operator!= (const DensityFittingParameters &lhs, const DensityFittingParameters &rhs)
 Check if two structs holding density fitting parameters are not equal. More...
 
std::unique_ptr< IMDModule > createElectricFieldModule ()
 Creates a module for an external electric field. More...
 
CommandLineProgramContext & initForCommandLine (int *argc, char ***argv)
 Initializes the GROMACS library for command-line use. More...
 
void finalizeForCommandLine ()
 Deinitializes the GROMACS library after initForCommandLine(). More...
 
int processExceptionAtExitForCommandLine (const std::exception &ex)
 Handles an exception and deinitializes after initForCommandLine. More...
 
int runCommandLineModule (int argc, char *argv[], ICommandLineModule *module)
 Implements a main() method that runs a single module. More...
 
int runCommandLineModule (int argc, char *argv[], const char *name, const char *description, std::function< std::unique_ptr< ICommandLineOptionsModule >()> factory)
 Implements a main() method that runs a single module. More...
 
static int getFileType (const std::string &filename)
 Get the internal file type from the filename. More...
 
static unsigned long getSupportedOutputAdapters (int filetype)
 Get the flag representing the requirements for a given file output. More...
 
static OutputAdapterContainer addOutputAdapters (const OutputRequirements &requirements, AtomsDataPtr atoms, const Selection &sel, unsigned long abilities)
 Creates a new container object with the user requested IOutputAdapter derived methods attached to it. More...
 
std::unique_ptr
< TrajectoryFrameWriter
createTrajectoryFrameWriter (const gmx_mtop_t *top, const Selection &sel, const std::string &filename, AtomsDataPtr atoms, OutputRequirements requirements)
 Factory function for TrajectoryFrameWriter. More...
 
static void deepCopy_t_trxframe (const t_trxframe &input, t_trxframe *copy, RVec *xvec, RVec *vvec, RVec *fvec, int *indexvec)
 Create a deep copy of a t_trxframe input into copy. More...
 
static t_trxstatus * openTNG (const std::string &name, const Selection &sel, const gmx_mtop_t *mtop)
 Method to open TNG file. More...
 
unsigned long convertFlag (CoordinateFileFlags flag)
 Conversion of flag to its corresponding unsigned long value.
 
static void adjustAtomInformation (t_atoms *atoms, t_atoms *selectionAtoms, const Selection &sel)
 Modify atoms information in coordinate frame to fit output selection. More...
 
void mdAlgorithmsSetupAtomData (const t_commrec *cr, const t_inputrec *ir, const gmx_mtop_t &top_global, gmx_localtop_t *top, t_forcerec *fr, ForceBuffers *force, MDAtoms *mdAtoms, Constraints *constr, VirtualSitesHandler *vsite, gmx_shellfc_t *shellfc)
 Sets atom data for several MD algorithms. More...
 
void make_local_shells (const t_commrec *cr, const t_mdatoms *md, gmx_shellfc_t *shfc)
 Gets the local shell with domain decomposition. More...
 
template<typename ValueType >
void readKvtCheckpointValue (compat::not_null< ValueType * > value, const std::string &name, const std::string &identifier, const KeyValueTreeObject &kvt)
 Read to a key-value-tree value used for checkpointing. More...
 
template void readKvtCheckpointValue (compat::not_null< std::int64_t * > value, const std::string &name, const std::string &identifier, const KeyValueTreeObject &kvt)
 Read to a key-value-tree value used for checkpointing. More...
 
template void readKvtCheckpointValue (compat::not_null< real * > value, const std::string &name, const std::string &identifier, const KeyValueTreeObject &kvt)
 Read to a key-value-tree value used for checkpointing. More...
 
template<typename ValueType >
void writeKvtCheckpointValue (const ValueType &value, const std::string &name, const std::string &identifier, KeyValueTreeObjectBuilder kvtBuilder)
 Write to a key-value-tree used for checkpointing. More...
 
template void writeKvtCheckpointValue (const std::int64_t &value, const std::string &name, const std::string &identifier, KeyValueTreeObjectBuilder kvtBuilder)
 Write to a key-value-tree used for checkpointing. More...
 
template void writeKvtCheckpointValue (const real &value, const std::string &name, const std::string &identifier, KeyValueTreeObjectBuilder kvtBuilder)
 Write to a key-value-tree used for checkpointing. More...
 
size_t numberOfExpectedDataItems (const MrcDensityMapHeader &header)
 Return the number of density data items that are expected to follow this header. More...
 
TranslateAndScale getCoordinateTransformationToLattice (const MrcDensityMapHeader &header)
 Extract the transformation into lattice coordinates. More...
 
dynamicExtents3D getDynamicExtents3D (const MrcDensityMapHeader &header)
 Extract the extents of the density data. More...
 
bool mrcHeaderIsSane (const MrcDensityMapHeader &header)
 Checks if the values in the header are sane. More...
 
void serializeMrcDensityMapHeader (ISerializer *serializer, const MrcDensityMapHeader &mrcHeader)
 Serializes an MrcDensityMapHeader from a given serializer. More...
 
MrcDensityMapHeader deserializeMrcDensityMapHeader (ISerializer *serializer)
 Deserializes an MrcDensityMapHeader from a given serializer. More...
 
template<class T1 , class T2 >
bool operator== (const Allocator< T1, HostAllocationPolicy > &a, const Allocator< T2, HostAllocationPolicy > &b)
 Return true if two allocators are identical. More...
 
template<typename PinnableVector >
void changePinningPolicy (PinnableVector *v, PinningPolicy pinningPolicy)
 Helper function for changing the pinning policy of a pinnable vector. More...
 
void pinBuffer (void *pointer, std::size_t numBytes) noexcept
 Pin the allocation to physical memory. More...
 
void unpinBuffer (void *pointer) noexcept
 Unpin the allocation. More...
 
void doDeviceTransfers (const DeviceInformation &deviceInfo, ArrayRef< const char > input, ArrayRef< char > output)
 Helper function for GPU test code to be platform agnostic. More...
 
bool cpuIsX86Nehalem (const CpuInfo &cpuInfo)
 Return true if the CPU is an Intel x86 Nehalem. More...
 
static DeviceDetectionResult detectAllDeviceInformation (const PhysicalNodeCommunicator &physicalNodeComm)
 Detect GPUs when that makes sense to attempt. More...
 
static void gmx_collect_hardware_mpi (const gmx::CpuInfo &cpuInfo, const PhysicalNodeCommunicator &physicalNodeComm, gmx_hw_info_t *hardwareInfo)
 Reduce the locally collected hardwareInfo over MPI ranks.
 
void hardwareTopologyDoubleCheckDetection (const gmx::MDLogger &mdlog, const gmx::HardwareTopology &hardwareTopology)
 Sanity check hardware topology and print some notes to log. More...
 
std::unique_ptr< gmx_hw_info_t > gmx_detect_hardware (const PhysicalNodeCommunicator &physicalNodeComm)
 Run detection and make correct and consistent hardware information available on all ranks. More...
 
void logHardwareDetectionWarnings (const gmx::MDLogger &mdlog, const gmx_hw_info_t &hardwareInformation)
 Issue warnings to mdlog that were decided during detection. More...
 
static bool runningOnCompatibleOSForAmd ()
 Return true if executing on compatible OS for AMD OpenCL. More...
 
static bool runningOnCompatibleHWForNvidia (const DeviceInformation &deviceInfo)
 Return true if executing on compatible GPU for NVIDIA OpenCL. More...
 
static DeviceStatus isDeviceFunctional (const DeviceInformation &deviceInfo)
 Checks that device deviceInfo is compatible with GROMACS. More...
 
std::string makeOpenClInternalErrorString (const char *message, cl_int status)
 Make an error string following an OpenCL API call. More...
 
static bool isDeviceFunctional (const DeviceInformation &deviceInfo, std::string *errorMessage)
 Checks that device deviceInfo is sane (ie can run a kernel). More...
 
static DeviceStatus checkGpu (size_t deviceId, const DeviceInformation &deviceInfo)
 Check whether the ocl_gpu_device is suitable for use by mdrun. More...
 
int identifyAvx512FmaUnits ()
 Test whether machine has dual AVX512 FMA units. More...
 
static void spinUpCore ()
 Utility that does dummy computing for max 2 seconds to spin up cores. More...
 
void hardwareTopologyPrepareDetection ()
 Prepare the system before hardware topology detection. More...
 
std::unique_ptr< IMDModule > createInteractiveMolecularDynamicsModule ()
 Creates a module for interactive molecular dynamics.
 
static void fill_header (IMDHeader *header, IMDMessageType type, int32_t length)
 Fills the header with message and the length argument.
 
static void swap_header (IMDHeader *header)
 Swaps the endianess of the header.
 
static int32_t imd_read_multiple (IMDSocket *socket, char *datptr, int32_t toread)
 Reads multiple bytes from socket.
 
static int32_t imd_write_multiple (IMDSocket *socket, const char *datptr, int32_t towrite)
 Writes multiple bytes to socket in analogy to imd_read_multiple.
 
static int imd_handshake (IMDSocket *socket)
 Handshake with IMD client.
 
static int imd_send_energies (IMDSocket *socket, const IMDEnergyBlock *energies, char *buffer)
 Send energies using the energy block and the send buffer.
 
static IMDMessageType imd_recv_header (IMDSocket *socket, int32_t *length)
 Receive IMD header from socket, sets the length and returns the IMD message.
 
static bool imd_recv_mdcomm (IMDSocket *socket, int32_t nforces, int32_t *forcendx, float *forces)
 Receive force indices and forces. More...
 
void write_IMDgroup_to_file (bool bIMD, t_inputrec *ir, const t_state *state, const gmx_mtop_t *sys, int nfile, const t_filenm fnm[])
 Writes out the group of atoms selected for interactive manipulation. More...
 
static int imd_send_rvecs (IMDSocket *socket, int nat, rvec *x, char *buffer)
 Send positions from rvec. More...
 
static bool rvecs_differ (const rvec v1, const rvec v2)
 Returns true if any component of the two rvecs differs.
 
static void shift_positions (const matrix box, rvec x[], const ivec is, int nr)
 Copied and modified from groupcoord.c shift_positions_group().
 
static void imd_check_integrator_parallel (const t_inputrec *ir, const t_commrec *cr)
 Check for non-working integrator / parallel options.
 
std::unique_ptr< ImdSession > makeImdSession (const t_inputrec *ir, const t_commrec *cr, gmx_wallcycle *wcycle, gmx_enerdata_t *enerd, const gmx_multisim_t *ms, const gmx_mtop_t *top_global, const MDLogger &mdlog, const rvec x[], int nfile, const t_filenm fnm[], const gmx_output_env_t *oenv, const ImdOptions &options, StartingBehavior startingBehavior)
 Makes and returns an initialized IMD session, which may be inactive. More...
 
int imdsock_winsockinit ()
 Define a function to initialize winsock.
 
static void print_IMD_error (const char *file, int line, char *msg)
 Print a nice error message on UNIX systems, using errno.h.
 
IMDSocket * imdsock_create ()
 Create an IMD master socket. More...
 
void imd_sleep (unsigned int seconds)
 Portability wrapper around sleep function.
 
int imdsock_bind (IMDSocket *sock, int port)
 Bind the IMD socket to address and port. More...
 
int imd_sock_listen (IMDSocket *sock)
 Set socket to listening state. More...
 
IMDSocket * imdsock_accept (IMDSocket *sock)
 Accept incoming connection and redirect to client socket. More...
 
int imdsock_getport (IMDSocket *sock, int *port)
 Get the port number used for IMD connection. More...
 
int imd_htonl (int src)
 Portability wrapper around system htonl function.
 
int imd_ntohl (int src)
 Portability wrapper around system ntohl function.
 
int imdsock_write (IMDSocket *sock, const char *buffer, int length)
 Write to socket. More...
 
int imdsock_read (IMDSocket *sock, char *buffer, int length)
 Read from socket. More...
 
void imdsock_shutdown (IMDSocket *sock)
 Shutdown the socket. More...
 
int imdsock_destroy (IMDSocket *sock)
 Close the socket and free the sock struct memory. More...
 
int imdsock_tryread (IMDSocket *sock, int timeoutsec, int timeoutusec)
 Try to read from the socket. More...
 
bool buildSupportsGpuBondeds (std::string *error)
 Checks whether the GROMACS build allows to compute bonded interactions on a GPU. More...
 
bool inputSupportsGpuBondeds (const t_inputrec &ir, const gmx_mtop_t &mtop, std::string *error)
 Checks whether the input system allows to compute bonded interactions on a GPU. More...
 
static bool someInteractionsCanRunOnGpu (const InteractionLists &ilists)
 Returns whether there are any interactions in ilists suitable for a GPU.
 
static bool bondedInteractionsCanRunOnGpu (const gmx_mtop_t &mtop)
 Returns whether there are any bonded interactions in the global topology suitable for a GPU.
 
static bool addMessageIfNotSupported (ArrayRef< const std::string > errorReasons, std::string *error)
 Help build a descriptive message in error if there are errorReasons why bondeds on a GPU are not supported. More...
 
static void PrintTo (const RVec &value, std::ostream *os)
 Print an RVec to os.
 
static void PrintTo (const PaddedVector< RVec > &vector, std::ostream *os)
 Print a padded vector of RVec to os.
 
void exponentialMovingAverageStateAsKeyValueTree (KeyValueTreeObjectBuilder builder, const ExponentialMovingAverageState &state)
 Convert the exponential moving average state as key-value-tree object.
 
ExponentialMovingAverageState exponentialMovingAverageStateFromKeyValueTree (const KeyValueTreeObject &object)
 Sets the exponential moving average state from a key-value-tree object. More...
 
unsigned int log2I (std::uint32_t x)
 Compute floor of logarithm to base 2, 32 bit unsigned argument. More...
 
unsigned int log2I (std::uint64_t x)
 Compute floor of logarithm to base 2, 64 bit unsigned argument. More...
 
unsigned int log2I (std::int32_t x)
 Compute floor of logarithm to base 2, 32 bit signed argument. More...
 
unsigned int log2I (std::int64_t x)
 Compute floor of logarithm to base 2, 64 bit signed argument. More...
 
std::int64_t greatestCommonDivisor (std::int64_t p, std::int64_t q)
 Find greatest common divisor of two numbers. More...
 
double erfinv (double x)
 Inverse error function, double precision. More...
 
float erfinv (float x)
 Inverse error function, single precision. More...
 
static float invsqrt (float x)
 Calculate 1.0/sqrt(x) in single precision. More...
 
static double invsqrt (double x)
 Calculate 1.0/sqrt(x) in double precision, but single range. More...
 
static double invsqrt (int x)
 Calculate 1.0/sqrt(x) for integer x in double precision. More...
 
static float invcbrt (float x)
 Calculate inverse cube root of x in single precision. More...
 
static double invcbrt (double x)
 Calculate inverse sixth root of x in double precision. More...
 
static double invcbrt (int x)
 Calculate inverse sixth root of integer x in double precision. More...
 
static float sixthroot (float x)
 Calculate sixth root of x in single precision. More...
 
static double sixthroot (double x)
 Calculate sixth root of x in double precision. More...
 
static double sixthroot (int x)
 Calculate sixth root of integer x, return double. More...
 
static float invsixthroot (float x)
 Calculate inverse sixth root of x in single precision. More...
 
static double invsixthroot (double x)
 Calculate inverse sixth root of x in double precision. More...
 
static double invsixthroot (int x)
 Calculate inverse sixth root of integer x in double precision. More...
 
template<typename T >
square (T x)
 calculate x^2 More...
 
template<typename T >
power3 (T x)
 calculate x^3 More...
 
template<typename T >
power4 (T x)
 calculate x^4 More...
 
template<typename T >
power5 (T x)
 calculate x^5 More...
 
template<typename T >
power6 (T x)
 calculate x^6 More...
 
template<typename T >
power12 (T x)
 calculate x^12 More...
 
static real series_sinhx (real x)
 Maclaurin series for sinh(x)/x. More...
 
constexpr int32_t exactDiv (int32_t a, int32_t b)
 Exact integer division, 32bit. More...
 
constexpr int64_t exactDiv (int64_t a, int64_t b)
 Exact integer division, 64bit.
 
static int roundToInt (float x)
 Round float to int. More...
 
static int roundToInt (double x)
 Round double to int.
 
static int64_t roundToInt64 (float x)
 Round float to int64_t.
 
static int64_t roundToInt64 (double x)
 Round double to int64_t.
 
IntegerBox spreadRangeWithinLattice (const IVec &center, dynamicExtents3D extent, IVec range)
 Construct a box that holds all indices that are not more than a given range remote from center coordinates and still within a given lattice extent. More...
 
void invertBoxMatrix (const matrix src, matrix dest)
 Invert a simulation-box matrix in src, return in dest. More...
 
void invertMatrix (const matrix src, matrix dest)
 Invert a general 3x3 matrix in src, return in dest. More...
 
Matrix3x3 transpose (Matrix3x3ConstSpan matrixView)
 Calculate the transpose of a 3x3 matrix, from its view.
 
void matrixVectorMultiply (Matrix3x3ConstSpan matrix, RVec *v)
 Multiply matrix with vector.
 
constexpr real determinant (Matrix3x3ConstSpan matrix)
 Determinant of a 3x3 matrix.
 
constexpr real trace (Matrix3x3ConstSpan matrixView)
 Calculates the trace of a 3x3 matrix view.
 
template<typename ElementType , int N, int M = N>
MultiDimArray< std::array
< ElementType, N *M >, extents
< N, M > > 
identityMatrix ()
 Create an identity matrix of ElementType with N * M elements. More...
 
static Matrix3x3 createMatrix3x3FromLegacyMatrix (const matrix legacyMatrix)
 Create new matrix type from legacy type.
 
static void fillLegacyMatrix (Matrix3x3ConstSpan newMatrix, matrix legacyMatrix)
 Fill legacy matrix from new matrix type.
 
template<class TContainer , class Extents >
constexpr MultiDimArray
< TContainer, Extents >
::const_iterator 
begin (const MultiDimArray< TContainer, Extents > &multiDimArray)
 Free MultiDimArray begin function addressing its contiguous memory.
 
template<class TContainer , class Extents >
constexpr MultiDimArray
< TContainer, Extents >
::iterator 
begin (MultiDimArray< TContainer, Extents > &multiDimArray)
 Free MultiDimArray begin function addressing its contiguous memory.
 
template<class TContainer , class Extents >
constexpr MultiDimArray
< TContainer, Extents >
::const_iterator 
end (const MultiDimArray< TContainer, Extents > &multiDimArray)
 Free MultiDimArray end function addressing its contiguous memory.
 
template<class TContainer , class Extents >
constexpr MultiDimArray
< TContainer, Extents >
::iterator 
end (MultiDimArray< TContainer, Extents > &multiDimArray)
 Free MultiDimArray end function addressing its contiguous memory.
 
template<class TContainer , class Extents >
void swap (MultiDimArray< TContainer, Extents > &a, MultiDimArray< TContainer, Extents > &b) noexcept
 Swap function.
 
OptimisationResult nelderMead (const std::function< real(ArrayRef< const real >)> &functionToMinimize, ArrayRef< const real > initialGuess, real minimumRelativeSimplexLength=1e-8, int maxSteps=10'000)
 Derivative-free downhill simplex optimisation. More...
 
template<typename ValueType >
BasicVector< ValueType > operator* (const BasicVector< ValueType > &basicVector, const ValueType &scalar)
 Allow vector scalar multiplication.
 
template<typename ValueType >
BasicVector< ValueType > operator* (const ValueType &scalar, const BasicVector< ValueType > &basicVector)
 Allow scalar vector multiplication.
 
template<typename VectorType >
static VectorType unitVector (const VectorType &v)
 unitv for gmx::BasicVector
 
template<typename ValueType >
static ValueType norm (BasicVector< ValueType > v)
 norm for gmx::BasicVector
 
template<typename ValueType >
static ValueType norm2 (BasicVector< ValueType > v)
 Square of the vector norm for gmx::BasicVector.
 
template<typename VectorType >
static VectorType cross (const VectorType &a, const VectorType &b)
 cross product for gmx::BasicVector
 
template<typename ValueType >
static ValueType dot (BasicVector< ValueType > a, BasicVector< ValueType > b)
 dot product for gmx::BasicVector
 
template<typename VectorType >
static VectorType scaleByVector (const VectorType &a, const VectorType &b)
 Multiply two vectors element by element and return the result.
 
template<typename VectorType >
static VectorType elementWiseMin (const VectorType &a, const VectorType &b)
 Return the element-wise minimum of two vectors.
 
template<typename VectorType >
static VectorType elementWiseMax (const VectorType &a, const VectorType &b)
 Return the element-wise maximum of two vectors.
 
template<typename ValueType >
static BasicVector< ValueType >
::RawArray * 
as_vec_array (BasicVector< ValueType > *x)
 Casts a gmx::BasicVector array into an equivalent raw C array.
 
template<typename ValueType >
static const BasicVector
< ValueType >::RawArray * 
as_vec_array (const BasicVector< ValueType > *x)
 Casts a gmx::BasicVector array into an equivalent raw C array.
 
static rvec * as_rvec_array (RVec *x)
 Casts a gmx::RVec array into an rvec array.
 
static const rvec * as_rvec_array (const RVec *x)
 Casts a gmx::RVec array into an rvec array.
 
static dvec * as_dvec_array (DVec *x)
 Casts a gmx::DVec array into an Dvec array.
 
static ivec * as_ivec_array (IVec *x)
 Casts a gmx::IVec array into an ivec array.
 
static const dvec * as_dvec_array (const DVec *x)
 Casts a gmx::DVec array into an dvec array.
 
static const ivec * as_ivec_array (const IVec *x)
 Casts a gmx::IVec array into an ivec array.
 
std::unique_ptr< BoxDeformation > prepareBoxDeformation (const matrix &initialBox, DDRole ddRole, NumRanks numRanks, MPI_Comm communicator, const t_inputrec &inputrec)
 Factory function for box deformation module. More...
 
static CheckpointSignal convertToCheckpointSignal (signed char sig)
 Convert signed char (as used by SimulationSignal) to CheckpointSignal enum. More...
 
static void clear_constraint_quantity_nonlocal (gmx_domdec_t *dd, ArrayRef< RVec > q)
 Clears constraint quantities for atoms in nonlocal region.
 
void too_many_constraint_warnings (int eConstrAlg, int warncount)
 Generate a fatal error because of too many LINCS/SETTLE warnings.
 
static void write_constr_pdb (const char *fn, const char *title, const gmx_mtop_t &mtop, int start, int homenr, const t_commrec *cr, ArrayRef< const RVec > x, const matrix box)
 Writes out coordinates.
 
static void dump_confs (FILE *log, int64_t step, const gmx_mtop_t &mtop, int start, int homenr, const t_commrec *cr, ArrayRef< const RVec > x, ArrayRef< const RVec > xprime, const matrix box)
 Writes out domain contents to help diagnose crashes.
 
FlexibleConstraintTreatment flexibleConstraintTreatment (bool haveDynamicsIntegrator)
 Returns the flexible constraint treatment depending on whether the integrator is dynamic.
 
static ListOfLists< int > makeAtomsToConstraintsList (int numAtoms, ArrayRef< const InteractionList > ilists, ArrayRef< const t_iparams > iparams, FlexibleConstraintTreatment flexibleConstraintTreatment)
 Returns a block struct to go from atoms to constraints. More...
 
ListOfLists< int > make_at2con (int numAtoms, ArrayRef< const InteractionList > ilist, ArrayRef< const t_iparams > iparams, FlexibleConstraintTreatment flexibleConstraintTreatment)
 Returns a ListOfLists object to go from atoms to constraints. More...
 
ListOfLists< int > make_at2con (const gmx_moltype_t &moltype, gmx::ArrayRef< const t_iparams > iparams, FlexibleConstraintTreatment flexibleConstraintTreatment)
 Returns a ListOfLists object to go from atoms to constraints. More...
 
int countFlexibleConstraints (ArrayRef< const InteractionList > ilist, ArrayRef< const t_iparams > iparams)
 Return the number of flexible constraints in the ilist and iparams.
 
static std::vector< int > make_at2settle (int natoms, const InteractionList &ilist)
 Returns the index of the settle to which each atom belongs.
 
static std::vector
< ListOfLists< int > > 
makeAtomToConstraintMappings (const gmx_mtop_t &mtop, FlexibleConstraintTreatment flexibleConstraintTreatment)
 Makes a per-moleculetype container of mappings from atom indices to constraint indices. More...
 
void do_constrain_first (FILE *log, gmx::Constraints *constr, const t_inputrec *inputrec, int numAtoms, int numHomeAtoms, ArrayRefWithPadding< RVec > x, ArrayRefWithPadding< RVec > v, const matrix box, real lambda)
 Constrain the initial coordinates and velocities.
 
void constrain_velocities (gmx::Constraints *constr, bool do_log, bool do_ene, int64_t step, t_state *state, real *dvdlambda, gmx_bool computeVirial, tensor constraintsVirial)
 Constrain velocities only. More...
 
void constrain_coordinates (gmx::Constraints *constr, bool do_log, bool do_ene, int64_t step, t_state *state, ArrayRefWithPadding< RVec > xp, real *dvdlambda, gmx_bool computeVirial, tensor constraintsVirial)
 Constraint coordinates. More...
 
static bool isConstraintFlexible (ArrayRef< const t_iparams > iparams, int iparamsIndex)
 Returns whether constraint with parameter iparamsIndex is a flexible constraint.
 
const int * constr_iatomptr (gmx::ArrayRef< const int > iatom_constr, gmx::ArrayRef< const int > iatom_constrnc, int con)
 Returns the constraint iatoms for a constraint number con which comes from a list where F_CONSTR and F_CONSTRNC constraints are concatenated.
 
bool inter_charge_group_constraints (const gmx_mtop_t &mtop)
 Returns whether there are inter charge group constraints.
 
bool inter_charge_group_settles (const gmx_mtop_t &mtop)
 Returns whether there are inter charge group settles.
 
static void constr_recur (const ListOfLists< int > &at2con, const InteractionLists &ilist, gmx::ArrayRef< const t_iparams > iparams, gmx_bool bTopB, int at, int depth, int nc, ArrayRef< int > path, real r0, real r1, real *r2max, int *count)
 Recursing function to help find all adjacent constraints.
 
static real constr_r_max_moltype (const gmx_moltype_t *molt, gmx::ArrayRef< const t_iparams > iparams, const t_inputrec *ir)
 Find the interaction radius needed for constraints for this molecule type.
 
real constr_r_max (const MDLogger &mdlog, const gmx_mtop_t *mtop, const t_inputrec *ir)
 Returns an estimate of the maximum distance between atoms required for LINCS.
 
real calculateAcceptanceWeight (int calculationMode, real lambdaEnergyDifference)
 Calculates the acceptance weight for a lambda state transition. More...
 
std::array< real, efptNR > currentLambdas (int64_t step, const t_lambda &fepvals, int currentLambdaState)
 Evaluate the current lambdas. More...
 
template<NumTempScaleValues numTempScaleValues, VelocityScalingType velocityScaling>
auto leapFrogKernel (cl::sycl::handler &cgh, DeviceAccessor< float3, mode::read_write > a_x, DeviceAccessor< float3, mode::discard_write > a_xp, DeviceAccessor< float3, mode::read_write > a_v, DeviceAccessor< float3, mode::read > a_f, DeviceAccessor< float, mode::read > a_inverseMasses, float dt, OptionalAccessor< float, mode::read, numTempScaleValues!=NumTempScaleValues::None > a_lambdas, OptionalAccessor< unsigned short, mode::read, numTempScaleValues==NumTempScaleValues::Multiple > a_tempScaleGroups, float3 prVelocityScalingMatrixDiagonal)
 Main kernel for the Leap-Frog integrator. More...
 
template<NumTempScaleValues numTempScaleValues, VelocityScalingType velocityScaling, class... Args>
static cl::sycl::event launchLeapFrogKernel (const DeviceStream &deviceStream, int numAtoms, Args &&...args)
 
static NumTempScaleValues getTempScalingType (bool doTemperatureScaling, int numTempScaleValues)
 
template<class... Args>
static cl::sycl::event launchLeapFrogKernel (NumTempScaleValues tempScalingType, VelocityScalingType prVelocityScalingType, Args &&...args)
 Select templated kernel and launch it.
 
ArrayRef< reallincs_rmsdData (Lincs *lincsd)
 Return the data for determining constraint RMS relative deviations.
 
real lincs_rmsd (const Lincs *lincsd)
 Return the RMSD of the constraint.
 
static void lincs_matrix_expand (const Lincs &lincsd, const Task &li_task, gmx::ArrayRef< const real > blcc, gmx::ArrayRef< real > rhs1, gmx::ArrayRef< real > rhs2, gmx::ArrayRef< real > sol)
 Do a set of nrec LINCS matrix multiplications. More...
 
static void lincs_update_atoms_noind (int ncons, gmx::ArrayRef< const AtomPair > atoms, real preFactor, gmx::ArrayRef< const real > fac, gmx::ArrayRef< const gmx::RVec > r, const real *invmass, rvec *x)
 Update atomic coordinates when an index is not required.
 
static void lincs_update_atoms_ind (gmx::ArrayRef< const int > ind, gmx::ArrayRef< const AtomPair > atoms, real preFactor, gmx::ArrayRef< const real > fac, gmx::ArrayRef< const gmx::RVec > r, const real *invmass, rvec *x)
 Update atomic coordinates when an index is required.
 
static void lincs_update_atoms (Lincs *li, int th, real preFactor, gmx::ArrayRef< const real > fac, gmx::ArrayRef< const gmx::RVec > r, const real *invmass, rvec *x)
 Update coordinates for atoms.
 
static void do_lincsp (ArrayRefWithPadding< const RVec > xPadded, ArrayRefWithPadding< RVec > fPadded, ArrayRef< RVec > fp, t_pbc *pbc, Lincs *lincsd, int th, const real *invmass, ConstraintVariable econq, bool bCalcDHDL, bool bCalcVir, tensor rmdf)
 LINCS projection, works on derivatives of the coordinates.
 
static void calc_dist_iter (int b0, int b1, gmx::ArrayRef< const AtomPair > atoms, const rvec *__restrict xp, const real *__restrict bllen, const real *__restrict blc, const t_pbc *pbc, real wfac, real *__restrict rhs, real *__restrict sol, bool *bWarn)
 Determine the distances and right-hand side for the next iteration.
 
static void do_lincs (ArrayRefWithPadding< const RVec > xPadded, ArrayRefWithPadding< RVec > xpPadded, const matrix box, t_pbc *pbc, Lincs *lincsd, int th, const real *invmass, const t_commrec *cr, bool bCalcDHDL, real wangle, bool *bWarn, real invdt, ArrayRef< RVec > vRef, bool bCalcVir, tensor vir_r_m_dr)
 Implements LINCS constraining.
 
static void set_lincs_matrix_task (Lincs *li, Task *li_task, const real *invmass, int *ncc_triangle, int *nCrossTaskTriangles)
 Sets the elements in the LINCS matrix for task task.
 
static void set_lincs_matrix (Lincs *li, const real *invmass, real lambda)
 Sets the elements in the LINCS matrix.
 
static int count_triangle_constraints (const InteractionLists &ilist, const ListOfLists< int > &at2con)
 Finds all triangles of atoms that share constraints to a central atom.
 
static bool more_than_two_sequential_constraints (const InteractionLists &ilist, const ListOfLists< int > &at2con)
 Finds sequences of sequential constraints.
 
Lincs * init_lincs (FILE *fplog, const gmx_mtop_t &mtop, int nflexcon_global, ArrayRef< const ListOfLists< int >> atomsToConstraintsPerMolType, bool bPLINCS, int nIter, int nProjOrder)
 Initializes and returns the lincs data struct.
 
void done_lincs (Lincs *li)
 Destructs the lincs object when it is not nullptr.
 
static void lincs_thread_setup (Lincs *li, int natoms)
 Sets up the work division over the threads.
 
static void assign_constraint (Lincs *li, int constraint_index, int a1, int a2, real lenA, real lenB, const ListOfLists< int > &at2con)
 Assign a constraint.
 
static void check_assign_connected (Lincs *li, gmx::ArrayRef< const int > iatom, const InteractionDefinitions &idef, bool bDynamics, int a1, int a2, const ListOfLists< int > &at2con)
 Check if constraint with topology index constraint_index is connected to other constraints, and if so add those connected constraints to our task.
 
static void check_assign_triangle (Lincs *li, gmx::ArrayRef< const int > iatom, const InteractionDefinitions &idef, bool bDynamics, int constraint_index, int a1, int a2, const ListOfLists< int > &at2con)
 Check if constraint with topology index constraint_index is involved in a constraint triangle, and if so add the other two constraints in the triangle to our task.
 
static void set_matrix_indices (Lincs *li, const Task &li_task, const ListOfLists< int > &at2con, bool bSortMatrix)
 Sets matrix indices.
 
void set_lincs (const InteractionDefinitions &idef, int numAtoms, const real *invmass, real lambda, bool bDynamics, const t_commrec *cr, Lincs *li)
 Initialize lincs stuff.
 
static void lincs_warning (gmx_domdec_t *dd, ArrayRef< const RVec > x, ArrayRef< const RVec > xprime, t_pbc *pbc, int ncons, gmx::ArrayRef< const AtomPair > atoms, gmx::ArrayRef< const real > bllen, real wangle, int maxwarn, int *warncount)
 Issues a warning when LINCS constraints cannot be satisfied.
 
static LincsDeviations makeLincsDeviations (const Lincs &lincsd, ArrayRef< const RVec > x, const t_pbc *pbc)
 Determine how well the constraints have been satisfied.
 
bool constrain_lincs (bool computeRmsd, const t_inputrec &ir, int64_t step, Lincs *lincsd, const real *invmass, const t_commrec *cr, const gmx_multisim_t *ms, ArrayRefWithPadding< const RVec > x, ArrayRefWithPadding< RVec > xprime, ArrayRef< RVec > min_proj, const matrix box, t_pbc *pbc, bool hasMassPerturbed, real lambda, real *dvdlambda, real invdt, ArrayRef< RVec > v, bool bCalcVir, tensor vir_r_m_dr, ConstraintVariable econq, t_nrnb *nrnb, int maxwarn, int *warncount)
 Applies LINCS constraints. More...
 
template<typename... Args>
std::unique_ptr< Constraints > makeConstraints (const gmx_mtop_t &mtop, const t_inputrec &ir, pull_t *pull_work, bool doEssentialDynamics, Args &&...args)
 Factory function for Constraints. More...
 
std::unique_ptr< MDAtoms > makeMDAtoms (FILE *fp, const gmx_mtop_t &mtop, const t_inputrec &ir, bool useGpuForPme)
 Builder function for MdAtomsWrapper. More...
 
static ResetSignal convertToResetSignal (signed char sig)
 Convert signed char (as used by SimulationSignal) to ResetSignal enum. More...
 
static void initializeProjectionMatrix (const real invmO, const real invmH, const real dOH, const real dHH, matrix inverseCouplingMatrix)
 Initializes a projection matrix. More...
 
SettleParameters settleParameters (real mO, real mH, real dOH, real invmO, real invmH, real dHH)
 Computes and returns settle parameters. More...
 
void settle_proj (const SettleData &settled, ConstraintVariable econq, int nsettle, const int iatoms[], const t_pbc *pbc,ArrayRef< const RVec > x, ArrayRef< RVec > der, ArrayRef< RVec > derp, int CalcVirAtomEnd, tensor vir_r_m_dder)
 Analytical algorithm to subtract the components of derivatives of coordinates working on settle type constraint.
 
template<typename T , typename TypeBool , int packSize, typename TypePbc , bool bCorrectVelocity, bool bCalcVirial>
static void settleTemplate (const SettleData &settled, int settleStart, int settleEnd, const TypePbc pbc, const real *x, real *xprime, real invdt, real *gmx_restrict v, tensor vir_r_m_dr, bool *bErrorHasOccurred)
 The actual settle code, templated for real/SimdReal and for optimization.
 
template<typename T , typename TypeBool , int packSize, typename TypePbc >
static void settleTemplateWrapper (const SettleData &settled, int nthread, int thread, TypePbc pbc, const real x[], real xprime[], real invdt, real *v, bool bCalcVirial, tensor vir_r_m_dr, bool *bErrorHasOccurred)
 Wrapper template function that divides the settles over threads and instantiates the core template with instantiated booleans.
 
void csettle (const SettleData &settled,int nthread,int thread,const t_pbc *pbc,ArrayRefWithPadding< const RVec > x,ArrayRefWithPadding< RVec > xprime,real invdt,ArrayRefWithPadding< RVec > v,bool bCalcVirial,tensor vir_r_m_dr,bool *bErrorHasOccurred)
 Constrain coordinates using SETTLE. Can be called on any number of threads.
 
static int pcomp (const void *p1, const void *p2)
 Compares sort blocks.
 
static void pr_sortblock (FILE *fp, const char *title, int nsb, t_sortblock sb[])
 Prints sortblocks.
 
static void resizeLagrangianData (shakedata *shaked, int ncons)
 Reallocates a vector.
 
void make_shake_sblock_serial (shakedata *shaked, InteractionDefinitions *idef, int numAtoms)
 Make SHAKE blocks when not using DD.
 
void make_shake_sblock_dd (shakedata *shaked, const InteractionList &ilcon)
 Make SHAKE blocks when using DD.
 
void cshake (const int iatom[], int ncon, int *nnit, int maxnit, ArrayRef< const real > constraint_distance_squared, ArrayRef< RVec > positions, const t_pbc *pbc, ArrayRef< const RVec > initial_displacements, ArrayRef< const real > half_of_reduced_mass, real omega, const real invmass[], ArrayRef< const real > distance_squared_tolerance, ArrayRef< real > scaled_lagrange_multiplier, int *nerror)
 Inner kernel for SHAKE constraints. More...
 
static void crattle (const int iatom[], int ncon, int *nnit, int maxnit, ArrayRef< const real > constraint_distance_squared, ArrayRef< RVec > vp, ArrayRef< const RVec > rij, ArrayRef< const real > m2, real omega, const real invmass[], ArrayRef< const real > distance_squared_tolerance, ArrayRef< real > scaled_lagrange_multiplier, int *nerror, real invdt)
 Implements RATTLE (ie. SHAKE for velocity verlet integrators)
 
static int vec_shakef (FILE *fplog, shakedata *shaked, const real invmass[], int ncon, ArrayRef< const t_iparams > ip, const int *iatom, real tol, ArrayRef< const RVec > x, ArrayRef< RVec > prime, const t_pbc *pbc, real omega, bool bFEP, real lambda, ArrayRef< real > scaled_lagrange_multiplier, real invdt, ArrayRef< RVec > v, bool bCalcVir, tensor vir_r_m_dr, ConstraintVariable econq)
 Applies SHAKE.
 
static void check_cons (FILE *log, int nc, ArrayRef< const RVec > x, ArrayRef< const RVec > prime, ArrayRef< const RVec > v, const t_pbc *pbc, ArrayRef< const t_iparams > ip, const int *iatom, const real invmass[], ConstraintVariable econq)
 Check that constraints are satisfied.
 
static bool bshakef (FILE *log, shakedata *shaked, const real invmass[], const InteractionDefinitions &idef, const t_inputrec &ir, ArrayRef< const RVec > x_s, ArrayRef< RVec > prime, const t_pbc *pbc, t_nrnb *nrnb, real lambda, real *dvdlambda, real invdt, ArrayRef< RVec > v, bool bCalcVir, tensor vir_r_m_dr, bool bDumpOnError, ConstraintVariable econq)
 Applies SHAKE.
 
bool constrain_shake (FILE *log,shakedata *shaked,const real invmass[],const InteractionDefinitions &idef,const t_inputrec &ir,ArrayRef< const RVec > x_s,ArrayRef< RVec > xprime,ArrayRef< RVec > vprime,const t_pbc *pbc,t_nrnb *nrnb,real lambda,real *dvdlambda,real invdt,ArrayRef< RVec > v,bool bCalcVir,tensor vir_r_m_dr,bool bDumpOnError,ConstraintVariable econq)
 Shake all the atoms blockwise. It is assumed that all the constraints in the idef->shakes field are sorted, to ascending block nr. The sblock array points into the idef->shakes.iatoms field, with block 0 starting at sblock[0] and running to ( < ) sblock[1], block n running from sblock[n] to sblock[n+1]. Array sblock should be large enough. Return TRUE when OK, FALSE when shake-error.
 
static StopSignal convertToStopSignal (signed char sig)
 Convert signed char (as used by SimulationSignal) to StopSignal enum. More...
 
static bool hasFlexibleConstraints (const gmx_moltype_t &moltype, gmx::ArrayRef< const t_iparams > iparams)
 Returns whether moltype contains flexible constraints.
 
static bool hasIncompatibleVsites (const gmx_moltype_t &moltype, gmx::ArrayRef< const t_iparams > iparams)
 Returns whether moltype has incompatible vsites. More...
 
static InteractionList jointConstraintList (const gmx_moltype_t &moltype)
 Returns a merged list with constraints of all types.
 
static AtomIndexExtremes vsiteConstructRange (int a, const gmx_moltype_t &moltype)
 Returns the range of constructing atom for vsite with atom index a.
 
static AtomIndexExtremes constraintAtomRange (int a, const ListOfLists< int > &at2con, const InteractionList &ilistConstraints)
 Returns the range of atoms constrained to atom a (including a itself)
 
static std::vector< bool > buildIsParticleVsite (const gmx_moltype_t &moltype)
 Returns a list that tells whether atoms in moltype are vsites.
 
static int detectGroup (int firstAtom, const gmx_moltype_t &moltype, const ListOfLists< int > &at2con, const InteractionList &ilistConstraints)
 Returns the size of the update group starting at firstAtom or 0 when criteria (see updategroups.h) are not met.
 
static RangePartitioning makeUpdateGroups (const gmx_moltype_t &moltype, gmx::ArrayRef< const t_iparams > iparams)
 Returns a list of update groups for moltype.
 
std::vector< RangePartitioningmakeUpdateGroups (const gmx_mtop_t &mtop)
 Returns a vector with update groups for each moleculetype in mtop or an empty vector when the criteria (see below) are not satisfied. More...
 
static std::unordered_multimap
< int, int > 
getAngleIndices (const gmx_moltype_t &moltype)
 Returns a map of angles ilist.iatoms indices with the middle atom as key.
 
template<int numPartnerAtoms>
static real constraintGroupRadius (const gmx_moltype_t &moltype, gmx::ArrayRef< const t_iparams > iparams, const int centralAtom, const ListOfLists< int > &at2con, const std::unordered_multimap< int, int > &angleIndices, const real constraintLength, const real temperature)
 When possible, computes the maximum radius of constrained atom in an update group. More...
 
static real computeMaxUpdateGroupRadius (const gmx_moltype_t &moltype, gmx::ArrayRef< const t_iparams > iparams, const RangePartitioning &updateGroups, real temperature)
 Returns the maximum update group radius for moltype.
 
real computeMaxUpdateGroupRadius (const gmx_mtop_t &mtop, gmx::ArrayRef< const RangePartitioning > updateGroups, real temperature)
 Returns the maximum update group radius. More...
 
static int vsiteIlistNrCount (ArrayRef< const InteractionList > ilist)
 Returns the sum of the vsite ilist sizes over all vsite types. More...
 
static int pbc_rvec_sub (const t_pbc *pbc, const rvec xi, const rvec xj, rvec dx)
 Computes the distance between xi and xj, pbc is used when pbc!=nullptr.
 
static real inverseNorm (const rvec x)
 Returns the 1/norm(x)
 
static PbcMode getPbcMode (const t_pbc *pbcPtr)
 Returns the PBC mode based on the system PBC and vsite properties. More...
 
static void construct_vsites_thread (ArrayRef< RVec > x, const real dt, ArrayRef< RVec > v, ArrayRef< const t_iparams > ip, ArrayRef< const InteractionList > ilist, const t_pbc *pbc_null)
 Executes the vsite construction task for a single thread. More...
 
static void construct_vsites (const ThreadingInfo *threadingInfo, ArrayRef< RVec > x, real dt, ArrayRef< RVec > v, ArrayRef< const t_iparams > ip, ArrayRef< const InteractionList > ilist, const DomainInfo &domainInfo, const matrix box)
 Dispatch the vsite construction tasks for all threads. More...
 
void constructVirtualSites (ArrayRef< RVec > x, ArrayRef< const t_iparams > ip, ArrayRef< const InteractionList > ilist)
 Create positions of vsite atoms based for the local system. More...
 
static int vsite_count (ArrayRef< const InteractionList > ilist, int ftype)
 Returns the number of virtual sites in the interaction list, for VSITEN the number of atoms.
 
template<VirialHandling virialHandling>
static void spreadForceForThread (ArrayRef< const RVec > x, ArrayRef< RVec > f, ArrayRef< RVec > fshift, matrix dxdf, ArrayRef< const t_iparams > ip, ArrayRef< const InteractionList > ilist, const t_pbc *pbc_null)
 Executes the force spreading task for a single thread.
 
static void spreadForceWrapper (ArrayRef< const RVec > x, ArrayRef< RVec > f, const VirialHandling virialHandling, ArrayRef< RVec > fshift, matrix dxdf, const bool clearDxdf, ArrayRef< const t_iparams > ip, ArrayRef< const InteractionList > ilist, const t_pbc *pbc_null)
 Wrapper function for calling the templated thread-local spread function.
 
static void clearTaskForceBufferUsedElements (InterdependentTask *idTask)
 Clears the task force buffer elements that are written by task idTask.
 
static std::vector< int > makeAtomToGroupMapping (const gmx::RangePartitioning &grouping)
 Returns the an array with group indices for each atom. More...
 
int countNonlinearVsites (const gmx_mtop_t &mtop)
 Return the number of non-linear virtual site constructions in the system.
 
int countInterUpdategroupVsites (const gmx_mtop_t &mtop, ArrayRef< const RangePartitioning > updateGroupingPerMoleculetype)
 Return the number of virtual sites that cross update groups. More...
 
std::unique_ptr
< VirtualSitesHandler > 
makeVirtualSitesHandler (const gmx_mtop_t &mtop, const t_commrec *cr, PbcType pbcType)
 Create the virtual site handler. More...
 
static int getNumInterUpdategroupVsites (const gmx_mtop_t &mtop, const gmx_domdec_t *domdec)
 Returns the number of inter update-group vsites.
 
 iparams_ (mtop.ffparams.iparams)
 
static void flagAtom (InterdependentTask *idTask, const int atom, const int numThreads, const int numAtomsPerThread)
 Flag that atom atom which is home in another task, if it has not already been added before.
 
static void assignVsitesToThread (VsiteThread *tData, int thread, int nthread, int natperthread, gmx::ArrayRef< int > taskIndex, ArrayRef< const InteractionList > ilist, ArrayRef< const t_iparams > ip, const unsigned short *ptype)
 Here we try to assign all vsites that are in our local range. More...
 
static void assignVsitesToSingleTask (VsiteThread *tData, int task, gmx::ArrayRef< const int > taskIndex, ArrayRef< const InteractionList > ilist, ArrayRef< const t_iparams > ip)
 Assign all vsites with taskIndex[]==task to task tData.
 
void constructVirtualSitesGlobal (const gmx_mtop_t &mtop, ArrayRef< RVec > x)
 Create positions of vsite atoms for the whole system assuming all molecules are wholex. More...
 
static bool is_multisim_option_set (int argc, const char *const argv[])
 Return whether the command-line parameter that will trigger a multi-simulation is set.
 
static DevelopmentFeatureFlags manageDevelopmentFeatures (const gmx::MDLogger &mdlog, const bool useGpuForNonbonded, const PmeRunMode pmeRunMode)
 Manage any development feature flag variables encountered. More...
 
static void threadMpiMdrunnerAccessBarrier ()
 Barrier for safe simultaneous thread access to mdrunner data. More...
 
static void mdrunner_start_fn (const void *arg)
 The callback used for running on spawned threads. More...
 
static bool gpuAccelerationOfNonbondedIsUseful (const MDLogger &mdlog, const t_inputrec &ir, bool issueWarning)
 Return whether GPU acceleration of nonbondeds is supported with the given settings. More...
 
static gmx::LoggerOwner buildLogger (FILE *fplog, const bool isSimulationMasterRank)
 Initializes the logger for mdrun.
 
static TaskTarget findTaskTarget (const char *optionString)
 Make a TaskTarget from an mdrun argument string.
 
static void finish_run (FILE *fplog, const gmx::MDLogger &mdlog, const t_commrec *cr, const t_inputrec *inputrec, t_nrnb nrnb[], gmx_wallcycle_t wcycle, gmx_walltime_accounting_t walltime_accounting, nonbonded_verlet_t *nbv, const gmx_pme_t *pme, gmx_bool bWriteStat)
 Finish run, aggregate data to print performance info.
 
void applyLocalState (const SimulationInput &simulationInput, t_fileio *logfio, const t_commrec *cr, int *dd_nc, t_inputrec *ir, t_state *state, ObservablesHistory *observablesHistory, bool reproducibilityRequested, const MdModulesNotifier &notifier, gmx::ReadCheckpointDataHolder *modularSimulatorCheckpointData, bool useModularSimulator)
 Initialize local stateful simulation data. More...
 
SimulationInputHandle makeSimulationInput (const LegacyMdrunOptions &options)
 
std::tuple< StartingBehavior,
LogFilePtr
handleRestart (bool isSimulationMaster, MPI_Comm communicator, const gmx_multisim_t *ms, AppendingBehavior appendingBehavior, int nfile, t_filenm fnm[])
 Handle startup of mdrun, particularly regarding -cpi and -append. More...
 
static void prepareLogFile (BinaryInformationSettings settings, FILE *fplog)
 Implements aspects of logfile handling common to opening either for writing or appending.
 
LogFilePtr openLogFile (const char *lognm, bool appendFiles)
 Open the log file for writing/appending. More...
 
void prepareLogAppending (FILE *fplog)
 Prepare to use the open log file when appending. More...
 
void closeLogFile (t_fileio *logfio)
 Close the log file.
 
template<class BasicMdspan >
constexpr std::enable_if_t
< BasicMdspan::is_always_contiguous(),
typename BasicMdspan::pointer > 
begin (const BasicMdspan &basicMdspan)
 Free begin function addressing memory of a contiguously laid out basic_mdspan. More...
 
template<class BasicMdspan >
constexpr std::enable_if_t
< BasicMdspan::is_always_contiguous(),
typename BasicMdspan::pointer > 
end (const BasicMdspan &basicMdspan)
 Free end function addressing memory of a contiguously laid out basic_mdspan. More...
 
template<class BasicMdspan >
constexpr BasicMdspan addElementwise (const BasicMdspan &span1, const BasicMdspan &span2)
 Elementwise addition.
 
template<class BasicMdspan >
constexpr BasicMdspan subtractElementwise (const BasicMdspan &span1, const BasicMdspan &span2)
 Elementwise subtraction - left minus right.
 
template<class BasicMdspan >
constexpr BasicMdspan multiplyElementwise (const BasicMdspan &span1, const BasicMdspan &span2)
 Elementwise multiplication.
 
template<class BasicMdspan >
constexpr BasicMdspan divideElementwise (const BasicMdspan &span1, const BasicMdspan &span2)
 Elementwise division - left / right.
 
template<std::ptrdiff_t... LHS, std::ptrdiff_t... RHS>
constexpr bool operator== (const extents< LHS...> &lhs, const extents< RHS...> &rhs) noexcept
 Comparison operator. More...
 
template<std::ptrdiff_t... LHS, std::ptrdiff_t... RHS>
constexpr bool operator!= (const extents< LHS...> &lhs, const extents< RHS...> &rhs) noexcept
 Check for non-equality. More...
 
template<CheckpointDataOperation operation, typename T >
ArrayRef< std::conditional_t
< operation==CheckpointDataOperation::Write||std::is_const
< T >::value, const typename
T::value_type, typename
T::value_type > > 
makeCheckpointArrayRef (T &container)
 
template<typename VersionEnum >
VersionEnum checkpointVersion (const ReadCheckpointData *checkpointData, const std::string &key, const VersionEnum programVersion)
 Read a checkpoint version enum variable. More...
 
template<typename VersionEnum >
VersionEnum checkpointVersion (WriteCheckpointData *checkpointData, const std::string &key, const VersionEnum programVersion)
 Write the current code checkpoint version enum variable. More...
 
 forceMtsCombined_ ({})
 
 view_ ({},{}, false)
 
 useForceMtsCombined_ (false)
 
template<class T >
T & makeRefFromPointer (T *ptr)
 Take pointer, check if valid, return reference.
 
int nonbondedMtsFactor (const t_inputrec &ir)
 Returns the interval in steps at which the non-bonded pair forces are calculated. More...
 
void assertMtsRequirements (const t_inputrec &ir)
 (Release) Asserts that all multiple time-stepping requirements on ir are fulfilled
 
static int forceGroupMtsLevel (ArrayRef< const MtsLevel > mtsLevels, const MtsForceGroups mtsForceGroup)
 Returns the MTS level at which a force group is to be computed. More...
 
template<typename... Ts>
auto checkUseModularSimulator (Ts &&...args) -> decltype(ModularSimulator::isInputCompatible(std::forward< Ts >(args)...))
 Whether or not to use the ModularSimulator. More...
 
 statePropagatorData_ (statePropagatorData)
 
 energyData_ (energyData)
 
 fplog_ (fplog)
 
 inputrec_ (inputrec)
 
 mdAtoms_ (mdAtoms)
 
template<NumVelocityScalingValues numVelocityScalingValues, ParrinelloRahmanVelocityScaling parrinelloRahmanVelocityScaling>
static void updateVelocities (int a, real dt, real lambda, const rvec *__restrict invMassPerDim, rvec *__restrict v, const rvec *__restrict f, const rvec diagPR, const matrix matrixPR)
 Update velocities.
 
static void updatePositions (int a, real dt, const rvec *__restrict x, rvec *__restrict xprime, const rvec *__restrict v)
 Update positions.
 
template<ParrinelloRahmanVelocityScaling parrinelloRahmanVelocityScaling>
static bool diagonalizePRMatrix (matrix matrixPR, rvec diagPR)
 Helper function diagonalizing the PR matrix if possible.
 
 scalingStepPR_ (-1)
 
 wcycle_ (wcycle)
 
static void runAllCallbacks (const std::vector< SignallerCallback > &callbacks, Step step, Time time)
 Helper function to call all callbacks in a list.
 
template<typename Element , typename... Args>
ISimulatorElement * getElementPointer (LegacySimulatorData *legacySimulatorData, ModularSimulatorAlgorithmBuilderHelper *builderHelper, StatePropagatorData *statePropagatorData, EnergyData *energyData, FreeEnergyPerturbationData *freeEnergyPerturbationData, GlobalCommunicationHelper *globalCommunicationHelper, Args &&...args)
 
template<typename Base , typename Element >
static std::enable_if_t
< std::is_base_of< Base,
Element >::value, Base * > 
castOrNull (Element *element)
 Returns a pointer casted to type Base if the Element is derived from Base.
 
template<typename Base , typename Element >
static std::enable_if_t
<!std::is_base_of< Base,
Element >::value, Base * > 
castOrNull (Element *element)
 Returns a nullptr of type Base if Element is not derived from Base.
 
 ddpCount_ (0)
 
 element_ (std::make_unique< Element >(this, fplog, cr, inputrec->nstxout, inputrec->nstvout, inputrec->nstfout, inputrec->nstxout_compressed, canMoleculesBeDistributedOverPBC, writeFinalConfiguration, finalConfigurationFilename, inputrec, globalTop))
 
 vvResetVelocities_ (false)
 
 isRegularSimulationEnd_ (false)
 
 lastStep_ (-1)
 
 globalState_ (globalState)
 
static void updateGlobalState (t_state *globalState, const PaddedHostVector< RVec > &x, const PaddedHostVector< RVec > &v, const tensor box, int ddpCount, int ddpCountCgGl, const std::vector< int > &cgGl)
 Update the legacy global state. More...
 
static void generateCoordinates (int multiplicationFactor, std::vector< gmx::RVec > *coordinates, matrix box)
 Generates coordinates and a box for the base system scaled by multiplicationFactor.
 
bool boxesAreEqual (const matrix box1, const matrix box2)
 Returns whether two boxes are of equal size and shape (within reasonable tolerance).
 
bool boxIsZero (const matrix box)
 Returns whether a box is only initialised to zero or not.
 
void shiftAtoms (const RVec &shift, ArrayRef< RVec > x)
 Shift all coordinates. More...
 
void placeCoordinatesWithCOMInBox (const PbcType &pbcType, UnitCellType unitCellType, CenteringType centerType, const matrix box, ArrayRef< RVec > x, const gmx_mtop_t &mtop, COMShiftType comShiftType)
 Moves collection of atoms along the center of mass into a box. More...
 
const char * centerTypeNames (CenteringType type)
 Get names for the different centering types. More...
 
const char * unitCellTypeNames (UnitCellType type)
 Get names for the different unit cell representation types. More...
 
static bool checkIfRandomDeviceIsFunctional ()
 Check if the RDRAND random device functioning correctly. More...
 
template<typename GeneratorType >
static uint64_t makeRandomSeedInternal (GeneratorType &gen)
 Get the next pure or pseudo-random number. More...
 
uint64_t makeRandomSeed ()
 Return 64 random bits from the random device, suitable as seed. More...
 
template<class RealType = real, unsigned int Bits, class Rng >
RealType generateCanonical (Rng &g)
 Generate a floating-point value with specified number of random bits. More...
 
void compileSelection (SelectionCollection *coll)
 
static void simdPrefetch (void *m)
 Prefetch memory at address m. More...
 
static void store (float *m, float a)
 Store contents of float variable to aligned memory m. More...
 
static void storeU (float *m, float a)
 Store contents of float variable to unaligned memory m. More...
 
static float fma (float a, float b, float c)
 Float Fused-multiply-add. Result is a*b + c. More...
 
static float fms (float a, float b, float c)
 Float Fused-multiply-subtract. Result is a*b - c. More...
 
static float fnma (float a, float b, float c)
 Float Fused-negated-multiply-add. Result is -a*b + c. More...
 
static float fnms (float a, float b, float c)
 Float Fused-negated-multiply-subtract. Result is -a*b - c. More...
 
static float maskAdd (float a, float b, float m)
 Add two float variables, masked version. More...
 
static float maskzMul (float a, float b, float m)
 Multiply two float variables, masked version. More...
 
static float maskzFma (float a, float b, float c, float m)
 Float fused multiply-add, masked version. More...
 
static float abs (float a)
 Float Floating-point abs(). More...
 
static float max (float a, float b)
 Set each float element to the largest from two variables. More...
 
static float min (float a, float b)
 Set each float element to the smallest from two variables. More...
 
static float round (float a)
 Float round to nearest integer value (in floating-point format). More...
 
static float trunc (float a)
 Truncate float, i.e. round towards zero - common hardware instruction. More...
 
static float reduce (float a)
 Return sum of all elements in float variable (i.e., the variable itself). More...
 
static float andNot (float a, float b)
 Bitwise andnot for two scalar float variables. More...
 
static bool testBits (float a)
 Return true if any bits are set in the float variable. More...
 
static bool anyTrue (bool a)
 Returns if the boolean is true. More...
 
static float selectByMask (float a, bool mask)
 Select from single precision variable where boolean is true. More...
 
static float selectByNotMask (float a, bool mask)
 Select from single precision variable where boolean is false. More...
 
static float blend (float a, float b, bool sel)
 Blend float selection. More...
 
static std::int32_t cvtR2I (float a)
 Round single precision floating point to integer. More...
 
static std::int32_t cvttR2I (float a)
 Truncate single precision floating point to integer. More...
 
static std::int32_t cvtI2R (std::int32_t a)
 Return integer. More...
 
static void store (double *m, double a)
 Store contents of double variable to aligned memory m. More...
 
static void storeU (double *m, double a)
 Store contents of double variable to unaligned memory m. More...
 
static double fma (double a, double b, double c)
 double Fused-multiply-add. Result is a*b + c. More...
 
static double fms (double a, double b, double c)
 double Fused-multiply-subtract. Result is a*b - c. More...
 
static double fnma (double a, double b, double c)
 double Fused-negated-multiply-add. Result is - a*b + c. More...
 
static double fnms (double a, double b, double c)
 double Fused-negated-multiply-subtract. Result is -a*b - c. More...
 
static double maskAdd (double a, double b, double m)
 Add two double variables, masked version. More...
 
static double maskzMul (double a, double b, double m)
 Multiply two double variables, masked version. More...
 
static double maskzFma (double a, double b, double c, double m)
 double fused multiply-add, masked version. More...
 
static double abs (double a)
 double doubleing-point abs(). More...
 
static double max (double a, double b)
 Set each double element to the largest from two variables. More...
 
static double min (double a, double b)
 Set each double element to the smallest from two variables. More...
 
static double round (double a)
 double round to nearest integer value (in doubleing-point format). More...
 
static double trunc (double a)
 Truncate double, i.e. round towards zero - common hardware instruction. More...
 
static double reduce (double a)
 Return sum of all elements in double variable (i.e., the variable itself). More...
 
static double andNot (double a, double b)
 Bitwise andnot for two scalar double variables. More...
 
static bool testBits (double a)
 Return true if any bits are set in the double variable. More...
 
static double selectByMask (double a, bool mask)
 Select from double precision variable where boolean is true. More...
 
static double selectByNotMask (double a, bool mask)
 Select from double precision variable where boolean is false. More...
 
static double blend (double a, double b, bool sel)
 Blend double selection. More...
 
static std::int32_t cvtR2I (double a)
 Round single precision doubleing point to integer. More...
 
static std::int32_t cvttR2I (double a)
 Truncate single precision doubleing point to integer. More...
 
static double cvtF2D (float a)
 Convert float to double (mimicks SIMD conversion) More...
 
static float cvtD2F (double a)
 Convert double to float (mimicks SIMD conversion) More...
 
static void store (std::int32_t *m, std::int32_t a)
 Store contents of integer variable to aligned memory m. More...
 
static void storeU (std::int32_t *m, std::int32_t a)
 Store contents of integer variable to unaligned memory m. More...
 
static std::int32_t andNot (std::int32_t a, std::int32_t b)
 Bitwise andnot for two scalar integer variables. More...
 
static bool testBits (std::int32_t a)
 Return true if any bits are set in the integer variable. More...
 
static std::int32_t selectByMask (std::int32_t a, bool mask)
 Select from integer variable where boolean is true. More...
 
static std::int32_t selectByNotMask (std::int32_t a, bool mask)
 Select from integer variable where boolean is false. More...
 
static std::int32_t blend (std::int32_t a, std::int32_t b, bool sel)
 Blend integer selection. More...
 
static bool cvtB2IB (bool a)
 Just return a boolean (mimicks SIMD real-to-int bool conversions) More...
 
static bool cvtIB2B (bool a)
 Just return a boolean (mimicks SIMD int-to-real bool conversions) More...
 
static float copysign (float x, float y)
 Composes single value with the magnitude of x and the sign of y. More...
 
static void invsqrtPair (float x0, float x1, float *out0, float *out1)
 Calculate 1/sqrt(x) for two floats. More...
 
static float inv (float x)
 Calculate 1/x for float. More...
 
static float maskzInvsqrt (float x, bool m)
 Calculate 1/sqrt(x) for masked entry of float. More...
 
static float maskzInv (float x, bool m)
 Calculate 1/x for masked entry of float. More...
 
template<MathOptimization opt = MathOptimization::Safe>
static float sqrt (float x)
 Float sqrt(x). This is the square root. More...
 
static float log (float x)
 Float log(x). This is the natural logarithm. More...
 
template<MathOptimization opt = MathOptimization::Safe>
static float exp2 (float x)
 Float 2^x. More...
 
template<MathOptimization opt = MathOptimization::Safe>
static float exp (float x)
 Float exp(x). More...
 
static float erf (float x)
 Float erf(x). More...
 
static float erfc (float x)
 Float erfc(x). More...
 
static void sincos (float x, float *sinval, float *cosval)
 Float sin & cos. More...
 
static float sin (float x)
 Float sin. More...
 
static float cos (float x)
 Float cos. More...
 
static float tan (float x)
 Float tan. More...
 
static float asin (float x)
 float asin. More...
 
static float acos (float x)
 Float acos. More...
 
static float atan (float x)
 Float atan. More...
 
static float atan2 (float y, float x)
 Float atan2(y,x). More...
 
static float pmeForceCorrection (float z2)
 Calculate the force correction due to PME analytically in float. More...
 
static float pmePotentialCorrection (float z2)
 Calculate the potential correction due to PME analytically in float. More...
 
static double copysign (double x, double y)
 Composes double value with the magnitude of x and the sign of y. More...
 
static void invsqrtPair (double x0, double x1, double *out0, double *out1)
 Calculate 1/sqrt(x) for two doubles. More...
 
static double inv (double x)
 Calculate 1/x for double. More...
 
static double maskzInvsqrt (double x, bool m)
 Calculate 1/sqrt(x) for masked entry of double. More...
 
static double maskzInv (double x, bool m)
 Calculate 1/x for masked entry of double. More...
 
template<MathOptimization opt = MathOptimization::Safe>
static double sqrt (double x)
 Double sqrt(x). This is the square root. More...
 
static double log (double x)
 Double log(x). This is the natural logarithm. More...
 
template<MathOptimization opt = MathOptimization::Safe>
static double exp2 (double x)
 Double 2^x. More...
 
template<MathOptimization opt = MathOptimization::Safe>
static double exp (double x)
 Double exp(x). More...
 
static double erf (double x)
 Double erf(x). More...
 
static double erfc (double x)
 Double erfc(x). More...
 
static void sincos (double x, double *sinval, double *cosval)
 Double sin & cos. More...
 
static double sin (double x)
 Double sin. More...
 
static double cos (double x)
 Double cos. More...
 
static double tan (double x)
 Double tan. More...
 
static double asin (double x)
 Double asin. More...
 
static double acos (double x)
 Double acos. More...
 
static double atan (double x)
 Double atan. More...
 
static double atan2 (double y, double x)
 Double atan2(y,x). More...
 
static double pmeForceCorrection (double z2)
 Calculate the force correction due to PME analytically in double. More...
 
static double pmePotentialCorrection (double z2)
 Calculate the potential correction due to PME analytically in double. More...
 
static double invsqrtSingleAccuracy (double x)
 Calculate 1/sqrt(x) for double, but with single accuracy. More...
 
static void invsqrtPairSingleAccuracy (double x0, double x1, double *out0, double *out1)
 Calculate 1/sqrt(x) for two doubles, but with single accuracy. More...
 
static double invSingleAccuracy (double x)
 Calculate 1/x for double, but with single accuracy. More...
 
static double maskzInvsqrtSingleAccuracy (double x, bool m)
 Calculate 1/sqrt(x) for masked entry of double, but with single accuracy. More...
 
static double maskzInvSingleAccuracy (double x, bool m)
 Calculate 1/x for masked entry of double, but with single accuracy. More...
 
static double sqrtSingleAccuracy (double x)
 Calculate sqrt(x) for double, but with single accuracy. More...
 
static double logSingleAccuracy (double x)
 Double log(x), but with single accuracy. This is the natural logarithm. More...
 
static double exp2SingleAccuracy (double x)
 Double 2^x, but with single accuracy. More...
 
static double expSingleAccuracy (double x)
 Double exp(x), but with single accuracy. More...
 
static double erfSingleAccuracy (double x)
 Double erf(x), but with single accuracy. More...
 
static double erfcSingleAccuracy (double x)
 Double erfc(x), but with single accuracy. More...
 
static void sincosSingleAccuracy (double x, double *sinval, double *cosval)
 Double sin & cos, but with single accuracy. More...
 
static double sinSingleAccuracy (double x)
 Double sin, but with single accuracy. More...
 
static double cosSingleAccuracy (double x)
 Double cos, but with single accuracy. More...
 
static double tanSingleAccuracy (double x)
 Double tan, but with single accuracy. More...
 
static double asinSingleAccuracy (double x)
 Double asin, but with single accuracy. More...
 
static double acosSingleAccuracy (double x)
 Double acos, but with single accuracy. More...
 
static double atanSingleAccuracy (double x)
 Double atan, but with single accuracy. More...
 
static double atan2SingleAccuracy (double y, double x)
 Double atan2(y,x), but with single accuracy. More...
 
static double pmeForceCorrectionSingleAccuracy (double z2)
 Force correction due to PME in double, but with single accuracy. More...
 
static double pmePotentialCorrectionSingleAccuracy (double z2)
 Potential correction due to PME in double, but with single accuracy. More...
 
template<int align>
static void gatherLoadTranspose (const float *base, const std::int32_t offset[], float *v0, float *v1, float *v2, float *v3)
 Load 4 consecutive floats from base/offset into four variables. More...
 
template<int align>
static void gatherLoadTranspose (const float *base, const std::int32_t offset[], float *v0, float *v1)
 Load 2 consecutive floats from base/offset into four variables. More...
 
template<int align>
static void gatherLoadUTranspose (const float *base, const std::int32_t offset[], float *v0, float *v1, float *v2)
 Load 3 consecutive floats from base/offsets, store into three vars. More...
 
template<int align>
static void transposeScatterStoreU (float *base, const std::int32_t offset[], float v0, float v1, float v2)
 Store 3 floats to 3 to base/offset. More...
 
template<int align>
static void transposeScatterIncrU (float *base, const std::int32_t offset[], float v0, float v1, float v2)
 Add 3 floats to base/offset. More...
 
template<int align>
static void transposeScatterDecrU (float *base, const std::int32_t offset[], float v0, float v1, float v2)
 Subtract 3 floats from base/offset. More...
 
static void expandScalarsToTriplets (float scalar, float *triplets0, float *triplets1, float *triplets2)
 Copy single float to three variables. More...
 
template<int align>
static void gatherLoadBySimdIntTranspose (const float *base, std::int32_t offset, float *v0, float *v1, float *v2, float *v3)
 Load 4 floats from base/offsets and store into variables. More...
 
template<int align>
static void gatherLoadUBySimdIntTranspose (const float *base, std::int32_t offset, float *v0, float *v1)
 Load 2 floats from base/offsets and store into variables (unaligned). More...
 
template<int align>
static void gatherLoadBySimdIntTranspose (const float *base, std::int32_t offset, float *v0, float *v1)
 Load 2 floats from base/offsets and store into variables (aligned). More...
 
static float reduceIncr4ReturnSum (float *m, float v0, float v1, float v2, float v3)
 Add each float to four consecutive memory locations, return sum. More...
 
template<int align>
static void gatherLoadTranspose (const double *base, const std::int32_t offset[], double *v0, double *v1, double *v2, double *v3)
 Load 4 consecutive doubles from base/offset into four variables. More...
 
template<int align>
static void gatherLoadTranspose (const double *base, const std::int32_t offset[], double *v0, double *v1)
 Load 2 consecutive doubles from base/offset into four variables. More...
 
template<int align>
static void gatherLoadUTranspose (const double *base, const std::int32_t offset[], double *v0, double *v1, double *v2)
 Load 3 consecutive doubles from base/offsets, store into three vars. More...
 
template<int align>
static void transposeScatterStoreU (double *base, const std::int32_t offset[], double v0, double v1, double v2)
 Store 3 doubles to 3 to base/offset. More...
 
template<int align>
static void transposeScatterIncrU (double *base, const std::int32_t offset[], double v0, double v1, double v2)
 Add 3 doubles to base/offset. More...
 
template<int align>
static void transposeScatterDecrU (double *base, const std::int32_t offset[], double v0, double v1, double v2)
 Subtract 3 doubles from base/offset. More...
 
static void expandScalarsToTriplets (double scalar, double *triplets0, double *triplets1, double *triplets2)
 Copy single double to three variables. More...
 
template<int align>
static void gatherLoadBySimdIntTranspose (const double *base, std::int32_t offset, double *v0, double *v1, double *v2, double *v3)
 Load 4 doubles from base/offsets and store into variables. More...
 
template<int align>
static void gatherLoadUBySimdIntTranspose (const double *base, std::int32_t offset, double *v0, double *v1)
 Load 2 doubles from base/offsets and store into variables (unaligned). More...
 
template<int align>
static void gatherLoadBySimdIntTranspose (const double *base, std::int32_t offset, double *v0, double *v1)
 Load 2 doubles from base/offsets and store into variables (aligned). More...
 
static double reduceIncr4ReturnSum (double *m, double v0, double v1, double v2, double v3)
 Add each double to four consecutive memory locations, return sum. More...
 
std::unique_ptr< IMDModule > createSwapCoordinatesModule ()
 Creates a module for Computational Electrophysiology swapping.
 
bool decideWhetherToUseGpusForNonbondedWithThreadMpi (TaskTarget nonbondedTarget, int numDevicesToUse, const std::vector< int > &userGpuTaskAssignment, EmulateGpuNonbonded emulateGpuNonbonded, bool buildSupportsNonbondedOnGpu, bool nonbondedOnGpuIsUseful, int numRanksPerSimulation)
 Decide whether this thread-MPI simulation will run nonbonded tasks on GPUs. More...
 
bool decideWhetherToUseGpusForPmeWithThreadMpi (bool useGpuForNonbonded, TaskTarget pmeTarget, int numDevicesToUse, const std::vector< int > &userGpuTaskAssignment, const gmx_hw_info_t &hardwareInfo, const t_inputrec &inputrec, int numRanksPerSimulation, int numPmeRanksPerSimulation)
 Decide whether this thread-MPI simulation will run PME tasks on GPUs. More...
 
bool decideWhetherToUseGpusForNonbonded (TaskTarget nonbondedTarget, const std::vector< int > &userGpuTaskAssignment, EmulateGpuNonbonded emulateGpuNonbonded, bool buildSupportsNonbondedOnGpu, bool nonbondedOnGpuIsUseful, bool gpusWereDetected)
 Decide whether the simulation will try to run nonbonded tasks on GPUs. More...
 
bool decideWhetherToUseGpusForPme (bool useGpuForNonbonded, TaskTarget pmeTarget, const std::vector< int > &userGpuTaskAssignment, const gmx_hw_info_t &hardwareInfo, 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 determinePmeRunMode (bool useGpuForPme, const TaskTarget &pmeFftTarget, const t_inputrec &inputrec)
 Determine PME run mode. More...
 
bool 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 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 useReplicaExchange, bool haveFrozenAtoms, bool doRerun, const DevelopmentFeatureFlags &devFlags, const gmx::MDLogger &mdlog)
 Decide whether to use GPU for update. More...
 
bool decideWhetherToUseGpuForHalo (const DevelopmentFeatureFlags &devFlags, bool havePPDomainDecomposition, bool useGpuForNonbonded, bool useModularSimulator, bool doRerun, bool haveEnergyMinimization)
 Decide whether to use GPU for halo exchange. More...
 
SimulationWorkload createSimulationWorkload (const t_inputrec &inputrec, bool disableNonbondedCalculation, const DevelopmentFeatureFlags &devFlags, bool useGpuForNonbonded, PmeRunMode pmeRunMode, bool useGpuForBonded, bool useGpuForUpdate, bool useGpuDirectHalo)
 Build datastructure that contains decisions whether to run different workload task on GPUs. More...
 
std::vector< GpuTaskfindGpuTasksOnThisRank (bool haveGpusOnThisPhysicalNode, TaskTarget nonbondedTarget, TaskTarget pmeTarget, TaskTarget bondedTarget, TaskTarget updateTarget, bool useGpuForNonbonded, bool useGpuForPme, bool rankHasPpTask, bool rankHasPmeTask)
 Returns container of all tasks on this rank that are eligible for GPU execution. More...
 
GpuTasksOnRanks findAllGpuTasksOnThisNode (ArrayRef< const GpuTask > gpuTasksOnThisRank, const PhysicalNodeCommunicator &physicalNodeComm)
 Returns container of all tasks on all ranks of this node that are eligible for GPU execution. More...
 
void reportGpuUsage (const MDLogger &mdlog, ArrayRef< const GpuTaskAssignment > gpuTaskAssignmentOnRanksOfThisNode, size_t numGpuTasksOnThisNode, size_t numPpRanks, bool printHostName, bool useGpuForBonded, PmeRunMode pmeRunMode, bool useGpuForUpdate)
 Log a report on how GPUs are being used on the ranks of the physical node of rank 0 of the simulation. More...
 
void checkHardwareOversubscription (int numThreadsOnThisRank, int rank, const HardwareTopology &hwTop, const PhysicalNodeCommunicator &comm, const MDLogger &mdlog)
 Warns for oversubscribing the hardware threads, when that is the case.
 
template<GpuTask TaskType>
static bool hasTaskType (const GpuTaskMapping &mapping)
 Function for whether the task of mapping has value TaskType. More...
 
static bool hasPmeOrNonbondedTask (const GpuTaskMapping &mapping)
 Function for whether the mapping has the GPU PME or Nonbonded task. More...
 
static std::vector< int > parseGpuDeviceIdentifierList (const std::string &gpuIdString)
 Parse a GPU ID specifier string into a container. More...
 
std::vector< int > parseUserGpuIdString (const std::string &gpuIdString)
 Parse a GPU ID specifier string into a container describing device IDs exposed to the run. More...
 
std::vector< int > makeGpuIdsToUse (const std::vector< std::unique_ptr< DeviceInformation >> &deviceInfoList, const std::string &gpuIdsAvailableString)
 Implement GPU ID selection by returning the available GPU IDs on this physical node that are compatible. More...
 
std::vector< int > parseUserTaskAssignmentString (const std::string &gpuIdString)
 Parse a GPU ID specifier string into a container describing device ID to task mapping. More...
 
std::vector< int > makeGpuIds (ArrayRef< const int > compatibleGpus, size_t numGpuTasks)
 Make a vector containing numGpuTasks IDs of the IDs found in compatibleGpus. More...
 
std::string makeGpuIdString (const std::vector< int > &gpuIds, int totalNumberOfTasks)
 Convert a container of GPU deviced IDs to a string that can be used by gmx tune_pme as input to mdrun -gputasks. More...
 
void checkUserGpuIds (const std::vector< std::unique_ptr< DeviceInformation >> &deviceInfoList, const std::vector< int > &compatibleGpus, const std::vector< int > &gpuIds)
 Check that all user-selected GPUs are compatible. More...
 
void writeHeader (TextWriter *writer, const std::string &text, const std::string &section, bool writeFormattedText)
 Write appropiate Header to output stream. More...
 
void writeSystemInformation (TextWriter *writer, const gmx_mtop_t &top, bool writeFormattedText)
 Write information about the molecules in the system. More...
 
void writeParameterInformation (TextWriter *writer, const t_inputrec &ir, bool writeFormattedText)
 Write information about system parameters. More...
 
void writeInformation (TextOutputFile *outputStream, const t_inputrec &ir, const gmx_mtop_t &top, bool writeFormattedText, bool notStdout)
 Wrapper for writing out information. More...
 
void blockaToExclusionBlocks (const t_blocka *b, gmx::ArrayRef< ExclusionBlock > b2)
 Convert the exclusions. More...
 
void exclusionBlocksToBlocka (gmx::ArrayRef< const ExclusionBlock > b2, t_blocka *b)
 Convert the exclusions expressed in b into t_blocka form.
 
void mergeExclusions (ListOfLists< int > *excl, gmx::ArrayRef< ExclusionBlock > b2)
 Merge the contents of b2 into excl. More...
 
gmx_rmpbc_t gmx_rmpbc_init (const gmx::TopologyInformation &topInfo)
 Convenience overload useful for implementing legacy tools.
 
static std::size_t getPageSize ()
 Return a page size, from a sysconf/WinAPI query if available, or a default guess (4096 bytes). More...
 
std::size_t pageSize ()
 Return the memory page size on this system. More...
 
template<typename T >
ArrayRef< std::conditional_t
< std::is_const< T >::value,
const typename T::value_type,
typename T::value_type > > 
makeArrayRef (T &c)
 Create ArrayRef from container with type deduction. More...
 
template<typename T >
ArrayRef< const typename
T::value_type > 
makeConstArrayRef (const T &c)
 Create ArrayRef to const T from container with type deduction. More...
 
template<typename T >
void swap (ArrayRef< T > &a, ArrayRef< T > &b)
 Simple swap method for ArrayRef objects. More...
 
template<typename T >
std::vector< T > copyOf (const ArrayRef< const T > &arrayRef)
 Return a vector that is a copy of an ArrayRef. More...
 
template<typename T >
index ssize (const T &t)
 Return signed size of container.
 
void printBinaryInformation (FILE *fp, const IProgramContext &programContext)
 Print basic information about the executable. More...
 
void printBinaryInformation (FILE *fp, const IProgramContext &programContext, const BinaryInformationSettings &settings)
 Print basic information about the executable with custom settings. More...
 
void printBinaryInformation (TextWriter *writer, const IProgramContext &programContext, const BinaryInformationSettings &settings)
 Print basic information about the executable with custom settings. More...
 
std::string bromacs ()
 Return a cool definition for the acronym GROMACS.
 
std::string getCoolQuote ()
 Return a string with a cool quote.
 
std::string getCudaDriverVersionString ()
 Returns a string of the CUDA driver version.
 
std::string getCudaRuntimeVersionString ()
 Returns a string of the CUDA runtime version.
 
template<typename EnumerationArrayType >
EnumerationArrayType::EnumerationWrapperType keysOf (const EnumerationArrayType &)
 Returns an object that provides iterators over the keys associated with EnumerationArrayType. More...
 
const char * getErrorCodeString (int errorcode)
 Returns a short string description of an error code. More...
 
void printFatalErrorMessage (FILE *fp, const std::exception &ex)
 Formats a standard fatal error message for reporting an exception. More...
 
std::string formatExceptionMessageToString (const std::exception &ex)
 Formats an error message for reporting an exception. More...
 
void formatExceptionMessageToFile (FILE *fp, const std::exception &ex)
 Formats an error message for reporting an exception. More...
 
void formatExceptionMessageToWriter (TextWriter *writer, const std::exception &ex)
 Formats an error message for reporting an exception. More...
 
int processExceptionAtExit (const std::exception &ex)
 Handles an exception that is causing the program to terminate. More...
 
void processExceptionAsFatalError (const std::exception &ex)
 Helper function for terminating the program on an exception. More...
 
template<class Exception , class Tag , class T >
std::enable_if_t
< std::is_base_of
< GromacsException, Exception >
::value, Exception > 
operator<< (Exception ex, const ExceptionInfo< Tag, T > &item)
 Associates extra information with an exception. More...
 
void fclose_wrapper (FILE *fp)
 fclose wrapper to be used as unique_ptr deleter
 
const DataFileFindergetLibraryFileFinder ()
 Gets a finder for locating data files from share/top/. More...
 
void setLibraryFileFinder (const DataFileFinder *finder)
 Sets a finder for location data files from share/top/. More...
 
std::string findLibraryFile (const std::string &filename, bool bAddCWD=true, bool bFatal=true)
 Finds full path for a library file. More...
 
std::string findLibraryFile (const char *filename, bool bAddCWD=true, bool bFatal=true)
 Finds full path for a library file. More...
 
FilePtr openLibraryFile (const std::string &filename, bool bAddCWD=true, bool bFatal=true)
 Opens a library file for reading in an RAII-style FILE handle. More...
 
FilePtr openLibraryFile (const char *filename, bool bAddCWD=true, bool bFatal=true)
 Opens a library file for reading in an RAII-style FILE handle. More...
 
void init (int *argc, char ***argv)
 Initializes the GROMACS library. More...
 
void finalize ()
 Deinitializes the GROMACS library. More...
 
void writeKeyValueTreeAsMdp (TextWriter *writer, const KeyValueTreeObject &tree)
 Write a flat key-value tree to writer in mdp style. More...
 
void niceHeader (TextWriter *writer, const char *fn, char commentChar)
 Prints creation time stamp and user information into a string as comments, and returns it. More...
 
void MPI_Comm_free_wrapper (MPI_Comm *comm)
 Wrapper function for RAII-style cleanup. More...
 
const IProgramContextgetProgramContext ()
 Returns the global IProgramContext instance. More...
 
void setProgramContext (const IProgramContext *context)
 Sets the global IProgramContext instance. More...
 
template<typename ValueType , int NumExpectedValues>
static std::optional
< std::array< ValueType,
NumExpectedValues > > 
parsedArrayFromInputString (const std::string &str)
 Convert a string into an array of values. More...
 
template<typename ValueType , int NumExpectedValues>
static std::string stringIdentityTransformWithArrayCheck (const std::string &toConvert, const std::string &errorContextMessage)
 Returns the input string, throwing an excpetion if the demanded conversion to an array will not succeed. More...
 
std::size_t countWords (const char *s)
 Returns number of space-separated words in zero-terminated char ptr. More...
 
std::size_t countWords (const std::string &str)
 Returns the number of space-separated words in a string object. More...
 
bool endsWith (const char *str, const char *suffix)
 Tests whether a string ends with another string. More...
 
std::string stripSuffixIfPresent (const std::string &str, const char *suffix)
 Removes a suffix from a string. More...
 
std::string stripString (const std::string &str)
 Removes leading and trailing whitespace from a string. More...
 
std::string formatString (const char *fmt,...)
 Formats a string (snprintf() wrapper). More...
 
std::string formatStringV (const char *fmt, va_list ap)
 Formats a string (vsnprintf() wrapper). More...
 
std::vector< std::string > splitString (const std::string &str)
 Splits a string to whitespace separated tokens. More...
 
std::vector< std::string > splitDelimitedString (const std::string &str, char delim)
 Splits a string to tokens separated by a given delimiter. More...
 
std::vector< std::string > splitAndTrimDelimitedString (const std::string &str, char delim)
 Splits str to tokens separated by delimiter delim. Removes leading and trailing whitespace from those strings with std::isspace. More...
 
std::string replaceAll (const std::string &input, const char *from, const char *to)
 Replace all occurrences of a string with another string. More...
 
std::string replaceAll (const std::string &input, const std::string &from, const std::string &to)
 Replace all occurrences of a string with another string. More...
 
std::string replaceAllWords (const std::string &input, const char *from, const char *to)
 Replace whole words with others. More...
 
std::string replaceAllWords (const std::string &input, const std::string &from, const std::string &to)
 Replace whole words with others. More...
 
bool equalCaseInsensitive (const std::string &source, const std::string &target)
 Return whether two strings are equal, ignoring case. More...
 
bool equalCaseInsensitive (const std::string &source, const std::string &target, size_t maxLengthOfComparison)
 Checks if at most maxLengthOfComparison characters of two strings match case insensitive. More...
 
static bool isNullOrEmpty (const char *str)
 Tests whether a string is null or empty. More...
 
static bool startsWith (const std::string &str, const std::string &prefix)
 Tests whether a string starts with another string. More...
 
static bool startsWith (const char *str, const char *prefix)
 Tests whether a string starts with another string. More...
 
static bool endsWith (const std::string &str, const char *suffix)
 Tests whether a string ends with another string. More...
 
static bool contains (const std::string &str, const char *substr)
 Tests whether a string contains another as a substring. More...
 
static bool contains (const std::string &str, const std::string &substr)
 Tests whether a string contains another as a substring. More...
 
static bool endsWith (const std::string &str, const std::string &suffix)
 Tests whether a string ends with another string. More...
 
template<typename InputIterator , typename FormatterType >
std::string formatAndJoin (InputIterator begin, InputIterator end, const char *separator, const FormatterType &formatter)
 Formats all the range as strings, and then joins them with a separator in between. More...
 
template<typename ContainerType , typename FormatterType >
std::string formatAndJoin (const ContainerType &container, const char *separator, const FormatterType &formatter)
 Formats all elements of the container as strings, and then joins them with a separator in between. More...
 
template<typename InputIterator >
std::string joinStrings (InputIterator begin, InputIterator end, const char *separator)
 Joins strings from a range with a separator in between. More...
 
template<typename ContainerType >
std::string joinStrings (const ContainerType &container, const char *separator)
 Joins strings from a container with a separator in between. More...
 
template<size_t count>
std::string joinStrings (const char *const (&array)[count], const char *separator)
 Joins strings from an array with a separator in between. More...
 
template<class Function >
auto dispatchTemplatedFunction (Function &&f)
 
template<class Function , class Enum , class... Enums>
auto dispatchTemplatedFunction (Function &&f, Enum e, Enums...es)
 
template<class T >
void free_wrapper (T *p)
 Wrapper of standard library free(), to be used as unique_cptr deleter for memory allocated by malloc, e.g. by an external library such as TNG.
 
template<class T >
void sfree_wrapper (T *p)
 sfree wrapper to be used as unique_cptr deleter
 
template<typename T , typename D >
std::unique_ptr< T, D > create_unique_with_deleter (T *t, D d)
 Create unique_ptr with any deleter function or lambda.
 
int gmx_mdrun (int argc, char *argv[])
 Implements C-style main function for mdrun. More...
 
int gmx_mdrun (MPI_Comm communicator, const gmx_hw_info_t &hwinfo, int argc, char *argv[])
 Implements C-style main function for mdrun. More...
 
template<typename T >
std::remove_const_t< T > norm (T *v)
 Forward operations on C Array style vectors to C implementations. More...
 
template<typename T >
std::remove_const_t< T > norm2 (T *v)
 
void applyGlobalSimulationState (const SimulationInput &simulationInput, PartialDeserializedTprFile *partialDeserializedTpr, t_state *globalState, t_inputrec *inputrec, gmx_mtop_t *globalTopology)
 Get the global simulation input. More...
 
std::unique_ptr< t_stateglobalSimulationState (const SimulationInput &)
 
void applyGlobalInputRecord (const SimulationInput &, t_inputrec *)
 
void applyGlobalTopology (const SimulationInput &, gmx_mtop_t *)
 

Variables

const gmx::EnumerationArray
< XvgFormat, const char * > 
c_xvgFormatNames
 Names for XvgFormat. More...
 
static const int c_linewidth = 80 - 2
 Linewidth used for warning output.
 
static const int c_indent = 0
 Indent used for warning output.
 
static const int c_biasMaxNumDim = 4
 The maximum dimensionality of the AWH coordinate.
 
const char * eawhtarget_names [eawhtargetNR+1]
 String for target distribution. More...
 
const char * eawhgrowth_names [eawhgrowthNR+1] = { "exp-linear", "linear", nullptr }
 String for weight histogram growth.
 
const char * eawhpotential_names [eawhpotentialNR+1] = { "convolved", "umbrella", nullptr }
 String for AWH potential type.
 
const char * eawhcoordprovider_names [eawhcoordproviderNR+1] = { "pull", "fep-lambda", nullptr }
 String for AWH bias reaction coordinate provider.
 
static const EnumerationArray
< DensitySimilarityMeasureMethod,
const char * > 
c_densitySimilarityMeasureMethodNames
 Name the methods that may be used to evaluate similarity between densities. More...
 
static const EnumerationArray
< DensityFittingAmplitudeMethod,
const char * > 
c_densityFittingAmplitudeMethodNames
 The names of the methods to determine the amplitude of the atoms to be spread on a grid. More...
 
static const EnumerationArray
< ChangeSettingType, const
char * > 
c_changeSettingTypeNames
 Mapping for enums from ChangeSettingType. More...
 
static const EnumerationArray
< ChangeAtomsType, const char * > 
c_changeAtomsTypeNames
 Mapping for enums from ChangeAtomsType. More...
 
static constexpr Architecture c_architecture
 Constant that tells what the architecture is. More...
 
constexpr int c_loopWait = 1
 How long shall we wait in seconds until we check for a connection again?
 
constexpr int c_connectWait = 1
 How long shall we check for the IMD_GO?
 
constexpr int c_headerSize = 8
 IMD Header Size.
 
constexpr int c_protocolVersion = 2
 IMD Protocol Version.
 
static const char * eIMDType_names [IMD_NR+1]
 Names of the IMDType for error messages. More...
 
static const char IMDstr [] = "IMD:"
 Tag output from the IMD module with this string. More...
 
constexpr int c_maxConnections = 1
 Currently only 1 client connection is supported.
 
static constexpr int numFTypesOnGpu = 8
 The number on bonded function types supported on GPUs.
 
constexpr std::array< int,
numFTypesOnGpu
fTypesOnGpu
 List of all bonded function types supported on GPUs. More...
 
static const int simd_width = 1
 Define simd_width for memory allocation used for SIMD code.
 
static constexpr int c_ftypeVsiteStart = F_VSITE1
 The start value of the vsite indices in the ftype enum. More...
 
static constexpr int c_ftypeVsiteEnd = F_VSITEN + 1
 The start and end value of the vsite indices in the ftype enum.
 
constexpr bool BUGFREE_NOEXCEPT_STRING = std::is_nothrow_move_assignable<std::string>::value
 Work-around for GCC bug 58265 still present in CentOS 7 devtoolset-7.
 
static const EnumerationArray
< AtomLocality, const char * > 
c_atomLocalityNames
 Descriptive strings for atom localities. More...
 
static const EnumerationArray
< InteractionLocality, const
char * > 
c_interactionLocalityNames
 Descriptive strings for interaction localities. More...
 
static const
gmx::EnumerationArray
< MtsForceGroups, std::string > 
mtsForceGroupNames
 
const std::array< RVec, 2 > c_forces = { { { 0.5, 0.1, 1.2 }, { -2.1, 0.2, 0.3 } } }
 
 boxRel_ { { 0 } }
 
 boxVelocity_ { { 0 } }
 
 previousBox_ { { 0 } }
 
static EnumerationArray
< CenteringType, const char * > 
c_centeringTypeShortNames
 Names for different centering types. More...
 
static EnumerationArray
< UnitCellType, const char * > 
c_unitCellTypeShortNames
 Names for different centering types. More...
 

Typedef Documentation

template<class T >
using gmx::AlignedAllocator = typedef Allocator<T, AlignedAllocationPolicy>

Aligned memory allocator.

Template Parameters
TType of objects to allocate

This convenience partial specialization can be used for the optional allocator template parameter in standard library containers, which is necessary e.g. to use SIMD aligned load and store operations on data in those containers. The memory will always be aligned according to the behavior of AlignedAllocationPolicy.

template<class ElementType >
using gmx::BasicMatrix3x3 = typedef MultiDimArray<std::array<ElementType, 3 * 3>, extents<3, 3>>

Three-by-three matrix of ElementType.

Template Parameters
ElementTypetype of element to be stored in matrix
using gmx::BoxMatrix = typedef std::array<std::array<real, 3 >, 3 >

A 3x3 matrix data type useful for simulation boxes.

Todo:
Implement a full replacement for C-style real[DIM][DIM]

Default fast and accurate random engine in Gromacs.

This engine will return 2*2^64 random results using the default gmx::RandomDomain::Other stream, and can be initialized with a single seed argument without having to remember empty template angle brackets.

template<class T >
using gmx::HostAllocator = typedef Allocator<T, HostAllocationPolicy>

Memory allocator that uses HostAllocationPolicy.

Template Parameters
TType of objects to allocate

This convenience partial specialization can be used for the optional allocator template parameter in standard library containers whose memory may be used for e.g. GPU transfers. The memory will always be allocated according to the behavior of HostAllocationPolicy.

Enum for types of IMD messages.

We use the same records as the NAMD/VMD IMD implementation.

using gmx::index = typedef std::ptrdiff_t

Integer type for indexing into arrays or vectors.

Same as ptrdiff_t.

Three-by-three real number matrix.

Note
will replace the C-style real[3][3] "matrix"
template<class T >
using gmx::PageAlignedAllocator = typedef Allocator<T, PageAlignedAllocationPolicy>

PageAligned memory allocator.

Template Parameters
TType of objects to allocate

This convenience partial specialization can be used for the optional allocator template parameter in standard library containers, which is necessary for locking memory pages for asynchronous transfer between a GPU device and the host. The memory will always be aligned according to the behavior of PageAlignedAllocationPolicy.

typedef std::random_device gmx::RandomDevice

Random device.

For now this is identical to the standard library, but since we use the GROMACS random module for all other random engines and distributions it is convenient to have this too in the same module.

Enumeration Type Documentation

Enumeration for mdrun appending behavior.

Enumerator
Auto 

Append only if user command-line and file input is correct.

Appending 

Must append.

NoAppending 

Must not append.

enum gmx::Architecture
strong

Enum for GROMACS CPU hardware detection support.

Enumerator
X86 

Not one of the cases below.

Arm 

X86.

PowerPC 

ARM.

IBM PowerPC

enum gmx::AtomLocality : int
strong

Atom locality indicator: local, non-local, all.

Used for calls to: gridding, force calculation, x/f buffer operations

Enumerator
Local 

Local atoms.

NonLocal 

Non-local atoms.

All 

Both local and non-local atoms.

Count 

The number of atom locality types.

Enum with the AWH variables to write.

Enumerator
MetaData 

Meta data.

CoordValue 

Coordinate value.

Pmf 

The pmf.

Bias 

The bias.

Visits 

The number of visits.

Weights 

The weights.

Target 

The target distribition.

ForceCorrelationVolume 

The volume of the force correlation tensor.

FrictionTensor 

The full friction tensor.

Enum with the types of metadata to write.

Enumerator
NumBlock 

The number of blocks.

TargetError 

The target error.

ScaledSampleWeight 

The logarithm of the sample weight relative to a sample weight of 1 at the initial time.

Count 

The number of enum values, not including Count.

enum gmx::CheckpointSignal
strong

Checkpoint signals.

Signals set and read by CheckpointHandler. Possible signals include

  • nothing to signal
  • do checkpoint (at next NS step)
enum gmx::CoordinateFileFlags : unsigned long
strong

The enums here define the flags specifying the requirements of different outputadapter modules.

When building the object for deciding on the output to a new coordinate file, the CoordinateFile object needs to be able to validate that the dependencies of attached IOutputAdapters are fulfilled. Classes and interfaces that use the enum can check their dependencies against the information encoded in the flags and can then perform an appropriate reaction if there is a mismatch.

Todo:
Use std::bitset<16> for the entries.
Enumerator
Base 

Base setting that says that the module has no requirements.

Sets the flags to default setting to make sure all output methods are supported.

RequireForceOutput 

Requires output method to support force output.

If set, only output methods supporting writing of forces will work, others will generate an invalid input error.

RequireVelocityOutput 

Requires output method to support velocity output.

If set, only writing to files that support velocity output will succeed. Other writing methods will generate an error.

RequireAtomConnections 

Requires support for connection information in output format.

If set, only file output that supports writing of connection information will succeed. This means for now that only PDB and TNG files can be written. Other file writing methods will fail.

RequireAtomInformation 

Requires that output format supports the writing of atom information to the file.

If set, files will only be written if they can output the information from t_atoms and otherwise create an error while writing.

RequireChangedOutputPrecision 

Requires that output format supports writing user-specified output precision.

If set, output will only be written if the format supports the writing of custom precision of the included data.

RequireNewFrameStartTime 

Requires that output format supports writing time to the file.

RequireNewFrameTimeStep 

Requires that output format supports writing time to the file.

RequireNewBox 

Requires that output format supports writing box information.

RequireCoordinateSelection 

Requires output to support changes to selection of coordinates.

Default for most methods, will need to be able to write coordinates to output file or generate an error.

Count 

Needed for enumeration array.

enum gmx::DdRankOrder
strong

The options for the domain decomposition MPI task ordering.

Enumerator
select 

First value (needed to cope with command-line parsing)

interleave 

Interleave the PP and PME ranks.

pp_pme 

First all PP ranks, all PME rank at the end.

cartesian 

Use Cartesian communicators for PP, PME and PP-PME.

Count 

The number of options.

The methods that determine how amplitudes are spread on a grid in density guided simulations.

Enumerator
Unity 

same spread amplitude, unity, for all atoms

Mass 

atom mass is the spread amplitude

Charge 

partial charge determines the spread amplitude

The methods that determine how two densities are compared to one another.

Enumerator
innerProduct 

Measure similarity between densities as normalized inner product of their voxel values.

\[ \mathrm{Similarity}(\rho_{\mathrm{r}},\rho_{\mathrm{c}}) = \frac{1}{N_\mathrm{voxel}}/\sum_{v=1}^{N_\mathrm{voxel}} \rho^v_{\mathrm{r}} \rho^v_{\mathrm{c}} \]

relativeEntropy 

Measure similarity between densities by negative relative entropy.

Note
Voxels with negative values are ignored.

\[ \mathrm{Similarity}(\rho_{\mathrm{r}},\rho_{\mathrm{c}}) = \sum_{v=1}^{N_\mathrm{voxel}} \rho^v_{\mathrm{r}} (\log(\rho^v_{\mathrm{c}}) - \log(\rho^v_{\mathrm{r}})) \]

crossCorrelation 

Measure similarity between densities by cross correlation.

\[ \mathrm{Similarity}(\rho_{\mathrm{r}},\rho_{\mathrm{c}}) = \frac{\sum_{v}\left((\rho_{\mathrm{r}} - \bar{\rho}_{\mathrm{r}})(\rho_{\mathrm{c}} - \bar{\rho}_{\mathrm{c}})\right)} {\sqrt{\sum_v(\rho_{\mathrm{r}} - \bar{\rho}_{\mathrm{r}})^2 \sum_v (\rho_{\mathrm{c}} - \bar{\rho}_{\mathrm{c}})^2}} \]

enum gmx::DeviceStreamType : int
strong

Class enum to describe the different logical streams used for GPU work.

Whether the actual streams differ is an implementation detail of the manager class.

Enumerator
NonBondedLocal 

Stream primarily for short-ranged local nonbonded work.

NonBondedNonLocal 

Stream primarily for short-ranged nonlocal nonbonded work.

Pme 

Stream primarily for PME work.

PmePpTransfer 

Stream primarily for data exchange between PME and PP ranks.

UpdateAndConstraints 

Stream primarily for update and constraints.

Count 

Conventional termination of the enumeration.

enum gmx::DlbOption
strong

The options for the dynamic load balancing.

Enumerator
select 

First value (needed to cope with command-line parsing)

turnOnWhenUseful 

Turn on DLB when we think it would improve performance.

no 

Never turn on DLB.

yes 

Turn on DLB from the start and keep it on.

Count 

The number of options.

enum gmx::EmulateGpuNonbonded : bool
strong

Help pass GPU-emulation parameters with type safety.

Enumerator
No 

Do not emulate GPUs.

Yes 

Do emulate GPUs.

enum gmx::EndianSwapBehavior : int
strong

Specify endian swapping behavoir.

Enumerator
DoNotSwap 

Don't touch anything.

Swap 

User-enforced swapping.

SwapIfHostIsBigEndian 

Only swap if machine we execute on is big-endian.

SwapIfHostIsLittleEndian 

Only swap if machine we execute on is little-endian.

Count 

Number of possible behaviors.

Tells make_at2con how to treat flexible constraints.

Enumerator
Include 

Include all flexible constraints.

Exclude 

Exclude all flexible constraints.

enum gmx::GpuTask : int
strong

Types of compute tasks that can be run on a GPU.

These names refer to existing practice in GROMACS, which is not strictly accurate.

Enumerator
Nonbonded 

Short-ranged interactions.

Pme 

Long-ranged interactions.

Count 

Number of possible tasks.

Enum for types of IMD messages.

We use the same records as the NAMD/VMD IMD implementation.

Enumerator
IMD_DISCONNECT 

client disconnect

IMD_ENERGIES 

energy data

IMD_FCOORDS 

atomic coordinates

IMD_GO 

start command for the simulation

IMD_HANDSHAKE 

handshake to determine little/big endianness

IMD_KILL 

terminates the simulation

IMD_MDCOMM 

force data

IMD_PAUSE 

pauses the simulation

IMD_TRATE 

sets the IMD transmission and processing rate

IMD_IOERROR 

I/O error.

IMD_NR 

number of entries

enum gmx::InteractionLocality : int
strong

Interaction locality indicator: local, non-local, all.

Used for calls to: pair-search, force calculation, x/f buffer operations

Enumerator
Local 

Interactions between local atoms only.

NonLocal 

Interactions between non-local and (non-)local atoms.

Count 

The number of interaction locality types.

enum gmx::MrcDataMode : int32_t
strong

The type of density data stored in an mrc file. As named in "EMDB Map Distribution Format Description Version 1.01 (c) emdatabank.org 2014" Modes 0-4 are defined by the standard. NOTE only mode 2 is currently implemented and used.

Enumerator
uInt8 

compressed data mode, 8 bits, signed byte (range -128 to 127, ISO/IEC 10967)

int16 

16 bits, signed integer (range -32768 to 32767, ISO/IEC 10967)

float32 

32 bits, floating point number (IEEE 754)

complexInt32 

32 bits, complex signed integers (ISO/IEC 10967)

complexFloat64 

64 bits, complex floating point numbers (IEEE 754)

enum gmx::MtsForceGroups : int
strong

Force group available for selection for multiple time step integration.

Enumerator
LongrangeNonbonded 

PME-mesh or Ewald for electrostatics and/or LJ.

Nonbonded 

Non-bonded pair interactions.

Pair 

Bonded pair interactions.

Dihedral 

Dihedrals, including cmap (not restraints)

Angle 

Bonded angle potentials (not restraints)

Pull 

COM pulling.

Awh 

Accelerated weight histogram method.

Count 

The number of groups above.

enum gmx::Normalization
strong

Enum with different ways of normalizing the output.

Enumerator
None 

No normalization.

Coordinate 

Scale using the internal/user input coordinate scaling factor.

FreeEnergy 

Normalize free energy values by subtracting the minimum value.

Distribution 

Normalize the distribution to 1.

Sets the number of different temperature coupling values.

This is needed to template the kernel

Todo:
Unify with similar enum in CPU update module
Enumerator
None 

No temperature coupling.

Single 

Single T-scaling value (one group)

Multiple 

Multiple T-scaling values, need to use T-group indices.

Count 

Number of valid values.

enum gmx::PbcMode
strong

PBC modes for vsite construction and spreading.

Enumerator
all 

Apply normal, simple PBC for all vsites.

none 

No PBC treatment needed.

enum gmx::PinningPolicy : int
strong

Helper enum for pinning policy of the allocation of HostAllocationPolicy.

For an efficient non-blocking transfer (e.g. to a GPU), the memory pages for a buffer need to be pinned to a physical page. Aligning such buffers to a physical page should miminize the number of pages that need to be pinned. However, some buffers that may be used for such transfers may also be used in either GROMACS builds or run paths that cannot use such a device, so the policy can be configured so that the resource consumption is no higher than required for correct, efficient operation in all cases.

enum gmx::RandomDomain
strong

Enumerated values for fixed part of random seed (domain)

Random numbers are used in many places in GROMACS, and to avoid identical streams the random seeds should be different. Instead of keeping track of several different user-provided seeds, it is better to use the fact that generators like ThreeFry take two 64-bit keys, and combine a general user-provided 64-bit random seed with a second constant value from this list to make each stream guaranteed unique.

Note
There is no reason to go overboard with adding options; we only need to guarantee different streams for cases that might be present simultaneously in a single simulation. As an example, two different integrators (or thermostats) can reuse the same domain.
When you do add options, leave some space between the values so you can group new options with old ones without changing old values.
Enumerator
Other 

Generic - stream uniqueness is not important.

MaxwellVelocities 

Veolcity assignment from Maxwell distribution.

TestParticleInsertion 

Test particle insertion.

UpdateCoordinates 

Particle integrators.

UpdateConstraints 

Second integrator step for constraints.

Thermostat 

Stochastic temperature coupling.

Barostat 

Stochastic pressure coupling.

ReplicaExchange 

Replica exchange metropolis moves.

ExpandedEnsemble 

Expanded ensemble lambda moves.

AwhBiasing 

AWH biasing reference value moves.

enum gmx::ResetSignal
strong

Reset signals.

Signals set and read by ResetHandler. Possible signals include

  • nothing to signal
  • reset counters (as soon as signal is received)
enum gmx::SpaceGroup : int32_t
strong

Space group in three dimensions.

Currently only "no symmetry" is supported, the complete enum class would hold 230 symbols.

Table 12.3.4.1 Standard space-group symbols, pages 824-831, International Tables for Crystallography, Volume A, fifth edition

Enumerator
P1 

no symmetry

enum gmx::StartingBehavior : int
strong

Enumeration for describing how mdrun is (re)starting.

Enumerator
RestartWithAppending 

Restarting with appending, if a checkpoint is supplied and other conditions are met.

RestartWithoutAppending 

Restarting without appending, when a checkpoint is supplied.

NewSimulation 

Not restarting.

Count 

Mark the end of the enumeration.

enum gmx::StopSignal
strong

Stop signals.

Signals that stop conditions can send to all ranks. Possible signals include

  • nothing to signal
  • stop at the next neighbor-searching step
  • stop as soon as signal is received

Different variants of the Parrinello-Rahman velocity scaling.

This is needed to template the kernel

Todo:
Unify with similar enum in CPU update module
Enumerator
None 

Do not apply velocity scaling (not a PR-coupling run or step)

Diagonal 

Apply velocity scaling using a diagonal matrix.

Count 

Number of valid values.

enum gmx::VirtualSiteVirialHandling : int
strong

Tells how to handle virial contributions due to virtual sites.

Enumerator
None 

Do not compute virial contributions.

Pbc 

Add contributions working over PBC to shift forces.

NonLinear 

Compute contributions due to non-linear virtual sites.

Function Documentation

static float gmx::abs ( float  a)
inlinestatic

Float Floating-point abs().

Parameters
aany floating point values
Returns
abs(a) for each element.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::abs ( double  a)
inlinestatic

double doubleing-point abs().

Parameters
aany doubleing point values
Returns
abs(a) for each element.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static float gmx::acos ( float  x)
inlinestatic

Float acos.

Parameters
xThe argument to evaluate acos for
Returns
Acos(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::acos ( double  x)
inlinestatic

Double acos.

Parameters
xThe argument to evaluate acos for
Returns
Acos(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::acosSingleAccuracy ( double  x)
inlinestatic

Double acos, but with single accuracy.

Parameters
xThe argument to evaluate acos for
Returns
Acos(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static bool gmx::addMessageIfNotSupported ( ArrayRef< const std::string >  errorReasons,
std::string *  error 
)
static

Help build a descriptive message in error if there are errorReasons why bondeds on a GPU are not supported.

Returns
Whether the lack of errorReasons indicate there is support.
static OutputAdapterContainer gmx::addOutputAdapters ( const OutputRequirements &  requirements,
AtomsDataPtr  atoms,
const Selection &  sel,
unsigned long  abilities 
)
static

Creates a new container object with the user requested IOutputAdapter derived methods attached to it.

Parameters
[in]requirementsSpecifications for modules to add.
[in]atomsLocal copy of atom information to use.
[in]selSelection to use for choosing atoms to write out.
[in]abilitiesSpecifications for what the output method can do.
Returns
New container for IoutputAdapter derived methods.
static void gmx::adjustAtomInformation ( t_atoms *  atoms,
t_atoms *  selectionAtoms,
const Selection &  sel 
)
static

Modify atoms information in coordinate frame to fit output selection.

Changes the information contained in the coordinate frame t_atoms struct to match the selection provided to the module.

Parameters
[in]atomsPointer to original t_atoms.
[in]selectionAtomsPointer to local atoms.
[in]selReference to selection.
bool gmx::advancePointInSubgrid ( const BiasGrid &  grid,
const awh_ivec  subgridOrigin,
const awh_ivec  subgridNpoints,
int *  gridPointIndex 
)

Find the next grid point in the sub-part of the grid given a starting point.

The given grid point index is updated to the next valid grid point index by traversing the sub-part of the grid, here termed the subgrid. Since the subgrid range might extend beyond the actual size of the grid, the subgrid is traversed until a point both in the subgrid and grid is found. If no point is found, the function returns false and the index is not modified. The starting point needs to be inside of the subgrid. However, if this index is not given, meaning < 0, then the search is initialized at the subgrid origin, i.e. in this case the "next" grid point index is defined to be the first common grid/subgrid point.

Parameters
[in]gridThe grid.
[in]subgridOriginVector locating the subgrid origin relative to the grid origin.
[in]subgridNpointsNumber of points along each subgrid dimension.
[in,out]gridPointIndexPointer to the starting/next grid point index.
Returns
true if the grid point was updated.
static float gmx::andNot ( float  a,
float  b 
)
inlinestatic

Bitwise andnot for two scalar float variables.

Parameters
adata1
bdata2
Returns
(~data1) & data2
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::andNot ( double  a,
double  b 
)
inlinestatic

Bitwise andnot for two scalar double variables.

Parameters
adata1
bdata2
Returns
(~data1) & data2
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static std::int32_t gmx::andNot ( std::int32_t  a,
std::int32_t  b 
)
inlinestatic

Bitwise andnot for two scalar integer variables.

Parameters
adata1
bdata2
Returns
(~data1) & data2
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static bool gmx::anyDimUsesProvider ( const AwhBiasParams &  awhBiasParams,
const int  awhCoordProvider 
)
static

Checks whether any dimension uses the given coordinate provider type.

Parameters
[in]awhBiasParamsThe bias params to check.
[in]awhCoordProviderThe type of coordinate provider
Returns
true if any dimension of the bias is linked to the given provider
static bool gmx::anyDimUsesProvider ( const AwhParams &  awhParams,
const int  awhCoordProvider 
)
static

Checks whether any dimension uses the given coordinate provider type.

Parameters
[in]awhParamsThe AWH params to check.
[in]awhCoordProviderThe type of coordinate provider
Returns
true if any dimension of awh is linked to the given provider type.
static bool gmx::anyDimUsesPull ( const ArrayRef< BiasCoupledToSystem >  biasCoupledToSystem)
static

Checks whether any dimension uses pulling as a coordinate provider.

Parameters
[in]biasCoupledToSystemThe AWH biases to check.
Returns
true if any dimension of the provided biases is linked to pulling.
static bool gmx::anyTrue ( bool  a)
inlinestatic

Returns if the boolean is true.

Parameters
aLogical variable.
Returns
true if a is true, otherwise false.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
void gmx::applyGlobalSimulationState ( const SimulationInput &  simulationInput,
PartialDeserializedTprFile partialDeserializedTpr,
t_state globalState,
t_inputrec *  inputrec,
gmx_mtop_t *  globalTopology 
)

Get the global simulation input.

Acquire global simulation data structures from the SimulationInput handle. Note that global data is returned in the calling thread. In parallel computing contexts, the client is responsible for calling only where needed.

Example: if (SIMMASTER(cr)) { // Only the master rank has the global state globalState = globalSimulationState(simulationInput);

// Read (nearly) all data required for the simulation applyGlobalInputRecord(simulationInput, inputrec); applyGlobalTopology(simulationInput, &mtop); }

Todo:
Factor the logic for global/local and master-rank-checks. The SimulationInput utilities should behave properly for the various distributed data scenarios. Consider supplying data directly to the consumers rather than exposing the implementation details of the legacy aggregate types.
void gmx::applyLocalState ( const SimulationInput &  simulationInput,
t_fileio *  logfio,
const t_commrec *  cr,
int *  dd_nc,
t_inputrec *  ir,
t_state state,
ObservablesHistory *  observablesHistory,
bool  reproducibilityRequested,
const MdModulesNotifier &  notifier,
gmx::ReadCheckpointDataHolder *  modularSimulatorCheckpointData,
bool  useModularSimulator 
)

Initialize local stateful simulation data.

Establish an invariant for the simulator at a trajectory point. Call on all ranks (after domain decomposition and task assignments).

After this call, the simulator has all of the information it will receive in order to advance a trajectory from the current step. Checkpoint information has been applied, if applicable, and stateful data has been (re)initialized.

Warning
Mdrunner instances do not clearly distinguish between global and local versions of t_state.
Todo:
Factor the distributed data aspects of simulation input data into the SimulationInput implementation.
Todo:
Consider refactoring to decouple the checkpoint facility from its consumers (state, observablesHistory, mdModulesNotifier, and parts of ir).
Warning
It is the caller’s responsibility to make sure that preconditions are satisfied for the parameter objects.
See Also
globalSimulationState()
applyGlobalInputRecord()
applyGlobalTopology()
static float gmx::asin ( float  x)
inlinestatic

float asin.

Parameters
xThe argument to evaluate asin for
Returns
Asin(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::asin ( double  x)
inlinestatic

Double asin.

Parameters
xThe argument to evaluate asin for
Returns
Asin(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::asinSingleAccuracy ( double  x)
inlinestatic

Double asin, but with single accuracy.

Parameters
xThe argument to evaluate asin for
Returns
Asin(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static void gmx::assignVsitesToThread ( VsiteThread *  tData,
int  thread,
int  nthread,
int  natperthread,
gmx::ArrayRef< int >  taskIndex,
ArrayRef< const InteractionList >  ilist,
ArrayRef< const t_iparams >  ip,
const unsigned short *  ptype 
)
static

Here we try to assign all vsites that are in our local range.

Our task local atom range is tData->rangeStart - tData->rangeEnd. Vsites that depend only on local atoms, as indicated by taskIndex[]==thread, are assigned to task tData->ilist. Vsites that depend on non-local atoms but not on other vsites are assigned to task tData->id_task.ilist. taskIndex[] is set for all vsites in our range, either to our local tasks or to the single last task as taskIndex[]=2*nthreads.

static float gmx::atan ( float  x)
inlinestatic

Float atan.

Parameters
xThe argument to evaluate atan for
Returns
Atan(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::atan ( double  x)
inlinestatic

Double atan.

Parameters
xThe argument to evaluate atan for
Returns
Atan(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static float gmx::atan2 ( float  y,
float  x 
)
inlinestatic

Float atan2(y,x).

Parameters
yY component of vector, any quartile
xX component of vector, any quartile
Returns
Atan(y,x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::atan2 ( double  y,
double  x 
)
inlinestatic

Double atan2(y,x).

Parameters
yY component of vector, any quartile
xX component of vector, any quartile
Returns
Atan(y,x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::atan2SingleAccuracy ( double  y,
double  x 
)
inlinestatic

Double atan2(y,x), but with single accuracy.

Parameters
yY component of vector, any quartile
xX component of vector, any quartile
Returns
Atan(y,x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::atanSingleAccuracy ( double  x)
inlinestatic

Double atan, but with single accuracy.

Parameters
xThe argument to evaluate atan for
Returns
Atan(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<class BasicMdspan >
constexpr std::enable_if_t<BasicMdspan::is_always_contiguous(), typename BasicMdspan::pointer> gmx::begin ( const BasicMdspan &  basicMdspan)

Free begin function addressing memory of a contiguously laid out basic_mdspan.

Note
Changing the elements that basic_mdspan views does not change the view itself, so a single begin that takes a const view suffices.
void gmx::biasesAreCompatibleForSharingBetweenSimulations ( const AwhParams &  awhParams,
const std::vector< size_t > &  pointSize,
const gmx_multisim_t *  multiSimComm 
)

Checks if biases are compatible for sharing between simulations, throws if not.

Should be called simultaneously on the master rank of every simulation. Note that this only checks for technical compatibility. It is up to the user to check that the sharing physically makes sense. Throws an exception when shared biases are not compatible.

Parameters
[in]awhParamsThe AWH parameters.
[in]pointSizeVector of grid-point sizes for each bias.
[in]multiSimCommStruct for multi-simulation communication.
static float gmx::blend ( float  a,
float  b,
bool  sel 
)
inlinestatic

Blend float selection.

Parameters
aFirst source
bSecond source
selBoolean selector
Returns
Select b if sel is true, a otherwise.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::blend ( double  a,
double  b,
bool  sel 
)
inlinestatic

Blend double selection.

Parameters
aFirst source
bSecond source
selBoolean selector
Returns
Select b if sel is true, a otherwise.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static std::int32_t gmx::blend ( std::int32_t  a,
std::int32_t  b,
bool  sel 
)
inlinestatic

Blend integer selection.

Parameters
aFirst source
bSecond source
selBoolean selector
Returns
Select b if sel is true, a otherwise.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
void gmx::blockaToExclusionBlocks ( const t_blocka *  b,
gmx::ArrayRef< ExclusionBlock >  b2 
)

Convert the exclusions.

Convert t_blocka exclusions in b into ExclusionBlock form and include them in b2.

Parameters
[in]bExclusions in t_blocka form.
[in,out]b2ExclusionBlocks to populate with t_blocka exclusions.
bool gmx::buildSupportsGpuBondeds ( std::string *  error)

Checks whether the GROMACS build allows to compute bonded interactions on a GPU.

Parameters
[out]errorIf non-null, the diagnostic message when bondeds cannot run on a GPU.
Returns
true when this build can run bonded interactions on a GPU, false otherwise.
Exceptions
std::bad_allocwhen out of memory.
real gmx::calculateAcceptanceWeight ( int  calculationMode,
real  lambdaEnergyDifference 
)

Calculates the acceptance weight for a lambda state transition.

Parameters
[in]calculationModeHow the lambda weights are calculated
[in]lambdaEnergyDifferenceThe difference in energy between the two states
Returns
The acceptance weight
const char * gmx::centerTypeNames ( CenteringType  type)

Get names for the different centering types.

Parameters
[in]typeWhat name needs to be provided.
template<typename PinnableVector >
void gmx::changePinningPolicy ( PinnableVector *  v,
PinningPolicy  pinningPolicy 
)

Helper function for changing the pinning policy of a pinnable vector.

If the vector has contents, then a full reallocation and buffer copy are needed if the policy change requires tighter restrictions, and desirable even if the policy change requires looser restrictions. That cost is OK, because GROMACS will do this operation very rarely (e.g. when auto-tuning and deciding to switch whether a task will run on a GPU, or not).

void gmx::checkAwhParams ( const AwhParams *  awhParams,
const t_inputrec *  inputrec,
warninp_t  wi 
)

Check the AWH parameters.

Parameters
[in,out]awhParamsThe AWH parameters.
[in]inputrecInput parameter struct.
[in,out]wiStruct for bookeeping warnings.
static DeviceStatus gmx::checkGpu ( size_t  deviceId,
const DeviceInformation &  deviceInfo 
)
static

Check whether the ocl_gpu_device is suitable for use by mdrun.

Runs sanity checks: checking that the runtime can compile a dummy kernel and this can be executed; Runs compatibility checks verifying the device OpenCL version requirement and vendor/OS support.

Parameters
[in]deviceIdThe runtime-reported numeric ID of the device.
[in]deviceInfoThe device info pointer.
Returns
A DeviceStatus to indicate if the GPU device is supported and if it was able to run basic functionality checks.
static bool gmx::checkIfRandomDeviceIsFunctional ( )
static

Check if the RDRAND random device functioning correctly.

Due to a bug in AMD Ryzen microcode, RDRAND may always return -1 (0xFFFFFFFF). To avoid that, fall back to using PRNG instead of RDRAND if this happens.

Returns
The result of the checks.
static void gmx::checkInputConsistencyInterval ( const AwhParams *  awhParams,
warninp_t  wi 
)
static

Check if the starting configuration is consistent with the given interval.

Parameters
[in]awhParamsAWH parameters.
[in,out]wiStruct for bookeeping warnings.
template<typename VersionEnum >
VersionEnum gmx::checkpointVersion ( const ReadCheckpointData *  checkpointData,
const std::string &  key,
const VersionEnum  programVersion 
)

Read a checkpoint version enum variable.

This reads the checkpoint version from file. The read version is returned.

If the read version is more recent than the code version, this throws an error, since we cannot know what has changed in the meantime. Using newer checkpoint files with old code is not a functionality we can offer. Note, however, that since the checkpoint version is saved by module, older checkpoint files of all simulations that don't use that specific module can still be used.

Allowing backwards compatibility of files (i.e., reading an older checkpoint file with a newer version of the code) is in the responsibility of the caller module. They can use the returned file checkpoint version to do that:

const auto fileVersion = checkpointVersion(checkpointData, "version", c_currentVersion);
if (fileVersion >= CheckpointVersion::AddedX)
{
    checkpointData->scalar("x", &x_));
}
Template Parameters
VersionEnumThe type of the checkpoint version enum
Parameters
checkpointDataA reading checkpoint data object
keyThe key under which the version is saved - also used for error output
programVersionThe checkpoint version of the current code
Returns
The checkpoint version read from file
template<typename VersionEnum >
VersionEnum gmx::checkpointVersion ( WriteCheckpointData *  checkpointData,
const std::string &  key,
const VersionEnum  programVersion 
)

Write the current code checkpoint version enum variable.

Write the current program checkpoint version to the checkpoint data object. Returns the written checkpoint version to mirror the signature of the reading version.

Template Parameters
VersionEnumThe type of the checkpoint version enum
Parameters
checkpointDataA writing checkpoint data object
keyThe key under which the version is saved
programVersionThe checkpoint version of the current code
Returns
The checkpoint version written to file
void gmx::checkUserGpuIds ( const std::vector< std::unique_ptr< DeviceInformation >> &  deviceInfoList,
const std::vector< int > &  compatibleGpus,
const std::vector< int > &  gpuIds 
)

Check that all user-selected GPUs are compatible.

Given the gpuIds and hardwareInfo, throw if any selected GPUs is not compatible.

The error is given with a suitable descriptive message, which will have context if this check is done after the hardware detection results have been reported to the user. However, note that only the GPUs detected on the master rank are reported, because of the existing limitations of that reporting.

Todo:
Note that the selected GPUs can be different on each rank, and the IDs of compatible GPUs can be different on each node, so this routine ought to do communication to determine whether all ranks are able to proceed. Currently this relies on the MPI runtime to kill the other processes because GROMACS lacks the appropriate infrastructure to do a good job of coordinating error messages and behaviour across MPMD ranks and multiple simulations.
Parameters
[in]deviceInfoListInformation on the GPUs on this physical node.
[in]compatibleGpusVector of GPUs that are compatible
[in]gpuIdsThe GPU IDs selected by the user.
Exceptions
std::bad_allocIf out of memory InconsistentInputError If the assigned GPUs are not valid
real gmx::computeMaxUpdateGroupRadius ( const gmx_mtop_t &  mtop,
gmx::ArrayRef< const RangePartitioning >  updateGroups,
real  temperature 
)

Returns the maximum update group radius.

Note
When updateGroups is empty, 0 is returned.
Parameters
[in]mtopThe system topology
[in]updateGroupsList of update group, size should match the number of moltypes in mtop or be 0
[in]temperatureThe maximum reference temperature, pass -1 when unknown or not applicable
void gmx::constrain_coordinates ( gmx::Constraints *  constr,
bool  do_log,
bool  do_ene,
int64_t  step,
t_state state,
ArrayRefWithPadding< RVec >  xp,
real dvdlambda,
gmx_bool  computeVirial,
tensor  constraintsVirial 
)

Constraint coordinates.

The dvdlambda contribution has to be added to the bonded interactions

bool gmx::constrain_lincs ( bool  computeRmsd,
const t_inputrec &  ir,
int64_t  step,
Lincs *  lincsd,
const real invmass,
const t_commrec *  cr,
const gmx_multisim_t *  ms,
ArrayRefWithPadding< const RVec x,
ArrayRefWithPadding< RVec xprime,
ArrayRef< RVec min_proj,
const matrix  box,
t_pbc pbc,
bool  hasMassPerturbed,
real  lambda,
real dvdlambda,
real  invdt,
ArrayRef< RVec v,
bool  bCalcVir,
tensor  vir_r_m_dr,
ConstraintVariable  econq,
t_nrnb *  nrnb,
int  maxwarn,
int *  warncount 
)

Applies LINCS constraints.

Returns
true if the constraining succeeded.
void gmx::constrain_velocities ( gmx::Constraints *  constr,
bool  do_log,
bool  do_ene,
int64_t  step,
t_state state,
real dvdlambda,
gmx_bool  computeVirial,
tensor  constraintsVirial 
)

Constrain velocities only.

The dvdlambda contribution has to be added to the bonded interactions

template<int numPartnerAtoms>
static real gmx::constraintGroupRadius ( const gmx_moltype_t moltype,
gmx::ArrayRef< const t_iparams >  iparams,
const int  centralAtom,
const ListOfLists< int > &  at2con,
const std::unordered_multimap< int, int > &  angleIndices,
const real  constraintLength,
const real  temperature 
)
static

When possible, computes the maximum radius of constrained atom in an update group.

Supports groups with 2 or 3 atoms where all partner atoms are connected to each other by angle potentials. The temperature is used to compute a radius that is not exceeded with a chance of 10^-9. Note that this computation assumes there are no other strong forces working on these angular degrees of freedom. The return value is -1 when all partners are not connected to each other by one angle potential, when a potential is perturbed or when an angle could reach more than 180 degrees.

static void gmx::construct_vsites ( const ThreadingInfo *  threadingInfo,
ArrayRef< RVec >  x,
real  dt,
ArrayRef< RVec >  v,
ArrayRef< const t_iparams >  ip,
ArrayRef< const InteractionList >  ilist,
const DomainInfo &  domainInfo,
const matrix  box 
)
static

Dispatch the vsite construction tasks for all threads.

Parameters
[in]threadingInfoUsed to divide work over threads when != nullptr
[in,out]xCoordinates to construct vsites for
[in]dtTime step, needed when v is not empty
[in,out]vWhen not empty, velocities are generated for virtual sites
[in]ipInteraction parameters for all interaction, only vsite parameters are used
[in]ilistThe interaction lists, only vsites are usesd
[in]domainInfoInformation about PBC and DD
[in]boxUsed for PBC when PBC is set in domainInfo
static void gmx::construct_vsites_thread ( ArrayRef< RVec >  x,
const real  dt,
ArrayRef< RVec >  v,
ArrayRef< const t_iparams >  ip,
ArrayRef< const InteractionList >  ilist,
const t_pbc pbc_null 
)
static

Executes the vsite construction task for a single thread.

Parameters
[in,out]xCoordinates to construct vsites for
[in]dtTime step, needed when v is not empty
[in,out]vWhen not empty, velocities are generated for virtual sites
[in]ipInteraction parameters for all interaction, only vsite parameters are used
[in]ilistThe interaction lists, only vsites are usesd
[in]pbc_nullPBC struct, used for PBC distance calculations when !=nullptr
void gmx::constructVirtualSites ( ArrayRef< RVec >  x,
ArrayRef< const t_iparams >  ip,
ArrayRef< const InteractionList >  ilist 
)

Create positions of vsite atoms based for the local system.

Parameters
[in,out]xThe coordinates
[in]ipInteraction parameters
[in]ilistThe interaction list
void gmx::constructVirtualSitesGlobal ( const gmx_mtop_t &  mtop,
ArrayRef< RVec >  x 
)

Create positions of vsite atoms for the whole system assuming all molecules are wholex.

Parameters
[in]mtopThe global topology
[in,out]xThe global coordinates
static CheckpointSignal gmx::convertToCheckpointSignal ( signed char  sig)
inlinestatic

Convert signed char (as used by SimulationSignal) to CheckpointSignal enum.

Expected values are sig == 0 – no signal sig >= 1 – signal received

static ResetSignal gmx::convertToResetSignal ( signed char  sig)
inlinestatic

Convert signed char (as used by SimulationSignal) to ResetSignal enum.

Expected values are sig == 0 – no signal sig >= 1 – signal received

static StopSignal gmx::convertToStopSignal ( signed char  sig)
inlinestatic

Convert signed char (as used by SimulationSignal) to StopSignal enum.

  • Expected values are sig == 0 – no signal sig >= 1 – stop at next NS sig <= -1 – stop asap
static float gmx::copysign ( float  x,
float  y 
)
inlinestatic

Composes single value with the magnitude of x and the sign of y.

Parameters
xValue to set sign for
yValue used to set sign
Returns
Magnitude of x, sign of y
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::copysign ( double  x,
double  y 
)
inlinestatic

Composes double value with the magnitude of x and the sign of y.

Parameters
xValue to set sign for
yValue used to set sign
Returns
Magnitude of x, sign of y
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static float gmx::cos ( float  x)
inlinestatic

Float cos.

Parameters
xThe argument to evaluate cos for
Returns
Cos(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::cos ( double  x)
inlinestatic

Double cos.

Parameters
xThe argument to evaluate cos for
Returns
Cos(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::cosSingleAccuracy ( double  x)
inlinestatic

Double cos, but with single accuracy.

Parameters
xThe argument to evaluate cos for
Returns
Cos(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
int gmx::countInterUpdategroupVsites ( const gmx_mtop_t &  mtop,
ArrayRef< const RangePartitioning >  updateGroupingPerMoleculetype 
)

Return the number of virtual sites that cross update groups.

Parameters
[in]mtopThe global topology
[in]updateGroupingPerMoleculetypeUpdate grouping per molecule type, pass empty when not using update groups
static int64_t gmx::countSamples ( const std::vector< PointState > &  pointState)
static

Count the total number of samples / sample weight over all grid points.

Parameters
[in]pointStateThe state of the points in a bias.
Returns
the total sample count.
static int gmx::countTrailingZeroRows ( const double *const *  data,
int  numRows,
int  numColumns 
)
static

Count trailing data rows containing only zeros.

Parameters
[in]data2D data array.
[in]numRowsNumber of rows in array.
[in]numColumnsNumber of cols in array.
Returns
the number of trailing zero rows.
bool gmx::cpuIsX86Nehalem ( const CpuInfo &  cpuInfo)

Return true if the CPU is an Intel x86 Nehalem.

Parameters
cpuInfoObject with cpu information
Returns
True if running on Nehalem CPU
std::unique_ptr< IMDModule > gmx::createElectricFieldModule ( )

Creates a module for an external electric field.

The returned class describes the time dependent electric field that can be applied to all charges in a simulation. The field is described by the following: E(t) = A cos(omega*(t-t0))*exp(-sqr(t-t0)/(2.0*sqr(sigma))); If sigma = 0 there is no pulse and we have instead E(t) = A cos(omega*t)

force is kJ mol^-1 nm^-1 = e * kJ mol^-1 nm^-1 / e

WARNING: There can be problems with the virial. Since the field is not self-consistent this is unavoidable. For neutral molecules the virial is correct within this approximation. For neutral systems with many charged molecules the error is small. But for systems with a net charge or a few charged molecules the error can be significant when the field is high. Solution: implement a self-consistent electric field into PME.

SimulationWorkload gmx::createSimulationWorkload ( const t_inputrec &  inputrec,
bool  disableNonbondedCalculation,
const DevelopmentFeatureFlags &  devFlags,
bool  useGpuForNonbonded,
PmeRunMode  pmeRunMode,
bool  useGpuForBonded,
bool  useGpuForUpdate,
bool  useGpuDirectHalo 
)

Build datastructure that contains decisions whether to run different workload task on GPUs.

Parameters
[in]inputrecThe input record
[in]disableNonbondedCalculationDisable calculation of nonbonded forces
[in]devFlagsThe development feature flags
[in]useGpuForNonbondedWhether we have short-range nonbonded interactions calculations on GPU(s).
[in]pmeRunModeRun mode indicating what resource is PME execured on.
[in]useGpuForBondedWhether bonded interactions are calculated on GPU(s).
[in]useGpuForUpdateWhether coordinate update and constraint solving is performed on GPU(s).
[in]useGpuDirectHaloWhether halo exchange is performed directly between GPUs.
Returns
Simulation lifetime constant workload description.
std::unique_ptr< TrajectoryFrameWriter > gmx::createTrajectoryFrameWriter ( const gmx_mtop_t *  top,
const Selection &  sel,
const std::string &  filename,
AtomsDataPtr  atoms,
OutputRequirements  requirements 
)

Factory function for TrajectoryFrameWriter.

Used to initialize a new instance of TrajectoryFrameWriter with the user supplied information for writing trajectory data to disk. Information needed is the file type, file name corresponding to the type, if available topology information and selection information.

If supplied, the modules contained within adapters are registered on the TrajectoryFrameWriter if possible.

The factory function is responsible for the initial santity checks concerning file types and availability of topology information, with the registration of modules being the second part.

Parameters
[in]topPointer to full topology or null.
[in]selReference to global selection used to construct the object.
[in]filenameName of new output file, used to deduce file type.
[in]atomsSmart Pointer to atoms data or null.
[in]requirementsContainer for settings obtained to specify which OutputAdapters should be registered.
Exceptions
InconsistentInputErrorWhen user input and requirements don't match.
void gmx::cshake ( const int  iatom[],
int  ncon,
int *  nnit,
int  maxnit,
ArrayRef< const real constraint_distance_squared,
ArrayRef< RVec >  positions,
const t_pbc pbc,
ArrayRef< const RVec >  initial_displacements,
ArrayRef< const real half_of_reduced_mass,
real  omega,
const real  invmass[],
ArrayRef< const real distance_squared_tolerance,
ArrayRef< real scaled_lagrange_multiplier,
int *  nerror 
)

Inner kernel for SHAKE constraints.

Regular iterative shake.

Original implementation from R.C. van Schaik and W.F. van Gunsteren (ETH Zuerich, June 1992), adapted for GROMACS by David van der Spoel November 1992.

The algorithm here is based section five of Ryckaert, Ciccotti and Berendsen, J Comp Phys, 23, 327, 1977.

Parameters
[in]iatomMini-topology of triplets of constraint type (unused in this function) and indices of two atoms involved
[in]nconNumber of constraints
[out]nnitNumber of iterations performed
[in]maxnitMaximum number of iterations permitted
[in]constraint_distance_squaredThe objective value for each constraint
[in,out]positionsThe initial (and final) values of the positions of all atoms
[in]pbcPBC information
[in]initial_displacementsThe initial displacements of each constraint
[in]half_of_reduced_massHalf of the reduced mass for each constraint
[in]omegaSHAKE over-relaxation factor (set non-1.0 by using shake-sor=yes in the .mdp, but there is no documentation anywhere)
[in]invmassInverse mass of each atom
[in]distance_squared_toleranceMultiplicative tolerance on the difference in the square of the constrained distance (see code)
[out]scaled_lagrange_multiplierScaled Lagrange multiplier for each constraint (-2 * eta from p. 336 of the paper, divided by the constraint distance)
[out]nerrorZero upon success, returns one more than the index of the problematic constraint if the input was malformed
Todo:
Make SHAKE use better data structures, in particular for iatom.
std::array< real, efptNR > gmx::currentLambdas ( int64_t  step,
const t_lambda &  fepvals,
int  currentLambdaState 
)

Evaluate the current lambdas.

Parameters
[in]stepthe current simulation step
[in]fepvalsdescribing the lambda setup
[in]currentLambdaStatethe lambda state to use to set the lambdas, -1 if not set
Returns
the current lambda-value array
static bool gmx::cvtB2IB ( bool  a)
inlinestatic

Just return a boolean (mimicks SIMD real-to-int bool conversions)

Parameters
aboolean
Returns
same boolean
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static float gmx::cvtD2F ( double  a)
inlinestatic

Convert double to float (mimicks SIMD conversion)

Parameters
adouble
Returns
a, as float
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::cvtF2D ( float  a)
inlinestatic

Convert float to double (mimicks SIMD conversion)

Parameters
afloat
Returns
a, as double double
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static std::int32_t gmx::cvtI2R ( std::int32_t  a)
inlinestatic

Return integer.

This function mimicks the SIMD integer-to-real conversion routines. By simply returning an integer, we let the compiler sort out whether the conversion should be to float or double rather than using proxy objects.

Parameters
ainteger
Returns
same value (a)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static bool gmx::cvtIB2B ( bool  a)
inlinestatic

Just return a boolean (mimicks SIMD int-to-real bool conversions)

Parameters
aboolean
Returns
same boolean
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static std::int32_t gmx::cvtR2I ( float  a)
inlinestatic

Round single precision floating point to integer.

Parameters
afloat
Returns
Integer format, a rounded to nearest integer.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static std::int32_t gmx::cvtR2I ( double  a)
inlinestatic

Round single precision doubleing point to integer.

Parameters
adouble
Returns
Integer format, a rounded to nearest integer.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static std::int32_t gmx::cvttR2I ( float  a)
inlinestatic

Truncate single precision floating point to integer.

Parameters
afloat
Returns
Integer format, a truncated to integer.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static std::int32_t gmx::cvttR2I ( double  a)
inlinestatic

Truncate single precision doubleing point to integer.

Parameters
adouble
Returns
Integer format, a truncated to integer.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
bool gmx::decideWhetherToUseGpuForHalo ( const DevelopmentFeatureFlags &  devFlags,
bool  havePPDomainDecomposition,
bool  useGpuForNonbonded,
bool  useModularSimulator,
bool  doRerun,
bool  haveEnergyMinimization 
)

Decide whether to use GPU for halo exchange.

Parameters
[in]devFlagsGPU development / experimental feature flags.
[in]havePPDomainDecompositionWhether PP domain decomposition is in use.
[in]useGpuForNonbondedWhether GPUs will be used for nonbonded interactions.
[in]useModularSimulatorWhether modularsimulator is in use.
[in]doRerunWhether this is a rerun.
[in]haveEnergyMinimizationWhether energy minimization is in use.
Returns
Whether halo exchange can be run on GPU.
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  useReplicaExchange,
bool  haveFrozenAtoms,
bool  doRerun,
const DevelopmentFeatureFlags &  devFlags,
const gmx::MDLogger &  mdlog 
)

Decide whether to use GPU for update.

Parameters
[in]isDomainDecompositionWhether there more than one domain.
[in]useUpdateGroupsIf the constraints can be split across domains.
[in]pmeRunModePME running mode: CPU, GPU or mixed.
[in]havePmeOnlyRankIf there is a PME-only rank in the simulation.
[in]useGpuForNonbondedWhether GPUs will be used for nonbonded interactions.
[in]updateTargetUser choice for running simulation on GPU.
[in]gpusWereDetectedWhether compatible GPUs were detected on any node.
[in]inputrecThe user input.
[in]mtopThe global topology.
[in]useEssentialDynamicsIf essential dynamics is active.
[in]doOrientationRestraintsIf orientation restraints are enabled.
[in]useReplicaExchangeIf this is a REMD simulation.
[in]haveFrozenAtomsIf this simulation has frozen atoms (see Issue #3920).
[in]doRerunIt this is a rerun.
[in]devFlagsGPU development / experimental feature flags.
[in]mdlogMD logger.
Returns
Whether complete simulation can be run on GPU.
Exceptions
std::bad_allocIf out of memory InconsistentInputError If the user requirements are inconsistent.
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.

Parameters
[in]useGpuForNonbondedWhether GPUs will be used for nonbonded interactions.
[in]useGpuForPmeWhether GPUs will be used for PME interactions.
[in]bondedTargetThe user's choice for mdrun -bonded for where to assign tasks.
[in]inputrecThe user input.
[in]mtopThe global topology.
[in]numPmeRanksPerSimulationThe number of PME ranks in each simulation, can be -1 for auto.
[in]gpusWereDetectedWhether compatible GPUs were detected on any node.
Returns
Whether the simulation will run bondeded tasks on GPUs.
Exceptions
std::bad_allocIf out of memory InconsistentInputError If the user requirements are inconsistent.
bool gmx::decideWhetherToUseGpusForNonbonded ( TaskTarget  nonbondedTarget,
const std::vector< int > &  userGpuTaskAssignment,
EmulateGpuNonbonded  emulateGpuNonbonded,
bool  buildSupportsNonbondedOnGpu,
bool  nonbondedOnGpuIsUseful,
bool  gpusWereDetected 
)

Decide whether the simulation will try to run nonbonded tasks on GPUs.

The final decision cannot be made until after the duty of the rank is known. But we need to know if nonbonded will run on GPUs for setting up DD (particularly rlist) and determining duty. If the user requires GPUs for the tasks of that duty, then it will be an error when none are found.

With thread-MPI, calls have been made to decideWhetherToUseGpusForNonbondedWithThreadMpi() and decideWhetherToUseGpusForPmeWithThreadMpi() to help determine the number of ranks and run some checks, but the final decision is made in this routine, along with many more consistency checks.

Parameters
[in]nonbondedTargetThe user's choice for mdrun -nb for where to assign short-ranged nonbonded interaction tasks.
[in]userGpuTaskAssignmentThe user-specified assignment of GPU tasks to device IDs.
[in]emulateGpuNonbondedWhether we will emulate GPU calculation of nonbonded interactions.
[in]buildSupportsNonbondedOnGpuWhether GROMACS was build with GPU support.
[in]nonbondedOnGpuIsUsefulWhether computing nonbonded interactions on a GPU is useful for this calculation.
[in]gpusWereDetectedWhether compatible GPUs were detected on any node.
Returns
Whether the simulation will run nonbonded and PME tasks, respectively, on GPUs.
Exceptions
std::bad_allocIf out of memory InconsistentInputError If the user requirements are inconsistent.
bool gmx::decideWhetherToUseGpusForNonbondedWithThreadMpi ( TaskTarget  nonbondedTarget,
int  numDevicesToUse,
const std::vector< int > &  userGpuTaskAssignment,
EmulateGpuNonbonded  emulateGpuNonbonded,
bool  buildSupportsNonbondedOnGpu,
bool  nonbondedOnGpuIsUseful,
int  numRanksPerSimulation 
)

Decide whether this thread-MPI simulation will run nonbonded tasks on GPUs.

The number of GPU tasks and devices influences both the choice of the number of ranks, and checks upon any such choice made by the user. So we need to consider this before any automated choice of the number of thread-MPI ranks.

Parameters
[in]nonbondedTargetThe user's choice for mdrun -nb for where to assign short-ranged nonbonded interaction tasks.
[in]numDevicesToUseNumber of compatible GPUs that the user permitted us to use.
[in]userGpuTaskAssignmentThe user-specified assignment of GPU tasks to device IDs.
[in]emulateGpuNonbondedWhether we will emulate GPU calculation of nonbonded interactions.
[in]buildSupportsNonbondedOnGpuWhether GROMACS was built with GPU support.
[in]nonbondedOnGpuIsUsefulWhether computing nonbonded interactions on a GPU is useful for this calculation.
[in]numRanksPerSimulationThe number of ranks in each simulation.
Returns
Whether the simulation will run nonbonded tasks on GPUs.
Exceptions
std::bad_allocIf out of memory InconsistentInputError If the user requirements are inconsistent.
bool gmx::decideWhetherToUseGpusForPme ( bool  useGpuForNonbonded,
TaskTarget  pmeTarget,
const std::vector< int > &  userGpuTaskAssignment,
const gmx_hw_info_t &  hardwareInfo,
const t_inputrec &  inputrec,
int  numRanksPerSimulation,
int  numPmeRanksPerSimulation,
bool  gpusWereDetected 
)

Decide whether the simulation will try to run tasks of different types on GPUs.

The final decision cannot be made until after the duty of the rank is known. But we need to know if nonbonded will run on GPUs for setting up DD (particularly rlist) and determining duty. If the user requires GPUs for the tasks of that duty, then it will be an error when none are found.

With thread-MPI, calls have been made to decideWhetherToUseGpusForNonbondedWithThreadMpi() and decideWhetherToUseGpusForPmeWithThreadMpi() to help determine the number of ranks and run some checks, but the final decision is made in this routine, along with many more consistency checks.

Parameters
[in]useGpuForNonbondedWhether GPUs will be used for nonbonded interactions.
[in]pmeTargetThe user's choice for mdrun -pme for where to assign long-ranged PME nonbonded interaction tasks.
[in]userGpuTaskAssignmentThe user-specified assignment of GPU tasks to device IDs.
[in]hardwareInfoHardware information
[in]inputrecThe user input
[in]numRanksPerSimulationThe number of ranks in each simulation.
[in]numPmeRanksPerSimulationThe number of PME ranks in each simulation.
[in]gpusWereDetectedWhether compatible GPUs were detected on any node.
Returns
Whether the simulation will run nonbonded and PME tasks, respectively, on GPUs.
Exceptions
std::bad_allocIf out of memory InconsistentInputError If the user requirements are inconsistent.
bool gmx::decideWhetherToUseGpusForPmeWithThreadMpi ( bool  useGpuForNonbonded,
TaskTarget  pmeTarget,
int  numDevicesToUse,
const std::vector< int > &  userGpuTaskAssignment,
const gmx_hw_info_t &  hardwareInfo,
const t_inputrec &  inputrec,
int  numRanksPerSimulation,
int  numPmeRanksPerSimulation 
)

Decide whether this thread-MPI simulation will run PME tasks on GPUs.

The number of GPU tasks and devices influences both the choice of the number of ranks, and checks upon any such choice made by the user. So we need to consider this before any automated choice of the number of thread-MPI ranks.

Parameters
[in]useGpuForNonbondedWhether GPUs will be used for nonbonded interactions.
[in]pmeTargetThe user's choice for mdrun -pme for where to assign long-ranged PME nonbonded interaction tasks.
[in]numDevicesToUseThe number of compatible GPUs that the user permitted us to use.
[in]userGpuTaskAssignmentThe user-specified assignment of GPU tasks to device IDs.
[in]hardwareInfoHardware information
[in]inputrecThe user input
[in]numRanksPerSimulationThe number of ranks in each simulation.
[in]numPmeRanksPerSimulationThe number of PME ranks in each simulation.
Returns
Whether the simulation will run PME tasks on GPUs.
Exceptions
std::bad_allocIf out of memory InconsistentInputError If the user requirements are inconsistent.
static void gmx::deepCopy_t_trxframe ( const t_trxframe &  input,
t_trxframe *  copy,
RVec *  xvec,
RVec *  vvec,
RVec *  fvec,
int *  indexvec 
)
static

Create a deep copy of a t_trxframe input into copy.

When running the analysis tools and changing values with the outputadapters, a deep copy of the input coordinate frame has to be created first to ensure that the data is not changed if it is needed for other tools following with analysis later. Therefore, the data is passed to copy by performing a deep copy first.

The method allocates new storage for coordinates of the x, v, and f arrays in the new coordinate frame. This means that those arrays need to be free'd after the frame has been processed and been written to disk.

Parameters
[in]inputReference input coordinate frame.
[in,out]copyPointer to new output frame that will receive the deep copy.
[in]xvecPointer to local coordinate storage vector.
[in]vvecPointer to local velocity storage vector.
[in]fvecPointer to local force storage vector.
[in]indexvecPointer to local index storage vector.
MrcDensityMapHeader gmx::deserializeMrcDensityMapHeader ( ISerializer *  serializer)

Deserializes an MrcDensityMapHeader from a given serializer.

Parameters
[in]serializerthe serializer
Returns
mrc density map header
static DeviceDetectionResult gmx::detectAllDeviceInformation ( const PhysicalNodeCommunicator &  physicalNodeComm)
static

Detect GPUs when that makes sense to attempt.

Parameters
[in]physicalNodeCommThe communicator across this physical node
Returns
The result of the detection, perhaps including diagnostic messages to issue later.
Todo:
Coordinating the efficient detection of devices across multiple ranks per node should be separated from the lower-level hardware detection. See https://gitlab.com/gromacs/gromacs/-/issues/3650.
PmeRunMode gmx::determinePmeRunMode ( bool  useGpuForPme,
const TaskTarget &  pmeFftTarget,
const t_inputrec &  inputrec 
)

Determine PME run mode.

Given the PME task assignment in useGpuForPme and the user-provided FFT task target in pmeFftTarget, returns a PME run mode for the current run. It also checks the compatibility of the two.

Note
Aborts the run upon incompatible values of useGpuForPme and pmeFftTarget.
Parameters
[in]useGpuForPmePME task assignment, true if PME task is mapped to the GPU.
[in]pmeFftTargetThe user's choice for -pmefft for where to assign the FFT work of the PME task.
[in]inputrecThe user input record
void gmx::doDeviceTransfers ( const DeviceInformation &  deviceInfo,
ArrayRef< const char >  input,
ArrayRef< char >  output 
)

Helper function for GPU test code to be platform agnostic.

Transfers input to device 0, if present, and transfers it back into output. Both sizes must match. If no devices are present, do a simple host-side buffer copy instead.

Exceptions
InternalErrorUpon any GPU API error condition.
template<class BasicMdspan >
constexpr std::enable_if_t<BasicMdspan::is_always_contiguous(), typename BasicMdspan::pointer> gmx::end ( const BasicMdspan &  basicMdspan)

Free end function addressing memory of a contiguously laid out basic_mdspan.

Note
Changing the elements that basic_mdspan views does not change the view itself, so a single end that takes a const view suffices.
static void gmx::ensureStateAndRunConsistency ( const BiasParams &  params,
const BiasState &  state 
)
static

Check if the state (loaded from checkpoint) and the run are consistent.

When the state and the run setup are inconsistent, an exception is thrown.

Parameters
[in]paramsThe parameters of the bias.
[in]stateThe state of the bias.
static float gmx::erf ( float  x)
inlinestatic

Float erf(x).

Parameters
xArgument.
Returns
erf(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::erf ( double  x)
inlinestatic

Double erf(x).

Parameters
xArgument.
Returns
erf(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static float gmx::erfc ( float  x)
inlinestatic

Float erfc(x).

Parameters
xArgument.
Returns
erfc(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::erfc ( double  x)
inlinestatic

Double erfc(x).

Parameters
xArgument.
Returns
erfc(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::erfcSingleAccuracy ( double  x)
inlinestatic

Double erfc(x), but with single accuracy.

Parameters
xArgument.
Returns
erfc(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
double gmx::erfinv ( double  x)

Inverse error function, double precision.

Parameters
xArgument, should be in the range -1.0 < x < 1.0
Returns
The inverse of the error function if the argument is inside the range, +/- infinity if it is exactly 1.0 or -1.0, and NaN otherwise.
float gmx::erfinv ( float  x)

Inverse error function, single precision.

Parameters
xArgument, should be in the range -1.0 < x < 1.0
Returns
The inverse of the error function if the argument is inside the range, +/- infinity if it is exactly 1.0 or -1.0, and NaN otherwise.
static double gmx::erfSingleAccuracy ( double  x)
inlinestatic

Double erf(x), but with single accuracy.

Parameters
xArgument.
Returns
erf(x)
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
constexpr int32_t gmx::exactDiv ( int32_t  a,
int32_t  b 
)

Exact integer division, 32bit.

Parameters
adividend. Function asserts that it is a multiple of divisor
bdivisor
Returns
quotient of division
template<MathOptimization opt = MathOptimization::Safe>
static float gmx::exp ( float  x)
inlinestatic

Float exp(x).

Parameters
xArgument.
Returns
exp(x). Undefined if input argument caused overflow.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<MathOptimization opt = MathOptimization::Safe>
static double gmx::exp ( double  x)
inlinestatic

Double exp(x).

Parameters
xArgument.
Returns
exp(x). Undefined if input argument caused overflow.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<MathOptimization opt = MathOptimization::Safe>
static float gmx::exp2 ( float  x)
inlinestatic

Float 2^x.

Parameters
xArgument.
Returns
2^x. Undefined if input argument caused overflow.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<MathOptimization opt = MathOptimization::Safe>
static double gmx::exp2 ( double  x)
inlinestatic

Double 2^x.

Parameters
xArgument.
Returns
2^x. Undefined if input argument caused overflow.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::exp2SingleAccuracy ( double  x)
inlinestatic

Double 2^x, but with single accuracy.

Parameters
xArgument.
Returns
2^x. Undefined if input argument caused overflow.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static void gmx::expandScalarsToTriplets ( float  scalar,
float *  triplets0,
float *  triplets1,
float *  triplets2 
)
inlinestatic

Copy single float to three variables.

Parameters
scalarFloating-point input.
[out]triplets0Copy 1.
[out]triplets1Copy 2.
[out]triplets2Copy 3.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static void gmx::expandScalarsToTriplets ( double  scalar,
double *  triplets0,
double *  triplets1,
double *  triplets2 
)
inlinestatic

Copy single double to three variables.

Parameters
scalarFloating-point input.
[out]triplets0Copy 1.
[out]triplets1Copy 2.
[out]triplets2Copy 3.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
ExponentialMovingAverageState gmx::exponentialMovingAverageStateFromKeyValueTree ( const KeyValueTreeObject &  object)

Sets the exponential moving average state from a key-value-tree object.

Sets the expoential moving average state from a key-value-tree object.

static double gmx::expSingleAccuracy ( double  x)
inlinestatic

Double exp(x), but with single accuracy.

Parameters
xArgument.
Returns
exp(x). Undefined if input argument caused overflow.
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
GpuTasksOnRanks gmx::findAllGpuTasksOnThisNode ( ArrayRef< const GpuTask >  gpuTasksOnThisRank,
const PhysicalNodeCommunicator &  physicalNodeComm 
)

Returns container of all tasks on all ranks of this node that are eligible for GPU execution.

Perform all necessary communication for preparing for task assignment. Separating this aspect makes it possible to unit test the logic of task assignment.

std::vector< GpuTask > gmx::findGpuTasksOnThisRank ( bool  haveGpusOnThisPhysicalNode,
TaskTarget  nonbondedTarget,
TaskTarget  pmeTarget,
TaskTarget  bondedTarget,
TaskTarget  updateTarget,
bool  useGpuForNonbonded,
bool  useGpuForPme,
bool  rankHasPpTask,
bool  rankHasPmeTask 
)

Returns container of all tasks on this rank that are eligible for GPU execution.

Parameters
[in]haveGpusOnThisPhysicalNodeWhether there are any GPUs on this physical node.
[in]nonbondedTargetThe user's choice for mdrun -nb for where to assign short-ranged nonbonded interaction tasks.
[in]pmeTargetThe user's choice for mdrun -pme for where to assign long-ranged PME nonbonded interaction tasks.
[in]bondedTargetThe user's choice for mdrun -bonded for where to assign tasks.
[in]updateTargetThe user's choice for mdrun -update for where to assign tasks.
[in]useGpuForNonbondedWhether GPUs will be used for nonbonded interactions.
[in]useGpuForPmeWhether GPUs will be used for PME interactions.
[in]rankHasPpTaskWhether this rank has a PP task
[in]rankHasPmeTaskWhether this rank has a PME task
std::string gmx::findLibraryFile ( const std::string &  filename,
bool  bAddCWD = true,
bool  bFatal = true 
)

Finds full path for a library file.

Searches in the configured library directories for filename. If bAddCWD is true, searches first in the current directory. Fatal error results if the file is not found in any location and bFatal is true.

std::string gmx::findLibraryFile ( const char *  filename,
bool  bAddCWD = true,
bool  bFatal = true 
)

Finds full path for a library file.

Searches in the configured library directories for filename. If bAddCWD is true, searches first in the current directory. Fatal error results if the file is not found in any location and bFatal is true.

static float gmx::fma ( float  a,
float  b,
float  c 
)
inlinestatic

Float Fused-multiply-add. Result is a*b + c.

Parameters
afactor1
bfactor2
cterm
Returns
a*b + c
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::fma ( double  a,
double  b,
double  c 
)
inlinestatic

double Fused-multiply-add. Result is a*b + c.

Parameters
afactor1
bfactor2
cterm
Returns
a*b + c
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static float gmx::fms ( float  a,
float  b,
float  c 
)
inlinestatic

Float Fused-multiply-subtract. Result is a*b - c.

Parameters
afactor1
bfactor2
cterm
Returns
a*b - c
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::fms ( double  a,
double  b,
double  c 
)
inlinestatic

double Fused-multiply-subtract. Result is a*b - c.

Parameters
afactor1
bfactor2
cterm
Returns
a*b - c
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static float gmx::fnma ( float  a,
float  b,
float  c 
)
inlinestatic

Float Fused-negated-multiply-add. Result is -a*b + c.

Parameters
afactor1
bfactor2
cterm
Returns
-a*b + c
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::fnma ( double  a,
double  b,
double  c 
)
inlinestatic

double Fused-negated-multiply-add. Result is - a*b + c.

Parameters
afactor1
bfactor2
cterm
Returns
-a*b + c
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static float gmx::fnms ( float  a,
float  b,
float  c 
)
inlinestatic

Float Fused-negated-multiply-subtract. Result is -a*b - c.

Parameters
afactor1
bfactor2
cterm
Returns
-a*b - c
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static double gmx::fnms ( double  a,
double  b,
double  c 
)
inlinestatic

double Fused-negated-multiply-subtract. Result is -a*b - c.

Parameters
afactor1
bfactor2
cterm
Returns
-a*b - c
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
static int gmx::forceGroupMtsLevel ( ArrayRef< const MtsLevel >  mtsLevels,
const MtsForceGroups  mtsForceGroup 
)
inlinestatic

Returns the MTS level at which a force group is to be computed.

Parameters
[in]mtsLevelsList of force groups for each MTS level, can be empty without MTS
[in]mtsForceGroupThe force group to query the MTS level for
template<int align>
static void gmx::gatherLoadBySimdIntTranspose ( const float *  base,
std::int32_t  offset,
float *  v0,
float *  v1,
float *  v2,
float *  v3 
)
inlinestatic

Load 4 floats from base/offsets and store into variables.

Template Parameters
alignAlignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points.
Parameters
baseAligned pointer to the start of the memory.
offsetInteger type with offset to the start of each triplet.
[out]v0First float, base[align*offset[0]].
[out]v1Second float, base[align*offset[0] + 1].
[out]v2Third float, base[align*offset[0] + 2].
[out]v3Fourth float, base[align*offset[0] + 3].
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<int align>
static void gmx::gatherLoadBySimdIntTranspose ( const float *  base,
std::int32_t  offset,
float *  v0,
float *  v1 
)
inlinestatic

Load 2 floats from base/offsets and store into variables (aligned).

Template Parameters
alignAlignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points.
Parameters
baseAligned pointer to the start of the memory.
offsetInteger type with offset to the start of each triplet.
[out]v0First float, base[align*offset[0]].
[out]v1Second float, base[align*offset[0] + 1].
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<int align>
static void gmx::gatherLoadBySimdIntTranspose ( const double *  base,
std::int32_t  offset,
double *  v0,
double *  v1,
double *  v2,
double *  v3 
)
inlinestatic

Load 4 doubles from base/offsets and store into variables.

Template Parameters
alignAlignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points.
Parameters
baseAligned pointer to the start of the memory.
offsetInteger type with offset to the start of each triplet.
[out]v0First double, base[align*offset[0]].
[out]v1Second double, base[align*offset[0] + 1].
[out]v2Third double, base[align*offset[0] + 2].
[out]v3Fourth double, base[align*offset[0] + 3].
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<int align>
static void gmx::gatherLoadBySimdIntTranspose ( const double *  base,
std::int32_t  offset,
double *  v0,
double *  v1 
)
inlinestatic

Load 2 doubles from base/offsets and store into variables (aligned).

Template Parameters
alignAlignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points.
Parameters
baseAligned pointer to the start of the memory.
offsetInteger type with offset to the start of each triplet.
[out]v0First double, base[align*offset[0]].
[out]v1Second double, base[align*offset[0] + 1].
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<int align>
static void gmx::gatherLoadTranspose ( const float *  base,
const std::int32_t  offset[],
float *  v0,
float *  v1,
float *  v2,
float *  v3 
)
inlinestatic

Load 4 consecutive floats from base/offset into four variables.

Template Parameters
alignAlignment of the memory from which we read.
Parameters
basePointer to the start of the memory area
offsetIndex to data.
[out]v01st float, base[align*offset[0]].
[out]v12nd float, base[align*offset[0] + 1].
[out]v23rd float, base[align*offset[0] + 2].
[out]v34th float, base[align*offset[0] + 3].
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<int align>
static void gmx::gatherLoadTranspose ( const float *  base,
const std::int32_t  offset[],
float *  v0,
float *  v1 
)
inlinestatic

Load 2 consecutive floats from base/offset into four variables.

Template Parameters
alignAlignment of the memory from which we read.
Parameters
basePointer to the start of the memory area
offsetIndex to data.
[out]v01st float, base[align*offset[0]].
[out]v12nd float, base[align*offset[0] + 1].
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<int align>
static void gmx::gatherLoadTranspose ( const double *  base,
const std::int32_t  offset[],
double *  v0,
double *  v1,
double *  v2,
double *  v3 
)
inlinestatic

Load 4 consecutive doubles from base/offset into four variables.

Template Parameters
alignAlignment of the memory from which we read.
Parameters
basePointer to the start of the memory area
offsetIndex to data.
[out]v01st double, base[align*offset[0]].
[out]v12nd double, base[align*offset[0] + 1].
[out]v23rd double, base[align*offset[0] + 2].
[out]v34th double, base[align*offset[0] + 3].
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<int align>
static void gmx::gatherLoadTranspose ( const double *  base,
const std::int32_t  offset[],
double *  v0,
double *  v1 
)
inlinestatic

Load 2 consecutive doubles from base/offset into four variables.

Template Parameters
alignAlignment of the memory from which we read.
Parameters
basePointer to the start of the memory area
offsetIndex to data.
[out]v01st double, base[align*offset[0]].
[out]v12nd double, base[align*offset[0] + 1].
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<int align>
static void gmx::gatherLoadUBySimdIntTranspose ( const float *  base,
std::int32_t  offset,
float *  v0,
float *  v1 
)
inlinestatic

Load 2 floats from base/offsets and store into variables (unaligned).

Template Parameters
alignAlignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points.
Parameters
baseAligned pointer to the start of the memory.
offsetInteger type with offset to the start of each triplet.
[out]v0First float, base[align*offset[0]].
[out]v1Second float, base[align*offset[0] + 1].
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<int align>
static void gmx::gatherLoadUBySimdIntTranspose ( const double *  base,
std::int32_t  offset,
double *  v0,
double *  v1 
)
inlinestatic

Load 2 doubles from base/offsets and store into variables (unaligned).

Template Parameters
alignAlignment of the memory from which we read, i.e. distance (measured in elements, not bytes) between index points.
Parameters
baseAligned pointer to the start of the memory.
offsetInteger type with offset to the start of each triplet.
[out]v0First double, base[align*offset[0]].
[out]v1Second double, base[align*offset[0] + 1].
Note
This function might be superficially meaningless, but it helps us to write templated SIMD/non-SIMD code. For clarity it should not be used outside such code.
template<int align>
static void gmx::gatherLoadUTranspose ( const float *  base,
const std::int32_t  offset[],
float *  v0,
float *  v1,
float *