change Python.txt to Python_head.txt, adapt GPU package syntax

This commit is contained in:
Steven J. Plimpton
2018-08-15 07:31:31 -06:00
parent ad9126f30e
commit 9c3748e07c
24 changed files with 75 additions and 61 deletions

View File

@ -162,9 +162,10 @@ cmake ../cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_For
NOTE: When the cmake command completes, it prints info to the screen
as to which compilers it is using, and what flags will be used in the
compilation. Note that if the top-level compiler is mpicxx, it is
simply a wrapper on a real compiler. The low-level compiler info is
also in the Cmake output. You should check to insure you are using
the compiler and optimization flags are the ones you want.
simply a wrapper on a real compiler. The underlying compiler info is
what will be listed in the CMake output. You should check to insure
you are using the compiler and optimization flags are the ones you
want.
[Makefile.machine settings]:

View File

@ -84,12 +84,22 @@ which GPU hardware to build for.
-D OCL_TUNE=value # hardware choice for GPU_API=opencl
# generic (default) or intel (Intel CPU) or fermi, kepler, cypress (NVIDIA)
-D GPU_ARCH=value # hardware choice for GPU_API=cuda
# value = 20 (Fermi) or 30 (Kepler) or 50 (Maxwell) or 60 (Pascal) or 70 (Volta)
# default is Cuda-compiler dependent, but typically Fermi
# value = sm_XX, see below
# default is Cuda-compiler dependent, but typically sm_20
-D CUDPP_OPT=value # optimization setting for GPU_API=cudea
# enables CUDA Performance Primitives Optimizations
# yes (default) or no :pre
GPU_ARCH settings for different GPU hardware is as follows:
sm_20 for Fermi (C2050/C2070, deprecated as of CUDA 8.0) or GeForce GTX 580 or similar
sm_30 for Kepler (K10)
sm_35 for Kepler (K40) or GeForce GTX Titan or similar
sm_37 for Kepler (dual K80)
sm_50 for Maxwell
sm_60 for Pascal (P100)
sm_70 for Volta :ul
[Traditional make]:
Before building LAMMPS, you must build the GPU library in lib/gpu.
@ -107,18 +117,19 @@ script with the specified args:
make lib-gpu # print help message
make lib-gpu args="-b" # build GPU library with default Makefile.linux
make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
make lib-gpu args="-m mpi -p mixed -b" # build GPU library with mixed precision using settings in Makefile.mpi :pre
make lib-gpu args="-m mpi -a sm_60 -p mixed -b" # build GPU library with mixed precision and P100 using other settings in Makefile.mpi :pre
Note that this procedure starts with a Makefile.machine in lib/gpu, as
specified by the "-m" switch. For your convenience, machine makefiles
for "mpi" and "serial" are provided, which have the same settings as
the corresponding machine makefiles in the main LAMMPS source
folder. In addition you can alter 4 important settings in the
Makefile.machine you start from via the -h, -a, -p, -e switches, and
also save a copy of the new Makefile if desired:
Makefile.machine you start from via the corresponding -h, -a, -p, -e
switches (as in the examples above), and also save a copy of the new
Makefile if desired:
CUDA_HOME = where NVIDIA CUDA software is installed on your system
CUDA_ARCH = what GPU hardware you have (same as CMake, see help message for details)
CUDA_ARCH = sm_XX, what GPU hardware you have, same as CMake GPU_ARCH above
CUDA_PRECISION = precision (double, mixed, single)
EXTRAMAKE = which Makefile.lammps.* file to copy to Makefile.lammps :ul

View File

@ -1,4 +1,4 @@
"Previous Section"_Python.html - "LAMMPS WWW Site"_lws -
"Previous Section"_Python_head.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next
Section"_Manual.html :c

View File

@ -84,9 +84,9 @@ supports a vanilla C-like interface). For example, from C++ you could
create one (or more) "instances" of LAMMPS, pass it an input script to
process, or execute individual commands, all by invoking the correct
class methods in LAMMPS. From C or Fortran you can make function
calls to do the same things. See the "Python"_Python.html doc pages
for a description of the Python wrapper provided with LAMMPS that
operates through the LAMMPS library interface.
calls to do the same things. See the "Python"_Python_head.html doc
pages for a description of the Python wrapper provided with LAMMPS
that operates through the LAMMPS library interface.
The files src/library.cpp and library.h contain the C-style interface
to LAMMPS. See the "Howto library"_Howto_library.html doc page for a

View File

