diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7d1f1a417b86085e0c9f0630b070b4f7ef51663c..a4fc5b7b4f111296f4ae1ddcf5dad2cc2a74fa22 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -111,6 +111,7 @@ src/exceptions.h @rbberger src/fix_nh.* @athomps src/info.* @akohlmey @rbberger src/timer.* @akohlmey +src/min* @sjplimp @stanmoore1 # tools tools/msi2lmp/* @akohlmey diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 3ff672a05d3ffba38dace3c11ecb3b98270cfeef..0f15bf02be262268e29d00fa3c1558e0f357cb63 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -68,12 +68,12 @@ How quickly your contribution will be integrated depends largely on how much eff Here is a checklist of steps you need to follow to submit a single file or user package for our consideration. Following these steps will save both you and us time. See existing files in packages in the source directory for examples. If you are uncertain, please ask on the lammps-users mailing list. * All source files you provide must compile with the most current version of LAMMPS with multiple configurations. In particular you need to test compiling LAMMPS from scratch with `-DLAMMPS_BIGBIG` set in addition to the default `-DLAMMPS_SMALLBIG` setting. Your code will need to work correctly in serial and in parallel using MPI. -* For consistency with the rest of LAMMPS and especially, if you want your contribution(s) to be added to main LAMMPS code or one of its standard packages, it needs to be written in a style compatible with other LAMMPS source files. This means: 2-character indentation per level, no tabs, no lines over 80 characters. I/O is done via the C-style stdio library, style class header files should not import any system headers, STL containers should be avoided in headers, and forward declarations used where possible or needed. All added code should be placed into the LAMMPS_NS namespace or a sub-namespace; global or static variables should be avoided, as they conflict with the modular nature of LAMMPS and the C++ class structure. There MUST NOT be any "using namespace XXX;" statements in headers. In the implementation file (.cpp) system includes should be placed in angular brackets (<>) and for c-library functions the C++ style header files should be included ( instead of , or instead of ). This all is so the developers can more easily understand, integrate, and maintain your contribution and reduce conflicts with other parts of LAMMPS. This basically means that the code accesses data structures, performs its operations, and is formatted similar to other LAMMPS source files, including the use of the error class for error and warning messages. -* Source, style name, and documentation file should follow the following naming convention: style names should be lowercase and words separated by a forward slash; for a new fix style 'foo/bar', the class should be named FixFooBar, the name of the source files should be 'fix_foo_bar.h' and 'fix_foo_bar.cpp' and the corresponding documentation should be in a file 'fix_foo_bar.txt'. +* For consistency with the rest of LAMMPS and especially, if you want your contribution(s) to be added to main LAMMPS code or one of its standard packages, it needs to be written in a style compatible with other LAMMPS source files. This means: 2-character indentation per level, no tabs, no trailing whitespace, no lines over 80 characters. I/O is done via the C-style stdio library, style class header files should not import any system headers, STL containers should be avoided in headers, and forward declarations used where possible or needed. All added code should be placed into the LAMMPS_NS namespace or a sub-namespace; global or static variables should be avoided, as they conflict with the modular nature of LAMMPS and the C++ class structure. There MUST NOT be any "using namespace XXX;" statements in headers. In the implementation file (.cpp) system includes should be placed in angular brackets (<>) and for c-library functions the C++ style header files should be included ( instead of , or instead of ). This all is so the developers can more easily understand, integrate, and maintain your contribution and reduce conflicts with other parts of LAMMPS. This basically means that the code accesses data structures, performs its operations, and is formatted similar to other LAMMPS source files, including the use of the error class for error and warning messages. +* Source, style name, and documentation file should follow the following naming convention: style names should be lowercase and words separated by a forward slash; for a new fix style 'foo/bar', the class should be named FixFooBar, the name of the source files should be 'fix_foo_bar.h' and 'fix_foo_bar.cpp' and the corresponding documentation should be in a file 'fix_foo_bar.rst'. * If you want your contribution to be added as a user-contributed feature, and it is a single file (actually a `.cpp` and `.h` file) it can be rapidly added to the USER-MISC directory. Include the one-line entry to add to the USER-MISC/README file in that directory, along with the 2 source files. You can do this multiple times if you wish to contribute several individual features. * If you want your contribution to be added as a user-contribution and it is several related features, it is probably best to make it a user package directory with a name like USER-FOO. In addition to your new files, the directory should contain a README text file. The README should contain your name and contact information and a brief description of what your new package does. If your files depend on other LAMMPS style files also being installed (e.g. because your file is a derived class from the other LAMMPS class), then an Install.sh file is also needed to check for those dependencies. See other README and Install.sh files in other USER directories as examples. Send us a tarball of this USER-FOO directory. * Your new source files need to have the LAMMPS copyright, GPL notice, and your name and email address at the top, like other user-contributed LAMMPS source files. They need to create a class that is inside the LAMMPS namespace. If the file is for one of the USER packages, including USER-MISC, then we are not as picky about the coding style (see above). I.e. the files do not need to be in the same stylistic format and syntax as other LAMMPS files, though that would be nice for developers as well as users who try to read your code. -* You **must** also create or extend a documentation file for each new command or style you are adding to LAMMPS. For simplicity and convenience, the documentation of groups of closely related commands or styles may be combined into a single file. This will be one file for a single-file feature. For a package, it might be several files. These are simple text files with a specific markup language, that are then auto-converted to HTML and PDF. The tools for this conversion are included in the source distribution, and the translation can be as simple as doing "make html pdf" in the doc folder. Thus the documentation source files must be in the same format and style as other `.txt` files in the lammps/doc/src directory for similar commands and styles; use one or more of them as a starting point. A description of the markup can also be found in `lammps/doc/utils/txt2html/README.html` As appropriate, the text files can include links to equations (see doc/Eqs/*.tex for examples, we auto-create the associated JPG files), or figures (see doc/JPG for examples), or even additional PDF files with further details (see doc/PDF for examples). The doc page should also include literature citations as appropriate; see the bottom of doc/fix_nh.txt for examples and the earlier part of the same file for how to format the cite itself. The "Restrictions" section of the doc page should indicate that your command is only available if LAMMPS is built with the appropriate USER-MISC or USER-FOO package. See other user package doc files for examples of how to do this. The prerequisite for building the HTML format files are Python 3.x and virtualenv, the requirement for generating the PDF format manual is the htmldoc software. Please run at least "make html" and carefully inspect and proofread the resulting HTML format doc page before submitting your code. +* You **must** also create or extend a documentation file for each new command or style you are adding to LAMMPS. For simplicity and convenience, the documentation of groups of closely related commands or styles may be combined into a single file. This will be one file for a single-file feature. For a package, it might be several files. These are files in the [reStructuredText](https://docutils.sourceforge.io/rst.html) markup language, that are then converted to HTML and PDF. The tools for this conversion are included in the source distribution, and the translation can be as simple as doing "make html pdf" in the doc folder. Thus the documentation source files must be in the same format and style as other `.rst` files in the lammps/doc/src directory for similar commands and styles; use one or more of them as a starting point. An introduction to reStructuredText can be found at [https://docutils.sourceforge.io/docs/user/rst/quickstart.html](https://docutils.sourceforge.io/docs/user/rst/quickstart.html). As appropriate, the text files can include mathematical expressions in MathJAX markup or links to equations (see doc/Eqs/*.tex for examples, we auto-create the associated JPG files), or figures (see doc/JPG for examples), or even additional PDF files with further details (see doc/PDF for examples). The doc page should also include literature citations as appropriate; see the bottom of doc/fix_nh.rst for examples and the earlier part of the same file for how to format the cite itself. The "Restrictions" section of the doc page should indicate that your command is only available if LAMMPS is built with the appropriate USER-MISC or USER-FOO package. See other user package doc files for examples of how to do this. The prerequisite for building the HTML format files are Python 3.x and virtualenv. Please run at least `make html` and `make spelling` and carefully inspect and proofread the resulting HTML format doc page as well as the output produced to the screen. Make sure that all spelling errors are fixed or the necessary false positives are added to the `doc/utils/sphinx-config/false_positives.txt` file. For new styles, those usually also need to be added to lists on the respective overview pages. This can be checked for also with `make style_check`. * For a new package (or even a single command) you should include one or more example scripts demonstrating its use. These should run in no more than a couple minutes, even on a single processor, and not require large data files as input. See directories under examples/USER for examples of input scripts other users provided for their packages. These example inputs are also required for validating memory accesses and testing for memory leaks with valgrind * If there is a paper of yours describing your feature (either the algorithm/science behind the feature itself, or its initial usage, or its implementation in LAMMPS), you can add the citation to the *.cpp source file. See src/USER-EFF/atom_vec_electron.cpp for an example. A LaTeX citation is stored in a variable at the top of the file and a single line of code that references the variable is added to the constructor of the class. Whenever a user invokes your feature from their input script, this will cause LAMMPS to output the citation to a log.cite file and prompt the user to examine the file. Note that you should only use this for a paper you or your group authored. E.g. adding a cite in the code for a paper by Nose and Hoover if you write a fix that implements their integrator is not the intended usage. That kind of citation should just be in the doc page you provide. diff --git a/.gitignore b/.gitignore index f9dda49da647a4fd029fc9a905d869cc3bb47dee..52b8212b139460f02ecbce157ad6818206c71693 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ vgcore.* .vagrant \#*# .#* +.vscode .DS_Store .DS_Store? diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index a24818139b67020b01e3e35165d88a8d1fcb3534..e239099793ac75e3d88fb64dd26dca8cc181c866 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -588,8 +588,9 @@ if(BUILD_TOOLS) install(TARGETS binary2txt DESTINATION ${CMAKE_INSTALL_BINDIR}) # ninja-build currently does not support fortran. thus we skip building this tool - if(NOT CMAKE_GENERATOR STREQUAL "Ninja") + if(CMAKE_GENERATOR STREQUAL "Ninja") message(STATUS "Skipping building 'chain.x' with Ninja build tool due to lack of Fortran support") + else() enable_language(Fortran) add_executable(chain.x ${LAMMPS_TOOLS_DIR}/chain.f) target_link_libraries(chain.x ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES}) @@ -738,4 +739,20 @@ if(PKG_KSPACE) else() message(STATUS "Using double precision FFTs") endif() + if(FFT_FFTW_THREADS OR FFT_MKL_THREADS) + message(STATUS "Using threaded FFTs") + else() + message(STATUS "Using non-threaded FFTs") + endif() + if(PKG_KOKKOS) + if(KOKKOS_ENABLE_CUDA) + if (${FFT} STREQUAL "KISS") + message(STATUS "Kokkos FFT: KISS") + else() + message(STATUS "Kokkos FFT: cuFFT") + endif() + else() + message(STATUS "Kokkos FFT: ${FFT}") + endif() + endif() endif() diff --git a/cmake/Modules/FindFFTW3.cmake b/cmake/Modules/FindFFTW3.cmake index 552bcc4257adf0833a2d4d25bcbce3974a27ec7c..63752f85dfa889980598d3891e2dbc3c66be5c87 100644 --- a/cmake/Modules/FindFFTW3.cmake +++ b/cmake/Modules/FindFFTW3.cmake @@ -1,20 +1,22 @@ # - Find fftw3 -# Find the native FFTW3 headers and libraries. +# Find the native double precision FFTW3 headers and libraries. # -# FFTW3_INCLUDE_DIRS - where to find fftw3.h, etc. -# FFTW3_LIBRARIES - List of libraries when using fftw3. -# FFTW3_FOUND - True if fftw3 found. +# FFTW3_INCLUDE_DIRS - where to find fftw3.h, etc. +# FFTW3_LIBRARIES - List of libraries when using fftw3. +# FFTW3_OMP_LIBRARIES - List of libraries when using fftw3. +# FFTW3_FOUND - True if fftw3 found. # find_package(PkgConfig) pkg_check_modules(PC_FFTW3 fftw3) find_path(FFTW3_INCLUDE_DIR fftw3.h HINTS ${PC_FFTW3_INCLUDE_DIRS}) - find_library(FFTW3_LIBRARY NAMES fftw3 HINTS ${PC_FFTW3_LIBRARY_DIRS}) +find_library(FFTW3_OMP_LIBRARY NAMES fftw3_omp HINTS ${PC_FFTW3_LIBRARY_DIRS}) -set(FFTW3_LIBRARIES ${FFTW3_LIBRARY}) set(FFTW3_INCLUDE_DIRS ${FFTW3_INCLUDE_DIR}) +set(FFTW3_LIBRARIES ${FFTW3_LIBRARY}) +set(FFTW3_OMP_LIBRARIES ${FFTW3_OMP_LIBRARY}) include(FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE @@ -22,4 +24,4 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR) -mark_as_advanced(FFTW3_INCLUDE_DIR FFTW3_LIBRARY ) +mark_as_advanced(FFTW3_INCLUDE_DIR FFTW3_LIBRARY FFTW3_OMP_LIBRARY) diff --git a/cmake/Modules/FindFFTW3F.cmake b/cmake/Modules/FindFFTW3F.cmake index 92d1e85e791ec362a15909bd09dccdc046efc2a5..c67aa5faf1ca5b7a95eac870fa268f9fa2e26e2c 100644 --- a/cmake/Modules/FindFFTW3F.cmake +++ b/cmake/Modules/FindFFTW3F.cmake @@ -1,8 +1,8 @@ -# - Find fftw3f -# Find the native FFTW3F headers and libraries. +# Find the native single precision FFTW3 headers and libraries. # # FFTW3F_INCLUDE_DIRS - where to find fftw3f.h, etc. # FFTW3F_LIBRARIES - List of libraries when using fftw3f. +# FFTW3F_OMP_LIBRARIES - List of libraries when using fftw3. # FFTW3F_FOUND - True if fftw3f found. # @@ -10,11 +10,12 @@ find_package(PkgConfig) pkg_check_modules(PC_FFTW3F fftw3f) find_path(FFTW3F_INCLUDE_DIR fftw3.h HINTS ${PC_FFTW3F_INCLUDE_DIRS}) - find_library(FFTW3F_LIBRARY NAMES fftw3f HINTS ${PC_FFTW3F_LIBRARY_DIRS}) +find_library(FFTW3F_OMP_LIBRARY NAMES fftw3f_omp HINTS ${PC_FFTW3F_LIBRARY_DIRS}) -set(FFTW3F_LIBRARIES ${FFTW3F_LIBRARY}) set(FFTW3F_INCLUDE_DIRS ${FFTW3F_INCLUDE_DIR}) +set(FFTW3F_LIBRARIES ${FFTW3F_LIBRARY}) +set(FFTW3F_OMP_LIBRARIES ${FFTW3F_OMP_LIBRARY}) include(FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set FFTW3F_FOUND to TRUE @@ -22,4 +23,4 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(FFTW3F DEFAULT_MSG FFTW3F_LIBRARY FFTW3F_INCLUDE_DIR) -mark_as_advanced(FFTW3F_INCLUDE_DIR FFTW3F_LIBRARY ) +mark_as_advanced(FFTW3F_INCLUDE_DIR FFTW3F_LIBRARY) diff --git a/cmake/Modules/FindNetCDF.cmake b/cmake/Modules/FindNetCDF.cmake index a28c959acf626318a5bf00e7a2e1ca0c4c3eef7e..2a992b6b3b532513d1f2886cd5e76aeaba32df20 100644 --- a/cmake/Modules/FindNetCDF.cmake +++ b/cmake/Modules/FindNetCDF.cmake @@ -46,10 +46,14 @@ endif() find_path (NETCDF_INCLUDE_DIR netcdf.h HINTS "${NETCDF_DIR}/include") mark_as_advanced (NETCDF_INCLUDE_DIR) + set (NETCDF_C_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR}) +string(REGEX REPLACE "/include/?$" "" + NETCDF_LIB_HINT ${NETCDF_INCLUDE_DIR}) + find_library (NETCDF_LIBRARY NAMES netcdf - HINTS "${NETCDF_DIR}/lib") + HINTS "${NETCDF_DIR}" "${NETCDF_LIB_HINT}" PATH_SUFFIXES lib lib64) mark_as_advanced (NETCDF_LIBRARY) set (NETCDF_C_LIBRARIES ${NETCDF_LIBRARY}) diff --git a/cmake/Modules/FindPNetCDF.cmake b/cmake/Modules/FindPNetCDF.cmake new file mode 100644 index 0000000000000000000000000000000000000000..bc3a5f9538b17c82201437f3ee378e9be0bf49fa --- /dev/null +++ b/cmake/Modules/FindPNetCDF.cmake @@ -0,0 +1,55 @@ +# source: https://ftp.space.dtu.dk/pub/Ioana/pism0.6.1-10/CMake/FindPNetCDF.cmake +# license: GPL v3 (https://ftp.space.dtu.dk/pub/Ioana/pism0.6.1-10/COPYING) +# +# - Find PNetCDF +# Find the native PNetCDF includes and library +# +# PNETCDF_INCLUDES - where to find netcdf.h, etc +# PNETCDF_LIBRARIES - Link these libraries when using NetCDF +# PNETCDF_FOUND - True if PNetCDF was found +# +# Normal usage would be: +# find_package (PNetCDF REQUIRED) +# target_link_libraries (uses_pnetcdf ${PNETCDF_LIBRARIES}) + +if (PNETCDF_INCLUDES AND PNETCDF_LIBRARIES) + # Already in cache, be silent + set (PNETCDF_FIND_QUIETLY TRUE) +endif (PNETCDF_INCLUDES AND PNETCDF_LIBRARIES) + +find_path (PNETCDF_INCLUDES pnetcdf.h + HINTS "${PNETCDF_ROOT}/include" "$ENV{PNETCDF_ROOT}/include") + +string(REGEX REPLACE "/include/?$" "" + PNETCDF_LIB_HINT ${PNETCDF_INCLUDES}) + +find_library (PNETCDF_LIBRARIES + NAMES pnetcdf + HINTS ${PNETCDF_LIB_HINT} PATH_SUFFIXES lib lib64) + +if ((NOT PNETCDF_LIBRARIES) OR (NOT PNETCDF_INCLUDES)) + message(STATUS "Trying to find PNetCDF using LD_LIBRARY_PATH (we're desperate)...") + + file(TO_CMAKE_PATH "$ENV{LD_LIBRARY_PATH}" LD_LIBRARY_PATH) + + find_library(PNETCDF_LIBRARIES + NAMES pnetcdf + HINTS ${LD_LIBRARY_PATH}) + + if (PNETCDF_LIBRARIES) + get_filename_component(PNETCDF_LIB_DIR ${PNETCDF_LIBRARIES} PATH) + string(REGEX REPLACE "/(lib|lib64)/?$" "/include" + PNETCDF_H_HINT ${PNETCDF_LIB_DIR}) + + find_path (PNETCDF_INCLUDES pnetcdf.h + HINTS ${PNETCDF_H_HINT} + DOC "Path to pnetcdf.h") + endif() +endif() + +# handle the QUIETLY and REQUIRED arguments and set PNETCDF_FOUND to TRUE if +# all listed variables are TRUE +include (FindPackageHandleStandardArgs) +find_package_handle_standard_args (PNetCDF DEFAULT_MSG PNETCDF_LIBRARIES PNETCDF_INCLUDES) + +mark_as_advanced (PNETCDF_LIBRARIES PNETCDF_INCLUDES) diff --git a/cmake/Modules/Packages/KOKKOS.cmake b/cmake/Modules/Packages/KOKKOS.cmake index 428588ec9d06e860f3535cf6b8de619fc896a67d..29beaca957885e0886d34c16437467066c06a061 100644 --- a/cmake/Modules/Packages/KOKKOS.cmake +++ b/cmake/Modules/Packages/KOKKOS.cmake @@ -10,7 +10,7 @@ if(PKG_KOKKOS) set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos) set(LAMMPS_LIB_KOKKOS_BIN_DIR ${LAMMPS_LIB_BINARY_DIR}/kokkos) add_subdirectory(${LAMMPS_LIB_KOKKOS_SRC_DIR} ${LAMMPS_LIB_KOKKOS_BIN_DIR}) - + set(Kokkos_INCLUDE_DIRS ${LAMMPS_LIB_KOKKOS_SRC_DIR}/core/src ${LAMMPS_LIB_KOKKOS_SRC_DIR}/containers/src ${LAMMPS_LIB_KOKKOS_SRC_DIR}/algorithms/src @@ -39,7 +39,15 @@ if(PKG_KOKKOS) ${KOKKOS_PKG_SOURCES_DIR}/modify_kokkos.cpp) if(PKG_KSPACE) - list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/gridcomm_kokkos.cpp) + list(APPEND KOKKOS_PKG_SOURCES ${KOKKOS_PKG_SOURCES_DIR}/fft3d_kokkos.cpp + ${KOKKOS_PKG_SOURCES_DIR}/gridcomm_kokkos.cpp + ${KOKKOS_PKG_SOURCES_DIR}/remap_kokkos.cpp) + if(KOKKOS_ENABLE_CUDA) + if(NOT ${FFT} STREQUAL "KISS") + add_definitions(-DFFT_CUFFT) + list(APPEND LAMMPS_LINK_LIBS cufft) + endif() + endif() endif() set_property(GLOBAL PROPERTY "KOKKOS_PKG_SOURCES" "${KOKKOS_PKG_SOURCES}") diff --git a/cmake/Modules/Packages/KSPACE.cmake b/cmake/Modules/Packages/KSPACE.cmake index 63c42baf2d5c0bb17fce96f85dfc99fe84b6eede..07612447f985140dc88fb1c55112814a32ba8c81 100644 --- a/cmake/Modules/Packages/KSPACE.cmake +++ b/cmake/Modules/Packages/KSPACE.cmake @@ -21,9 +21,27 @@ if(PKG_KSPACE) add_definitions(-DFFT_FFTW3) include_directories(${${FFTW}_INCLUDE_DIRS}) list(APPEND LAMMPS_LINK_LIBS ${${FFTW}_LIBRARIES}) + if(FFTW3_OMP_LIBRARY OR FFTW3F_OMP_LIBRARY) + option(FFT_FFTW_THREADS "Use threaded FFTW library" ON) + else() + option(FFT_FFTW_THREADS "Use threaded FFT library" OFF) + endif() + + if(FFT_FFTW_THREADS) + if(FFTW3_OMP_LIBRARY OR FFTW3F_OMP_LIBRARY) + add_definitions(-DFFT_FFTW_THREADS) + list(APPEND LAMMPS_LINK_LIBS ${${FFTW}_OMP_LIBRARIES}) + else() + message(FATAL_ERROR "Need OpenMP enabled FFTW3 library for FFT_THREADS") + endif() + endif() elseif(FFT STREQUAL "MKL") find_package(MKL REQUIRED) add_definitions(-DFFT_MKL) + option(FFT_MKL_THREADS "Use threaded MKL FFT" ON) + if(FFT_MKL_THREADS) + add_definitions(-DFFT_MKL_THREADS) + endif() include_directories(${MKL_INCLUDE_DIRS}) list(APPEND LAMMPS_LINK_LIBS ${MKL_LIBRARIES}) else() diff --git a/cmake/Modules/Packages/USER-NETCDF.cmake b/cmake/Modules/Packages/USER-NETCDF.cmake index a90725bbbc65114fbc546006848a7a0c68b49304..f60c046ab99aa36fc26577e4225bed9b5edd46fc 100644 --- a/cmake/Modules/Packages/USER-NETCDF.cmake +++ b/cmake/Modules/Packages/USER-NETCDF.cmake @@ -1,6 +1,24 @@ if(PKG_USER-NETCDF) - find_package(NetCDF REQUIRED) - include_directories(${NETCDF_INCLUDE_DIRS}) - list(APPEND LAMMPS_LINK_LIBS ${NETCDF_LIBRARIES}) - add_definitions(-DLMP_HAS_NETCDF -DNC_64BIT_DATA=0x0020) + # USER-NETCDF can use NetCDF, Parallel NetCDF (PNetCDF), or both. At least one necessary. + # NetCDF library enables dump sytle "netcdf", while PNetCDF enables dump style "netcdf/mpiio" + find_package(NetCDF) + if(NETCDF_FOUND) + find_package(PNetCDF) + else(NETCDF_FOUND) + find_package(PNetCDF REQUIRED) + endif(NETCDF_FOUND) + + if(NETCDF_FOUND) + include_directories(${NETCDF_INCLUDE_DIRS}) + list(APPEND LAMMPS_LINK_LIBS ${NETCDF_LIBRARIES}) + add_definitions(-DLMP_HAS_NETCDF) + endif(NETCDF_FOUND) + + if(PNETCDF_FOUND) + include_directories(${PNETCDF_INCLUDES}) + list(APPEND LAMMPS_LINK_LIBS ${PNETCDF_LIBRARIES}) + add_definitions(-DLMP_HAS_PNETCDF) + endif(PNETCDF_FOUND) + + add_definitions(-DNC_64BIT_DATA=0x0020) endif() diff --git a/cmake/Modules/Packages/USER-PLUMED.cmake b/cmake/Modules/Packages/USER-PLUMED.cmake index bf5c502d84bbe9421c6e37518ea519fcb3f97dbb..e10176f9fd6b3348232f569018be5252e18dbd95 100644 --- a/cmake/Modules/Packages/USER-PLUMED.cmake +++ b/cmake/Modules/Packages/USER-PLUMED.cmake @@ -49,8 +49,8 @@ if(PKG_USER-PLUMED) message(STATUS "PLUMED download requested - we will build our own") include(ExternalProject) ExternalProject_Add(plumed_build - URL https://github.com/plumed/plumed2/releases/download/v2.5.3/plumed-src-2.5.3.tgz - URL_MD5 de30d6e7c2dcc0973298e24a6da24286 + URL https://github.com/plumed/plumed2/releases/download/v2.6.0/plumed-src-2.6.0.tgz + URL_MD5 204d2edae58d9b10ba3ad460cad64191 BUILD_IN_SOURCE 1 CONFIGURE_COMMAND /configure --prefix= ${CONFIGURE_REQUEST_PIC} diff --git a/doc/Makefile b/doc/Makefile index eceae88da648960adc554ddf674baf34270c1ab7..7fba611361e0f0a16b486eaeeba0e19a36eefe18 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -3,7 +3,6 @@ SHELL = /bin/bash BUILDDIR = ${CURDIR} RSTDIR = $(BUILDDIR)/src -TXTDIR = $(BUILDDIR)/txt VENV = $(BUILDDIR)/docenv TXT2RST = $(VENV)/bin/txt2rst ANCHORCHECK = $(VENV)/bin/rst_anchor_check @@ -28,10 +27,8 @@ HAS_VIRTUALENV = YES endif SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') -SOURCES=$(filter-out $(wildcard $(TXTDIR)/lammps_commands*.txt) $(TXTDIR)/lammps_support.txt $(TXTDIR)/lammps_tutorials.txt,$(wildcard $(TXTDIR)/*.txt)) -OBJECTS=$(SOURCES:$(TXTDIR)/%.txt=$(RSTDIR)/%.rst) -.PHONY: help clean-all clean epub mobi rst html pdf venv spelling anchor_check +.PHONY: help clean-all clean epub mobi rst html pdf venv spelling anchor_check style_check # ------------------------------------------ @@ -46,6 +43,7 @@ help: @echo " clean remove all intermediate RST files" @echo " clean-all reset the entire build environment" @echo " anchor_check scan for duplicate anchor labels" + @echo " style_check check for complete and consistent style lists" @echo " spelling spell-check the manual" # ------------------------------------------ @@ -60,15 +58,16 @@ clean: clean-spelling: rm -rf spelling -rst: clean $(OBJECTS) $(ANCHORCHECK) +rst: clean $(ANCHORCHECK) -html: $(OBJECTS) $(ANCHORCHECK) +html: $(ANCHORCHECK) @(\ . $(VENV)/bin/activate ;\ sphinx-build $(SPHINXEXTRA) -b html -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\ echo "############################################" ;\ rst_anchor_check src/*.rst ;\ env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\ + python utils/check-styles.py -s ../src -d src ;\ echo "############################################" ;\ deactivate ;\ ) @@ -76,15 +75,18 @@ html: $(OBJECTS) $(ANCHORCHECK) @rm -rf html/_sources @rm -rf html/PDF @rm -rf html/USER + @rm -rf html/JPG @cp -r src/PDF html/PDF @cp -r src/USER html/USER + @mkdir -p html/JPG + @cp `grep -A2 '\.\. image::' src/*.rst | grep ':target:' | sed -e 's,.*:target: JPG/,src/JPG/,' | sort | uniq` html/JPG/ @rm -rf html/PDF/.[sg]* @rm -rf html/USER/.[sg]* @rm -rf html/USER/*/.[sg]* @rm -rf html/USER/*/*.[sg]* @echo "Build finished. The HTML pages are in doc/html." -spelling: $(OBJECTS) utils/sphinx-config/false_positives.txt +spelling: utils/sphinx-config/false_positives.txt @(\ . $(VENV)/bin/activate ;\ pip install sphinxcontrib-spelling ;\ @@ -94,7 +96,7 @@ spelling: $(OBJECTS) utils/sphinx-config/false_positives.txt ) @echo "Spell check finished." -epub: $(OBJECTS) +epub: @mkdir -p epub/JPG @rm -f LAMMPS.epub @cp src/JPG/lammps-logo.png epub/ @@ -113,7 +115,7 @@ mobi: epub @ebook-convert LAMMPS.epub LAMMPS.mobi @echo "Conversion finished. The MOBI manual file is created." -pdf: $(OBJECTS) $(ANCHORCHECK) +pdf: $(ANCHORCHECK) @(\ cd src/Developer; \ pdflatex developer; \ @@ -122,24 +124,27 @@ pdf: $(OBJECTS) $(ANCHORCHECK) cd ../../; \ ) @(\ - . $(VENV)/bin/activate ;\ - sphinx-build $(SPHINXEXTRA) -b latex -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\ - echo "############################################" ;\ - rst_anchor_check src/*.rst ;\ - echo "############################################" ;\ - deactivate ;\ + . $(VENV)/bin/activate ;\ + sphinx-build $(SPHINXEXTRA) -b latex -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\ + echo "############################################" ;\ + rst_anchor_check src/*.rst ;\ + env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\ + python utils/check-styles.py -s ../src -d src ;\ + echo "############################################" ;\ + deactivate ;\ ) @cd latex && \ - sed 's/latexmk -pdf -dvi- -ps-/pdflatex/g' Makefile > temp && \ - mv temp Makefile && \ - sed 's/\\begin{equation}//g' LAMMPS.tex > tmp.tex && \ - mv tmp.tex LAMMPS.tex && \ - sed 's/\\end{equation}//g' LAMMPS.tex > tmp.tex && \ - mv tmp.tex LAMMPS.tex && \ - make && \ - make && \ - mv LAMMPS.pdf ../Manual.pdf && \ - cd ../; + sed 's/latexmk -pdf -dvi- -ps-/pdflatex/g' Makefile > temp && \ + mv temp Makefile && \ + sed 's/\\begin{equation}//g' LAMMPS.tex > tmp.tex && \ + mv tmp.tex LAMMPS.tex && \ + sed 's/\\end{equation}//g' LAMMPS.tex > tmp.tex && \ + mv tmp.tex LAMMPS.tex && \ + make && \ + make && \ + make && \ + mv LAMMPS.pdf ../Manual.pdf && \ + cd ../; @rm -rf latex/_sources @rm -rf latex/PDF @rm -rf latex/USER @@ -162,20 +167,19 @@ fetch: anchor_check : $(ANCHORCHECK) @(\ . $(VENV)/bin/activate ;\ - rst_anchor_check src/*.txt ;\ + rst_anchor_check src/*.rst ;\ deactivate ;\ ) -# ------------------------------------------ - -$(RSTDIR)/%.rst : $(TXTDIR)/%.txt $(TXT2RST) +style_check : @(\ - mkdir -p $(RSTDIR) ; \ . $(VENV)/bin/activate ;\ - txt2rst -v $< > $@ ;\ + python utils/check-styles.py -s ../src -d src ;\ deactivate ;\ ) +# ------------------------------------------ + $(VENV): @if [ "$(HAS_PYTHON3)" == "NO" ] ; then echo "Python3 was not found! Please check README.md for further instructions" 1>&2; exit 1; fi @if [ "$(HAS_VIRTUALENV)" == "NO" ] ; then echo "virtualenv was not found! Please check README.md for further instructions" 1>&2; exit 1; fi diff --git a/doc/github-development-workflow.md b/doc/github-development-workflow.md index ee6470370708b218e6e2319de47b982adc0d1769..a000dbe453df3eb2743915b744d7c7cc59a048c8 100644 --- a/doc/github-development-workflow.md +++ b/doc/github-development-workflow.md @@ -104,14 +104,17 @@ Here are some items to check: * every new command or style should have documentation. The names of source files (c++ and manual) should follow the name of the style. (example: `src/fix_nve.cpp`, `src/fix_nve.h` for `fix nve` command, - implementing the class `FixNVE`, documented in `doc/src/fix_nve.txt`) + implementing the class `FixNVE`, documented in `doc/src/fix_nve.rst`) * all new style names should be lower case, the must be no dashes, blanks, or underscores separating words, only forward slashes. * new style docs should be added to the "overview" files in - `doc/src/Commands_*.txt`, `doc/src/{fixes,computes,pairs,bonds,...}.txt` - and `doc/src/lammps.book` + `doc/src/Commands_*.rst`, `doc/src/{fixes,computes,pairs,bonds,...}.rst` * check whether manual cleanly translates with `make html` and `make pdf` + * if documentation is (still) provided as a .txt file, convert to .rst + and remove the .txt file. For files in doc/txt the conversion is automatic. + * remove all .txt files in `doc/txt` that are out of sync with their .rst counterparts in `doc/src` * check spelling of manual with `make spelling` in doc folder + * check style tables and command lists with `make style_check` * new source files in packages should be added to `src/.gitignore` * removed or renamed files in packages should be added to `src/Purge.list` * C++ source files should use C++ style include files for accessing @@ -136,7 +139,7 @@ Here are some items to check: * Code should follow the C++-98 standard. C++-11 is only accepted in individual special purpose packages * indentation is 2 spaces per level - * there should be NO tabs and no trailing whitespace + * there should be NO tabs and no trailing whitespace (review the "checkstyle" test on pull requests) * header files, especially of new styles, should not include any other headers, except the header with the base class or cstdio. Forward declarations should be used instead when possible. diff --git a/doc/lammps.1 b/doc/lammps.1 index a5045be5c4a8f36c867dc520d4949660112e72cb..ee2299f4b593d31ced2ec5272dafaf8ec64f5618 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,4 +1,4 @@ -.TH LAMMPS "20 November 2019" "2019-11-20" +.TH LAMMPS "18 February 2020" "2020-02-18" .SH NAME .B LAMMPS \- Molecular Dynamics Simulator. @@ -11,13 +11,18 @@ or mpirun \-np 2 .B lmp - [OPTIONS] ... +\-in [OPTIONS] ... or .B lmp \-r2data file.restart file.data +or + +.B lmp +\-h + .SH DESCRIPTION .B LAMMPS is a classical molecular dynamics code, and an acronym for \fBL\fRarge-scale @@ -249,7 +254,7 @@ the chapter on errors in the manual gives some additional information about error messages, if possible. .SH COPYRIGHT -© 2003--2019 Sandia Corporation +© 2003--2020 Sandia Corporation This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as diff --git a/doc/src/Build.rst b/doc/src/Build.rst index 2eba3ddd48cd580447c1f0e46ff843e7ebbc6796..bd218c8165cd3120a3fc05e55d3e990829b79f1b 100644 --- a/doc/src/Build.rst +++ b/doc/src/Build.rst @@ -21,8 +21,3 @@ as described on the :doc:`Install ` doc page. Build_extras Build_windows Build_development - - -.. _lws: http://lammps.sandia.gov -.. _ld: Manual.html -.. _lc: Commands_all.html diff --git a/doc/src/Build_basics.rst b/doc/src/Build_basics.rst index cf77c81e692b0d4dd9440d94f6d54c0fbae42fdd..832b6c3f02cc30fadfbe4e1a48faa2d07fad95f2 100644 --- a/doc/src/Build_basics.rst +++ b/doc/src/Build_basics.rst @@ -430,8 +430,3 @@ you want to copy files to is protected. There is no "install" option in the src/Makefile for LAMMPS. If you wish to do this you will need to first build LAMMPS, then manually copy the desired LAMMPS files to the appropriate system directories. - - -.. _lws: http://lammps.sandia.gov -.. _ld: Manual.html -.. _lc: Commands_all.html diff --git a/doc/src/Build_cmake.rst b/doc/src/Build_cmake.rst index 78459bb9906e07bdddc48b330fe48c7b12d1ec91..ce103d978aa3f92c3b89e57d6a5a6f4aab088863 100644 --- a/doc/src/Build_cmake.rst +++ b/doc/src/Build_cmake.rst @@ -238,8 +238,3 @@ enough version, you can download the latest version at `https://cmake.org/download/ `_. Instructions on how to install it on various platforms can be found `on this page `_. - - -.. _lws: http://lammps.sandia.gov -.. _ld: Manual.html -.. _lc: Commands_all.html diff --git a/doc/src/Build_development.rst b/doc/src/Build_development.rst index 7286caf7b3be0b8d21cd9e839cfc456d7fe4e9ff..ef06a27035d0f1119ea045cce703e8541705f960 100644 --- a/doc/src/Build_development.rst +++ b/doc/src/Build_development.rst @@ -112,9 +112,3 @@ These reports require GCOVR to be installed. The easiest way to do this to insta .. parsed-literal:: pip install git+https://github.com/gcovr/gcovr.git - - - -.. _lws: http://lammps.sandia.gov -.. _ld: Manual.html -.. _lc: Commands_all.html diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index c02b24641efd1c3979a94b63974db2688d7ea5b1..3ee3bce21ad73ab06111eb470ba32a7dc4632267 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -177,7 +177,7 @@ KIM package To build with this package, the KIM library with API v2 must be downloaded and built on your system. It must include the KIM models that you want to -use with LAMMPS. If you want to use the :doc:`kim\_query ` +use with LAMMPS. If you want to use the :doc:`kim_query ` command, you also need to have libcurl installed with the matching development headers and the curl-config tool. @@ -203,7 +203,7 @@ inside the CMake build directory. If the KIM library is already on your system (in a location CMake cannot find it), set the PKG\_CONFIG\_PATH environment variable so that libkim-api can be found. -For using KIM web queries. +For using OpenKIM web queries in LAMMPS. If LMP\_DEBUG\_CURL is set, the libcurl verbose mode will be on, and any libcurl calls within the KIM web query display a lot of information about @@ -350,10 +350,12 @@ For NVIDIA GPUs using CUDA: KOKKOS_DEVICES = Cuda KOKKOS_ARCH = archCPU,archGPU # archCPU = CPU from list above that is hosting the GPU # archGPU = GPU from list above + FFT_INC = -DFFT_CUFFT # enable use of cuFFT (optional) + FFT_LIB = -lcufft # link to cuFFT library -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 -2 lines define a nvcc wrapper compiler, which will use nvcc for +For GPUs, you also need the following 2 lines in your Makefile.machine +before the CC line is defined, in this case for use with OpenMPI mpicxx. +The 2 lines define a nvcc wrapper compiler, which will use nvcc for compiling CUDA files and use a C++ compiler for non-Kokkos, non-CUDA files. @@ -878,6 +880,9 @@ USER-PLUMED package Before building LAMMPS with this package, you must first build PLUMED. PLUMED can be built as part of the LAMMPS build or installed separately from LAMMPS using the generic `plumed installation instructions `_. +The USER-PLUMED package has been tested to work with Plumed versions +2.4.x, 2.5.x, and 2.6.x and will error out, when trying to run calculations +with a different version of the Plumed kernel. PLUMED can be linked into MD codes in three different modes: static, @@ -1412,8 +1417,3 @@ the settings are not valid for your system, check if one of the other lib/vtk/Makefile.lammps.\* files is compatible and copy it to Makefile.lammps. If none of the provided files work, you will need to edit the Makefile.lammps file. See lib/vtk/README for details. - - -.. _lws: http://lammps.sandia.gov -.. _ld: Manual.html -.. _lc: Commands_all.html diff --git a/doc/src/Build_link.rst b/doc/src/Build_link.rst index 8306fcb86f5930d89179a16b467a0cfecc9b0c62..1478eceaf874eae00ca1881f6be69e2ee657ecdc 100644 --- a/doc/src/Build_link.rst +++ b/doc/src/Build_link.rst @@ -84,8 +84,3 @@ See the sample codes in examples/COUPLE/simple for examples of C++ and C and Fortran codes that invoke LAMMPS through its library interface. Other examples in the COUPLE directory use coupling ideas discussed on the :doc:`Howto couple ` doc page. - - -.. _lws: http://lammps.sandia.gov -.. _ld: Manual.html -.. _lc: Commands_all.html diff --git a/doc/src/Build_make.rst b/doc/src/Build_make.rst index 8f1966f1014bc120cc9858c88fb23afe1ba92613..c7db5dbb52b64813706b178bd32acb62c6fbacd9 100644 --- a/doc/src/Build_make.rst +++ b/doc/src/Build_make.rst @@ -87,8 +87,3 @@ settings may become outdated: make kokkos_omp # build with the KOKKOS package for OpenMP make kokkos_cuda_mpi # build with the KOKKOS package for GPUs make kokkos_phi # build with the KOKKOS package for KNLs - - -.. _lws: http://lammps.sandia.gov -.. _ld: Manual.html -.. _lc: Commands_all.html diff --git a/doc/src/Build_package.rst b/doc/src/Build_package.rst index 9f56f3f329d7c13d78874ddafdb0b7e7e9402ffc..7f2fe7f8ef3ce1fd72fa313e3bea9ef4d43066b8 100644 --- a/doc/src/Build_package.rst +++ b/doc/src/Build_package.rst @@ -258,8 +258,3 @@ sub-directories with src files. Type "make package-diff" to list all differences between pairs of files in both the src dir and a package dir. - - -.. _lws: http://lammps.sandia.gov -.. _ld: Manual.html -.. _lc: Commands_all.html diff --git a/doc/src/Build_settings.rst b/doc/src/Build_settings.rst index 07d427db49860a522797a46d7b875177287b8948..273a598b1a88482bc5c710363905de28e4e7bdf6 100644 --- a/doc/src/Build_settings.rst +++ b/doc/src/Build_settings.rst @@ -5,11 +5,11 @@ LAMMPS can be built with several optional settings. Each sub-section explain how to do this for building both with CMake and make. | :ref:`C++11 standard compliance test ` when building all of LAMMPS -| :ref:`FFT library ` for use with the :doc:`kspace\_style pppm ` command +| :ref:`FFT library ` for use with the :doc:`kspace_style pppm ` command | :ref:`Size of LAMMPS data types ` | :ref:`Read or write compressed files ` | :ref:`Output of JPG and PNG files ` via the :doc:`dump image ` command -| :ref:`Output of movie files ` via the :doc:`dump\_movie ` command +| :ref:`Output of movie files ` via the :doc:`dump_movie ` command | :ref:`Memory allocation alignment ` | :ref:`Workaround for long long integers ` | :ref:`Error handling exceptions ` when using LAMMPS as a library @@ -49,13 +49,19 @@ through the CMAKE\_CXX\_FLAGS variable. Example for CentOS 7: -D CMAKE_CXX_FLAGS="-O3 -g -fopenmp -DNDEBUG -std=c++11" -**Makefile.machine setting**\ : +**Makefile.machine setting**\ to bypass the C++11 test and compile in C++98 mode: .. parsed-literal:: LMP_INC = -DLAMMPS_CXX98 +**Makefile.machine setting**\ to enable the C++11 with older (but not too old) GNU c++ (e.g. on CentOS 7): + + +.. parsed-literal:: + + CCFLAGS = -g -O3 -std=c++11 ---------- @@ -66,7 +72,7 @@ FFT library --------------------- When the KSPACE package is included in a LAMMPS build, the -:doc:`kspace\_style pppm ` command performs 3d FFTs which +:doc:`kspace_style pppm ` command performs 3d FFTs which require use of an FFT library to compute 1d FFTs. The KISS FFT library is included with LAMMPS but other libraries can be faster. LAMMPS can use them if they are available on your system. @@ -86,15 +92,21 @@ LAMMPS can use them if they are available on your system. an exception to the rule that all CMake variables can be specified with lower-case values. -Usually these settings are all that is needed. If CMake cannot find -the FFT library, you can set these variables: +Usually these settings are all that is needed. If FFTW3 is selected, +then CMake will try to detect, if threaded FFTW libraries are available +and enable them by default. This setting is independent of whether +OpenMP threads are enabled and a packages like KOKKOS or USER-OMP is +used. If CMake cannot detect the FFT library, you can set these variables +to assist: .. parsed-literal:: -D FFTW3_INCLUDE_DIRS=path # path to FFTW3 include files -D FFTW3_LIBRARIES=path # path to FFTW3 libraries + -D FFT_FFTW_THREADS=on # enable using threaded FFTW3 libraries -D MKL_INCLUDE_DIRS=path # ditto for Intel MKL library + -D FFT_MKL_THREADS=on # enable using threaded FFTs with MKL libraries -D MKL_LIBRARIES=path **Makefile.machine settings**\ : @@ -105,6 +117,8 @@ the FFT library, you can set these variables: FFT_INC = -DFFT_FFTW3 # -DFFT_FFTW3, -DFFT_FFTW (same as -DFFT_FFTW3), -DFFT_MKL, or -DFFT_KISS # default is KISS if not specified FFT_INC = -DFFT_SINGLE # do not specify for double precision + FFT_INC = -DFFT_FFTW_THREADS # enable using threaded FFTW3 libraries + FFT_INC = -DFFT_MKL_THREADS # enable using threaded FFTs with MKL libraries FFT_INC = -DFFT_PACK_ARRAY # or -DFFT_PACK_POINTER or -DFFT_PACK_MEMCPY # default is FFT\_PACK\_ARRAY if not specified @@ -115,27 +129,34 @@ the FFT library, you can set these variables: FFT_INC = -I/usr/local/include FFT_PATH = -L/usr/local/lib FFT_LIB = -lfftw3 # FFTW3 double precision + FFT_LIB = -lfftw3 -lfftw3_omp # FFTW3 double precision with threads (needs -DFFT_FFTW_THREADS) FFT_LIB = -lfftw3 -lfftw3f # FFTW3 single precision - FFT_LIB = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core # MKL with Intel compiler - FFT_LIB = -lmkl_gf_lp64 -lmkl_sequential -lmkl_core # MKL with GNU compier + FFT_LIB = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core # MKL with Intel compiler, serial interface + FFT_LIB = -lmkl_gf_lp64 -lmkl_sequential -lmkl_core # MKL with GNU compier, serial interface + FFT_LIB = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core # MKL with Intel compiler, threaded interface + FFT_LIB = -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core # MKL with GNU compiler, threaded interface + FFT_LIB = -lmkl_rt # MKL with automatic runtime selection of interface libs As with CMake, you do not need to set paths in FFT\_INC or FFT\_PATH, if -make can find the FFT header and library files. You must specify -FFT\_LIB with the appropriate FFT libraries to include in the link. +the compiler can find the FFT header and library files in its default search path. +You must specify FFT\_LIB with the appropriate FFT libraries to include in the link. **CMake and make info**\ : The `KISS FFT library `_ is included in the LAMMPS -distribution. It is portable across all platforms. Depending on the -size of the FFTs and the number of processors used, the other -libraries listed here can be faster. +distribution. It is portable across all platforms. Depending on the size +of the FFTs and the number of processors used, the other libraries listed +here can be faster. However, note that long-range Coulombics are only a portion of the per-timestep CPU cost, FFTs are only a portion of long-range Coulombics, and 1d FFTs are only a portion of the FFT cost (parallel communication can be costly). A breakdown of these timings is printed -to the screen at the end of a run using the :doc:`kspace\_style pppm ` command. The :doc:`Run output ` -doc page gives more details. +to the screen at the end of a run when using the +:doc:`kspace_style pppm ` command. The :doc:`Run output ` +doc page gives more details. A more detailed (and time consuming) +report of the FFT performance is generated with the +:doc:`kspace_modify fftbench yes ` command. FFTW is a fast, portable FFT library that should also work on any platform and can be faster than the KISS FFT library. You can @@ -166,7 +187,7 @@ When using -DFFT\_SINGLE with FFTW3 you may need to build the FFTW library a second time with support for single-precision. For FFTW3, do the following, which should produce the additional -library libfftw3f.a +library libfftw3f.a or libfftw3f.so. .. parsed-literal:: @@ -235,7 +256,7 @@ support 8-byte integers. It allows for: Atom IDs are not required for atomic systems which do not store bond topology information, though IDs are enabled by default. The -:doc:`atom\_modify id no ` command will turn them off. Atom +:doc:`atom_modify id no ` command will turn them off. Atom IDs are required for molecular systems with bond topology (bonds, angles, dihedrals, etc). Thus if you model a molecular system with more than 2 billion atoms, you need the "bigbig" setting. @@ -341,7 +362,7 @@ Read or write compressed files If this option is enabled, large files can be read or written with gzip compression by several LAMMPS commands, including -:doc:`read\_data `, :doc:`rerun `, and :doc:`dump `. +:doc:`read_data `, :doc:`rerun `, and :doc:`dump `. **CMake variables**\ : @@ -472,8 +493,3 @@ e.g. to Python. .. parsed-literal:: LMP_INC = -DLAMMPS_EXCEPTIONS - - -.. _lws: http://lammps.sandia.gov -.. _ld: Manual.html -.. _lc: Commands_all.html diff --git a/doc/src/Build_windows.rst b/doc/src/Build_windows.rst index fd96b379839bf298d9ce57d51358d206c2b6be50..264e4bf44fc8f515b65e63ab2721ea0567b0a487 100644 --- a/doc/src/Build_windows.rst +++ b/doc/src/Build_windows.rst @@ -17,9 +17,9 @@ General remarks LAMMPS is developed and tested primarily on Linux machines. The vast majority of HPC clusters and supercomputers today runs on Linux as well. -Thus portability to other platforms is desired, but not always achieved. +While portability to other platforms is desired, it is not always achieved. The LAMMPS developers strongly rely on LAMMPS users giving feedback and -providing assistance in resolving portability issues. This particularly +providing assistance in resolving portability issues. This is particularly true for compiling LAMMPS on Windows, since this platform has significant differences with some low-level functionality. @@ -31,18 +31,20 @@ Running Linux on Windows So before trying to build LAMMPS on Windows, please consider if using the pre-compiled Windows binary packages are sufficient for your needs (as an aside, those packages themselves are build on a Linux machine -using cross-compilers). If it is necessary for your to compile LAMMPS +using cross-compilers). If it is necessary for you to compile LAMMPS on a Windows machine (e.g. because it is your main desktop), please also -consider using a virtual machine software and run a Linux virtual machine, -or - if have a recently updated Windows 10 installation - consider using -the Windows subsystem for Linux, which allows to run a bash shell from -Ubuntu and from there on, you can pretty much use that shell like you -are running on an Ubuntu Linux machine (e.g. installing software via -apt-get). For more details on that, please see :doc:`this tutorial ` +consider using a virtual machine software and compile and run LAMMPS in +a Linux virtual machine, or - if you have a recently updated Windows 10 +installation - consider using the Windows subsystem for Linux. This +optional Windows feature allows you to run the bash shell from Ubuntu +from within Windows and from there on, you can pretty much use that +shell like you are running on an Ubuntu Linux machine (e.g. installing +software via apt-get and more). For more details on that, please +see :doc:`this tutorial ` .. _gnu: -Using GNU GCC ported to Windows +Using a GNU GCC ported to Windows ----------------------------------------- One option for compiling LAMMPS on Windows natively, that has been known @@ -83,13 +85,13 @@ traditional build system, but CMake has also been successfully tested using the mingw32-cmake and mingw64-cmake wrappers that are bundled with the cross-compiler environment on Fedora machines. A CMake preset selecting all packages compatible with this cross-compilation build -is provided. You likely need to disable the GPU package unless you +is provided. You will likely need to disable the GPU package unless you download and install the contents of the pre-compiled `OpenCL ICD loader library `_ into your MinGW64 cross-compiler environment. The cross-compilation currently will only produce non-MPI serial binaries. -Please keep in mind, though, that this only applies to compiling LAMMPS. -Whether the resulting binaries do work correctly is no tested by the +Please keep in mind, though, that this only applies to **compiling** LAMMPS. +Whether the resulting binaries do work correctly is not tested by the LAMMPS developers. We instead rely on the feedback of the users of these pre-compiled LAMMPS packages for Windows. We will try to resolve issues to the best of our abilities if we become aware of them. However @@ -104,8 +106,3 @@ Support for the Visual C++ compilers is currently not available. The CMake build system is capable of creating suitable a Visual Studio style build environment, but the LAMMPS code itself is not fully ported to support Visual C++. Volunteers to take on this task are welcome. - - -.. _lws: http://lammps.sandia.gov -.. _ld: Manual.html -.. _lc: Commands_all.html diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index d47c3299d0b4ca20deabc16b959feb8df9065dd4..721c5ece372d43f3604afcc486494fcffd27116e 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -25,102 +25,105 @@ An alphabetic list of all general LAMMPS commands. * :doc:`atom_style ` * :doc:`balance ` * :doc:`bond_coeff ` - * :doc:`bond\_style ` - * :doc:`bond\_write ` + * :doc:`bond_style ` + * :doc:`bond_write ` * :doc:`boundary ` * :doc:`box ` - * :doc:`change\_box ` + * :doc:`change_box ` * :doc:`clear ` - * :doc:`comm\_modify ` - * :doc:`comm\_style ` + * :doc:`comm_modify ` + * :doc:`comm_style ` * :doc:`compute ` - * :doc:`compute\_modify ` - * :doc:`create\_atoms ` - * :doc:`create\_bonds ` - * :doc:`create\_box ` - * :doc:`delete\_atoms ` - * :doc:`delete\_bonds ` + * :doc:`compute_modify ` + * :doc:`create_atoms ` + * :doc:`create_bonds ` + * :doc:`create_box ` + * :doc:`delete_atoms ` + * :doc:`delete_bonds ` * :doc:`dielectric ` - * :doc:`dihedral\_coeff ` - * :doc:`dihedral\_style ` + * :doc:`dihedral_coeff ` + * :doc:`dihedral_style ` * :doc:`dimension ` - * :doc:`displace\_atoms ` + * :doc:`displace_atoms ` * :doc:`dump ` - * :doc:`dump adios ` + * :doc:`dump atom/adios ` + * :doc:`dump custom/adios ` * :doc:`dump image ` * :doc:`dump movie ` * :doc:`dump netcdf ` * :doc:`dump netcdf/mpiio ` * :doc:`dump vtk ` - * :doc:`dump\_modify ` - * :doc:`dynamical\_matrix ` + * :doc:`dump_modify ` + * :doc:`dynamical_matrix ` * :doc:`echo ` * :doc:`fix ` - * :doc:`fix\_modify ` + * :doc:`fix_modify ` * :doc:`group ` * :doc:`group2ndx ` * :doc:`hyper ` * :doc:`if ` - * :doc:`improper\_coeff ` - * :doc:`improper\_style ` + * :doc:`improper_coeff ` + * :doc:`improper_style ` * :doc:`include ` + * :doc:`info ` * :doc:`jump ` - * :doc:`kim\_init ` - * :doc:`kim\_interactions ` - * :doc:`kim\_query ` - * :doc:`kspace\_modify ` - * :doc:`kspace\_style ` + * :doc:`kim_init ` + * :doc:`kim_interactions ` + * :doc:`kim_param ` + * :doc:`kim_query ` + * :doc:`kspace_modify ` + * :doc:`kspace_style ` * :doc:`label