Skip to content

Commit

Permalink
Merge pull request #4044 from lammps/maintenance
Browse files Browse the repository at this point in the history
Third Set of Collected Bug Fixes and Maintenance Updates for 2 August 2023 Stable release
  • Loading branch information
akohlmey committed Mar 2, 2024
2 parents 27e8d0f + 2a8d16e commit 46265e3
Show file tree
Hide file tree
Showing 112 changed files with 1,468 additions and 1,181 deletions.
18 changes: 18 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_CXX_COMPILER_ID STREQUAL "
set(CMAKE_TUNE_DEFAULT "-Minform=severe")
endif()

# this hack is required to compile fmt lib with 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_TUNE_DEFAULT "-DFMT_STATIC_THOUSANDS_SEPARATOR")
endif()
else()
if(CMAKE_CXX_COMPILER_ID STREQUAL "CrayClang")
set(CMAKE_TUNE_DEFAULT "-DFMT_STATIC_THOUSANDS_SEPARATOR")
endif()
endif()

# silence nvcc warnings
if((PKG_KOKKOS) AND (Kokkos_ENABLE_CUDA) AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
set(CMAKE_TUNE_DEFAULT "${CMAKE_TUNE_DEFAULT} -Xcudafe --diag_suppress=unrecognized_pragma")
Expand Down Expand Up @@ -212,6 +225,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 @@ -426,6 +443,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 Down
2 changes: 1 addition & 1 deletion cmake/Modules/ExternalCMakeProject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ function(ExternalCMakeProject target url hash basedir cmakedir cmakefile)
"${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}/CMakeLists.txt")
endif()
add_subdirectory("${CMAKE_BINARY_DIR}/_deps/${target}-src/${cmakedir}"
"${CMAKE_BINARY_DIR}/_deps/${target}-build")
"${CMAKE_BINARY_DIR}/_deps/${target}-build" EXCLUDE_FROM_ALL)
endfunction(ExternalCMakeProject)
6 changes: 5 additions & 1 deletion cmake/Modules/Packages/KOKKOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,12 @@ if(PKG_KSPACE)
${KOKKOS_PKG_SOURCES_DIR}/remap_kokkos.cpp)
if(Kokkos_ENABLE_CUDA)
if(NOT (FFT STREQUAL "KISS"))
find_library(CUFFT_LIBRARY cufft)
if (CUFFT_LIBRARY STREQUAL "CUFFT_LIBRARY-NOTFOUND")
message(FATAL_ERROR "Required cuFFT library not found. Check your environment or set CUFFT_LIBRARY to its location")
endif()
target_compile_definitions(lammps PRIVATE -DFFT_CUFFT)
target_link_libraries(lammps PRIVATE cufft)
target_link_libraries(lammps PRIVATE ${CUFFT_LIBRARY})
endif()
elseif(Kokkos_ENABLE_HIP)
if(NOT (FFT STREQUAL "KISS"))
Expand Down
4 changes: 2 additions & 2 deletions cmake/Modules/Packages/MDI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ option(DOWNLOAD_MDI "Download and compile the MDI library instead of using an al

if(DOWNLOAD_MDI)
message(STATUS "MDI download requested - we will build our own")
set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.4.16.tar.gz" CACHE STRING "URL for MDI tarball")
set(MDI_MD5 "407db44e2d79447ab5c1233af1965f65" CACHE STRING "MD5 checksum for MDI tarball")
set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.4.26.tar.gz" CACHE STRING "URL for MDI tarball")
set(MDI_MD5 "3124bb85259471e2a53a891f04bf697a" CACHE STRING "MD5 checksum for MDI tarball")
mark_as_advanced(MDI_URL)
mark_as_advanced(MDI_MD5)
GetFallbackURL(MDI_URL MDI_FALLBACK)
Expand Down
9 changes: 7 additions & 2 deletions cmake/Modules/Packages/ML-QUIP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if(DOWNLOAD_QUIP)
set(temp "${temp}F77FLAGS += -fpp -fixed -fPIC\n")
set(temp "${temp}F95_PRE_FILENAME_FLAG = -Tf\n")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
set(temp "${temp}FPP=${CMAKE_Fortran_COMPILER} -E -x f95-cpp-input\nOPTIM=${CMAKE_Fortran_FLAGS_${BTYPE}}\n")
set(temp "${temp}FPP=${CMAKE_Fortran_COMPILER} -E -x f95-cpp-input\nOPTIM=${CMAKE_Fortran_FLAGS_${BTYPE}} -fmax-stack-var-size=6553600\n")
set(temp "${temp}DEFINES += -DGETARG_F2003 -DGETENV_F2003 -DGFORTRAN -DFORTRAN_UNDERSCORE\n")
set(temp "${temp}F95FLAGS += -x f95-cpp-input -ffree-line-length-none -ffree-form -fno-second-underscore -fPIC\n")
set(temp "${temp}F77FLAGS += -x f77-cpp-input -fno-second-underscore -fPIC\n")
Expand All @@ -41,6 +41,11 @@ if(DOWNLOAD_QUIP)
set(temp "${temp}HAVE_TURBOGAP=0\nHAVE_QR=1\nHAVE_THIRDPARTY=0\nHAVE_FX=0\nHAVE_SCME=0\nHAVE_MTP=0\n")
set(temp "${temp}HAVE_MBD=0\nHAVE_TTM_NF=0\nHAVE_CH4=0\nHAVE_NETCDF4=0\nHAVE_MDCORE=0\nHAVE_ASAP=0\n")
set(temp "${temp}HAVE_CGAL=0\nHAVE_METIS=0\nHAVE_LMTO_TBE=0\nHAVE_SCALAPACK=0\n")
# for gfortran, the -std= flag, if present, *must* be -std=gnu or else the compilation will fail.
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
string(REGEX REPLACE -std=f[0-9]+ -std=gnu newtemp "${temp}")
set(temp "${newtemp}")
endif()
file(WRITE ${CMAKE_BINARY_DIR}/quip.config "${temp}")

message(STATUS "QUIP download via git requested - we will build our own")
Expand All @@ -56,7 +61,7 @@ if(DOWNLOAD_QUIP)
GIT_SUBMODULES "src/fox;src/GAP"
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/quip.config <SOURCE_DIR>/arch/Makefile.lammps
CONFIGURE_COMMAND env QUIP_ARCH=lammps make config
BUILD_COMMAND env QUIP_ARCH=lammps make libquip
BUILD_COMMAND env QUIP_ARCH=lammps make -j1 libquip
INSTALL_COMMAND ""
BUILD_IN_SOURCE YES
BUILD_BYPRODUCTS <SOURCE_DIR>/build/lammps/${CMAKE_STATIC_LIBRARY_PREFIX}quip${CMAKE_STATIC_LIBRARY_SUFFIX}
Expand Down
6 changes: 3 additions & 3 deletions cmake/presets/oneapi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)