@ -12,7 +12,7 @@ Library interface to LAMMPS :h3
As described on the "Build basics"_Build_basics.html doc page, LAMMPS
can be built as a library, so that it can be called by another code,
used in a "coupled manner"_Howto_couple.html with other codes, or
driven through a "Python interface"_Python.html.
driven through a "Python interface"_Python_head.html.
All of these methodologies use a C-style interface to LAMMPS that is
provided in the files src/library.cpp and src/library.h. The
@ -35,8 +35,8 @@ details.
NOTE: You can write code for additional functions as needed to define
how your code talks to LAMMPS and add them to src/library.cpp and
src/library.h, as well as to the "Python interface"_Python.html. The
added functions can access or change any internal LAMMPS data you
src/library.h, as well as to the "Python interface"_Python_head.html.
The added functions can access or change any internal LAMMPS data you
wish.
void lammps_open(int, char **, MPI_Comm, void **)

View File

@ -28,7 +28,7 @@ GUI: LAMMPS can be built as a library and a Python wrapper that wraps
the library interface is provided. Thus, GUI interfaces can be
written in Python (or C or C++ if desired) that run LAMMPS and
visualize or plot its output. Examples of this are provided in the
python directory and described on the "Python"_Python.html doc
python directory and described on the "Python"_Python_head.html doc
page. :ulb,l
Builder: Several pre-processing tools are packaged with LAMMPS. Some
@ -68,7 +68,7 @@ page"_http://lammps.sandia.gov/viz.html page of the LAMMPS website for
visualization packages that can use LAMMPS output data. :l
Plotting: See the next bullet about Pizza.py as well as the
"Python"_Python.html doc page for examples of plotting LAMMPS output.
"Python"_Python_head.html doc page for examples of plotting LAMMPS output.
Scripts provided with the {python} tool in the tools directory will
extract and massage data in log and dump files to make it easier to
analyze and plot. See the "Tools"_Tools.html doc page for more

View File

@ -47,9 +47,9 @@ all LAMMPS development is coordinated.
"PDF file"_Manual.pdf of the entire manual, generated by
"htmldoc"_http://freecode.com/projects/htmldoc
The content for this manual is part of the LAMMPS distribution.
You can build a local copy of the Manual as HTML pages or a PDF file,
by following the steps on the "this page"_Manual_build.html.
The content for this manual is part of the LAMMPS distribution. You
can build a local copy of the Manual as HTML pages or a PDF file, by
following the steps on the "Manual build"_Manual_build.html doc page.
There is also a "Developer.pdf"_Developer.pdf document which gives
a brief description of the basic code structure of LAMMPS.
@ -82,7 +82,7 @@ every LAMMPS command.
Examples
Tools
Modify
Python
Python_head
Errors
Manual_build
@ -120,8 +120,9 @@ END_RST -->
"Example scripts"_Examples.html :l
"Auxiliary tools"_Tools.html :l
"Modify & extend LAMMPS"_Modify.html :l
"Use Python with LAMMPS"_Python.html :l
"Use Python with LAMMPS"_Python_head.html :l
"Errors"_Errors.html :l
"Building the LAMMPS manual"_Manual_build.html :l
:ole
<!-- END_HTML_ONLY -->

View File

@ -8,7 +8,7 @@ Section"_Manual.html :c
:line
Building the LAMMPS Manual :h2
Building the LAMMPS manual :h2
Depending on how you obtained LAMMPS, the doc directory has
2 or 3 sub-directories and optionally 2 PDF files and an ePUB file:

View File

@ -1,6 +1,6 @@
"Previous Section"_Tools.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next
Section"_Python.html :c
Section"_Python_head.html :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)

View File

@ -763,8 +763,8 @@ A "python"_python.html command which allow you to execute Python code
from a LAMMPS input script. The code can be in a separate file or
embedded in the input script itself. See the "Python
call"_Python_call.html doc page for an overview of using Python from
LAMMPS in this manner and all the "Python"_Python.html doc pages for
other ways to use LAMMPS and Python together.
LAMMPS in this manner and all the "Python"_Python_head.html doc pages
for other ways to use LAMMPS and Python together.
NOTE: Building with the PYTHON package assumes you have a Python
shared library available on your system, which needs to be a Python 2
@ -780,7 +780,7 @@ extras"_Build_extras.html doc page.
[Supporting info:]
src/PYTHON: filenames -> commands
"Python call"_Python.html
"Python call"_Python_head.html
lib/python/README
examples/python :ul

View File

@ -1,5 +1,5 @@
"Higher level section"_Python.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
"Higher level section"_Python_head.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)

View File

@ -1,5 +1,5 @@
"Higher level section"_Python.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
"Higher level section"_Python_head.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)

View File

@ -1,5 +1,5 @@
"Higher level section"_Python.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
"Higher level section"_Python_head.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)

View File

@ -1,5 +1,5 @@
"Higher level section"_Python.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
"Higher level section"_Python_head.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)

View File

@ -1,5 +1,5 @@
"Higher level section"_Python.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
"Higher level section"_Python_head.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)

View File

