Skip to content

Commit

Permalink
Merge branch 'lammps:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
exapde authored May 21, 2024
2 parents 3454e1f + a8687b5 commit 4be02e9
Show file tree
Hide file tree
Showing 1,211 changed files with 86,307 additions and 44,279 deletions.
7 changes: 5 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ src/MESONT/* @iafoss
src/ML-HDNNP/* @singraber
src/ML-IAP/* @athomps
src/ML-PACE/* @yury-lysogorskiy
src/ML-POD/* @exapde @rohskopf
src/ML-POD/* @exapde
src/MOFFF/* @hheenen
src/MOLFILE/* @akohlmey
src/NETCDF/* @pastewka
Expand Down Expand Up @@ -65,9 +65,12 @@ src/MANYBODY/pair_nb3b_screened.* @flodesani
src/REPLICA/*_grem.* @dstelter92
src/EXTRA-COMPUTE/compute_stress_mop*.* @RomainVermorel
src/EXTRA-COMPUTE/compute_born_matrix.* @Bibobu @athomps
src/EXTRA-FIX/fix_deform_pressure.* @jtclemm
src/MISC/*_tracker.* @jtclemm
src/MC/fix_gcmc.* @athomps
src/MC/fix_sgcmc.* @athomps
src/REAXFF/compute_reaxff_atom.* @rbberger
src/KOKKOS/compute_reaxff_atom_kokkos.* @rbberger
src/REPLICA/fix_pimd_langevin.* @Yi-FanLi

# core LAMMPS classes
Expand All @@ -80,7 +83,7 @@ src/bond.* @sjplimp
src/comm*.* @sjplimp
src/compute.* @sjplimp
src/dihedral.* @sjplimp
src/domain.* @sjplimp
src/domain.* @sjplimp @stanmoore1
src/dump*.* @sjplimp
src/error.* @sjplimp
src/finish.* @sjplimp
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/unittest-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
build:
name: MacOS Unit Test
if: ${{ github.repository == 'lammps/lammps' }}
runs-on: macos-latest
runs-on: macos-13
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache

Expand Down Expand Up @@ -43,6 +43,8 @@ jobs:
working-directory: build
run: |
ccache -z
python3 -m venv macosenv
source macosenv/bin/activate
python3 -m pip install numpy
python3 -m pip install pyyaml
cmake -C ../cmake/presets/clang.cmake \
Expand Down
32 changes: 26 additions & 6 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ endif()
add_executable(lmp ${MAIN_SOURCES})
target_link_libraries(lmp PRIVATE lammps)
set_target_properties(lmp PROPERTIES OUTPUT_NAME ${LAMMPS_BINARY})
# re-export all symbols for plugins
if(PKG_PLUGIN AND (NOT ((CMAKE_SYSTEM_NAME STREQUAL "Windows"))))
set_target_properties(lmp PROPERTIES ENABLE_EXPORTS TRUE)
endif()
install(TARGETS lmp EXPORT LAMMPS_Targets DESTINATION ${CMAKE_INSTALL_BINDIR})

option(CMAKE_VERBOSE_MAKEFILE "Generate verbose Makefiles" OFF)
Expand Down Expand Up @@ -428,6 +432,7 @@ if(BUILD_OMP)
(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") OR (CMAKE_CXX_COMPILER_ID STREQUAL "XLClang") OR
((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR
((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR
((CMAKE_CXX_COMPILER_ID STREQUAL "CrayClang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR
((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)))
# GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts.
# Intel 18.0 was tested to support both, so we switch to OpenMP 4+ from 19.x onward to be safe.
Expand All @@ -438,6 +443,21 @@ if(BUILD_OMP)
target_compile_definitions(lammps PRIVATE -DLAMMPS_OMP_COMPAT=${LAMMPS_OMP_COMPAT_LEVEL})
target_link_libraries(lammps PRIVATE OpenMP::OpenMP_CXX)
target_link_libraries(lmp PRIVATE OpenMP::OpenMP_CXX)

# this hack is required to correctly link with OpenMP support when using CrayClang version 15.0.2
# CrayClang is only directly recognized by version 3.28 and later
if(CMAKE_VERSION VERSION_LESS 3.28)
get_filename_component(_exe "${CMAKE_CXX_COMPILER}" NAME)
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (_exe STREQUAL "crayCC"))
set(CMAKE_SHARED_LINKER_FLAGS_${BTYPE} "${CMAKE_SHARED_LINKER_FLAGS_${BTYPE} -fopenmp")
set(CMAKE_STATIC_LINKER_FLAGS_${BTYPE} "${CMAKE_STATIC_LINKER_FLAGS_${BTYPE} -fopenmp")
endif()
else()
if(CMAKE_CXX_COMPILER_ID STREQUAL "CrayClang")
set(CMAKE_SHARED_LINKER_FLAGS_${BTYPE} "${CMAKE_SHARED_LINKER_FLAGS_${BTYPE} -fopenmp")
set(CMAKE_STATIC_LINKER_FLAGS_${BTYPE} "${CMAKE_STATIC_LINKER_FLAGS_${BTYPE} -fopenmp")
endif()
endif()
endif()
# lower C++ standard for fmtlib sources when using Intel classic compiler
Expand Down Expand Up @@ -552,12 +572,12 @@ endforeach()
########################################################################
# Basic system tests (standard libraries, headers, functions, types) #
########################################################################
foreach(HEADER cmath)
check_include_file_cxx(${HEADER} FOUND_${HEADER})
if(NOT FOUND_${HEADER})
message(FATAL_ERROR "Could not find needed header - ${HEADER}")
endif(NOT FOUND_${HEADER})
endforeach(HEADER)
if (NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")))
check_include_file_cxx(cmath FOUND_CMATH)
if(NOT FOUND_CMATH)
message(FATAL_ERROR "Could not find the required 'cmath' header")
endif(NOT FOUND_CMATH)
endif()
# make the standard math library overrideable and autodetected (for systems that don't have it)
find_library(STANDARD_MATH_LIB m DOC "Standard Math library")
Expand Down
4 changes: 2 additions & 2 deletions cmake/Modules/OpenCLLoader.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
message(STATUS "Downloading and building OpenCL loader library")
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2024.02.09.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
set(OPENCL_LOADER_MD5 "f3573cf9daa3558ba46fd5866517f38f" CACHE STRING "MD5 checksum of OpenCL loader tarball")
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2024.05.09.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
set(OPENCL_LOADER_MD5 "e7796826b21c059224fabe997e0f2075" CACHE STRING "MD5 checksum of OpenCL loader tarball")
mark_as_advanced(OPENCL_LOADER_URL)
mark_as_advanced(OPENCL_LOADER_MD5)

Expand Down
3 changes: 3 additions & 0 deletions cmake/Modules/Packages/INTEL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ if(PKG_KSPACE)
list(APPEND INTEL_SOURCES ${INTEL_SOURCES_DIR}/verlet_lrt_intel.cpp)
RegisterIntegrateStyle(${INTEL_SOURCES_DIR}/verlet_lrt_intel.h)
endif()
if(PKG_ML-SNAP)
list(APPEND INTEL_SOURCES ${INTEL_SOURCES_DIR}/sna_intel.cpp)
endif()

target_sources(lammps PRIVATE ${INTEL_SOURCES})
target_include_directories(lammps PRIVATE ${INTEL_SOURCES_DIR})
9 changes: 5 additions & 4 deletions cmake/Modules/Packages/KOKKOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ if(DOWNLOAD_KOKKOS)
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
include(ExternalProject)
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.2.00.tar.gz" CACHE STRING "URL for KOKKOS tarball")
set(KOKKOS_MD5 "731647b61a4233f568d583702e9cd6d1" CACHE STRING "MD5 checksum of KOKKOS tarball")
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.3.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
set(KOKKOS_MD5 "243de871b3dc2cf3990c1c404032df83" CACHE STRING "MD5 checksum of KOKKOS tarball")
mark_as_advanced(KOKKOS_URL)
mark_as_advanced(KOKKOS_MD5)
GetFallbackURL(KOKKOS_URL KOKKOS_FALLBACK)
Expand All @@ -71,7 +71,7 @@ if(DOWNLOAD_KOKKOS)
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
elseif(EXTERNAL_KOKKOS)
find_package(Kokkos 4.2.00 REQUIRED CONFIG)
find_package(Kokkos 4.3.01 REQUIRED CONFIG)
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
else()
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
Expand Down Expand Up @@ -139,8 +139,9 @@ if(PKG_KSPACE)
message(WARNING "Using KISS FFT with the CUDA backend of Kokkos may be sub-optimal.")
target_compile_definitions(lammps PRIVATE -DFFT_KOKKOS_KISS)
elseif(FFT_KOKKOS STREQUAL "CUFFT")
find_package(CUDAToolkit REQUIRED)
target_compile_definitions(lammps PRIVATE -DFFT_KOKKOS_CUFFT)
target_link_libraries(lammps PRIVATE cufft)
target_link_libraries(lammps PRIVATE CUDA::cufft)
endif()
elseif(Kokkos_ENABLE_HIP)
if(NOT ((FFT_KOKKOS STREQUAL "KISS") OR (FFT_KOKKOS STREQUAL "HIPFFT")))
Expand Down
15 changes: 15 additions & 0 deletions cmake/Modules/Packages/ML-IAP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ endif()

option(MLIAP_ENABLE_PYTHON "Build ML-IAP package with Python support" ${MLIAP_ENABLE_PYTHON_DEFAULT})

# if ML-PACE package *and* MLIAP with Python is enabled is included we may also include ML-PACE support in ML-IAP
set(MLIAP_ENABLE_ACE_DEFAULT OFF)
if(PKG_ML-PACE)
set(MLIAP_ENABLE_ACE_DEFAULT ON)
endif()

option(MLIAP_ENABLE_ACE "Build ML-IAP package with ACE support" ${MLIAP_ENABLE_ACE_DEFAULT})

if(MLIAP_ENABLE_PYTHON)
find_package(Cythonize REQUIRED)
find_package(Python COMPONENTS NumPy REQUIRED)
Expand All @@ -36,3 +44,10 @@ if(MLIAP_ENABLE_PYTHON)
target_compile_definitions(lammps PRIVATE -DMLIAP_PYTHON)
target_include_directories(lammps PRIVATE ${MLIAP_BINARY_DIR})
endif()

if(MLIAP_ENABLE_ACE)
if(NOT PKG_ML-PACE)
message(FATAL_ERROR "Must enable ML-PACE package for including ACE support in ML-IAP")
endif()
target_compile_definitions(lammps PRIVATE -DMLIAP_ACE)
endif()
2 changes: 1 addition & 1 deletion cmake/presets/kokkos-cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ get_filename_component(NVCC_WRAPPER_CMD ${CMAKE_CURRENT_SOURCE_DIR}/../lib/kokko
set(CMAKE_CXX_COMPILER ${NVCC_WRAPPER_CMD} CACHE FILEPATH "" FORCE)

# If KSPACE is also enabled, use CUFFT for FFTs
set(FFT_KOKKOS "CUFFT" CACHE STRING FORCE)
set(FFT_KOKKOS "CUFFT" CACHE STRING "" FORCE)

# hide deprecation warnings temporarily for stable release
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
2 changes: 1 addition & 1 deletion cmake/presets/kokkos-hip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(CMAKE_CXX_COMPILER hipcc CACHE STRING "" FORCE)
set(CMAKE_TUNE_FLAGS "-munsafe-fp-atomics" CACHE STRING "" FORCE)

# If KSPACE is also enabled, use CUFFT for FFTs
set(FFT_KOKKOS "HIPFFT" CACHE STRING FORCE)
set(FFT_KOKKOS "HIPFFT" CACHE STRING "" FORCE)

# hide deprecation warnings temporarily for stable release
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
Expand Down
6 changes: 3 additions & 3 deletions doc/lammps.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.TH LAMMPS "1" "7 February 2024" "2024-02-07"
.TH LAMMPS "1" "17 April 2024" "2024-04-17"
.SH NAME
.B LAMMPS
\- Molecular Dynamics Simulator. Version 7 February 2024
\- Molecular Dynamics Simulator. Version 17 April 2024

.SH SYNOPSIS
.B lmp
Expand Down Expand Up @@ -297,7 +297,7 @@ the chapter on errors in the
manual gives some additional information about error messages, if possible.

.SH COPYRIGHT
© 2003--2022 Sandia Corporation
© 2003--2024 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
Expand Down
3 changes: 3 additions & 0 deletions doc/src/Bibliography.rst
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,9 @@ Bibliography
**(PLUMED)**
G.A. Tribello, M. Bonomi, D. Branduardi, C. Camilloni and G. Bussi, Comp. Phys. Comm 185, 604 (2014)

**(Pavlov)**
D Pavlov, V Galigerov, D Kolotinskii, V Nikolskiy, V Stegailov, International Journal of High Performance Computing Applications, 38, 34-49 (2024).

**(Paquay)**
Paquay and Kusters, Biophys. J., 110, 6, (2016). preprint available at `arXiv:1411.3019 <https://arxiv.org/abs/1411.3019/>`_.

Expand Down
14 changes: 4 additions & 10 deletions doc/src/Build_extras.rst
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,6 @@ They must be specified in uppercase.
* - A64FX
- HOST
- ARMv8.2 with SVE Support
* - WSM
- HOST
- Intel Westmere CPU (SSE 4.2)
* - SNB
- HOST
- Intel Sandy/Ivy Bridge CPU (AVX 1)
Expand Down Expand Up @@ -566,18 +563,15 @@ They must be specified in uppercase.
* - KNL
- HOST
- Intel Knights Landing Xeon Phi
* - BGQ
- HOST
- IBM Blue Gene/Q CPU
* - POWER7
- HOST
- IBM POWER7 CPU
* - POWER8
- HOST
- IBM POWER8 CPU
* - POWER9
- HOST
- IBM POWER9 CPU
* - RISCV_SG2042
- HOST
- SG2042 (RISC-V) CPU
* - KEPLER30
- GPU
- NVIDIA Kepler generation CC 3.0 GPU
Expand Down Expand Up @@ -666,7 +660,7 @@ They must be specified in uppercase.
- GPU
- Intel GPU Ponte Vecchio

This list was last updated for version 4.2 of the Kokkos library.
This list was last updated for version 4.3.0 of the Kokkos library.

.. tabs::

Expand Down
2 changes: 2 additions & 0 deletions doc/src/Commands_bond.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ OPT.
* :doc:`cosine/shift (o) <angle_cosine_shift>`
* :doc:`cosine/shift/exp (o) <angle_cosine_shift_exp>`
* :doc:`cosine/squared (o) <angle_cosine_squared>`
* :doc:`cosine/squared/restricted (o) <angle_cosine_squared_restricted>`
* :doc:`cross <angle_cross>`
* :doc:`dipole (o) <angle_dipole>`
* :doc:`fourier (o) <angle_fourier>`
Expand Down Expand Up @@ -127,6 +128,7 @@ OPT.
* :doc:`charmmfsw (k) <dihedral_charmm>`
* :doc:`class2 (ko) <dihedral_class2>`
* :doc:`cosine/shift/exp (o) <dihedral_cosine_shift_exp>`
* :doc:`cosine/squared/restricted <dihedral_cosine_squared_restricted>`
* :doc:`fourier (io) <dihedral_fourier>`
* :doc:`harmonic (iko) <dihedral_harmonic>`
* :doc:`helix (o) <dihedral_helix>`
Expand Down
2 changes: 2 additions & 0 deletions doc/src/Commands_fix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ OPT.
* :doc:`controller <fix_controller>`
* :doc:`damping/cundall <fix_damping_cundall>`
* :doc:`deform (k) <fix_deform>`
* :doc:`deform/pressure <fix_deform_pressure>`
* :doc:`deposit <fix_deposit>`
* :doc:`dpd/energy (k) <fix_dpd_energy>`
* :doc:`drag <fix_drag>`
Expand Down Expand Up @@ -262,6 +263,7 @@ OPT.
* :doc:`wall/body/polyhedron <fix_wall_body_polyhedron>`
* :doc:`wall/colloid <fix_wall>`
* :doc:`wall/ees <fix_wall_ees>`
* :doc:`wall/flow (k) <fix_wall_flow>`
* :doc:`wall/gran (k) <fix_wall_gran>`
* :doc:`wall/gran/region <fix_wall_gran_region>`
* :doc:`wall/harmonic <fix_wall>`
Expand Down
2 changes: 2 additions & 0 deletions doc/src/Commands_pair.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ OPT.
* :doc:`oxrna2/coaxstk <pair_oxrna2>`
* :doc:`pace (k) <pair_pace>`
* :doc:`pace/extrapolation (k) <pair_pace>`
* :doc:`pedone (o) <pair_pedone>`
* :doc:`pod <pair_pod>`
* :doc:`peri/eps <pair_peri>`
* :doc:`peri/lps (o) <pair_peri>`
Expand All @@ -256,6 +257,7 @@ OPT.
* :doc:`rann <pair_rann>`
* :doc:`reaxff (ko) <pair_reaxff>`
* :doc:`rebo (io) <pair_airebo>`
* :doc:`rebomos (o) <pair_rebomos>`
* :doc:`resquared (go) <pair_resquared>`
* :doc:`saip/metal (t) <pair_saip_metal>`
* :doc:`sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>`
Expand Down
47 changes: 42 additions & 5 deletions doc/src/Developer_updating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Available topics in mostly chronological order are:
- `Setting flags in the constructor`_
- `Rename of pack/unpack_comm() to pack/unpack_forward_comm()`_
- `Use ev_init() to initialize variables derived from eflag and vflag`_
- `Use utils::count_words() functions instead of atom->count_words()`_
- `Use utils::numeric() functions instead of force->numeric()`_
- `Use utils::open_potential() function to open potential files`_
- `Use symbolic Atom and AtomVec constants instead of numerical values`_
Expand Down Expand Up @@ -130,18 +131,54 @@ Not applying this change will not cause a compilation error, but
can lead to inconsistent behavior and incorrect tallying of
energy or virial.

Use utils::count_words() functions instead of atom->count_words()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. versionchanged:: 2Jun2020

The "count_words()" functions for parsing text have been moved from the
Atom class to the :doc:`utils namespace <Developer_utils>`. The
"count_words()" function in "utils" uses the Tokenizer class internally
to split a line into words and count them, thus it will not modify the
argument string as the function in the Atoms class did and thus had a
variant using a copy buffer. Unlike the old version, the new version
does not remove comments. For that you can use the
:cpp:func:`utils::trim_comment() function
<LAMMPS_NS::utils::trim_comment>` as shown in the example below.

Old:

.. code-block:: c++

nwords = atom->count_words(line);
int nwords = atom->count_words(buf);

New:

.. code-block:: c++

nwords = utils::count_words(line);
int nwords = utils::count_words(utils::trim_comment(buf));

.. seealso::

:cpp:func:`utils::count_words() <LAMMPS_NS::utils::count_words>`,
:cpp:func:`utils::trim_comments() <LAMMPS_NS::utils::trim_comments>`


Use utils::numeric() functions instead of force->numeric()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. versionchanged:: 18Sep2020

The "numeric()" conversion functions (including "inumeric()",
"bnumeric()", and "tnumeric()") have been moved from the Force class to
the utils namespace. Also they take an additional argument that selects
whether the ``Error::all()`` or ``Error::one()`` function should be
called in case of an error. The former should be used when *all* MPI
processes call the conversion function and the latter *must* be used
when they are called from only one or a subset of the MPI processes.
the :doc:`utils namespace <Developer_utils>`. Also they take an
additional argument that selects whether the ``Error::all()`` or
``Error::one()`` function should be called in case of an error. The
former should be used when *all* MPI processes call the conversion
function and the latter *must* be used when they are called from only
one or a subset of the MPI processes.

Old:

Expand Down
Loading

0 comments on commit 4be02e9

Please sign in to comment.