Commit 7ec52784 authored by Steven J. Plimpton's avatar Steven J. Plimpton
Browse files

more changes to doc pages and CMakeLists.txt

parent 64d539d9
Loading
Loading
Loading
Loading
+30 −19
Original line number Diff line number Diff line
@@ -371,8 +371,8 @@ if(PKG_USER-NETCDF)
endif()

if(PKG_USER-SMD)
  option(DOWNLOAD_Eigen3 "Download Eigen3 (instead of using the system's one)" OFF)
  if(DOWNLOAD_Eigen3)
  option(DOWNLOAD_EIGEN3 "Download Eigen3 (instead of using the system's one)" OFF)
  if(DOWNLOAD_EIGEN3)
    include(ExternalProject)
    ExternalProject_Add(Eigen3_build
      URL http://bitbucket.org/eigen/eigen/get/3.3.4.tar.gz 
@@ -385,7 +385,7 @@ if(PKG_USER-SMD)
  else()
    find_package(Eigen3)
    if(NOT Eigen3_FOUND)
      message(FATAL_ERROR "Eigen3 not found, help CMake to find it by setting EIGEN3_INCLUDE_DIR, or set DOWNLOAD_Eigen3=ON to download it")
      message(FATAL_ERROR "Eigen3 not found, help CMake to find it by setting EIGEN3_INCLUDE_DIR, or set DOWNLOAD_EIGEN3=ON to download it")
    endif()
  endif()
  include_directories(${EIGEN3_INCLUDE_DIR})
@@ -807,16 +807,26 @@ if(PKG_GPU)
                    ${GPU_SOURCES_DIR}/fix_gpu.h
                    ${GPU_SOURCES_DIR}/fix_gpu.cpp)

    set(GPU_API "OpenCL" CACHE STRING "API used by GPU package")
    set_property(CACHE GPU_API PROPERTY STRINGS OpenCL CUDA)
    set(GPU_API "opencl" CACHE STRING "API used by GPU package")
    set_property(CACHE GPU_API PROPERTY STRINGS opencl cuda)
    string(TOUPPER ${GPU_API} GPU_API_DEFINE)

    set(GPU_PREC "SINGLE_DOUBLE" CACHE STRING "LAMMPS GPU precision size")
    set_property(CACHE GPU_PREC PROPERTY STRINGS SINGLE_DOUBLE SINGLE_SINGLE DOUBLE_DOUBLE)
    set(GPU_PREC "mixed" CACHE STRING "LAMMPS GPU precision")
    set_property(CACHE GPU_PREC PROPERTY STRINGS double mixed single)
    string(TOUPPER ${GPU_PREC} GPU_PREC_DEFINE)

    if(GPU_PREC_DEFINE STREQUAL "DOUBLE")
      set(GPU_PREC_SETTING "DOUBLE_DOUBLE")
    elseif(GPU_PREC_DEFINE STREQUAL "MIXED")
      set(GPU_PREC_SETTING "SINGLE_DOUBLE")
    elseif(GPU_PREC_DEFINE STREQUAL "SINGLE")
      set(GPU_PREC_SETTING "SINGLE_SINGLE")
    endif()

    file(GLOB GPU_LIB_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/gpu/*.cpp)
    file(MAKE_DIRECTORY ${LAMMPS_LIB_BINARY_DIR}/gpu)

    if(GPU_API STREQUAL "CUDA")
    if(GPU_API_DEFINE STREQUAL "CUDA")
      find_package(CUDA REQUIRED)
      find_program(BIN2C bin2c)
      if(NOT BIN2C)
@@ -824,7 +834,7 @@ if(PKG_GPU)
      endif()
      option(CUDPP_OPT "Enable CUDPP_OPT" ON)

      set(GPU_ARCH "sm_30" CACHE STRING "LAMMPS GPU CUDA SM architecture (e.g.  sm_60)")
      set(GPU_ARCH "30" CACHE STRING "LAMMPS GPU CUDA SM architecture (e.g. 60)")

      file(GLOB GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/*.cu ${CMAKE_CURRENT_SOURCE_DIR}/gpu/*.cu)
      list(REMOVE_ITEM GPU_LIB_CU ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_pppm.cu)
@@ -838,10 +848,10 @@ if(PKG_GPU)
      endif()

      cuda_compile_cubin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS
                   -DUNIX -O3 -Xptxas -v --use_fast_math -DNV_KERNEL -DUCL_CUDADR -arch=${GPU_ARCH} -D_${GPU_PREC})
                   -DUNIX -O3 -Xptxas -v --use_fast_math -DNV_KERNEL -DUCL_CUDADR -arch=sm_${GPU_ARCH} -D_${GPU_PREC_SETTING})

      cuda_compile(GPU_OBJS ${GPU_LIB_CUDPP_CU} OPTIONS $<$<BOOL:${BUILD_SHARED_LIBS}>:-Xcompiler=-fPIC>
                   -DUNIX -O3 -Xptxas -v --use_fast_math -DUCL_CUDADR -arch=${GPU_ARCH} -D_${GPU_PREC})
                   -DUNIX -O3 -Xptxas -v --use_fast_math -DUCL_CUDADR -arch=sm_${GPU_ARCH} -D_${GPU_PREC_SETTING})

      foreach(CU_OBJ ${GPU_GEN_OBJS})
        get_filename_component(CU_NAME ${CU_OBJ} NAME_WE)
@@ -858,7 +868,7 @@ if(PKG_GPU)
      add_library(gpu STATIC ${GPU_LIB_SOURCES} ${GPU_LIB_CUDPP_SOURCES} ${GPU_OBJS})
      target_link_libraries(gpu ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
      target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu ${CUDA_INCLUDE_DIRS})
      target_compile_definitions(gpu PRIVATE -D_${GPU_PREC} -DMPI_GERYON -DUCL_NO_EXIT)
      target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DUCL_NO_EXIT)
      if(CUDPP_OPT)
        target_include_directories(gpu PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/gpu/cudpp_mini)
        target_compile_definitions(gpu PRIVATE -DUSE_CUDPP)
@@ -872,10 +882,11 @@ if(PKG_GPU)
      target_include_directories(nvc_get_devices PRIVATE ${CUDA_INCLUDE_DIRS})


    elseif(GPU_API STREQUAL "OpenCL")
    elseif(GPU_API_DEFINE STREQUAL "OPENCL")
      find_package(OpenCL REQUIRED)
      set(OCL_TUNE "GENERIC" CACHE STRING "OpenCL Device Tuning")
      set_property(CACHE OCL_TUNE PROPERTY STRINGS INTEL FERMI KEPLER CYPRESS GENERIC)
      set(OCL_TUNE "generic" CACHE STRING "OpenCL Device Tuning")
      set_property(CACHE OCL_TUNE PROPERTY STRINGS intel fermi kepler cypress generic)
      string(TOUPPER ${OCL_TUNE} OCL_TUNE_DEFINE)

      include(OpenCLUtils)
      set(OCL_COMMON_HEADERS ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_preprocessor.h ${LAMMPS_LIB_SOURCE_DIR}/gpu/lal_aux_fun1.h)
@@ -897,7 +908,7 @@ if(PKG_GPU)
      add_library(gpu STATIC ${GPU_LIB_SOURCES})
      target_link_libraries(gpu ${OpenCL_LIBRARIES})
      target_include_directories(gpu PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/gpu ${OpenCL_INCLUDE_DIRS})
      target_compile_definitions(gpu PRIVATE -D_${GPU_PREC} -D${OCL_TUNE}_OCL -DMPI_GERYON -DUCL_NO_EXIT)
      target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -D${OCL_TUNE_DEFINE}_OCL -DMPI_GERYON -DUCL_NO_EXIT)
      target_compile_definitions(gpu PRIVATE -DUSE_OPENCL)

      list(APPEND LAMMPS_LINK_LIBS gpu)
@@ -1148,9 +1159,9 @@ if(BUILD_MPI)
endif()
if(PKG_GPU)
  message(STATUS "GPU Api: ${GPU_API}")
  if(GPU_API STREQUAL "CUDA")
    message(STATUS "GPU Arch: ${GPU_ARCH}")
  elseif(GPU_API STREQUAL "OpenCL")
  if(GPU_API_DEFINE STREQUAL "CUDA")
    message(STATUS "GPU Arch: sm_${GPU_ARCH}")
  elseif(GPU_API_DEFINE STREQUAL "OPENCL")
    message(STATUS "OCL Tune: ${OCL_TUNE}")
  endif()
  message(STATUS "GPU Precision: ${GPU_PREC}")
+3 −0
Original line number Diff line number Diff line
@@ -19,18 +19,21 @@ as described on the "Install"_Install.html doc page.
<!-- RST

.. toctree::
   :maxdepth: 1

   Build_cmake
   Build_make
   Build_link

.. toctree::
   :maxdepth: 1

   Build_basics
   Build_settings
   Build_package

.. toctree::
   :maxdepth: 1

   Build_extras

+0 −1
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ CMake and make:
"Build the LAMMPS documentation"_#doc
"Install LAMMPS after a build"_#install :ul

:line
:line

Serial vs parallel build :h3,link(serial)
+80 −45
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ This is the list of packages that may require additional steps.
"USER-SMD"_#user-smd,
"USER-VTK"_#user-vtk :tb(c=6,ea=c)

:line
:line

COMPRESS package :h4,link(compress)
@@ -81,15 +80,15 @@ which GPU hardware to build for.

-D GPU_API=value      # value = opencl (default) or cuda
-D GPU_PREC=value     # precision setting
                      # value = single or mixed (default) or double
                      # value = double or mixed (default) or single
-D OCL_TUNE=value     # hardware choice for GPU_API=opencl
                      # generic (default) or intel (Intel CPU) or phi (Intel Xeon Phi) or fermi, kepler, cypress (NVIDIA)
                      # generic (default) or intel (Intel CPU) or fermi, kepler, cypress (NVIDIA)
-D GPU_ARCH=value     # hardware choice for GPU_API=cuda
                      # value = sm20 (Fermi) or sm30 (Kepler) or sm50 (Maxwell) or sm60 (Pascal) or sm70 (Volta)
                      # value = 20 (Fermi) or 30 (Kepler) or 50 (Maxwell) or 60 (Pascal) or 70 (Volta)
                      # default is Cuda-compiler dependent, but typically Fermi
-D CUDPP_OPT=value    # optimization setting for GPU_API=cudea
                      # enables CUDA Performance Primitives Optimizations
                      # on (default) or off :pre
                      # yes (default) or no :pre

[Traditional make]:

@@ -119,7 +118,7 @@ Makefile.machine you start from via the -h, -a, -p, -e switches, 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 (see help message for details)
CUDA_ARCH = what GPU hardware you have (same as CMake, see help message for details)
CUDA_PRECISION = precision (double, mixed, single)
EXTRAMAKE = which Makefile.lammps.* file to copy to Makefile.lammps :ul

@@ -163,7 +162,7 @@ package?" page.

[CMake build]:

-D DOWNLOAD_KIM=value    # download OpenKIM API v1 for build, value = off (default) or on
-D DOWNLOAD_KIM=value    # download OpenKIM API v1 for build, value = no (default) or yes
-D KIM_LIBRARY=path      # path to KIM shared library (only needed if a custom location) 
-D KIM_INCLUDE_DIR=path  # path to KIM include directory (only needed if a custom location) :pre

@@ -188,12 +187,60 @@ KOKKOS package :h4,link(kokkos)

To build with this package, you must choose which hardware you want to
build for, either CPUs (multi-threading via OpenMP) or KNLs (OpenMP)
or GPUs (Cuda).
or GPUs (NVIDIA Cuda).

For a CMake or make build, these are the possible choices for the
KOKKOS_ARCH settings described below.  Note that for CMake, these are
really Kokkos variables, not LAMMPS variables.  Hence you must use
case-sensitive values, e.g. BDW, not bdw.

ARMv80 = ARMv8.0 Compatible CPU
ARMv81 = ARMv8.1 Compatible CPU
ARMv8-ThunderX = ARMv8 Cavium ThunderX CPU
BGQ = IBM Blue Gene/Q CPUs
Power8 = IBM POWER8 CPUs
Power9 = IBM POWER9 CPUs
SNB = Intel Sandy/Ivy Bridge CPUs
HSW = Intel Haswell CPUs
BDW = Intel Broadwell Xeon E-class CPUs
SKX = Intel Sky Lake Xeon E-class HPC CPUs (AVX512)
KNC = Intel Knights Corner Xeon Phi
KNL = Intel Knights Landing Xeon Phi
Kepler30 = NVIDIA Kepler generation CC 3.0
Kepler32 = NVIDIA Kepler generation CC 3.2
Kepler35 = NVIDIA Kepler generation CC 3.5
Kepler37 = NVIDIA Kepler generation CC 3.7
Maxwell50 = NVIDIA Maxwell generation CC 5.0
Maxwell52 = NVIDIA Maxwell generation CC 5.2
Maxwell53 = NVIDIA Maxwell generation CC 5.3
Pascal60 = NVIDIA Pascal generation CC 6.0
Pascal61 = NVIDIA Pascal generation CC 6.1 :ul

[CMake build]:

TODO: how to do this, how to select CPU vs KNL vs GPU, and specify
the particular flavor of hardware: e.g. HSW vs BWL
For multicore CPUs using OpenMP, set these 2 variables.

-D KOKKOS_ARCH=archCPU         # archCPU = CPU from list above :pre
-D KOKKOS_ENABLE_OPENMP=yes :pre

For Intel KNLs using OpenMP, set these 2 variables:

-D KOKKOS_ARCH=KNL
-D KOKKOS_ENABLE_OPENMP=yes :pre

For NVIDIA GPUs using CUDA, set these 4 variables:

-D KOKKOS_ARCH="archCPU;archGPU"   # archCPU = CPU from list above that is hosting the GPU
                                   # archGPU = GPU from list above
-D KOKKOS_ENABLE_CUDA=yes
-D KOKKOS_ENABLE_OPENMP=yes 
-D CMAKE_CXX_COMPILER=wrapper      # wrapper = full path to Cuda nvcc wrapper :pre

The wrapper value is the Cuda nvcc compiler wrapper provided in the
Kokkos library: lib/kokkos/bin/nvcc_wrapper.  The setting should
include the full path name to the wrapper, e.g.

-D CMAKE_CXX_COMPILER=/home/username/lammps/lib/kokkos/bin/nvcc_wrapper :pre

[Traditional make]:

@@ -204,16 +251,7 @@ src/MAKE/OPTIONS/Makefile.kokkos* files for examples.
For multicore CPUs using OpenMP:

KOKKOS_DEVICES = OpenMP
KOKKOS_ARCH = HSW :pre

Possible values are:

HSW for Intel Haswell
SNB for Intel SandyBridge
BDW for Intel Broadwell
BGQ for IBM BlueGene Q
Power7 for IBM
Power8 for IBM :ul
KOKKOS_ARCH = archCPU      # archCPU = CPU from list above :pre

For Intel KNLs using OpenMP:

@@ -223,8 +261,8 @@ KOKKOS_ARCH = KNL :pre
For NVIDIA GPUs using CUDA:

KOKKOS_DEVICES = Cuda
KOKKOS_ARCH = Pascal60,Power8     # P100 hosted by an IBM Power8, etc
KOKKOS_ARCH = Kepler37,Power8     # K80 hosted by an IBM Power8, etc :pre
KOKKOS_ARCH = archCPU,archGPU    # archCPU = CPU from list above that is hosting the GPU
                                 # archGPU = GPU from list above :pre

For GPUs, you also need these 2 lines in your Makefile.machine before
the CC line is defined, in this case for use with OpenMPI mpicxx.  The
@@ -245,7 +283,7 @@ library.

[CMake build]:

-D DOWNLOAD_LATTE=value    # download LATTE for build, value = off (default) or on
-D DOWNLOAD_LATTE=value    # download LATTE for build, value = no (default) or yes
-D LATTE_LIBRARY=path      # path to LATTE shared library (only needed if a custom location) :pre

[Traditional make]:
@@ -320,7 +358,7 @@ lib/mscg/README and MSCG/Install files for more details.

[CMake build]:

-D DOWNLOAD_MSCG=value    # download MSCG for build, value = off (default) or on
-D DOWNLOAD_MSCG=value    # download MSCG for build, value = no (default) or yes
-D MSCG_LIBRARY=path      # path to MSCG shared library (only needed if a custom location) 
-D MSCG_INCLUDE_DIR=path  # path to MSCG include directory (only needed if a custom location) :pre

@@ -400,12 +438,12 @@ lib/python/README for more details.

-D PYTHON_EXECUTABLE=path   # path to Python executable to use :pre

Without this setting, CMake will you your system default Python.  To
use a different Python version, you can either create a virtualenv,
activate it and then run cmake.  Or you can set the PYTHON_EXECUTABLE
variable to specify which Python interpreter should be used.  Note
note that you will also need to have the development headers installed
for this version, e.g. python2-devel.
Without this setting, CMake will ues the default Python on your
system.  To use a different Python version, you can either create a
virtualenv, activate it and then run cmake.  Or you can set the
PYTHON_EXECUTABLE variable to specify which Python interpreter should
be used.  Note note that you will also need to have the development
headers installed for this version, e.g. python2-devel.

[Traditional make]:

@@ -464,7 +502,7 @@ library"_voro_home.

[CMake build]:

-D DOWNLOAD_VORO=value    # download Voro++ for build, value = off (default) or on
-D DOWNLOAD_VORO=value    # download Voro++ for build, value = no (default) or yes
-D VORO_LIBRARY=path      # (only needed if at custom location) path to VORO shared library
-D VORO_INCLUDE_DIR=path  # (only needed if at custom location) path to VORO include directory :pre

@@ -486,7 +524,6 @@ created in lib/voronoi to point to the Voro++ src dir. When LAMMPS
builds in src it will use these links.  You should not need to edit
the lib/voronoi/Makefile.lammps file.

:line
:line

USER-ATC package :h4,link(user-atc)
@@ -642,15 +679,16 @@ USER-INTEL package :h4,link(user-intel)

To build with this package, you must choose which hardware you want to
build for, either Intel CPUs or Intel KNLs.  You should also typically
install the USER-OMP package, as it can be used in tandem with the
USER-INTEL package to good effect, as explained on the "Speed
"install the USER-OMP package"_#user-omp, as it can be used in tandem
with the USER-INTEL package to good effect, as explained on the "Speed
intel"_Speed_intel.html doc page.

[CMake build]:

-D INTEL_ARCH=value     # value = cpu (default) or knl :pre
-D BUILD_OMP=yes        # also required to build with the USER-INTEl package :pre

Requires an Intel compiler, Intel TBB and MKL and has to be built with "-D BUILD_OMP=on".
Requires an Intel compiler as well as the Intel TBB and MKL libraries.

[Traditional make]:

@@ -821,22 +859,19 @@ successfully build on your system.

USER-SMD package :h4,link(user-smd)

To build with this package, you must download the Eigen library.
Eigen is a template library, so you do not need to build it.
To build with this package, you must download the Eigen3 library.
Eigen3 is a template library, so you do not need to build it.

[CMake build]:

-D EIGEN3_INCLUDE_DIR=path    # path to Eigen library :pre

TODO: there is no download option for the Eigen lib?
-D DOWNLOAD_EIGEN3            # download Eigen3, value = no (default) or yes
-D EIGEN3_INCLUDE_DIR=path    # path to Eigen library (only needed if a custom location) :pre

CMake will not download the Eigen library.  But once you have done
that, a CMake build of LAMMPS with "-D PKG_USER-SMD=yes" should work.
Set EIGEN3_INCLUDE_DIR if CMake cannot find the Eigen library.
Set EIGEN3_INCLUDE_DIR if CMake cannot find the Eigen3 library.

[Traditional make]:

You can download the Eigen library manually if you prefer; follow the
You can download the Eigen3 library manually if you prefer; follow the
instructions in lib/smd/README.  You can also do it in one step from
the lammps/src dir, using a command like these, which simply invoke
the lib/smd/Install.py script with the specified args:
+12 −11
Original line number Diff line number Diff line
@@ -130,16 +130,16 @@ the Git or SVN repositories, no packages are pre-installed.

[CMake shortcuts for installing many packages]:

Instead of specifying all the CMake options via the command-line, CMake allows
initializing the variable cache using script files. These are regular CMake
files which can manipulate and set variables, and can also contain control flow
constructs.
Instead of specifying all the CMake options via the command-line,
CMake allows initializing the variable cache using script files. These
are regular CMake files which can manipulate and set variables, and
can also contain control flow constructs.

LAMMPS includes several of these files to define configuration "presets",
similar to the options that exist for the Make based system. Using these files
you can enable/disable portions of the available packages in LAMMPS. If you need a
custom preset you can take one of them as a starting point and customize it to your
needs.
LAMMPS includes several of these files to define configuration
"presets", similar to the options that exist for the Make based
system. Using these files you can enable/disable portions of the
available packages in LAMMPS. If you need a custom preset you can take
one of them as a starting point and customize it to your needs.

cmake -C ../cmake/presets/all_on.cmake \[OPTIONS\] ../cmake | enable all packages
cmake -C ../cmake/presets/all_off.cmake \[OPTIONS\] ../cmake | disable all packages
@@ -149,8 +149,9 @@ cmake -C ../cmake/presets/std_nolib.cmake \[OPTIONS\] ../cmake | enable standard
cmake -C ../cmake/presets/nolib.cmake \[OPTIONS\] ../cmake | disable all packages that do not require extra libraries
cmake -C ../cmake/presets/manual_selection.cmake \[OPTIONS\] ../cmake | example of how to create a manual selection of packages :tb(s=|,a=l)

NOTE: Running cmake this way manipulates the variable cache in your current
build directory. You can combine presets and options with multiple cmake runs.
NOTE: Running cmake this way manipulates the variable cache in your
current build directory. You can combine presets and options with
multiple cmake runs.

[Example:]

Loading