@ -1,5 +1,5 @@
"Higher level section"_Python.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
"Higher level section"_Python_head.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)

View File

@ -1,5 +1,5 @@
"Higher level section"_Python.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
"Higher level section"_Python_head.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)

View File

@ -1,5 +1,5 @@
"Higher level section"_Python.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
"Higher level section"_Python_head.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)

View File

@ -1,5 +1,5 @@
"Higher level section"_Python.html - "LAMMPS WWW Site"_lws - "LAMMPS
Documentation"_ld - "LAMMPS Commands"_lc :c
"Higher level section"_Python_head.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)

View File

@ -34,7 +34,7 @@ This fix allows external programs that are running LAMMPS through its
"library interface"_Howto_library.html to modify certain LAMMPS
properties on specific timesteps, similar to the way other fixes do.
The external driver can be a "C/C++ or Fortran
program"_Howto_library.html or a "Python script"_Python.html.
program"_Howto_library.html or a "Python script"_Python_head.html.
:line

View File

@ -100,7 +100,7 @@ be passed to various commands as arguments, so that the variable is
evaluated during a simulation run.
A broader overview of how Python can be used with LAMMPS is given on
the "Python"_Python.html doc page. There is an examples/python
the "Python"_Python_head.html doc page. There is an examples/python
directory which illustrates use of the python command.
:line
@ -483,8 +483,8 @@ building LAMMPS. LAMMPS must also be built as a shared library and
your Python function must be able to to load the Python module in
python/lammps.py that wraps the LAMMPS library interface. These are
the same steps required to use Python by itself to wrap LAMMPS.
Details on these steps are explained on the "Python"_Python.html doc
page. Note that it is important that the stand-alone LAMMPS
Details on these steps are explained on the "Python"_Python_head.html
doc page. Note that it is important that the stand-alone LAMMPS
executable and the LAMMPS shared library be consistent (built from the
same source code files) in order for this to work. If the two have
been built at different times using different source files, problems

View File

@ -23,16 +23,17 @@ optionally copies Makefile.auto to a new Makefile.osuffix
-m = use Makefile.machine as starting point, copy to Makefile.auto
default machine = linux
default for -h, -a, -p, -e settings are those in -m Makefile
-h = set CUDA_HOME variable in Makefile.auto to hdir
hdir = path to NVIDIA Cuda software, e.g. /usr/local/cuda
-a = set CUDA_ARCH variable in Makefile.auto to arch
use arch = 20 for Fermi (C2050/C2070, deprecated as of CUDA 8.0)
use arch = sm_20 for Fermi (C2050/C2070, deprecated as of CUDA 8.0)
or GeForce GTX 580 or similar
use arch = 30 for Kepler (K10)
use arch = 35 for Kepler (K40) or GeForce GTX Titan or similar
use arch = 37 for Kepler (dual K80)
use arch = 60 for Pascal (P100)
use arch = 70 for Volta
use arch = sm_30 for Kepler (K10)
use arch = sm_35 for Kepler (K40) or GeForce GTX Titan or similar
use arch = sm_37 for Kepler (dual K80)
use arch = sm_60 for Pascal (P100)
use arch = sm_70 for Volta
-p = set CUDA_PRECISION variable in Makefile.auto to precision
use precision = double or mixed or single
-e = set EXTRAMAKE variable in Makefile.auto to Makefile.lammps.esuffix
@ -47,7 +48,7 @@ Examples:
make lib-gpu args="-b" # build GPU lib with default Makefile.linux
make lib-gpu args="-m xk7 -p single -o xk7.single" # create new Makefile.xk7.single, altered for single-precision
make lib-gpu args="-m mpi -a 35 -p single -o mpi.mixed -b" # create new Makefile.mpi.mixed, also build GPU lib with these settings
make lib-gpu args="-m mpi -a sm_35 -p single -o mpi.mixed -b" # create new Makefile.mpi.mixed, also build GPU lib with these settings
"""
# print error message or help
@ -128,7 +129,7 @@ for line in lines:
if hflag and words[0] == "CUDA_HOME" and words[1] == '=':
line = line.replace(words[2],hdir)
if aflag and words[0] == "CUDA_ARCH" and words[1] == '=':
line = line.replace(words[2],"-arch=sm_%s" % arch)
line = line.replace(words[2],"-arch=%s" % arch)
if pflag and words[0] == "CUDA_PRECISION" and words[1] == '=':
line = line.replace(words[2],precstr)
if eflag and words[0] == "EXTRAMAKE" and words[1] == '=':

View File

@ -13,8 +13,8 @@ endif
NVCC = nvcc
# Tesla CUDA
CUDA_ARCH = -arch=sm_21
# older CUDA
#CUDA_ARCH = -arch=sm_21
# newer CUDA
#CUDA_ARCH = -arch=sm_13
# older CUDA