2010-02-05 05:33:18 +08:00
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
|
|
|
http://lammps.sandia.gov, Sandia National Laboratories
|
|
|
|
Steve Plimpton, sjplimp@sandia.gov
|
2009-08-12 03:00:24 +08:00
|
|
|
|
2010-02-05 05:33:18 +08:00
|
|
|
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
2009-08-12 03:00:24 +08:00
|
|
|
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
|
|
|
certain rights in this software. This software is distributed under
|
|
|
|
the GNU General Public License.
|
2010-02-05 05:33:18 +08:00
|
|
|
|
|
|
|
See the README file in the top-level LAMMPS directory.
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------
|
2010-11-23 08:40:35 +08:00
|
|
|
Contributing authors: Mike Brown (ORNL), brownw@ornl.gov
|
2010-02-05 05:33:18 +08:00
|
|
|
Peng Wang (Nvidia), penwang@nvidia.com
|
|
|
|
Paul Crozier (SNL), pscrozi@sandia.gov
|
|
|
|
------------------------------------------------------------------------- */
|
2009-08-12 03:00:24 +08:00
|
|
|
|
|
|
|
GENERAL NOTES
|
|
|
|
|
2010-02-05 05:33:18 +08:00
|
|
|
This library, libgpu.a, provides routines for GPU acceleration
|
2010-11-23 08:40:35 +08:00
|
|
|
of LAMMPS pair styles. Compilation of this library requires
|
|
|
|
installing the CUDA GPU driver and CUDA toolkit for your operating
|
|
|
|
system. 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.
|
2009-08-12 03:00:24 +08:00
|
|
|
|
|
|
|
NOTE: Installation of the CUDA SDK is not required.
|
|
|
|
|
2010-02-05 05:33:18 +08:00
|
|
|
Current pair styles supporting GPU acceleration:
|
2009-08-12 03:00:24 +08:00
|
|
|
|
|
|
|
1. lj/cut/gpu
|
2010-11-23 08:40:35 +08:00
|
|
|
2. lj/cut/coul/cut/gpu
|
|
|
|
3. lj/cut/coul/long/gpu
|
|
|
|
4. lj96/cut/gpu
|
|
|
|
5. gayberne/gpu
|
|
|
|
6. cmm/cg/gpu
|
|
|
|
7. cmm/cg/coul/long/gpu
|
2009-08-12 03:00:24 +08:00
|
|
|
|
|
|
|
MULTIPLE LAMMPS PROCESSES
|
|
|
|
|
2010-11-23 08:40:35 +08:00
|
|
|
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.
|
2009-08-12 03:00:24 +08:00
|
|
|
|
2010-11-23 08:40:35 +08:00
|
|
|
BUILDING AND PRECISION MODES
|
2009-08-12 03:00:24 +08:00
|
|
|
|
2010-11-23 08:40:35 +08:00
|
|
|
To build, edit the CUDA_ARCH, CUDA_PRECISION, CUDA_HOME, NVCC, CUDA_INCLUD,
|
|
|
|
CUDA_LIB and CUDA_OPTS 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.
|
2009-08-12 03:00:24 +08:00
|
|
|
|
2010-11-23 08:40:35 +08:00
|
|
|
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).
|
2009-08-12 03:00:24 +08:00
|
|
|
|
2010-11-23 08:40:35 +08:00
|
|
|
The gpu library supports 3 precision modes as determined by
|
|
|
|
the CUDA_PRECISION variable:
|
2009-08-12 03:00:24 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2010-11-23 08:40:35 +08:00
|
|
|
NOTE: Double precision is only supported on certain GPUs (with
|
2009-08-12 03:00:24 +08:00
|
|
|
compute capability>=1.3).
|
|
|
|
|
2009-11-17 05:42:57 +08:00
|
|
|
NOTE: For Tesla and other graphics cards with compute capability>=1.3,
|
|
|
|
make sure that -arch=sm_13 is set on the CUDA_ARCH line.
|
|
|
|
|
2010-11-23 08:40:35 +08:00
|
|
|
NOTE: For Fermi, make sure that -arch=sm_20 is set on the CUDA_ARCH line.
|
|
|
|
|
2009-08-12 03:00:24 +08:00
|
|
|
NOTE: The gayberne/gpu pair style will only be installed if the ASPHERE
|
|
|
|
package has been installed before installing the GPU package in LAMMPS.
|
2010-11-23 08:40:35 +08:00
|
|
|
|
|
|
|
NOTE: The cg/cmm/gpu and cg/cmm/coul/long/gpu pair styles will only be
|
|
|
|
installed if the USER-CG-CMM package has been installed before
|
|
|
|
installing the GPU package in LAMMPS.
|
|
|
|
|
|
|
|
NOTE: The lj/cut/coul/long/gpu and cg/cmm/coul/long/gpu style will only be
|
|
|
|
installed if the KSPACE package has been installed before installing
|
|
|
|
the GPU package in LAMMPS.
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
------------------------------------------------------------------------
|
|
|
|
Last merge with gpulammps: r561 on 2010-11-12
|
|
|
|
------------------------------------------------------------------------
|