All Classes Namespaces Functions Variables Pages
Platform Class Reference

A Platform defines an implementation of all the kernels needed to perform some calculation. More...

Inherits _object.

## Public Member Functions

def | __init__
def | __del__
| del(OpenMM::Platform self) More...
def | registerPlatform
| registerPlatform(Platform platform) More...
def | getNumPlatforms
| getNumPlatforms() -> int More...
def | getPlatform
| getPlatform(int index) -> Platform More...
def | getPluginLoadFailures
| getPluginLoadFailures() -> vectorstring More...
def | getPlatformByName
| getPlatformByName(std::string const & name) -> Platform More...
def | findPlatform
| findPlatform(vectorstring kernelNames) -> Platform More...
def | loadPluginLibrary
| loadPluginLibrary(std::string const & file) More...
def | loadPluginsFromDirectory
| loadPluginsFromDirectory(std::string const & directory) -> vectorstring More...
def | getDefaultPluginsDirectory
| getDefaultPluginsDirectory() -> std::string const & More...
def | getOpenMMVersion
| getOpenMMVersion() -> std::string const & More...
def | getName
| getName(Platform self) -> std::string const & More...
def | getSpeed
| getSpeed(Platform self) -> double More...
def | supportsDoublePrecision
| supportsDoublePrecision(Platform self) -> bool More...
def | getPropertyNames
| getPropertyNames(Platform self) -> vectorstring More...
def | getPropertyValue
| getPropertyValue(Platform self, Context context, std::string const & property) -> std::string const & More...
def | setPropertyValue
| setPropertyValue(Platform self, Context context, std::string const & property, std::string const & value) More...
def | getPropertyDefaultValue
| getPropertyDefaultValue(Platform self, std::string const & property) -> std::string const & More...
def | setPropertyDefaultValue
| setPropertyDefaultValue(Platform self, std::string const & property, std::string const & value) More...
def | supportsKernels
| supportsKernels(Platform self, vectorstring kernelNames) -> bool More...

## Static Public Attributes

tuple | registerPlatform = staticmethod(registerPlatform)
tuple | getNumPlatforms = staticmethod(getNumPlatforms)
tuple | getPlatform = staticmethod(getPlatform)
tuple | getPluginLoadFailures = staticmethod(getPluginLoadFailures)
tuple | getPlatformByName = staticmethod(getPlatformByName)
tuple | findPlatform = staticmethod(findPlatform)
tuple | loadPluginLibrary = staticmethod(loadPluginLibrary)
tuple | loadPluginsFromDirectory = staticmethod(loadPluginsFromDirectory)
tuple | getDefaultPluginsDirectory = staticmethod(getDefaultPluginsDirectory)
tuple | getOpenMMVersion = staticmethod(getOpenMMVersion)

## Detailed Description

A Platform defines an implementation of all the kernels needed to perform some calculation.

More precisely, a Platform object acts as a registry for a set of KernelFactory objects which together implement the kernels. The Platform class, in turn, provides a static registry of all available Platform objects.

To get a Platform object, call

    Platform& platform Platform::findPlatform(kernelNames);

passing in the names of all kernels that will be required for the calculation you plan to perform. It will return the fastest available Platform which provides implementations of all the specified kernels. You can then call createKernel() to construct particular kernels as needed.

## Constructor & Destructor Documentation

def __init__ | ( |  | self,
|  |  | args,
|  |  | kwargs
| ) |  |

def __del__ | ( |  | self | ) |

del(OpenMM::Platform self)

References simtk.openmm.openmm.stripUnits().

## Member Function Documentation

def findPlatform | ( |  | args | ) |

findPlatform(vectorstring kernelNames) -> Platform

Find a Platform which can be used to perform a calculation.

Parameters

  kernelNames | the names of all kernels which will be needed for the calculation

References Platform.findPlatform, and simtk.openmm.openmm.stripUnits().

def getDefaultPluginsDirectory | ( |  | args | ) |

getDefaultPluginsDirectory() -> std::string const &

Get the default directory from which to load plugins. If the environment variable OPENMM_PLUGIN_DIR is set, this returns its value. Otherwise, it returns a platform specific default location.

References Platform.getDefaultPluginsDirectory, and simtk.openmm.openmm.stripUnits().

def getName | ( |  | self,
|  |  | args
| ) |  |

getName(Platform self) -> std::string const &

Get the name of this platform. This should be a unique identifier which can be used to recognized it.

References simtk.openmm.openmm.stripUnits().

def getNumPlatforms | ( |  | args | ) |

getNumPlatforms() -> int

Get the number of Platforms that have been registered.

References Platform.getNumPlatforms, and simtk.openmm.openmm.stripUnits().

def getOpenMMVersion | ( |  | args | ) |

getOpenMMVersion() -> std::string const &

Get a string containing the version number of the OpenMM library.

References Platform.getOpenMMVersion, and simtk.openmm.openmm.stripUnits().

def getPlatform | ( |  | args | ) |

getPlatform(int index) -> Platform

Get a registered Platform by index.

References Platform.getPlatform, and simtk.openmm.openmm.stripUnits().

def getPlatformByName | ( |  | args | ) |

getPlatformByName(std::string const & name) -> Platform

Get the registered Platform with a particular name. If no Platform with that name has been registered, this throws an exception.

References Platform.getPlatformByName, and simtk.openmm.openmm.stripUnits().

def getPluginLoadFailures | ( |  | args | ) |

getPluginLoadFailures() -> vectorstring

Get any failures caused during the last call to loadPluginsFromDirectory

