Plugin: openaccPTM
| Description | Usage |
|---|---|
| versions of CVs in PLUMED that can run on the GPU using OpenACC parallelism | |
| Authors: Daniele Rapetti and Gareth Tribello |
Details
This plugin allows you to use the USEGPU flag with certain actions in PLUMED. This flag turns on an experimental GPU parallized version of the command. GPU parallelism in PLUMED has been implemented using openACC and is currently experimental. We are actively working on these features at the moment. There is thus no guarantee that the GPU accelerated versions of actions are any faster than the CPU versions. If you have experimented with these features on your own calculations we would love to hear from you (even if your experience was negative.)
[Experimental] Compiling the openaccPTM plugin
The openaccPTM plugin is compiled separately to the main PLUMED code. To compile the plugin you need to have the NVIDIA HPC SDK and the plumed library avaiable in your path. You then compile the plugin by issuing the following commands:
cd plugin/openaccPTM
./configure
make clean
NVCXX=mpic++ make
It is worth running these commands more than once if the compilation doesn't work the first time. If they complete correctly a dynamic libarary called plumedOpenACC.so
will be created in the plumed2/plugin directory.
We have tested this module with the 24.3 version of the NVIDIA HPC SDK compiler and found that it works. It currently does not work with NVHPC 26.5 compiler.
Note that we recommend running the test suite after compilation. You can do this by issuing the following commands:
cd plugin/openaccPTM/regtest
make
[Experimental] Using PLUMED with the openaccPTM plugin
To use openACC in PLUMED you need to load the dynamic libary that you compiled in the previous section. You can do this as follows:
LOADLoads a library, possibly defining new actions. More details FILEfile to be loaded=/path/to/plumedOpenACC.so
where /path/to is the directory that contains the compiled plugins. If you choose not to move the library after compilation this will
be the plumed2/plugin directory. To use the plugin to calculate an action using the GPU you add the USEGPU keyword to the list of keywords
for that action. For example, to calculate a contact matrix using the GPU you would use the following input:
LOADLoads a library, possibly defining new actions. More details FILEfile to be loaded=/path/to/plumedOpenACC.so CONTACT_MATRIXAdjacency matrix in which two atoms are adjacent if they are within a certain cutoff. More details GROUPspecifies the list of atoms that should be assumed indistinguishable=1-1000 SWITCHthe input for the switching function that acts upon the distance between each pair of atoms. Options for this keyword are explained in the documentation for LESS_THAN.={EXP D_0=0.2 R_0=0.1 D_MAX=0.66} USEGPU run this calculation on the GPU
The next section contains a list of the actions that can take the USEGPU command in input and that can thus be run on the GPU using this plugin.
List of actions that can be called with the USEGPU option:
- module:
-
ACTION
-
colvar:
- ANGLE
- DIPOLE
- DISTANCE
- PLANE
- POSITION
- TORSION
- crystdistrib:
- ~~QUATERNION_BOND_PRODUCT_MATRIX~~ setup, but deactivated
- secondarystructure:
- SECONDARY_STRUCTURE_DRMSD, and in particular:
- ALPHARMSD only with TYPE=DRMSD
- ANTIBETARMSD only with TYPE=DRMSD
- PARABETARMSD only with TYPE=DRMSD
- volumes:
- AROUND
- INCYLINDER
- INSPHERE
- adjmat
- CONTACT_MATRIX
- function
- LESS_THAN
- MORE_THAN
- BETWEEN
- COMBINE
- matrixtools
- MATRIX_PRODUCT
- MATRIX_VECTOR_PRODUCT
- symfunc
- Q1
- Q3
- Q4
- Q6
- LOCAL_AVERAGE
- FCCUBIC
- TETRAHEDRAL
- SIMPLECUBIC
- COORDINATION_SHELL_FUNCTION
- COORDINATION_SHELL_AVERAGE
- LOCAL_Q1
- LOCAL_Q3
- LOCAL_Q4
- LOCAL_Q6