unset(HAVE_OMP_H_INCLUDE CACHE)
set(OpenMP_C "icx" CACHE STRING "" FORCE)
set(OpenMP_C_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
set(OpenMP_C_FLAGS "-qopenmp;-qopenmp-simd" CACHE STRING "" FORCE)
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
set(OpenMP_CXX "icpx" CACHE STRING "" FORCE)
set(OpenMP_CXX_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
set(OpenMP_CXX_FLAGS "-qopenmp;-qopenmp-simd" CACHE STRING "" FORCE)
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
set(OpenMP_Fortran_FLAGS "-qopenmp -qopenmp-simd" CACHE STRING "" FORCE)
set(OpenMP_Fortran_FLAGS "-qopenmp;-qopenmp-simd" CACHE STRING "" FORCE)
set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE)

10 changes: 5 additions & 5 deletions doc/src/fix_charge_regulation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ built with that package. See the :doc:`Build package <Build_package>`
page for more info.

The :doc:`atom_style <atom_style>`, used must contain the charge
property, for example, the style could be *charge* or *full*. Only
usable for 3D simulations. Atoms specified as free ions cannot be part
of rigid bodies or molecules and cannot have bonding interactions. The
scheme is limited to integer charges, any atoms with non-integer charges
will not be considered by the fix.
property and have per atom type masses, for example, the style could be
*charge* or *full*. Only usable for 3D simulations. Atoms specified as
free ions cannot be part of rigid bodies or molecules and cannot have
bonding interactions. The scheme is limited to integer charges, any
atoms with non-integer charges will not be considered by the fix.

All interaction potentials used must be continuous, otherwise the MD
integration and the particle exchange MC moves do not correspond to the
Expand Down
5 changes: 4 additions & 1 deletion doc/src/fix_gcmc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,11 @@ This fix is part of the MC package. It is only enabled if LAMMPS was
built with that package. See the :doc:`Build package <Build_package>`
doc page for more info.

This fix style requires an :doc:`atom style <atom_style>` with per atom
type masses.

Do not set "neigh_modify once yes" or else this fix will never be
called. Reneighboring is required.
called. Reneighboring is **required**.

Only usable for 3D simulations.

Expand Down
2 changes: 0 additions & 2 deletions doc/src/fix_qeq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ These fixes are part of the QEQ package. They are only enabled if
LAMMPS was built with that package. See the :doc:`Build package
<Build_package>` page for more info.

These qeq fixes are not compatible with the GPU and USER-INTEL packages.

These qeq fixes will ignore electric field contributions from
:doc:`fix efield <fix_efield>`.

Expand Down
3 changes: 3 additions & 0 deletions doc/src/fix_sgcmc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ This fix is part of the MC package. It is only enabled if LAMMPS was
built with that package. See the :doc:`Build package <Build_package>`
page for more info.

This fix style requires an :doc:`atom style <atom_style>` with per atom
type masses.

At present the fix provides optimized subroutines for EAM type
potentials (see above) that calculate potential energy changes due to
*local* atom type swaps very efficiently. Other potentials are
Expand Down
7 changes: 5 additions & 2 deletions doc/src/fix_widom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,11 @@ doc page for more info.
Do not set "neigh_modify once yes" or else this fix will never be
called. Reneighboring is **required**.

Can be run in parallel, but aspects of the GCMC part will not scale well
in parallel. Only usable for 3D simulations.
This fix style requires an :doc:`atom style <atom_style>` with per atom
type masses.

Can be run in parallel, but some aspects of the insertion procedure
will not scale well in parallel. Only usable for 3D simulations.


Related commands
Expand Down
8 changes: 6 additions & 2 deletions doc/src/pair_dsmc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,12 @@ This pair style can only be used via the *pair* keyword of the
Restrictions
""""""""""""

This style is part of the MC package. It is only enabled if LAMMPS
was built with that package. See the :doc:`Build package <Build_package>` page for more info.
This pair style is part of the MC package. It is only enabled if LAMMPS
was built with that package. See the :doc:`Build package
<Build_package>` page for more info.

This pair style requires an :doc:`atom style <atom_style>` with per
atom type masses.

Related commands
""""""""""""""""
Expand Down

0 comments on commit 46265e3

Please sign in to comment.