References Platform.getPluginLoadFailures, and simtk.openmm.openmm.stripUnits().

def getPropertyDefaultValue | ( |  | self,
|  |  | args
| ) |  |

getPropertyDefaultValue(Platform self, std::string const & property) -> std::string const &

Get the default value of a Platform-specific property. This is the value that will be used for newly created Contexts.

Parameters

  property | the name of the property to get

References simtk.openmm.openmm.stripUnits().

def getPropertyNames | ( |  | self,
|  |  | args
| ) |  |

getPropertyNames(Platform self) -> vectorstring

Get the names of all Platform-specific properties this Platform supports.

References simtk.openmm.openmm.stripUnits().

def getPropertyValue | ( |  | self,
|  |  | args
| ) |  |

getPropertyValue(Platform self, Context context, std::string const & property) -> std::string const &

Get the value of a Platform-specific property for a Context.

Parameters

  context | the Context for which to get the property
  property | the name of the property to get

References simtk.openmm.openmm.stripUnits().

def getSpeed | ( |  | self,
|  |  | args
| ) |  |

getSpeed(Platform self) -> double

Get an estimate of how fast this Platform class is. This need not be precise. It only is expected to return an order or magnitude estimate of the relative performance of different Platform classes. An unoptimized reference implementation should return 1.0, and all other Platforms should return a larger value that is an estimate of how many times faster they are than the reference implementation.

References simtk.openmm.openmm.stripUnits().

def loadPluginLibrary | ( |  | args | ) |

loadPluginLibrary(std::string const & file)

Load a dynamic library (DLL) which contains an OpenMM plugin. Typically, each Platform is distributed as a separate dynamic library. This method can then be called at runtime to load each available library. Each library should contain an initializer function to register any Platforms and KernelFactories that it contains.

If the file does not exist or cannot be loaded, an exception is thrown.

Parameters

  file | the path to the dynamic library file. This is interpreted using the operating system's rules for loading libraries. Typically it may be either an absolute path or relative to a set of standard locations.

References Platform.loadPluginLibrary, and simtk.openmm.openmm.stripUnits().

def loadPluginsFromDirectory | ( |  | args | ) |

loadPluginsFromDirectory(std::string const & directory) -> vectorstring

Load multiple dynamic libraries (DLLs) which contain OpenMM plugins from a single directory. This method loops over every file contained in the specified directory and calls loadPluginLibrary() for each one. If an error occurs while trying to load a particular file, that file is simply ignored. You can retrieve a list of all such errors by calling getPluginLoadFailures().

Parameters

  directory | the path to the directory containing libraries to load

References Platform.loadPluginsFromDirectory, and simtk.openmm.openmm.stripUnits().

def registerPlatform | ( |  | args | ) |

registerPlatform(Platform platform)

Register a new Platform.

References Platform.registerPlatform.

def setPropertyDefaultValue | ( |  | self,
|  |  | args
| ) |  |

setPropertyDefaultValue(Platform self, std::string const & property, std::string const & value)

Set the default value of a Platform-specific property. This is the value that will be used for newly created Contexts.

Parameters

  property | the name of the property to set
  value | the value to set for the property

References simtk.openmm.openmm.stripUnits().

def setPropertyValue | ( |  | self,
|  |  | args
| ) |  |

setPropertyValue(Platform self, Context context, std::string const & property, std::string const & value)

Set the value of a Platform-specific property for a Context.

Parameters

  context | the Context for which to set the property
  property | the name of the property to set
  value | the value to set for the property

References simtk.openmm.openmm.stripUnits().

def supportsDoublePrecision | ( |  | self,
|  |  | args
| ) |  |

supportsDoublePrecision(Platform self) -> bool

Get whether this Platform supports double precision arithmetic. If this returns false, the platform is permitted to represent double precision values internally as single precision.

References simtk.openmm.openmm.stripUnits().

def supportsKernels | ( |  | self,
|  |  | args
| ) |  |

supportsKernels(Platform self, vectorstring kernelNames) -> bool

Determine whether this Platforms provides implementations of a set of kernels.

Parameters

  kernelNames | the names of the kernels of interests

References simtk.openmm.openmm.stripUnits().

## Member Data Documentation

tuple findPlatform = staticmethod(findPlatform)

static

Referenced by Platform.findPlatform().

tuple getDefaultPluginsDirectory = staticmethod(getDefaultPluginsDirectory)

static

Referenced by Platform.getDefaultPluginsDirectory().

tuple getNumPlatforms = staticmethod(getNumPlatforms)

static

Referenced by Platform.getNumPlatforms().

tuple getOpenMMVersion = staticmethod(getOpenMMVersion)

static

Referenced by Platform.getOpenMMVersion().

tuple getPlatform = staticmethod(getPlatform)

static

Referenced by Platform.getPlatform().

tuple getPlatformByName = staticmethod(getPlatformByName)

static

Referenced by Platform.getPlatformByName().

tuple getPluginLoadFailures = staticmethod(getPluginLoadFailures)

static

Referenced by Platform.getPluginLoadFailures().

tuple loadPluginLibrary = staticmethod(loadPluginLibrary)

static

Referenced by Platform.loadPluginLibrary().

tuple loadPluginsFromDirectory = staticmethod(loadPluginsFromDirectory)

static

Referenced by Platform.loadPluginsFromDirectory().

tuple registerPlatform = staticmethod(registerPlatform)

static

Referenced by Platform.registerPlatform().

The documentation for this class was generated from the following file:

- openmm.py