Unverified Commit 28fb2918 authored by Anton Gorenko's avatar Anton Gorenko
Browse files

Fix docs, comments, remove non-existing types from swigInputConfig.py

parent f7240731
......@@ -104,17 +104,6 @@ For more information, see the OpenMMTools_ website.
.. _OpenMMTools: https://github.com/choderalab/openmmtools
OpenMM-HIP
**********
This package adds a new platform that is implemented with AMD's HIP framework.
When running on AMD GPUs, it often has much faster performance than the OpenCL
platform. For information about how to install it, see the OpenMM-HIP_ website.
Once it is installed, the new platform can be selected and used exactly like the
ones included in the main OpenMM package.
.. _OpenMM-HIP: https://github.com/StreamHPC/openmm-hip
openmmforcefields
*****************
......
......@@ -46,7 +46,7 @@ license. This is a very permissive license which allows them to be used in
almost any way, requiring only that you retain the copyright notice and
disclaimer when distributing them.
The CUDA and OpenCL platforms are distributed under the GNU Lesser General
The CUDA, HIP, and OpenCL platforms are distributed under the GNU Lesser General
Public License (LGPL). This also allows you to use, modify, and distribute them
in any way you want, but it requires you to also distribute the source code for
your modifications. This restriction applies only to modifications to OpenMM
......@@ -280,8 +280,8 @@ simulation; it is a fairly generic computational API. In addition to defining
the generic classes, OpenMM also defines abstract subclasses of KernelImpl
corresponding to specific calculations. For example, there is a class called
CalcHarmonicBondForceKernel to implement HarmonicBondForce and a class called
IntegrateLangevinStepKernel to implement LangevinIntegrator. It is these
classes for which each Platform must provide a concrete subclass.
IntegrateLangevinMiddleStepKernel to implement LangevinMiddleIntegrator. It is
these classes for which each Platform must provide a concrete subclass.
This architecture is designed to allow easy extensibility. To support a new
hardware platform, for example, you create concrete subclasses of all the
......@@ -330,6 +330,9 @@ conventional CPUs.
**CudaPlatform**\ : This platform is implemented using the CUDA language, and
performs calculations on Nvidia GPUs.
**HipPlatform**\ : This platform is implemented using the HIP language, and
performs calculations on ROCm-compatible AMD GPUs.
**OpenCLPlatform**\ : This platform is implemented using the OpenCL language,
and performs calculations on a variety of types of GPUs and CPUs.
......@@ -343,8 +346,8 @@ The choice of which platform to use for a simulation depends on various factors:
some older computers. Also, for simulations that use certain features
(primarily the various “custom” force classes), it may be faster to use the
OpenCL platform running on the CPU.
#. The CUDA platform can only be used with NVIDIA GPUs. For using an AMD or
Intel GPU, use the OpenCL platform.
#. The AMOEBA force field only works with the CUDA platform, not with the OpenCL
platform. It also works with the Reference and CPU platforms, but the performance
is usually too slow to be useful on those platforms.
#. The CUDA platform can be used with NVIDIA GPUs. For using an AMD GPU,
use the HIP platform (or the OpenCL platform which is usually slower), for
using an Intel GPU, use the OpenCL platform.
#. The AMOEBA force field works with all platforms, but the performance
of the Reference and CPU platforms is usually too slow to be useful.
......@@ -111,7 +111,7 @@ There are several variables that can be adjusted in the CMake interface:
any reason CMake is unable to find them, set OPENCL_INCLUDE_DIR to point to
the directory containing the headers (usually /usr/local/cuda/include on Linux)
and OPENCL_LIBRARY to point to the library (usually /usr/local/cuda/lib64/libOpenCL.so
on Linux).
on Linux).
Configure (press “c”) again. Adjust any variables that cause an error.
......@@ -167,12 +167,6 @@ fraction of the time. These tests will say so in the error message:
exception: Assertion failure at TestReferenceLangevinIntegrator.cpp:129. Expected 9.97741,
found 10.7884 (This test is stochastic and may occasionally fail)
If you get an error message such as :code:`exception: Error launching CUDA compiler: 32512` you need
to specify the path to the CUDA compiler (nvcc) using the :code:`OPENMM_CUDA_COMPILER` environment
variable, for example using something like the following::
OPENMM_CUDA_COMPILER=/<path_to_custom_cuda_dir>/nvcc
Step 3: Install
===============
Install your local build of OpenMM using the following command::
......@@ -309,7 +303,7 @@ There are several variables that can be adjusted in the CMake interface:
the directory containing the headers (usually
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.4/include", except
with the correct version number for the toolkit you installed) and
OPENCL_LIBRARY to point to the library (usually "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.4/lib/x64/OpenCL.lib").
OPENCL_LIBRARY to point to the library (usually "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.4/lib/x64/OpenCL.lib").
Press "Configure" again. Adjust any variables that cause an error.
......@@ -437,4 +431,4 @@ Step 3: Install local build of openmm
=====================================
Now we just install our local build of :code:`openmm` as instructed in
:ref:`compiling-openmm-from-source-linux`
\ No newline at end of file
:ref:`compiling-openmm-from-source-linux`
......@@ -152,10 +152,10 @@ ExpressionTreeNode ParsedExpression::substituteSimplerExpression(const Expressio
else
children[i] = cached->second;
}
// Collect some info on constant expressions in children
bool first_const = children.size() > 0 && isConstant(children[0]); // is first child constant?
bool second_const = children.size() > 1 && isConstant(children[1]); // is second child constant?
bool second_const = children.size() > 1 && isConstant(children[1]); // is second child constant?
double first, second; // if yes, value of first and second child
if (first_const)
first = getConstantValue(children[0]);
......@@ -205,7 +205,7 @@ ExpressionTreeNode ParsedExpression::substituteSimplerExpression(const Expressio
break;
}
case Operation::MULTIPLY:
{
{
if ((first_const && first == 0.0) || (second_const && second == 0.0)) // Multiply by 0
return ExpressionTreeNode(new Operation::Constant(0.0));
if (first_const && first == 1.0) // Multiply by 1
......@@ -247,7 +247,7 @@ ExpressionTreeNode ParsedExpression::substituteSimplerExpression(const Expressio
case Operation::DIVIDE:
{
if (children[0] == children[1])
return ExpressionTreeNode(new Operation::Constant(1.0)); // Dividing anything from itself is 0
return ExpressionTreeNode(new Operation::Constant(1.0)); // Dividing anything by itself is 1
if (first_const && first == 0.0) // 0 divided by something
return ExpressionTreeNode(new Operation::Constant(0.0));
if (first_const && first == 1.0) // 1 divided by something
......
......@@ -43,21 +43,18 @@ SKIP_METHODS = [('State', 'getPositions'),
('CalcGBSAOBCForceKernel',),
('CalcHarmonicAngleForceKernel',),
('CalcHarmonicBondForceKernel',),
('CalcKineticEnergyKernel',),
('CalcNonbondedForceKernel',),
('CalcPeriodicTorsionForceKernel',),
('CalcRBTorsionForceKernel',),
('ComputationInfo',),
('ConstraintInfo',),
('CudaKernelFactory',),
('CudaStreamFactory',),
('HipKernelFactory',),
('ExceptionInfo',),
('ExclusionInfo',),
('FunctionInfo',),
('GlobalParameterInfo',),
('InitializeForcesKernel',),
('IntegrateBrownianStepKernel',),
('IntegrateLangevinStepKernel',),
('IntegrateNoseHooverStepKernel',),
('IntegrateVariableLangevinStepKernel',),
('IntegrateVariableVerletStepKernel',),
......@@ -75,23 +72,19 @@ SKIP_METHODS = [('State', 'getPositions'),
('RBTorsionInfo',),
('RemoveCMMotionKernel',),
('SplineFitter',),
('StreamFactory',),
('TorsionInfo',),
('TorsionTorsionGridInfo',),
('TorsionTorsionInfo',),
('UpdateStateDataKernel',),
('UpdateTimeKernel',),
('VdwInfo',),
('WcaDispersionInfo',),
('Context', 'getIntegrator'),
('Context', 'createCheckpoint'),
('Context', 'loadCheckpoint'),
('CudaPlatform',),
('HipPlatform',),
('Force', 'Force'),
('ParticleParameterInfo',),
('Platform', 'createStream'),
('Platform', 'getDefaultStreamFactory'),
('Platform', 'registerStreamFactory'),
('Platform', 'contextCreated'),
('Platform', 'contextDestroyed'),
('Platform', 'createKernel'),
......@@ -113,7 +106,7 @@ SKIP_METHODS = [('State', 'getPositions'),
# The build script assumes method args that are non-const references are
# used to output values. This list gives excpetions to this rule.
# used to output values. This list gives exceptions to this rule.
NO_OUTPUT_ARGS = [('LocalEnergyMinimizer', 'minimize', 'context'),
('Platform', 'setPropertyValue', 'context'),
('AmoebaTorsionTorsionForce', 'setTorsionTorsionGrid', 'grid'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment