lammps/lib/gpu5af93163abe3lammm-master-deprecated
gpu
README
LAMMPS ACCELERATOR LIBRARY -------------------------------- W. Michael Brown (ORNL) Peng Wang (NVIDIA) Axel Kohlmeyer (Temple) Steve Plimpton (SNL) Inderaj Bains (NVIDIA)
This directory has source files to build a library that LAMMPS links against when using the GPU package.
When you are done building this library, two files should exist in this directory:
libgpu.a the library LAMMPS will link against Makefile.lammps settings the LAMMPS Makefile will import
The latter file will have settings like this (can be omitted if blank):
gpu_SYSINC = gpu_SYSLIB = -lcudart -lcuda gpu_SYSPATH = -L/usr/local/cuda/lib64
SYSINC is for settings needed to compile LAMMPS source files SYSLIB is for additional system libraries needed by this package SYSPATH is the path(s) to where those libraries are
You must insure these settings are correct for your system, else the LAMMPS build will likely fail.
GENERAL NOTES --------------------------------
This library, libgpu.a, provides routines for GPU acceleration of certain LAMMPS styles and neighbor list builds. Compilation of this library requires installing the CUDA GPU driver and CUDA toolkit for your operating system. Installation of the CUDA SDK is not necessary. In addition to the LAMMPS library, the binary nvc_get_devices will also be built. This can be used to query the names and properties of GPU devices on your system. A Makefile for OpenCL compilation is provided, but support for OpenCL use is not currently provided by the developers. Details of the implementation are provided in:
Brown, W.M., Wang, P. Plimpton, S.J., Tharrington, A.N. Implementing Molecular Dynamics on Hybrid High Performance Computers - Short Range Forces. Computer Physics Communications. 2011. 182: p. 898-911.
and
Brown, W.M., Kohlmeyer, A. Plimpton, S.J., Tharrington, A.N. Implementing Molecular Dynamics on Hybrid High Performance Computers - Particle-Particle Particle-Mesh. Computer Physics Communications. 2011. In press.
Current styles supporting GPU acceleration:
- lj/cut
- lj96/cut
- lj/expand
- lj/cut/coul/cut
- lj/cut/coul/long
- lj/charmm/coul/long
- lj/class2
- lj/class2/coul/long
- morse
- cg/cmm
- cg/cmm/coul/long
- coul/long
- gayberne
- resquared
- pppm
MULTIPLE LAMMPS PROCESSES --------------------------------
Multiple LAMMPS MPI processes can share GPUs on the system, but multiple GPUs cannot be utilized by a single MPI process. In many cases, the best performance will be obtained by running as many MPI processes as CPU cores available with the condition that the number of MPI processes is an integer multiple of the number of GPUs being used. See the LAMMPS user manual for details on running with GPU acceleration.
BUILDING AND PRECISION MODES --------------------------------
To build, edit the CUDA_ARCH, CUDA_PRECISION, CUDA_HOME variables in one of the Makefiles. CUDA_ARCH should be set based on the compute capability of your GPU. This can be verified by running the nvc_get_devices executable after the build is complete. Additionally, the GPU package must be installed and compiled for LAMMPS. This may require editing the gpu_SYSPATH variable in the LAMMPS makefile.
Please note that the GPU library accesses the CUDA driver library directly, so it needs to be linked not only to the CUDA runtime library (libcudart.so) that ships with the CUDA toolkit, but also with the CUDA driver library (libcuda.so) that ships with the Nvidia driver. If you are compiling LAMMPS on the head node of a GPU cluster, this library may not be installed, so you may need to copy it over from one of the compute nodes (best into this directory).
The gpu library supports 3 precision modes as determined by the CUDA_PRECISION variable:
CUDA_PREC = -D_SINGLE_SINGLE # Single precision for all calculations CUDA_PREC = -D_DOUBLE_DOUBLE # Double precision for all calculations CUDA_PREC = -D_SINGLE_DOUBLE # Accumulation of forces, etc. in double
EXAMPLE BUILD PROCESS --------------------------------
cd ~/lammps/lib/gpu emacs Makefile.linux make -f Makefile.linux ./nvc_get_devices cd ../../src emacs ./MAKE/Makefile.linux make yes-asphere make yes-kspace make yes-gpu make linux