From 9c3748e07cdde3014530936a7ad7158f57eb69c2 Mon Sep 17 00:00:00 2001 From: "Steven J. Plimpton" <sjplimp@singsing.sandia.gov> Date: Wed, 15 Aug 2018 07:31:31 -0600 Subject: [PATCH] change Python.txt to Python_head.txt, adapt GPU package syntax --- doc/src/Build_basics.txt | 7 ++++--- doc/src/Build_extras.txt | 23 +++++++++++++++++------ doc/src/Errors.txt | 2 +- doc/src/Howto_couple.txt | 6 +++--- doc/src/Howto_library.txt | 6 +++--- doc/src/Intro_nonfeatures.txt | 4 ++-- doc/src/Manual.txt | 11 ++++++----- doc/src/Manual_build.txt | 2 +- doc/src/Modify.txt | 2 +- doc/src/Packages_details.txt | 6 +++--- doc/src/Python_call.txt | 4 ++-- doc/src/Python_examples.txt | 4 ++-- doc/src/{Python.txt => Python_head.txt} | 0 doc/src/Python_install.txt | 4 ++-- doc/src/Python_library.txt | 4 ++-- doc/src/Python_mpi.txt | 4 ++-- doc/src/Python_pylammps.txt | 4 ++-- doc/src/Python_run.txt | 4 ++-- doc/src/Python_shlib.txt | 4 ++-- doc/src/Python_test.txt | 4 ++-- doc/src/fix_external.txt | 2 +- doc/src/python.txt | 6 +++--- lib/gpu/Install.py | 19 ++++++++++--------- lib/gpu/Makefile.linux | 4 ++-- 24 files changed, 75 insertions(+), 61 deletions(-) rename doc/src/{Python.txt => Python_head.txt} (100%) diff --git a/doc/src/Build_basics.txt b/doc/src/Build_basics.txt index 79c22d8fe4..425266a35f 100644 --- a/doc/src/Build_basics.txt +++ b/doc/src/Build_basics.txt @@ -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]: diff --git a/doc/src/Build_extras.txt b/doc/src/Build_extras.txt index b55efa02a7..a3a05ed50e 100644 --- a/doc/src/Build_extras.txt +++ b/doc/src/Build_extras.txt @@ -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 diff --git a/doc/src/Errors.txt b/doc/src/Errors.txt index a8d8d3a18e..10f84874a3 100644 --- a/doc/src/Errors.txt +++ b/doc/src/Errors.txt @@ -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 diff --git a/doc/src/Howto_couple.txt b/doc/src/Howto_couple.txt index 4c0f72a806..d7b4924d8c 100644 --- a/doc/src/Howto_couple.txt +++ b/doc/src/Howto_couple.txt @@ -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 diff --git a/doc/src/Howto_library.txt b/doc/src/Howto_library.txt index 8e99182f87..741078e7eb 100644 --- a/doc/src/Howto_library.txt +++ b/doc/src/Howto_library.txt @@ -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 **) diff --git a/doc/src/Intro_nonfeatures.txt b/doc/src/Intro_nonfeatures.txt index 41f001fc8b..87ab42e2ac 100644 --- a/doc/src/Intro_nonfeatures.txt +++ b/doc/src/Intro_nonfeatures.txt @@ -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 diff --git a/doc/src/Manual.txt b/doc/src/Manual.txt index ad2a41d6bc..ca30f32311 100644 --- a/doc/src/Manual.txt +++ b/doc/src/Manual.txt @@ -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 --> diff --git a/doc/src/Manual_build.txt b/doc/src/Manual_build.txt index 2be4b98960..747a55a729 100644 --- a/doc/src/Manual_build.txt +++ b/doc/src/Manual_build.txt @@ -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: diff --git a/doc/src/Modify.txt b/doc/src/Modify.txt index 6189b9ba3e..666aaba8a7 100644 --- a/doc/src/Modify.txt +++ b/doc/src/Modify.txt @@ -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) diff --git a/doc/src/Packages_details.txt b/doc/src/Packages_details.txt index ff0ce7844c..5ab85a80c8 100644 --- a/doc/src/Packages_details.txt +++ b/doc/src/Packages_details.txt @@ -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 diff --git a/doc/src/Python_call.txt b/doc/src/Python_call.txt index 621f1fe241..029c8f831c 100644 --- a/doc/src/Python_call.txt +++ b/doc/src/Python_call.txt @@ -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) diff --git a/doc/src/Python_examples.txt b/doc/src/Python_examples.txt index 46e5fee2b9..f4b2197464 100644 --- a/doc/src/Python_examples.txt +++ b/doc/src/Python_examples.txt @@ -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) diff --git a/doc/src/Python.txt b/doc/src/Python_head.txt similarity index 100% rename from doc/src/Python.txt rename to doc/src/Python_head.txt diff --git a/doc/src/Python_install.txt b/doc/src/Python_install.txt index 85cf267de0..97f6bf3c3a 100644 --- a/doc/src/Python_install.txt +++ b/doc/src/Python_install.txt @@ -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) diff --git a/doc/src/Python_library.txt b/doc/src/Python_library.txt index 8d0c724a45..9a3ea93fc3 100644 --- a/doc/src/Python_library.txt +++ b/doc/src/Python_library.txt @@ -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) diff --git a/doc/src/Python_mpi.txt b/doc/src/Python_mpi.txt index 6e0a2ce319..96c42e0d0f 100644 --- a/doc/src/Python_mpi.txt +++ b/doc/src/Python_mpi.txt @@ -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) diff --git a/doc/src/Python_pylammps.txt b/doc/src/Python_pylammps.txt index d7baa93e2e..303ac21a27 100644 --- a/doc/src/Python_pylammps.txt +++ b/doc/src/Python_pylammps.txt @@ -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) diff --git a/doc/src/Python_run.txt b/doc/src/Python_run.txt index a94dc07f2d..963248efce 100644 --- a/doc/src/Python_run.txt +++ b/doc/src/Python_run.txt @@ -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) diff --git a/doc/src/Python_shlib.txt b/doc/src/Python_shlib.txt index 206f56688c..91c90d9a8f 100644 --- a/doc/src/Python_shlib.txt +++ b/doc/src/Python_shlib.txt @@ -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) diff --git a/doc/src/Python_test.txt b/doc/src/Python_test.txt index 3d52485aa8..2bfec91bd6 100644 --- a/doc/src/Python_test.txt +++ b/doc/src/Python_test.txt @@ -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) diff --git a/doc/src/fix_external.txt b/doc/src/fix_external.txt index 1dec226414..dd7f7914e9 100644 --- a/doc/src/fix_external.txt +++ b/doc/src/fix_external.txt @@ -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 diff --git a/doc/src/python.txt b/doc/src/python.txt index 0c0a203ccd..54d18d2f60 100644 --- a/doc/src/python.txt +++ b/doc/src/python.txt @@ -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 diff --git a/lib/gpu/Install.py b/lib/gpu/Install.py index 3b12db5091..d1024c0085 100644 --- a/lib/gpu/Install.py +++ b/lib/gpu/Install.py @@ -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) - 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_20 for Fermi (C2050/C2070, deprecated as of CUDA 8.0) + or GeForce GTX 580 or similar + 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] == '=': diff --git a/lib/gpu/Makefile.linux b/lib/gpu/Makefile.linux index ed5b6092d3..9580bfd4ae 100644 --- a/lib/gpu/Makefile.linux +++ b/lib/gpu/Makefile.linux @@ -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 -- GitLab