diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..5ace4600a1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7ea31fcf14..07f7564727 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,6 +13,11 @@ jobs: if: ${{ github.repository == 'lammps/lammps' }} runs-on: ubuntu-latest + permissions: + security-events: write + actions: read + contents: read + strategy: fail-fast: false matrix: @@ -20,17 +25,17 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.x' - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} config-file: ./.github/codeql/${{ matrix.language }}.yml @@ -48,4 +53,4 @@ jobs: cmake --build . --parallel 2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/compile-msvc.yml b/.github/workflows/compile-msvc.yml index 15fcf1099d..7747be7b46 100644 --- a/.github/workflows/compile-msvc.yml +++ b/.github/workflows/compile-msvc.yml @@ -15,12 +15,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 - name: Select Python version - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.10' diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 2d903af646..e6e5ccfdc8 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 2 @@ -28,7 +28,7 @@ jobs: run: mkdir build - name: Set up ccache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ env.CCACHE_DIR }} key: macos-ccache-${{ github.sha }} diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 2566497c0e..b0b8bfd363 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -135,11 +135,13 @@ set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions") # ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro # and prints lots of pointless warnings about "unsafe" functions if(MSVC) - add_compile_options(/Zc:__cplusplus) - add_compile_options(/wd4244) - add_compile_options(/wd4267) - if(LAMMPS_EXCEPTIONS) - add_compile_options(/EHsc) + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_compile_options(/Zc:__cplusplus) + add_compile_options(/wd4244) + add_compile_options(/wd4267) + if(LAMMPS_EXCEPTIONS) + add_compile_options(/EHsc) + endif() endif() add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() @@ -784,14 +786,16 @@ if(BUILD_SHARED_LIBS) find_package(Python COMPONENTS Interpreter) endif() if(BUILD_IS_MULTI_CONFIG) - set(LIBLAMMPS_SHARED_BINARY ${CMAKE_BINARY_DIR}/$/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(MY_BUILD_DIR ${CMAKE_BINARY_DIR}/$) else() - set(LIBLAMMPS_SHARED_BINARY ${CMAKE_BINARY_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(MY_BUILD_DIR ${CMAKE_BINARY_DIR}) endif() + set(LIBLAMMPS_SHARED_BINARY ${MY_BUILD_DIR}/liblammps${LAMMPS_MACHINE}${CMAKE_SHARED_LIBRARY_SUFFIX}) if(Python_EXECUTABLE) add_custom_target( install-python ${CMAKE_COMMAND} -E remove_directory build - COMMAND ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps -l ${LIBLAMMPS_SHARED_BINARY} + COMMAND ${Python_EXECUTABLE} ${LAMMPS_PYTHON_DIR}/install.py -p ${LAMMPS_PYTHON_DIR}/lammps + -l ${LIBLAMMPS_SHARED_BINARY} -w ${MY_BUILD_DIR} COMMENT "Installing LAMMPS Python module") else() add_custom_target( diff --git a/cmake/Modules/LAMMPSInterfacePlugin.cmake b/cmake/Modules/LAMMPSInterfacePlugin.cmake new file mode 100644 index 0000000000..ec7a739785 --- /dev/null +++ b/cmake/Modules/LAMMPSInterfacePlugin.cmake @@ -0,0 +1,197 @@ +# CMake script code to define LAMMPS settings required for building LAMMPS plugins + +# enforce out-of-source build +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "In-source builds are not allowed. You must create and use a build directory. " + "Please remove CMakeCache.txt and CMakeFiles first.") +endif() + +# global LAMMPS/plugin build settings +set(LAMMPS_SOURCE_DIR "" CACHE PATH "Location of LAMMPS sources folder") +if(NOT LAMMPS_SOURCE_DIR) + message(FATAL_ERROR "Must set LAMMPS_SOURCE_DIR") +endif() + +# by default, install into $HOME/.local (not /usr/local), +# so that no root access (and sudo) is needed +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Default install path" FORCE) +endif() + +# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro +# and prints lots of pointless warnings about "unsafe" functions +if(MSVC) + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_compile_options(/Zc:__cplusplus) + add_compile_options(/wd4244) + add_compile_options(/wd4267) + if(LAMMPS_EXCEPTIONS) + add_compile_options(/EHsc) + endif() + endif() + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) +endif() + +# C++11 is required +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# Need -restrict with Intel compilers +if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict") +endif() +set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) + +####### +# helper functions from LAMMPSUtils.cmake +function(validate_option name values) + string(TOLOWER ${${name}} needle_lower) + string(TOUPPER ${${name}} needle_upper) + list(FIND ${values} ${needle_lower} IDX_LOWER) + list(FIND ${values} ${needle_upper} IDX_UPPER) + if(${IDX_LOWER} LESS 0 AND ${IDX_UPPER} LESS 0) + list_to_bulletpoints(POSSIBLE_VALUE_LIST ${${values}}) + message(FATAL_ERROR "\n########################################################################\n" + "Invalid value '${${name}}' for option ${name}\n" + "\n" + "Possible values are:\n" + "${POSSIBLE_VALUE_LIST}" + "########################################################################") + endif() +endfunction(validate_option) + +# helper function for getting the most recently modified file or folder from a glob pattern +function(get_newest_file path variable) + file(GLOB _dirs ${path}) + set(_besttime 2000-01-01T00:00:00) + set(_bestfile "") + foreach(_dir ${_dirs}) + file(TIMESTAMP ${_dir} _newtime) + if(_newtime IS_NEWER_THAN _besttime) + set(_bestfile ${_dir}) + set(_besttime ${_newtime}) + endif() + endforeach() + if(_bestfile STREQUAL "") + message(FATAL_ERROR "Could not find valid path at: ${path}") + endif() + set(${variable} ${_bestfile} PARENT_SCOPE) +endfunction() + +################################################################################# +# LAMMPS C++ interface. We only need the header related parts except on windows. +add_library(lammps INTERFACE) +target_include_directories(lammps INTERFACE ${LAMMPS_SOURCE_DIR}) +if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING) + target_link_libraries(lammps INTERFACE ${CMAKE_BINARY_DIR}/../liblammps.dll.a) +endif() + +################################################################################ +# MPI configuration +if(NOT CMAKE_CROSSCOMPILING) + find_package(MPI QUIET) + option(BUILD_MPI "Build MPI version" ${MPI_FOUND}) +else() + option(BUILD_MPI "Build MPI version" OFF) +endif() + +if(BUILD_MPI) + # do not include the (obsolete) MPI C++ bindings which makes + # for leaner object files and avoids namespace conflicts + set(MPI_CXX_SKIP_MPICXX TRUE) + # We use a non-standard procedure to cross-compile with MPI on Windows + if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING) + # Download and configure custom MPICH files for Windows + message(STATUS "Downloading and configuring MPICH-1.4.1 for Windows") + set(MPICH2_WIN64_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win64-devel.tar.gz" CACHE STRING "URL for MPICH2 (win64) tarball") + set(MPICH2_WIN32_DEVEL_URL "${LAMMPS_THIRDPARTY_URL}/mpich2-win32-devel.tar.gz" CACHE STRING "URL for MPICH2 (win32) tarball") + set(MPICH2_WIN64_DEVEL_MD5 "4939fdb59d13182fd5dd65211e469f14" CACHE STRING "MD5 checksum of MPICH2 (win64) tarball") + set(MPICH2_WIN32_DEVEL_MD5 "a61d153500dce44e21b755ee7257e031" CACHE STRING "MD5 checksum of MPICH2 (win32) tarball") + mark_as_advanced(MPICH2_WIN64_DEVEL_URL) + mark_as_advanced(MPICH2_WIN32_DEVEL_URL) + mark_as_advanced(MPICH2_WIN64_DEVEL_MD5) + mark_as_advanced(MPICH2_WIN32_DEVEL_MD5) + + include(ExternalProject) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + ExternalProject_Add(mpi4win_build + URL ${MPICH2_WIN64_DEVEL_URL} + URL_MD5 ${MPICH2_WIN64_DEVEL_MD5} + CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" + BUILD_BYPRODUCTS /lib/libmpi.a) + else() + ExternalProject_Add(mpi4win_build + URL ${MPICH2_WIN32_DEVEL_URL} + URL_MD5 ${MPICH2_WIN32_DEVEL_MD5} + CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" + BUILD_BYPRODUCTS /lib/libmpi.a) + endif() + + ExternalProject_get_property(mpi4win_build SOURCE_DIR) + file(MAKE_DIRECTORY "${SOURCE_DIR}/include") + add_library(MPI::MPI_CXX UNKNOWN IMPORTED) + set_target_properties(MPI::MPI_CXX PROPERTIES + IMPORTED_LOCATION "${SOURCE_DIR}/lib/libmpi.a" + INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include" + INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX") + add_dependencies(MPI::MPI_CXX mpi4win_build) + + # set variables for status reporting at the end of CMake run + set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include") + set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX") + set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a") + else() + find_package(MPI REQUIRED) + option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF) + if(LAMMPS_LONGLONG_TO_LONG) + target_compile_definitions(lammps INTERFACE -DLAMMPS_LONGLONG_TO_LONG) + endif() + endif() + target_link_libraries(lammps INTERFACE MPI::MPI_CXX) +else() + add_library(mpi_stubs INTERFACE) + target_include_directories(mpi_stubs INTERFACE $) + target_link_libraries(lammps INTERFACE mpi_stubs) +endif() + +################################################################################ +# detect if we may enable OpenMP support by default +set(BUILD_OMP_DEFAULT OFF) +find_package(OpenMP QUIET) +if(OpenMP_FOUND) + check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE) + if(HAVE_OMP_H_INCLUDE) + set(BUILD_OMP_DEFAULT ON) + endif() +endif() + +option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT}) + +if(BUILD_OMP) + find_package(OpenMP REQUIRED) + check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE) + if(NOT HAVE_OMP_H_INCLUDE) + message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support") + endif() + + if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR + (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR + ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 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. + target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=4) + else() + target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=3) + endif() + target_link_libraries(lammps INTERFACE OpenMP::OpenMP_CXX) +endif() + +################ +# integer size selection +set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)") +set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall) +set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES}) +validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES) +string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES) +target_compile_definitions(lammps INTERFACE -DLAMMPS_${LAMMPS_SIZES}) diff --git a/cmake/Modules/Packages/ML-PACE.cmake b/cmake/Modules/Packages/ML-PACE.cmake index c647c8873a..c553809ff1 100644 --- a/cmake/Modules/Packages/ML-PACE.cmake +++ b/cmake/Modules/Packages/ML-PACE.cmake @@ -32,5 +32,6 @@ target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR} ${YAML_CPP_ target_link_libraries(pace PRIVATE yaml-cpp-pace) - -target_link_libraries(lammps PRIVATE pace) +if(CMAKE_PROJECT_NAME STREQUAL "lammps") + target_link_libraries(lammps PRIVATE pace) +endif() diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 81db71729a..13cfee9018 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -46,8 +46,8 @@ set(WIN_PACKAGES MISC ML-HDNNP ML-IAP - ML-SNAP ML-RANN + ML-SNAP MOFFF MOLECULE MOLFILE @@ -56,6 +56,7 @@ set(WIN_PACKAGES ORIENT PERI PHONON + PLUGIN POEMS PTM QEQ diff --git a/doc/Makefile b/doc/Makefile index 07b201b07e..8841ae4825 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -13,7 +13,7 @@ VENV = $(BUILDDIR)/docenv ANCHORCHECK = $(VENV)/bin/rst_anchor_check SPHINXCONFIG = $(BUILDDIR)/utils/sphinx-config MATHJAX = $(SPHINXCONFIG)/_static/mathjax -MATHJAXTAG = 3.2.1 +MATHJAXTAG = 3.2.2 PYTHON = $(word 3,$(shell type python3)) DOXYGEN = $(word 3,$(shell type doxygen)) diff --git a/doc/src/Developer_plugins.rst b/doc/src/Developer_plugins.rst index 9bf52801a7..36fdd010b3 100644 --- a/doc/src/Developer_plugins.rst +++ b/doc/src/Developer_plugins.rst @@ -276,10 +276,27 @@ Compilation of the plugin can be managed via both, CMake or traditional GNU makefiles. Some examples that can be used as a template are in the ``examples/plugins`` folder. The CMake script code has some small adjustments to allow building the plugins for running unit tests with -them. Another example that converts the KIM package into a plugin can be -found in the ``examples/kim/plugin`` folder. No changes to the sources -of the KIM package themselves are needed; only the plugin interface and -loader code needs to be added. This example only supports building with -CMake, but is probably a more typical example. To compile you need to -run CMake with -DLAMMPS_SOURCE_DIR=. Other +them. + +Another example that converts the KIM package into a plugin can be found +in the ``examples/kim/plugin`` folder. No changes to the sources of the +KIM package themselves are needed; only the plugin interface and loader +code needs to be added. This example only supports building with CMake, +but is probably a more typical example. To compile you need to run CMake +with -DLAMMPS_SOURCE_DIR=. Other configuration setting are identical to those for compiling LAMMPS. + +A second example for a plugin from a package is in the +``examples/PACKAGES/pace/plugin`` folder that will create a plugin from +the ML-PACE package. In this case the bulk of the code is in a static +external library that is being downloaded and compiled first and then +combined with the pair style wrapper and the plugin loader. This +example also contains a NSIS script that can be used to create an +Installer package for Windows (the mutual licensing terms of the +external library and LAMMPS conflict when distributing binaries, so the +ML-PACE package cannot be linked statically, but the LAMMPS headers +required to build the plugin are also available under a less restrictive +license). This will automatically set the required environment variable +and launching a (compatible) LAMMPS binary will load and register the +plugin and the ML-PACE package can then be used as it was linked into +LAMMPS. diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 92a4cab46b..65bab0e5a2 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -657,7 +657,7 @@ advection-diffusion-reaction systems. The equations of motion of these DPD extensions are integrated through a modified velocity-Verlet (MVV) algorithm. -**Author:** Zhen Li (Division of Applied Mathematics, Brown University) +**Author:** Zhen Li (Department of Mechanical Engineering, Clemson University) **Supporting info:** diff --git a/doc/src/Tools.rst b/doc/src/Tools.rst index ef403daa84..b57c91ffee 100644 --- a/doc/src/Tools.rst +++ b/doc/src/Tools.rst @@ -95,7 +95,7 @@ Miscellaneous tools * :ref:`LAMMPS shell ` * :ref:`LAMMPS magic patterns for file(1) ` * :ref:`Offline build tool ` - * :ref:`singularity ` + * :ref:`singularity/apptainer ` * :ref:`SWIG interface ` * :ref:`vim ` @@ -1007,14 +1007,15 @@ Ivanov, at University of Iceland (ali5 at hi.is). .. _singularity_tool: -singularity tool ----------------------------------------- +singularity/apptainer tool +-------------------------- -The singularity sub-directory contains container definitions files -that can be used to build container images for building and testing -LAMMPS on specific OS variants using the `Singularity `_ -container software. Contributions for additional variants are welcome. -For more details please see the README.md file in that folder. +The singularity sub-directory contains container definitions files that +can be used to build container images for building and testing LAMMPS on +specific OS variants using the `Apptainer `_ or +`Singularity `_ container software. Contributions for +additional variants are welcome. For more details please see the +README.md file in that folder. ---------- diff --git a/doc/src/compute_ave_sphere_atom.rst b/doc/src/compute_ave_sphere_atom.rst index db04682865..48dbf377cb 100644 --- a/doc/src/compute_ave_sphere_atom.rst +++ b/doc/src/compute_ave_sphere_atom.rst @@ -35,16 +35,24 @@ Examples Description """"""""""" -Define a computation that calculates the local density and temperature -for each atom and neighbors inside a spherical cutoff. +Define a computation that calculates the local mass density and +temperature for each atom based on its neighbors inside a spherical +cutoff. If an atom has M neighbors, then its local mass density is +calculated as the sum of its mass and its M neighbor masses, divided +by the volume of the cutoff sphere (or circle in 2d). The local +temperature of the atom is calculated as the temperature of the +collection of M+1 atoms, after subtracting the center-of-mass velocity +of the M+1 atoms from each of the M+1 atom's velocities. This is +effectively the thermal velocity of the neighborhood of the central +atom, similar to :doc:`compute temp/com `. -The optional keyword *cutoff* defines the distance cutoff -used when searching for neighbors. The default value is the cutoff -specified by the pair style. If no pair style is defined, then a cutoff -must be defined using this keyword. If the specified cutoff is larger than -that of the pair_style plus neighbor skin (or no pair style is defined), -the *comm_modify cutoff* option must also be set to match that of the -*cutoff* keyword. +The optional keyword *cutoff* defines the distance cutoff used when +searching for neighbors. The default value is the cutoff specified by +the pair style. If no pair style is defined, then a cutoff must be +defined using this keyword. If the specified cutoff is larger than +that of the pair_style plus neighbor skin (or no pair style is +defined), the *comm_modify cutoff* option must also be set to match +that of the *cutoff* keyword. The neighbor list needed to compute this quantity is constructed each time the calculation is performed (i.e. each time a snapshot of atoms @@ -55,16 +63,16 @@ too frequently. If you have a bonded system, then the settings of :doc:`special_bonds ` command can remove pairwise - interactions between atoms in the same bond, angle, or dihedral. This - is the default setting for the :doc:`special_bonds ` - command, and means those pairwise interactions do not appear in the - neighbor list. Because this fix uses the neighbor list, it also means - those pairs will not be included in the order parameter. This - difficulty can be circumvented by writing a dump file, and using the - :doc:`rerun ` command to compute the order parameter for - snapshots in the dump file. The rerun script can use a - :doc:`special_bonds ` command that includes all pairs in - the neighbor list. + interactions between atoms in the same bond, angle, or dihedral. + This is the default setting for the :doc:`special_bonds + ` command, and means those pairwise interactions do + not appear in the neighbor list. Because this compute uses the + neighbor list, it also means those pairs will not be included in + the order parameter. This difficulty can be circumvented by + writing a dump file, and using the :doc:`rerun ` command to + compute the order parameter for snapshots in the dump file. The + rerun script can use a :doc:`special_bonds ` command + that includes all pairs in the neighbor list. ---------- @@ -77,17 +85,20 @@ too frequently. Output info """"""""""" -This compute calculates a per-atom array with two columns: density and temperature. +This compute calculates a per-atom array with two columns: mass +density in density :doc:`units ` and temperature in temperature +:doc:`units `. These values can be accessed by any command that uses per-atom values -from a compute as input. See the :doc:`Howto output ` doc -page for an overview of LAMMPS output options. +from a compute as input. See the :doc:`Howto output ` +doc page for an overview of LAMMPS output options. Restrictions """""""""""" -This compute is part of the EXTRA-COMPUTE package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` page for more info. +This compute is part of the EXTRA-COMPUTE package. It is only enabled +if LAMMPS was built with that package. See the :doc:`Build package +` page for more info. Related commands """""""""""""""" @@ -97,5 +108,5 @@ Related commands Default """"""" -The option defaults are *cutoff* = pair style cutoff +The option defaults are *cutoff* = pair style cutoff. diff --git a/doc/src/fix_mdi_aimd.rst b/doc/src/fix_mdi_aimd.rst index 64bc4a3d6a..9ab2a933ed 100644 --- a/doc/src/fix_mdi_aimd.rst +++ b/doc/src/fix_mdi_aimd.rst @@ -12,7 +12,6 @@ Syntax * ID, group-ID are documented in :doc:`fix ` command * mdi/aimd = style name of this fix command -* optional keyword = *plugin* Examples """""""" @@ -20,7 +19,6 @@ Examples .. code-block:: LAMMPS fix 1 all mdi/aimd - fix 1 all mdi/aimd plugin Description """"""""""" @@ -53,14 +51,6 @@ same time as LAMMPS, or as a plugin library. See the :doc:`mdi plugin Again, the examples/mdi/README file explains how to launch both driver and engine codes so that engine is used in plugin mode. -To use this fix with a plugin engine, you must specify the -*plugin* keyword as the last argument, as illustrated above. - -.. note:: - - As of April 2022, the *plugin* keyword is needed. In a future - version of the MDI library it will no longer be necessary. - ---------- This fix performs the timestepping portion of an AIMD simulation. diff --git a/doc/src/kspace_style.rst b/doc/src/kspace_style.rst index 59efbdc5bd..30f3e550c5 100644 --- a/doc/src/kspace_style.rst +++ b/doc/src/kspace_style.rst @@ -129,8 +129,8 @@ Examples kspace_style pppm 1.0e-4 kspace_style pppm/cg 1.0e-5 1.0e-6 - kspace style msm 1.0e-4 - kspace style scafacos fmm 1.0e-4 + kspace_style msm 1.0e-4 + kspace_style scafacos fmm 1.0e-4 kspace_style none Used in input scripts: diff --git a/doc/src/pair_e3b.rst b/doc/src/pair_e3b.rst index b75fb8450c..8ae6d10b82 100644 --- a/doc/src/pair_e3b.rst +++ b/doc/src/pair_e3b.rst @@ -50,6 +50,12 @@ Examples pair_style hybrid/overlay e3b 1 lj/cut/tip4p/long 1 2 1 1 0.15 8.5 pair_coeff * * e3b preset 2011 +Used in example input script: + +.. parsed-literal:: + + examples/PACKAGES/e3b/in.e3b-tip4p2005 + Description """"""""""" @@ -68,21 +74,27 @@ The *e3b* style computes an \"explicit three-body\" (E3B) potential for water :r 0 & r>R_f\\ \end{cases} -This potential was developed as a water model that includes the three-body cooperativity of hydrogen bonding explicitly. -To use it in this way, it must be applied in conjunction with a conventional two-body water model, through *pair_style hybrid/overlay*. -The three body interactions are split into three types: A, B, and C. -Type A corresponds to anti-cooperative double hydrogen bond donor interactions. -Type B corresponds to the cooperative interaction of molecules that both donate and accept a hydrogen bond. -Type C corresponds to anti-cooperative double hydrogen bond acceptor interactions. -The three-body interactions are smoothly cutoff by the switching function s(r) between Rs and Rc3. -The two-body interactions are designed to correct for the effective many-body interactions implicitly included in the conventional two-body potential. -The two-body interactions are cut off sharply at Rc2, because K3 is typically significantly smaller than K2. -See :ref:`(Kumar 2008) ` for more details. +This potential was developed as a water model that includes the +three-body cooperativity of hydrogen bonding explicitly. To use it in +this way, it must be applied in conjunction with a conventional two-body +water model, through pair style :doc:`hybrid/overlay `. The +three body interactions are split into three types: A, B, and C. Type A +corresponds to anti-cooperative double hydrogen bond donor interactions. +Type B corresponds to the cooperative interaction of molecules that both +donate and accept a hydrogen bond. Type C corresponds to +anti-cooperative double hydrogen bond acceptor interactions. The +three-body interactions are smoothly cutoff by the switching function +s(r) between Rs and Rc3. The two-body interactions are designed to +correct for the effective many-body interactions implicitly included in +the conventional two-body potential. The two-body interactions are cut +off sharply at Rc2, because K3 is typically significantly smaller than +K2. See :ref:`(Kumar 2008) ` for more details. -Only a single *pair_coeff* command is used with the *e3b* style. -The first two arguments must be \* \*. -The oxygen atom type for the pair style is passed as the only argument to the *pair_style* command, not in the *pair_coeff* command. -The hydrogen atom type is inferred by the ordering of the atoms. +Only a single :doc:`pair_coeff ` command is used with the +*e3b* style and the first two arguments must be \* \*. The oxygen atom +type for the pair style is passed as the only argument to the +*pair_style* command, not in the *pair_coeff* command. The hydrogen +atom type is inferred from the ordering of the atoms. .. note:: @@ -90,26 +102,41 @@ The hydrogen atom type is inferred by the ordering of the atoms. Each water molecule must have consecutive IDs with the oxygen first. This pair style does not test that this criteria is met. -The *pair_coeff* command must have at least one keyword/value pair, as described above. -The *preset* keyword sets the potential parameters to the values used in :ref:`(Tainter 2011) ` or :ref:`(Tainter 2015) `. -To use the water models defined in those references, the *e3b* style should always be used in conjunction with an *lj/cut/tip4p/long* style through *pair_style hybrid/overlay*, as demonstrated in the second example above. -The *preset 2011* option should be used with the :doc:`TIP4P water model `. -The *preset 2015* option should be used with the :doc:`TIP4P/2005 water model `. -If the *preset* keyword is used, no other keyword is needed. -Changes to the preset parameters can be made by specifying the *preset* keyword followed by the specific parameter to change, like *Ea*\ . -Note that the other keywords must come after *preset* in the pair_style command. -The *e3b* style can also be used to implement any three-body potential of the same form by specifying all the keywords except *neigh*\ : *Ea*, *Eb*, *Ec*, *E2*, *K3*, *K2*, *Rc3*, *Rc2*, *Rs*, and *bondL*\ . -The keyword *bondL* specifies the intramolecular OH bond length of the water model being used. -This is needed to include H atoms that are within the cutoff even when the attached oxygen atom is not. +The *pair_coeff* command must have at least one keyword/value pair, as +described above. The *preset* keyword sets the potential parameters to +the values used in :ref:`(Tainter 2011) ` or +:ref:`(Tainter 2015) `. To use the water models defined in +those references, the *e3b* style should always be used in conjunction +with an *lj/cut/tip4p/long* style through *pair_style hybrid/overlay*, +as demonstrated in the second example above. The *preset 2011* option +should be used with the :doc:`TIP4P water model `. The +*preset 2015* option should be used with the :doc:`TIP4P/2005 water +model `. If the *preset* keyword is used, no other keyword +is needed. Changes to the preset parameters can be made by specifying +the *preset* keyword followed by the specific parameter to change, like +*Ea*\ . Note that the other keywords must come after *preset* in the +pair_style command. The *e3b* style can also be used to implement any +three-body potential of the same form by specifying all the keywords +except *neigh*\ : *Ea*, *Eb*, *Ec*, *E2*, *K3*, *K2*, *Rc3*, *Rc2*, +*Rs*, and *bondL*\ . The keyword *bondL* specifies the intramolecular +OH bond length of the water model being used. This is needed to include +H atoms that are within the cutoff even when the attached oxygen atom is +not. -This pair style allocates arrays sized according to the number of pairwise interactions within Rc3. -To do this it needs an estimate for the number of water molecules within Rc3 of an oxygen atom. -This estimate defaults to 10 and can be changed using the *neigh* keyword, which takes an integer as an argument. -If the neigh setting is too small, the simulation will fail with the error "neigh is too small". -If the neigh setting is too large, the pair style will use more memory than necessary. +This pair style allocates arrays sized according to the number of +pairwise interactions within Rc3. To do this it needs an estimate for +the number of water molecules within Rc3 of an oxygen atom. This +estimate defaults to 10 and can be changed using the *neigh* keyword, +which takes an integer as an argument. If the neigh setting is too +small, the simulation will fail with the error "neigh is too small". If +the neigh setting is too large, the pair style will use more memory than +necessary. -This pair style tallies a breakdown of the total E3B potential energy into sub-categories, which can be accessed via the :doc:`compute pair ` command as a vector of values of length 4. -The 4 values correspond to the terms in the first equation above: the E2 term, the Ea term, the Eb term, and the Ec term. +This pair style tallies a breakdown of the total E3B potential energy +into sub-categories, which can be accessed via the :doc:`compute pair +` command as a vector of values of length 4. The 4 values +correspond to the terms in the first equation above: the E2 term, the Ea +term, the Eb term, and the Ec term. See the examples/PACKAGES/e3b directory for a complete example script. diff --git a/doc/src/pair_sw_angle_table.rst b/doc/src/pair_sw_angle_table.rst index 6431917d67..ff88711d7a 100644 --- a/doc/src/pair_sw_angle_table.rst +++ b/doc/src/pair_sw_angle_table.rst @@ -23,9 +23,9 @@ Examples Used in example input script: - .. parsed-literal:: +.. parsed-literal:: - examples/PACKAGES/manybody_table/in.spce_sw + examples/PACKAGES/manybody_table/in.spce_sw Description diff --git a/doc/src/pair_threebody_table.rst b/doc/src/pair_threebody_table.rst index 68661270c9..19c90feccd 100644 --- a/doc/src/pair_threebody_table.rst +++ b/doc/src/pair_threebody_table.rst @@ -27,10 +27,10 @@ Examples Used in example input scripts: - .. parsed-literal:: +.. parsed-literal:: - examples/PACKAGES/manybody_table/in.spce - examples/PACKAGES/manybody_table/in.spce2 + examples/PACKAGES/manybody_table/in.spce + examples/PACKAGES/manybody_table/in.spce2 Description """"""""""" diff --git a/doc/src/read_data.rst b/doc/src/read_data.rst index 68e1efc496..853d86785e 100644 --- a/doc/src/read_data.rst +++ b/doc/src/read_data.rst @@ -56,7 +56,7 @@ Examples read_data ../run7/data.polymer.gz read_data data.protein fix mycmap crossterm CMAP read_data data.water add append offset 3 1 1 1 1 shift 0.0 0.0 50.0 - read_data data.water add merge 1 group solvent + read_data data.water add merge group solvent Description """"""""""" @@ -622,6 +622,8 @@ of analysis. - atom-ID molecule-ID atom-type x y z * - charge - atom-ID atom-type q x y z + * - dielectric + - atom-ID atom-type q x y z normx normy normz area ed em epsilon curvature * - dipole - atom-ID atom-type q x y z mux muy muz * - dpd diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 21f4549441..be9f554007 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -120,6 +120,7 @@ Antonelli api Apoorva Appl +apptainer Apu arallel arccos @@ -2370,6 +2371,9 @@ Nord norder Nordlund normals +normx +normy +normz Noskov noslip noticable diff --git a/examples/ELASTIC_T/BORN_MATRIX/Argon/Analytical/compute_born.py b/examples/ELASTIC_T/BORN_MATRIX/Argon/Analytical/compute_born.py index 0f3265faeb..88cc8dcca2 100644 --- a/examples/ELASTIC_T/BORN_MATRIX/Argon/Analytical/compute_born.py +++ b/examples/ELASTIC_T/BORN_MATRIX/Argon/Analytical/compute_born.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import sys import numpy as np def reduce_Born(Cf): diff --git a/examples/ELASTIC_T/BORN_MATRIX/Argon/Numdiff/compute_born.py b/examples/ELASTIC_T/BORN_MATRIX/Argon/Numdiff/compute_born.py index 0f3265faeb..88cc8dcca2 100644 --- a/examples/ELASTIC_T/BORN_MATRIX/Argon/Numdiff/compute_born.py +++ b/examples/ELASTIC_T/BORN_MATRIX/Argon/Numdiff/compute_born.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import sys import numpy as np def reduce_Born(Cf): diff --git a/examples/ELASTIC_T/BORN_MATRIX/Silicon/elastic_utils.py b/examples/ELASTIC_T/BORN_MATRIX/Silicon/elastic_utils.py index 0daf62b1b0..2307f3d413 100644 --- a/examples/ELASTIC_T/BORN_MATRIX/Silicon/elastic_utils.py +++ b/examples/ELASTIC_T/BORN_MATRIX/Silicon/elastic_utils.py @@ -1,5 +1,5 @@ import numpy as np -from lammps import lammps, LAMMPS_INT, LMP_STYLE_GLOBAL, LMP_VAR_EQUAL, LMP_VAR_ATOM +from lammps import lammps, LMP_VAR_EQUAL # method for rotating elastic constants diff --git a/examples/PACKAGES/pace/plugin/CMakeLists.txt b/examples/PACKAGES/pace/plugin/CMakeLists.txt new file mode 100644 index 0000000000..f4068a03c9 --- /dev/null +++ b/examples/PACKAGES/pace/plugin/CMakeLists.txt @@ -0,0 +1,36 @@ +########################################## +# CMake build system for plugin examples. +# The is meant to be used as a template for plugins that are +# distributed independent from the LAMMPS package. +########################################## + +cmake_minimum_required(VERSION 3.10) + +project(paceplugin VERSION 1.0 LANGUAGES CXX) + +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +include(CheckIncludeFileCXX) +include(LAMMPSInterfacePlugin) +include(ML-PACE) + +########################## +# building the plugins + +add_library(paceplugin MODULE paceplugin.cpp ${LAMMPS_SOURCE_DIR}/ML-PACE/pair_pace.cpp) +target_link_libraries(paceplugin PRIVATE pace) +target_link_libraries(paceplugin PRIVATE lammps) +target_include_directories(paceplugin PRIVATE ${LAMMPS_SOURCE_DIR}/ML-PACE) +set_target_properties(paceplugin PROPERTIES PREFIX "" SUFFIX ".so") + +# MacOS seems to need this +if(CMAKE_SYSTEM_NAME STREQUAL Darwin) + set_target_properties(paceplugin PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") +# tell CMake to export all symbols to a .dll on Windows with special case for MinGW cross-compilers + set_target_properties(paceplugin PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + if(CMAKE_CROSSCOMPILING) + set_target_properties(paceplugin PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols") + endif() +else() + set_target_properties(paceplugin PROPERTIES LINK_FLAGS "-rdynamic") +endif() diff --git a/examples/PACKAGES/pace/plugin/LAMMPSInterfacePlugin.cmake b/examples/PACKAGES/pace/plugin/LAMMPSInterfacePlugin.cmake new file mode 120000 index 0000000000..2ac6d20a54 --- /dev/null +++ b/examples/PACKAGES/pace/plugin/LAMMPSInterfacePlugin.cmake @@ -0,0 +1 @@ +../../../../cmake/Modules/LAMMPSInterfacePlugin.cmake \ No newline at end of file diff --git a/examples/PACKAGES/pace/plugin/ML-PACE.cmake b/examples/PACKAGES/pace/plugin/ML-PACE.cmake new file mode 120000 index 0000000000..3990c0d334 --- /dev/null +++ b/examples/PACKAGES/pace/plugin/ML-PACE.cmake @@ -0,0 +1 @@ +../../../../cmake/Modules/Packages/ML-PACE.cmake \ No newline at end of file diff --git a/examples/PACKAGES/pace/plugin/README.txt b/examples/PACKAGES/pace/plugin/README.txt new file mode 100644 index 0000000000..85490c3f6c --- /dev/null +++ b/examples/PACKAGES/pace/plugin/README.txt @@ -0,0 +1,2 @@ +This folder contains a loader and support files to build the ML-PACE package as plugin. +For more information please see: https://docs.lammps.org/Developer_plugins.html diff --git a/examples/PACKAGES/pace/plugin/lammps-text-logo-wide.bmp b/examples/PACKAGES/pace/plugin/lammps-text-logo-wide.bmp new file mode 100644 index 0000000000..b9ec4c35f2 Binary files /dev/null and b/examples/PACKAGES/pace/plugin/lammps-text-logo-wide.bmp differ diff --git a/examples/PACKAGES/pace/plugin/lammps.ico b/examples/PACKAGES/pace/plugin/lammps.ico new file mode 100644 index 0000000000..cce156bf79 Binary files /dev/null and b/examples/PACKAGES/pace/plugin/lammps.ico differ diff --git a/examples/PACKAGES/pace/plugin/paceplugin.cpp b/examples/PACKAGES/pace/plugin/paceplugin.cpp new file mode 100644 index 0000000000..adf1c168f9 --- /dev/null +++ b/examples/PACKAGES/pace/plugin/paceplugin.cpp @@ -0,0 +1,28 @@ + +#include "lammpsplugin.h" +#include "version.h" + +#include "pair_pace.h" + +using namespace LAMMPS_NS; + +static Pair *pair_pace_creator(LAMMPS *lmp) +{ + return new PairPACE(lmp); +} + +extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc) +{ + lammpsplugin_t plugin; + lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc; + + // register pace pair style + plugin.version = LAMMPS_VERSION; + plugin.style = "pair"; + plugin.name = "pace"; + plugin.info = "PACE plugin pair style v1.0"; + plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)"; + plugin.creator.v1 = (lammpsplugin_factory1 *) &pair_pace_creator; + plugin.handle = handle; + (*register_plugin)(&plugin, lmp); +} diff --git a/examples/PACKAGES/pace/plugin/paceplugin.nsis b/examples/PACKAGES/pace/plugin/paceplugin.nsis new file mode 100644 index 0000000000..de8d1d8478 --- /dev/null +++ b/examples/PACKAGES/pace/plugin/paceplugin.nsis @@ -0,0 +1,157 @@ +#!Nsis Installer Command Script +# +# The following external defines are recognized: +# ${VERSION} = YYYYMMDD + +!include "MUI2.nsh" +!include "FileFunc.nsh" + +!define MUI_ICON "lammps.ico" +!define MUI_UNICON "lammps.ico" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP "lammps-text-logo-wide.bmp" +!define MUI_HEADERIMAGE_RIGHT + +Unicode true +XPStyle on + +!include "LogicLib.nsh" +!addplugindir "envvar/Plugins/x86-unicode" +!include "x64.nsh" + +RequestExecutionLevel user + +!macro VerifyUserIsAdmin +UserInfo::GetAccountType +pop $0 +${If} $0 != "admin" + messageBox mb_iconstop "Administrator rights required!" + setErrorLevel 740 ;ERROR_ELEVATION_REQUIRED + quit +${EndIf} +!macroend + +!define PACEPLUGIN "LAMMPS ML-PACE Plugin ${VERSION}" +OutFile "LAMMPS-ML-PACE-plugin-${VERSION}.exe" + +Name "${PACEPLUGIN}" +InstallDir "$LOCALAPPDATA\${PACEPLUGIN}" + +ShowInstDetails show +ShowUninstDetails show +SetCompressor lzma + +!define MUI_ABORTWARNING + +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES + +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +!insertmacro MUI_LANGUAGE "English" + +function .onInit + # Determine if LAMMPS was already installed and check whether it was in 32-bit + # or 64-bit. Then look up path to uninstaller and offer to uninstall or quit + SetRegView 32 + ReadRegDWORD $0 HKCU "Software\LAMMPS-ML-PACE" "Bits" + SetRegView LastUsed + ${If} $0 == "32" + SetRegView 32 + ${ElseIf} $0 == "64" + SetRegView 64 + ${Else} + SetRegView 64 + ${EndIf} + ClearErrors + ReadRegStr $R0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-ML-PACE" "UninstallString" + SetRegView LastUsed + ${If} ${Errors} + DetailPrint "LAMMPS ML-PACE plugin not (yet) installed" + ${Else} + MessageBox MB_YESNO "LAMMPS ML-PACE plugin ($0 bit) is already installed. Uninstall existing version?" /SD IDYES IDNO Quit + Pop $R1 + StrCmp $R1 2 Quit +1 + Exec $R0 + Quit: + Quit + ${EndIf} + setShellVarContext all +functionEnd + +Section "${PACEPLUGIN}" SecPaceplugin + SectionIn RO + # Write LAMMPS installation bitness marker. Always use 32-bit registry view + SetRegView 32 + IntFmt $0 "0x%08X" 64 + WriteRegDWORD HKCU "Software\LAMMPS-ML-PACE" "Bits" $0 + + # Switch to "native" registry view + SetRegView 64 + SetShellVarContext current + + SetOutPath "$INSTDIR" + File lammps.ico + File paceplugin.so + + # Register Application and its uninstaller + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-ML-PACE" \ + "DisplayName" "${PACEPLUGIN}" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-ML-PACE" \ + "Publisher" "The LAMMPS and PACE Developers" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-ML-PACE" \ + "URLInfoAbout" "lammps.org" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-ML-PACE" \ + "DisplayIcon" "$INSTDIR\lammps.ico" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-ML-PACE" \ + "DisplayVersion" "${VERSION}" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-ML-PACE" \ + "InstallLocation" "$INSTDIR" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-ML-PACE" \ + "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-ML-PACE" \ + "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" + + ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 + IntFmt $0 "0x%08X" $0 + WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-ML-PACE" \ + "EstimatedSize" "$0" + + # update path variables + EnVar::SetHKCU + # add to LAMMPS plugin search path + EnVar::AddValue "LAMMPS_PLUGIN_PATH" "$INSTDIR" + + WriteUninstaller "$INSTDIR\Uninstall.exe" +SectionEnd + +function un.onInit + SetShellVarContext current +functionEnd + +Section "Uninstall" + # remove LAMMPS bitness/installation indicator always in 32-bit registry view + SetRegView 32 + DeleteRegKey HKCU "Software\LAMMPS-ML-PACE" + + # unregister extension, and uninstall info + SetRegView 64 + SetShellVarContext current + # unregister installation + DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-ML-PACE" + + # update path variables + EnVar::SetHKCU + # remove entry from LAMMPS plugin search path + EnVar::DeleteValue "LAMMPS_PLUGIN_PATH" "$INSTDIR" + + Delete /REBOOTOK "$INSTDIR\paceplugin.so" + Delete /REBOOTOK "$INSTDIR\Uninstall.exe" + Delete /REBOOTOK "$INSTDIR\lammps.ico" + RMDir /REBOOTOK "$INSTDIR" +SectionEnd + +# Local Variables: +# mode: sh +# End: diff --git a/examples/kim/plugin/CMakeLists.txt b/examples/kim/plugin/CMakeLists.txt index f4cb5f598d..78d117469d 100644 --- a/examples/kim/plugin/CMakeLists.txt +++ b/examples/kim/plugin/CMakeLists.txt @@ -6,46 +6,11 @@ cmake_minimum_required(VERSION 3.10) -# enforce out-of-source build -if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) - message(FATAL_ERROR "In-source builds are not allowed. You must create and use a build directory. " - "Please remove CMakeCache.txt and CMakeFiles first.") -endif() - project(kimplugin VERSION 1.0 LANGUAGES CXX) -set(LAMMPS_SOURCE_DIR "" CACHE PATH "Location of LAMMPS sources folder") -if(NOT LAMMPS_SOURCE_DIR) - message(FATAL_ERROR "Must set LAMMPS_SOURCE_DIR") -endif() - -# by default, install into $HOME/.local (not /usr/local), -# so that no root access (and sudo) is needed -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Default install path" FORCE) -endif() - -# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro -# and prints lots of pointless warnings about "unsafe" functions -if(MSVC) - add_compile_options(/Zc:__cplusplus) - add_compile_options(/wd4244) - add_compile_options(/wd4267) - add_compile_definitions(_CRT_SECURE_NO_WARNINGS) -endif() - -# C++11 is required -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -# Need -restrict with Intel compilers -if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict") -endif() - set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) include(CheckIncludeFileCXX) -include(LAMMPSInterfaceCXX) +include(LAMMPSInterfacePlugin) ########################## # building the plugins @@ -90,9 +55,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin) set_target_properties(kimplugin PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup") elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") # tell CMake to export all symbols to a .dll on Windows with special case for MinGW cross-compilers - set_target_properties(kimplugin.so PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + set_target_properties(kimplugin PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) if(CMAKE_CROSSCOMPILING) - set_target_properties(kimplugin PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols") + set_target_properties(kimplugin PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols") endif() else() set_target_properties(kimplugin PROPERTIES LINK_FLAGS "-rdynamic") diff --git a/examples/kim/plugin/LAMMPSInterfaceCXX.cmake b/examples/kim/plugin/LAMMPSInterfaceCXX.cmake deleted file mode 100644 index dfbd77e28a..0000000000 --- a/examples/kim/plugin/LAMMPSInterfaceCXX.cmake +++ /dev/null @@ -1,88 +0,0 @@ -# Cmake script code to define the LAMMPS C++ interface -# settings required for building LAMMPS plugins - -################################################################################ -# helper function -function(validate_option name values) - string(TOLOWER ${${name}} needle_lower) - string(TOUPPER ${${name}} needle_upper) - list(FIND ${values} ${needle_lower} IDX_LOWER) - list(FIND ${values} ${needle_upper} IDX_UPPER) - if(${IDX_LOWER} LESS 0 AND ${IDX_UPPER} LESS 0) - list_to_bulletpoints(POSSIBLE_VALUE_LIST ${${values}}) - message(FATAL_ERROR "\n########################################################################\n" - "Invalid value '${${name}}' for option ${name}\n" - "\n" - "Possible values are:\n" - "${POSSIBLE_VALUE_LIST}" - "########################################################################") - endif() -endfunction(validate_option) - -################################################################################# -# LAMMPS C++ interface. We only need the header related parts. -add_library(lammps INTERFACE) -target_include_directories(lammps INTERFACE ${LAMMPS_SOURCE_DIR}) -if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING) - target_link_libraries(lammps INTERFACE ${CMAKE_BINARY_DIR}/../liblammps.dll.a) -endif() -################################################################################ -# MPI configuration -if(NOT CMAKE_CROSSCOMPILING) - set(MPI_CXX_SKIP_MPICXX TRUE) - find_package(MPI QUIET) - option(BUILD_MPI "Build MPI version" ${MPI_FOUND}) -else() - option(BUILD_MPI "Build MPI version" OFF) -endif() - -if(BUILD_MPI) - find_package(MPI REQUIRED) - option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF) - if(LAMMPS_LONGLONG_TO_LONG) - target_compile_definitions(lammps INTERFACE -DLAMMPS_LONGLONG_TO_LONG) - endif() - target_link_libraries(lammps INTERFACE MPI::MPI_CXX) -else() - target_include_directories(lammps INTERFACE "${LAMMPS_SOURCE_DIR}/STUBS") -endif() - -set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)") -set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall) -set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES}) -validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES) -string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES) -target_compile_definitions(lammps INTERFACE -DLAMMPS_${LAMMPS_SIZES}) - -################################################################################ -# detect if we may enable OpenMP support by default -set(BUILD_OMP_DEFAULT OFF) -find_package(OpenMP QUIET) -if(OpenMP_FOUND) - check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE) - if(HAVE_OMP_H_INCLUDE) - set(BUILD_OMP_DEFAULT ON) - endif() -endif() - -option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT}) - -if(BUILD_OMP) - find_package(OpenMP REQUIRED) - check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE) - if(NOT HAVE_OMP_H_INCLUDE) - message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support") - endif() - - if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR - (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR - ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 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. - target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=4) - else() - target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=3) - endif() - target_link_libraries(lammps INTERFACE OpenMP::OpenMP_CXX) -endif() diff --git a/examples/kim/plugin/LAMMPSInterfacePlugin.cmake b/examples/kim/plugin/LAMMPSInterfacePlugin.cmake new file mode 120000 index 0000000000..2b78a6ebcc --- /dev/null +++ b/examples/kim/plugin/LAMMPSInterfacePlugin.cmake @@ -0,0 +1 @@ +../../../cmake/Modules/LAMMPSInterfacePlugin.cmake \ No newline at end of file diff --git a/examples/kim/plugin/README.txt b/examples/kim/plugin/README.txt new file mode 100644 index 0000000000..eecc6cc7b4 --- /dev/null +++ b/examples/kim/plugin/README.txt @@ -0,0 +1,2 @@ +This folder contains a loader and support files to build the KIM package as plugin. +For more information please see: https://docs.lammps.org/Developer_plugins.html diff --git a/examples/mdi/aimd_driver.py b/examples/mdi/aimd_driver.py index 2d8fe10c1a..ee493ea31e 100644 --- a/examples/mdi/aimd_driver.py +++ b/examples/mdi/aimd_driver.py @@ -26,7 +26,7 @@ # -nsteps 5 # number of timesteps, default = 5 -import sys,math,random +import sys import mdi import numpy as np from mpi4py import MPI @@ -42,10 +42,9 @@ def error(txt=None): def perform_aimd(world,mm_comm,qm_comm): me = world.Get_rank() - nprocs = world.Get_size() # receive number of atoms from the MM engine - + mdi.MDI_Send_command("= 3: diff --git a/src/.gitignore b/src/.gitignore index 198dcdc290..8294a204c7 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1001,8 +1001,8 @@ /neb.h /netcdf_units.cpp /netcdf_units.h -/pair_3b_table.cpp -/pair_3b_table.h +/pair_threebody_table.cpp +/pair_threebody_table.h /pair_adp.cpp /pair_adp.h /pair_agni.cpp @@ -1297,8 +1297,8 @@ /pair_sph_taitwater_morris.h /pair_sw.cpp /pair_sw.h -/pair_sw_3b_table.cpp -/pair_sw_3b_table.h +/pair_sw_angle_table.cpp +/pair_sw_angle_table.h /pair_sw_mod.cpp /pair_sw_mod.h /pair_tersoff.cpp diff --git a/src/ATC/fix_atc.cpp b/src/ATC/fix_atc.cpp index a7c0cf5ade..356aa2596c 100644 --- a/src/ATC/fix_atc.cpp +++ b/src/ATC/fix_atc.cpp @@ -284,7 +284,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), int me = ATC::LammpsInterface::instance()->comm_rank(); string groupName(arg[1]); - int igroup = group->find(groupName.c_str()); + int igroup = group->find(groupName); int atomCount = group->count(igroup); try { diff --git a/src/DIELECTRIC/atom_vec_dielectric.cpp b/src/DIELECTRIC/atom_vec_dielectric.cpp index b15b233991..67bb9f7dc3 100644 --- a/src/DIELECTRIC/atom_vec_dielectric.cpp +++ b/src/DIELECTRIC/atom_vec_dielectric.cpp @@ -78,9 +78,9 @@ AtomVecDielectric::AtomVecDielectric(LAMMPS *_lmp) : AtomVec(_lmp) "mu", "area", "ed", "em", "epsilon", "curvature", "q_unscaled"}; fields_create = {"q", "molecule", "num_bond", "num_angle", "num_dihedral", "num_improper", "nspecial", "mu", "area", "ed", "em", "epsilon", "curvature", "q_unscaled"}; - fields_data_atom = { "id", "molecule", "type", "q", "x", "mu3", "area", "ed", "em", "epsilon", + fields_data_atom = {"id", "molecule", "type", "q", "x", "mu3", "area", "ed", "em", "epsilon", "curvature"}; - fields_data_vel = {"id v"}; + fields_data_vel = {"id", "v"}; // clang-format on setup_fields(); diff --git a/src/DPD-MESO/fix_mvv_dpd.cpp b/src/DPD-MESO/fix_mvv_dpd.cpp index 73290535b1..d96031c9f9 100644 --- a/src/DPD-MESO/fix_mvv_dpd.cpp +++ b/src/DPD-MESO/fix_mvv_dpd.cpp @@ -17,8 +17,8 @@ modified velocity-Verlet (MVV) algorithm. Setting verlet = 0.5 recovers the standard velocity-Verlet algorithm. - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu ------------------------------------------------------------------------- */ #include "fix_mvv_dpd.h" diff --git a/src/DPD-MESO/fix_mvv_edpd.cpp b/src/DPD-MESO/fix_mvv_edpd.cpp index 856647d792..9b31bc4c5d 100644 --- a/src/DPD-MESO/fix_mvv_edpd.cpp +++ b/src/DPD-MESO/fix_mvv_edpd.cpp @@ -17,8 +17,8 @@ v and edpd_T) using the modified velocity-Verlet (MVV) algorithm. Setting verlet = 0.5 recovers the standard velocity-Verlet algorithm. - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu Please cite the related publication: Z. Li, Y.-H. Tang, H. Lei, B. Caswell and G.E. Karniadakis. "Energy- diff --git a/src/DPD-MESO/fix_mvv_tdpd.cpp b/src/DPD-MESO/fix_mvv_tdpd.cpp index 00c6e29968..1a0dc5d520 100644 --- a/src/DPD-MESO/fix_mvv_tdpd.cpp +++ b/src/DPD-MESO/fix_mvv_tdpd.cpp @@ -17,8 +17,8 @@ v and cc) using the modified velocity-Verlet (MVV) algorithm. Setting verlet = 0.5 recovers the standard velocity-Verlet algorithm. - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu Please cite the related publication: Z. Li, A. Yazdani, A. Tartakovsky and G.E. Karniadakis. "Transport diff --git a/src/DPD-MESO/pair_edpd.cpp b/src/DPD-MESO/pair_edpd.cpp index ddbbd05085..b05f588b7c 100644 --- a/src/DPD-MESO/pair_edpd.cpp +++ b/src/DPD-MESO/pair_edpd.cpp @@ -13,8 +13,8 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu ------------------------------------------------------------------------- */ #include "pair_edpd.h" diff --git a/src/DPD-MESO/pair_mdpd.cpp b/src/DPD-MESO/pair_mdpd.cpp index 053d322f00..ec0a57be15 100644 --- a/src/DPD-MESO/pair_mdpd.cpp +++ b/src/DPD-MESO/pair_mdpd.cpp @@ -13,8 +13,8 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu ------------------------------------------------------------------------- */ #include "pair_mdpd.h" diff --git a/src/DPD-MESO/pair_mdpd_rhosum.cpp b/src/DPD-MESO/pair_mdpd_rhosum.cpp index b44ca94c4e..773248a212 100644 --- a/src/DPD-MESO/pair_mdpd_rhosum.cpp +++ b/src/DPD-MESO/pair_mdpd_rhosum.cpp @@ -17,7 +17,7 @@ before the force calculation. The code uses 3D Lucy kernel, it can be modified for other kernels. - Contributing author: Zhen Li (Brown University) + Contributing author: Zhen Li (Clemson University) ------------------------------------------------------------------------- */ #include "pair_mdpd_rhosum.h" diff --git a/src/DPD-MESO/pair_tdpd.cpp b/src/DPD-MESO/pair_tdpd.cpp index 76f4b59108..39d9a151d9 100644 --- a/src/DPD-MESO/pair_tdpd.cpp +++ b/src/DPD-MESO/pair_tdpd.cpp @@ -13,8 +13,8 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Zhen Li (Brown University) - Email: zhen_li@brown.edu + Contributing author: Zhen Li (Clemson University) + Email: zli7@clemson.edu ------------------------------------------------------------------------- */ #include "pair_tdpd.h" diff --git a/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.cpp b/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.cpp index f5ccb15eac..7a36cdfc5c 100644 --- a/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.cpp +++ b/src/DPD-SMOOTH/pair_sdpd_taitwater_isothermal.cpp @@ -44,7 +44,7 @@ static const double sqrt_2_inv = std::sqrt(0.5); /* ---------------------------------------------------------------------- */ PairSDPDTaitwaterIsothermal::PairSDPDTaitwaterIsothermal (LAMMPS *lmp) -: Pair (lmp) { +: Pair (lmp), random(nullptr) { restartinfo = 0; single_enable =0; } @@ -61,6 +61,7 @@ PairSDPDTaitwaterIsothermal::~PairSDPDTaitwaterIsothermal () { memory->destroy (soundspeed); memory->destroy (B); } + delete random; } /* ---------------------------------------------------------------------- */ diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp index 07803aca20..010051029a 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.cpp @@ -11,10 +11,15 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + Contributing author: Stan Moore (SNL) +------------------------------------------------------------------------- */ + #include "compute_ave_sphere_atom.h" #include "atom.h" #include "comm.h" +#include "domain.h" #include "error.h" #include "force.h" #include "math_const.h" @@ -98,7 +103,10 @@ void ComputeAveSphereAtom::init() } cutsq = cutoff * cutoff; - sphere_vol = 4.0 / 3.0 * MY_PI * cutsq * cutoff; + if (domain->dimension == 3) + volume = 4.0 / 3.0 * MY_PI * cutsq * cutoff; + else + volume = MY_PI * cutsq; // need an occasional full neighbor list @@ -121,7 +129,7 @@ void ComputeAveSphereAtom::compute_peratom() double xtmp, ytmp, ztmp, delx, dely, delz, rsq; int *ilist, *jlist, *numneigh, **firstneigh; int count; - double vsum[3], vavg[3], vnet[3]; + double p[3], vcom[3], vnet[3]; invoked_peratom = update->ntimestep; @@ -152,12 +160,26 @@ void ComputeAveSphereAtom::compute_peratom() double **x = atom->x; double **v = atom->v; + double *mass = atom->mass; + double *rmass = atom->rmass; + int *type = atom->type; int *mask = atom->mask; + double massone_i, massone_j, totalmass; + + double adof = domain->dimension; + double mvv2e = force->mvv2e; + double mv2d = force->mv2d; + double boltz = force->boltz; for (ii = 0; ii < inum; ii++) { i = ilist[ii]; if (mask[i] & groupbit) { + if (rmass) + massone_i = rmass[i]; + else + massone_i = mass[type[i]]; + xtmp = x[i][0]; ytmp = x[i][1]; ztmp = x[i][2]; @@ -167,13 +189,18 @@ void ComputeAveSphereAtom::compute_peratom() // i atom contribution count = 1; - vsum[0] = v[i][0]; - vsum[1] = v[i][1]; - vsum[2] = v[i][2]; + totalmass = massone_i; + p[0] = v[i][0] * massone_i; + p[1] = v[i][1] * massone_i; + p[2] = v[i][2] * massone_i; for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; j &= NEIGHMASK; + if (rmass) + massone_j = rmass[j]; + else + massone_j = mass[type[j]]; delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; @@ -181,42 +208,45 @@ void ComputeAveSphereAtom::compute_peratom() rsq = delx * delx + dely * dely + delz * delz; if (rsq < cutsq) { count++; - vsum[0] += v[j][0]; - vsum[1] += v[j][1]; - vsum[2] += v[j][2]; + totalmass += massone_j; + p[0] += v[j][0] * massone_j; + p[1] += v[j][1] * massone_j; + p[2] += v[j][2] * massone_j; } } - vavg[0] = vsum[0] / count; - vavg[1] = vsum[1] / count; - vavg[2] = vsum[2] / count; + vcom[0] = p[0] / totalmass; + vcom[1] = p[1] / totalmass; + vcom[2] = p[2] / totalmass; // i atom contribution - count = 1; - vnet[0] = v[i][0] - vavg[0]; - vnet[1] = v[i][1] - vavg[1]; - vnet[2] = v[i][2] - vavg[2]; - double ke_sum = vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]; + vnet[0] = v[i][0] - vcom[0]; + vnet[1] = v[i][1] - vcom[1]; + vnet[2] = v[i][2] - vcom[2]; + double ke_sum = massone_i * (vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]); for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; j &= NEIGHMASK; + if (rmass) + massone_j = rmass[j]; + else + massone_j = mass[type[j]]; delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; rsq = delx * delx + dely * dely + delz * delz; if (rsq < cutsq) { - count++; - vnet[0] = v[j][0] - vavg[0]; - vnet[1] = v[j][1] - vavg[1]; - vnet[2] = v[j][2] - vavg[2]; - ke_sum += vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]; + vnet[0] = v[j][0] - vcom[0]; + vnet[1] = v[j][1] - vcom[1]; + vnet[2] = v[j][2] - vcom[2]; + ke_sum += massone_j * (vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]); } } - double density = count / sphere_vol; - double temp = ke_sum / 3.0 / count; + double density = mv2d * totalmass / volume; + double temp = mvv2e * ke_sum / (adof * count * boltz); result[i][0] = density; result[i][1] = temp; } diff --git a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h index ffed09bae5..76350997f9 100644 --- a/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h +++ b/src/EXTRA-COMPUTE/compute_ave_sphere_atom.h @@ -37,7 +37,7 @@ class ComputeAveSphereAtom : public Compute { protected: int nmax; - double cutoff, cutsq, sphere_vol; + double cutoff, cutsq, volume; class NeighList *list; double **result; diff --git a/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp b/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp index 25c3117b0f..f873c70bae 100644 --- a/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp +++ b/src/EXTRA-COMPUTE/compute_stress_cartesian.cpp @@ -318,7 +318,7 @@ void ComputeStressCartesian::compute_array() // Check if inside cut-off if (rsq >= cutsq[itype][jtype]) continue; pair->single(i, j, itype, jtype, rsq, factor_coul, factor_lj, fpair); - compute_pressure(fpair, xi1, xi2, xj1, xj2, delx, dely, delz); + compute_pressure(fpair, xi1, xi2, delx, dely, delz); } } @@ -356,8 +356,8 @@ void ComputeStressCartesian::compute_array() } } -void ComputeStressCartesian::compute_pressure(double fpair, double xi, double yi, double xj, - double yj, double delx, double dely, double delz) +void ComputeStressCartesian::compute_pressure(double fpair, double xi, double yi, double delx, + double dely, double delz) { int bin1, bin2, next_bin1, next_bin2; double la = 0.0, lb = 0.0, l_sum = 0.0; diff --git a/src/EXTRA-COMPUTE/compute_stress_cartesian.h b/src/EXTRA-COMPUTE/compute_stress_cartesian.h index 63e33a5407..d4505a1e8e 100644 --- a/src/EXTRA-COMPUTE/compute_stress_cartesian.h +++ b/src/EXTRA-COMPUTE/compute_stress_cartesian.h @@ -41,7 +41,7 @@ class ComputeStressCartesian : public Compute { double *dens, *pkxx, *pkyy, *pkzz, *pcxx, *pcyy, *pczz; double *tdens, *tpkxx, *tpkyy, *tpkzz, *tpcxx, *tpcyy, *tpczz; class NeighList *list; - void compute_pressure(double, double, double, double, double, double, double, double); + void compute_pressure(double, double, double, double, double, double); }; } // namespace LAMMPS_NS diff --git a/src/EXTRA-DUMP/dump_xtc.cpp b/src/EXTRA-DUMP/dump_xtc.cpp index 3c5be6b9be..8e0bb4a0d7 100644 --- a/src/EXTRA-DUMP/dump_xtc.cpp +++ b/src/EXTRA-DUMP/dump_xtc.cpp @@ -433,10 +433,10 @@ int xdropen(XDR *xdrs, const char *filename, const char *type) return 0; } if (*type == 'w' || *type == 'W') { - type = (char *) "w+"; + type = (char *) "wb+"; lmode = XDR_ENCODE; } else { - type = (char *) "r"; + type = (char *) "rb"; lmode = XDR_DECODE; } xdrfiles[xdrid] = fopen(filename, type); diff --git a/src/INTERLAYER/pair_ilp_tmd.cpp b/src/INTERLAYER/pair_ilp_tmd.cpp index 15e1beede7..52119cbf12 100644 --- a/src/INTERLAYER/pair_ilp_tmd.cpp +++ b/src/INTERLAYER/pair_ilp_tmd.cpp @@ -483,7 +483,7 @@ void PairILPTMD::calc_normal() } } //############################ For the edge atoms of TMD ################################ - else if (cont > 1 && cont < Nnei) { + else if (cont < Nnei) { if (strcmp(elements[itype], "Mo") == 0 || strcmp(elements[itype], "W") == 0 || strcmp(elements[itype], "S") == 0 || strcmp(elements[itype], "Se") == 0) { // derivatives of Ni[l] respect to the cont neighbors diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp index d2cb6682a7..7873bd0d92 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.cpp @@ -11,11 +11,16 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + Contributing author: Stan Moore (SNL) +------------------------------------------------------------------------- */ + #include "compute_ave_sphere_atom_kokkos.h" #include "atom_kokkos.h" #include "atom_masks.h" #include "comm.h" +#include "domain.h" #include "error.h" #include "force.h" #include "memory_kokkos.h" @@ -105,11 +110,19 @@ void ComputeAveSphereAtomKokkos::compute_peratom() // compute properties for each atom in group // use full neighbor list to count atoms less than cutoff - atomKK->sync(execution_space,X_MASK|V_MASK|TYPE_MASK|MASK_MASK); + atomKK->sync(execution_space,X_MASK|V_MASK|RMASS_MASK|TYPE_MASK|MASK_MASK); x = atomKK->k_x.view(); v = atomKK->k_v.view(); + rmass = atomKK->k_rmass.view(); + mass = atomKK->k_mass.view(); + type = atomKK->k_type.view(); mask = atomKK->k_mask.view(); + adof = domain->dimension; + mvv2e = force->mvv2e; + mv2d = force->mv2d; + boltz = force->boltz; + Kokkos::deep_copy(d_result,0.0); copymode = 1; @@ -125,8 +138,13 @@ template KOKKOS_INLINE_FUNCTION void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, const int &ii) const { + double massone_i,massone_j; + const int i = d_ilist[ii]; if (mask[i] & groupbit) { + if (rmass.data()) massone_i = rmass[i]; + else massone_i = mass[type[i]]; + const X_FLOAT xtmp = x(i,0); const X_FLOAT ytmp = x(i,1); const X_FLOAT ztmp = x(i,2); @@ -135,14 +153,17 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, // i atom contribution int count = 1; - double vsum[3]; - vsum[0] = v(i,0); - vsum[1] = v(i,1); - vsum[2] = v(i,2); + double totalmass = massone_i; + double p[3]; + p[0] = v(i,0)*massone_i; + p[1] = v(i,1)*massone_i; + p[2] = v(i,2)*massone_i; for (int jj = 0; jj < jnum; jj++) { int j = d_neighbors(i,jj); j &= NEIGHMASK; + if (rmass.data()) massone_j = rmass[j]; + else massone_j = mass[type[j]]; const F_FLOAT delx = x(j,0) - xtmp; const F_FLOAT dely = x(j,1) - ytmp; @@ -150,44 +171,45 @@ void ComputeAveSphereAtomKokkos::operator()(TagComputeAveSphereAtom, const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq < cutsq) { count++; - vsum[0] += v(j,0); - vsum[1] += v(j,1); - vsum[2] += v(j,2); + totalmass += massone_j; + p[0] += v(j,0)*massone_j; + p[1] += v(j,1)*massone_j; + p[2] += v(j,2)*massone_j; } } - double vavg[3]; - vavg[0] = vsum[0]/count; - vavg[1] = vsum[1]/count; - vavg[2] = vsum[2]/count; + double vcom[3]; + vcom[0] = p[0]/totalmass; + vcom[1] = p[1]/totalmass; + vcom[2] = p[2]/totalmass; // i atom contribution - count = 1; double vnet[3]; - vnet[0] = v(i,0) - vavg[0]; - vnet[1] = v(i,1) - vavg[1]; - vnet[2] = v(i,2) - vavg[2]; - double ke_sum = vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]; + vnet[0] = v(i,0) - vcom[0]; + vnet[1] = v(i,1) - vcom[1]; + vnet[2] = v(i,2) - vcom[2]; + double ke_sum = massone_i * (vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]); for (int jj = 0; jj < jnum; jj++) { int j = d_neighbors(i,jj); j &= NEIGHMASK; + if (rmass.data()) massone_j = rmass[j]; + else massone_j = mass[type[j]]; const F_FLOAT delx = x(j,0) - xtmp; const F_FLOAT dely = x(j,1) - ytmp; const F_FLOAT delz = x(j,2) - ztmp; const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq < cutsq) { - count++; - vnet[0] = v(j,0) - vavg[0]; - vnet[1] = v(j,1) - vavg[1]; - vnet[2] = v(j,2) - vavg[2]; - ke_sum += vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]; + vnet[0] = v(j,0) - vcom[0]; + vnet[1] = v(j,1) - vcom[1]; + vnet[2] = v(j,2) - vcom[2]; + ke_sum += massone_j * (vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]); } } - double density = count/sphere_vol; - double temp = ke_sum/3.0/count; + double density = mv2d*totalmass/volume; + double temp = mvv2e*ke_sum/(adof*count*boltz); d_result(i,0) = density; d_result(i,1) = temp; } diff --git a/src/KOKKOS/compute_ave_sphere_atom_kokkos.h b/src/KOKKOS/compute_ave_sphere_atom_kokkos.h index 75b5ca3aba..1ddf943e7d 100644 --- a/src/KOKKOS/compute_ave_sphere_atom_kokkos.h +++ b/src/KOKKOS/compute_ave_sphere_atom_kokkos.h @@ -46,13 +46,18 @@ template class ComputeAveSphereAtomKokkos : public ComputeAve void operator()(TagComputeAveSphereAtom, const int &) const; private: - typename AT::t_x_array_randomread x; - typename AT::t_v_array_randomread v; + double adof,mvv2e,mv2d,boltz; + + typename AT::t_x_array x; + typename AT::t_v_array v; + typename ArrayTypes::t_float_1d rmass; + typename ArrayTypes::t_float_1d mass; + typename ArrayTypes::t_int_1d type; typename ArrayTypes::t_int_1d mask; typename AT::t_neighbors_2d d_neighbors; - typename AT::t_int_1d_randomread d_ilist; - typename AT::t_int_1d_randomread d_numneigh; + typename AT::t_int_1d d_ilist; + typename AT::t_int_1d d_numneigh; DAT::tdual_float_2d k_result; typename AT::t_float_2d d_result; diff --git a/src/KOKKOS/pair_pace_kokkos.cpp b/src/KOKKOS/pair_pace_kokkos.cpp index 9d78b63167..4ffc971cea 100644 --- a/src/KOKKOS/pair_pace_kokkos.cpp +++ b/src/KOKKOS/pair_pace_kokkos.cpp @@ -534,8 +534,7 @@ void PairPACEKokkos::compute(int eflag_in, int vflag_in) } copymode = 1; - int newton_pair = force->newton_pair; - if (newton_pair == false) + if (!force->newton_pair) error->all(FLERR,"PairPACEKokkos requires 'newton on'"); if (recursive) diff --git a/src/KOKKOS/pair_reaxff_kokkos.cpp b/src/KOKKOS/pair_reaxff_kokkos.cpp index 7f2477adba..bb6ee0c1f1 100644 --- a/src/KOKKOS/pair_reaxff_kokkos.cpp +++ b/src/KOKKOS/pair_reaxff_kokkos.cpp @@ -2628,7 +2628,7 @@ int PairReaxFFKokkos::preprocess_angular(int i, int itype, int j_sta template template KOKKOS_INLINE_FUNCTION -int PairReaxFFKokkos::preprocess_torsion(int i, int /*itype*/, int itag, +int PairReaxFFKokkos::preprocess_torsion(int i, int /*itype*/, tagint itag, F_FLOAT xtmp, F_FLOAT ytmp, F_FLOAT ztmp, int j_start, int j_end, int location_torsion) const { // in reaxff_torsion_angles: j = i, k = j, i = k; diff --git a/src/KOKKOS/pair_reaxff_kokkos.h b/src/KOKKOS/pair_reaxff_kokkos.h index 39b323a0fe..836a2de731 100644 --- a/src/KOKKOS/pair_reaxff_kokkos.h +++ b/src/KOKKOS/pair_reaxff_kokkos.h @@ -257,7 +257,7 @@ class PairReaxFFKokkos : public PairReaxFF { // Abstraction for counting and populating torsion intermediated template KOKKOS_INLINE_FUNCTION - int preprocess_torsion(int, int, int, F_FLOAT, F_FLOAT, F_FLOAT, int, int, int) const; + int preprocess_torsion(int, int, tagint, F_FLOAT, F_FLOAT, F_FLOAT, int, int, int) const; template KOKKOS_INLINE_FUNCTION diff --git a/src/MANYBODY/pair_threebody_table.cpp b/src/MANYBODY/pair_threebody_table.cpp index 14f3c261d9..2f4bc83f5a 100644 --- a/src/MANYBODY/pair_threebody_table.cpp +++ b/src/MANYBODY/pair_threebody_table.cpp @@ -450,7 +450,7 @@ void PairThreebodyTable::read_table(Table *tb, char *file, char *keyword, bool s param_extract(tb, line); // if it is a symmetric threebody interaction, less table entries are required - if (symmetric == true) { + if (symmetric) { memory->create(tb->r12file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r12file"); memory->create(tb->r13file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r13file"); memory->create(tb->thetafile, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:thetafile"); @@ -481,7 +481,7 @@ void PairThreebodyTable::read_table(Table *tb, char *file, char *keyword, bool s int cerror = 0; reader.skip_line(); // if it is a symmetric threebody interaction, less table entries are required - if (symmetric == true) { + if (symmetric) { for (int i = 0; i < tb->ninput * tb->ninput * (tb->ninput + 1); i++) { line = reader.next_line(11); try { @@ -583,7 +583,7 @@ void PairThreebodyTable::bcast_table(Table *tb, bool symmetric) MPI_Comm_rank(world, &me); if (me > 0) { // if it is a symmetric threebody interaction, less table entries are required - if (symmetric == true) { + if (symmetric) { memory->create(tb->r12file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r12file"); memory->create(tb->r13file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r13file"); memory->create(tb->thetafile, tb->ninput * tb->ninput * (tb->ninput + 1), @@ -612,7 +612,7 @@ void PairThreebodyTable::bcast_table(Table *tb, bool symmetric) } // if it is a symmetric threebody interaction, less table entries are required - if (symmetric == true) { + if (symmetric) { MPI_Bcast(tb->r12file, tb->ninput * tb->ninput * (tb->ninput + 1), MPI_DOUBLE, 0, world); MPI_Bcast(tb->r13file, tb->ninput * tb->ninput * (tb->ninput + 1), MPI_DOUBLE, 0, world); MPI_Bcast(tb->thetafile, tb->ninput * tb->ninput * (tb->ninput + 1), MPI_DOUBLE, 0, world); @@ -697,7 +697,7 @@ void PairThreebodyTable::uf_lookup(Param *pm, double r12, double r13, double the //lookup scheme // if it is a symmetric threebody interaction, less table entries are required - if (pm->symmetric == true) { + if (pm->symmetric) { nr12 = (r12 - pm->mltable->rmin + 0.5 * dr - 0.00000001) / dr; if (r12 == (pm->mltable->rmin - 0.5 * dr)) { nr12 = 0; } nr13 = (r13 - pm->mltable->rmin + 0.5 * dr - 0.00000001) / dr; @@ -778,7 +778,7 @@ void PairThreebodyTable::threebody(Param *paramijk, double rsq1, double rsq2, do } // if the indices have been swapped, swap them back - if (swapped == true) { + if (swapped) { temp = r12; r12 = r13; r13 = temp; diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index 0adabe5eae..0a20e7adf3 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -273,7 +273,7 @@ void FixWidom::init() triclinic = domain->triclinic; - ave_widom_chemical_potential = 0; + ave_widom_chemical_potential = 0.0; if (region) volume = region_volume; else volume = domain->xprd * domain->yprd * domain->zprd; diff --git a/src/Makefile b/src/Makefile index ab8e5c4fea..649a1ad002 100644 --- a/src/Makefile +++ b/src/Makefile @@ -461,7 +461,7 @@ mpi-stubs: sinclude ../lib/python/Makefile.lammps install-python: @rm -rf ../python/build - @$(PYTHON) ../python/install.py -p ../python/lammps -l ../src/liblammps.so + @$(PYTHON) ../python/install.py -p ../python/lammps -l ../src/liblammps.so -w $(PWD) # Create a tarball of src dir and packages diff --git a/src/REAXFF/fix_acks2_reaxff.cpp b/src/REAXFF/fix_acks2_reaxff.cpp index bd93dec0b7..be71bc761f 100644 --- a/src/REAXFF/fix_acks2_reaxff.cpp +++ b/src/REAXFF/fix_acks2_reaxff.cpp @@ -94,8 +94,8 @@ FixACKS2ReaxFF::~FixACKS2ReaxFF() memory->destroy(s_hist_X); memory->destroy(s_hist_last); - deallocate_storage(); - deallocate_matrix(); + FixACKS2ReaxFF::deallocate_storage(); + FixACKS2ReaxFF::deallocate_matrix(); } /* ---------------------------------------------------------------------- */ diff --git a/src/REAXFF/fix_qeq_reaxff.cpp b/src/REAXFF/fix_qeq_reaxff.cpp index aeeee7b71a..48e93f682a 100644 --- a/src/REAXFF/fix_qeq_reaxff.cpp +++ b/src/REAXFF/fix_qeq_reaxff.cpp @@ -163,7 +163,7 @@ FixQEqReaxFF::~FixQEqReaxFF() memory->destroy(t_hist); FixQEqReaxFF::deallocate_storage(); - deallocate_matrix(); + FixQEqReaxFF::deallocate_matrix(); memory->destroy(shld); @@ -640,7 +640,7 @@ void FixQEqReaxFF::compute_H() int jnum; int i, j, ii, jj, flag; double dx, dy, dz, r_sqr; - const double SMALL = 0.0001; + constexpr double EPSILON = 0.0001; int *type = atom->type; tagint *tag = atom->tag; @@ -671,10 +671,10 @@ void FixQEqReaxFF::compute_H() if (j < atom->nlocal) flag = 1; else if (tag[i] < tag[j]) flag = 1; else if (tag[i] == tag[j]) { - if (dz > SMALL) flag = 1; - else if (fabs(dz) < SMALL) { - if (dy > SMALL) flag = 1; - else if (fabs(dy) < SMALL && dx > SMALL) + if (dz > EPSILON) flag = 1; + else if (fabs(dz) < EPSILON) { + if (dy > EPSILON) flag = 1; + else if (fabs(dy) < EPSILON && dx > EPSILON) flag = 1; } } diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index 7b3929db62..d316644e15 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -73,7 +73,6 @@ void CreateBonds::command(int narg, char **arg) iarg = 6; } else if (strcmp(arg[0], "single/bond") == 0) { style = SBOND; - if (narg < 4) error->all(FLERR, "Illegal create_bonds command"); btype = utils::inumeric(FLERR, arg[1], false, lmp); batom1 = utils::tnumeric(FLERR, arg[2], false, lmp); batom2 = utils::tnumeric(FLERR, arg[3], false, lmp); diff --git a/src/fmt/core.h b/src/fmt/core.h index 8444cd9546..2fafa777ba 100644 --- a/src/fmt/core.h +++ b/src/fmt/core.h @@ -315,7 +315,9 @@ // Enable minimal optimizations for more compact code in debug mode. FMT_GCC_PRAGMA("GCC push_options") -#ifndef __OPTIMIZE__ +// LAMMPS CUSTOMIZATION: suppress warning about pragma with KOKKOS +#if !defined(__OPTIMIZE__) && !defined(LMP_KOKKOS) +// END LAMMPS CUSTOMIZATION FMT_GCC_PRAGMA("GCC optimize(\"Og\")") #endif diff --git a/src/reader.cpp b/src/reader.cpp index c7b99260e7..025445ca24 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -28,6 +28,12 @@ Reader::Reader(LAMMPS *lmp) : Pointers(lmp) compressed = false; } +// avoid resource leak +Reader::~Reader() +{ + if (fp != nullptr) close_file(); +} + /* ---------------------------------------------------------------------- try to open given file generic version for ASCII files with optional compression or for native binary dumps diff --git a/src/reader.h b/src/reader.h index 93f9197b7a..753b6956f7 100644 --- a/src/reader.h +++ b/src/reader.h @@ -23,6 +23,7 @@ namespace LAMMPS_NS { class Reader : protected Pointers { public: Reader(class LAMMPS *); + ~Reader() override; virtual void settings(int, char **); diff --git a/tools/singularity/README.md b/tools/singularity/README.md index db7aa9e3b0..4700dac6ec 100644 --- a/tools/singularity/README.md +++ b/tools/singularity/README.md @@ -1,17 +1,19 @@ -# Singularity container definitions for compiling/testing LAMMPS +# Apptainer (aka Singularity) container definitions for compiling/testing LAMMPS The *.def files in this folder can be used to build container images -for [Singularity](https://sylabs.io), suitable for compiling and testing +for [Apptainer](https://apptainer.org) (previously called +[Singularity](https://sylabs.io)), suitable for compiling and testing LAMMPS on a variety of OS variants with support for most standard packages and - for some of them - also building/spellchecking the manual -in all supported formats. This allows to test and debug LAMMPS code on +in all supported formats. This allows to test and debug LAMMPS code on different OS variants without doing a full installation on your development workstation, e.g. when bugs are reported that can only be reproduced on a specific OS or with specific (mostly older) versions of tools, compilers, or libraries. Here is a workflow for testing a compilation of LAMMPS with a locally -built CentOS 7.x singularity container. +built CentOS 7.x Singularity container. For Apptainer replace the +`singularity` command with `apptainer`. ``` cd some/work/directory diff --git a/tools/singularity/ubuntu18.04_amd_rocm.def b/tools/singularity/ubuntu18.04_amd_rocm.def index ceedfd8144..febdf1172e 100644 --- a/tools/singularity/ubuntu18.04_amd_rocm.def +++ b/tools/singularity/ubuntu18.04_amd_rocm.def @@ -3,7 +3,7 @@ From: ubuntu:18.04 %environment export PATH=/usr/lib/ccache:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib:/opt/rocm-5.1.2/llvm/lib + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib:/opt/rocm-5.1.3/llvm/lib %post export DEBIAN_FRONTEND=noninteractive apt-get update @@ -22,10 +22,10 @@ From: ubuntu:18.04 apt install -y cmake ########################################################################### - # ROCm 5.1.2 + # ROCm 5.1.3 ########################################################################### - wget https://repo.radeon.com/amdgpu-install/22.10.2/ubuntu/bionic/amdgpu-install_22.10.2.50102-1_all.deb - apt-get install -y ./amdgpu-install_22.10.2.50102-1_all.deb + wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/bionic/amdgpu-install_22.10.3.50103-1_all.deb + apt-get install -y ./amdgpu-install_22.10.3.50103-1_all.deb apt-get update apt-get install --no-install-recommends -y \ diff --git a/tools/singularity/ubuntu18.04_gpu.def b/tools/singularity/ubuntu18.04_gpu.def index 6aa37ccf84..90034285ff 100644 --- a/tools/singularity/ubuntu18.04_gpu.def +++ b/tools/singularity/ubuntu18.04_gpu.def @@ -2,11 +2,11 @@ BootStrap: docker From: ubuntu:18.04 %environment - export PATH=/usr/lib/ccache:/usr/local/cuda-11.5/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 - export CUDADIR=/usr/local/cuda-11.5 - export CUDA_PATH=/usr/local/cuda-11.5 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.5/lib64:/opt/rocm/lib:/opt/rocm-4.5.0/llvm/lib - export LIBRARY_PATH=/usr/local/cuda-11.5/lib64/stubs + export PATH=/usr/lib/ccache:/usr/local/cuda-11.7/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 + export CUDADIR=/usr/local/cuda-11.7 + export CUDA_PATH=/usr/local/cuda-11.7 + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.7/lib64:/opt/rocm/lib:/opt/rocm-5.1.3/llvm/lib + export LIBRARY_PATH=/usr/local/cuda-11.7/lib64/stubs %post export DEBIAN_FRONTEND=noninteractive apt-get update @@ -27,8 +27,8 @@ From: ubuntu:18.04 ########################################################################### # ROCm 4.5 ########################################################################### - wget https://repo.radeon.com/amdgpu-install/21.40/ubuntu/focal/amdgpu-install-21.40.40500-1_all.deb - apt-get install -y ./amdgpu-install-21.40.40500-1_all.deb + wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/focal/amdgpu-install_22.10.3.50103-1_all.deb + apt-get install -y ./amdgpu-install_22.10.3.50103-1_all.deb apt-get update apt-get install --no-install-recommends -y \ @@ -122,11 +122,11 @@ From: ubuntu:18.04 wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 - apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" apt-get update - export CUDA_PKG_VERSION=11.5 + export CUDA_PKG_VERSION=11.7 apt-get install -y --no-install-recommends \ cuda-libraries-${CUDA_PKG_VERSION} \ diff --git a/tools/singularity/ubuntu20.04_amd_rocm.def b/tools/singularity/ubuntu20.04_amd_rocm.def index 5e351e49a8..6034014370 100644 --- a/tools/singularity/ubuntu20.04_amd_rocm.def +++ b/tools/singularity/ubuntu20.04_amd_rocm.def @@ -3,7 +3,7 @@ From: ubuntu:20.04 %environment export PATH=/usr/lib/ccache:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib:/opt/rocm-5.1.2/llvm/lib + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/rocm/lib:/opt/rocm-5.1.3/llvm/lib %post export DEBIAN_FRONTEND=noninteractive apt-get update @@ -13,10 +13,10 @@ From: ubuntu:20.04 apt-get install --no-install-recommends -y software-properties-common ########################################################################### - # ROCm 5.1.2 + # ROCm 5.1.3 ########################################################################### - wget https://repo.radeon.com/amdgpu-install/22.10.2/ubuntu/focal/amdgpu-install_22.10.2.50102-1_all.deb - apt-get install -y ./amdgpu-install_22.10.2.50102-1_all.deb + wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/focal/amdgpu-install_22.10.3.50103-1_all.deb + apt-get install -y ./amdgpu-install_22.10.3.50103-1_all.deb apt-get update apt-get install --no-install-recommends -y \ diff --git a/tools/singularity/ubuntu20.04_gpu.def b/tools/singularity/ubuntu20.04_gpu.def index 23bddeb14f..f7bab1ee9d 100644 --- a/tools/singularity/ubuntu20.04_gpu.def +++ b/tools/singularity/ubuntu20.04_gpu.def @@ -2,11 +2,11 @@ BootStrap: docker From: ubuntu:20.04 %environment - export PATH=/usr/lib/ccache:/usr/local/cuda-11.5/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 - export CUDADIR=/usr/local/cuda-11.5 - export CUDA_PATH=/usr/local/cuda-11.5 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.5/lib64:/opt/rocm/lib:/opt/rocm-4.5.0/llvm/lib - export LIBRARY_PATH=/usr/local/cuda-11.5/lib64/stubs + export PATH=/usr/lib/ccache:/usr/local/cuda-11.7/bin:${PATH}:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin/x86_64 + export CUDADIR=/usr/local/cuda-11.7 + export CUDA_PATH=/usr/local/cuda-11.7 + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.7/lib64:/opt/rocm/lib:/opt/rocm-5.1.3/llvm/lib + export LIBRARY_PATH=/usr/local/cuda-11.7/lib64/stubs %post export DEBIAN_FRONTEND=noninteractive apt-get update @@ -15,10 +15,10 @@ From: ubuntu:20.04 apt-get install -y --no-install-recommends curl wget libnuma-dev gnupg ca-certificates ########################################################################### - # ROCm 4.5 + # ROCm 5.1.3 ########################################################################### - wget https://repo.radeon.com/amdgpu-install/21.40/ubuntu/focal/amdgpu-install-21.40.40500-1_all.deb - apt-get install -y ./amdgpu-install-21.40.40500-1_all.deb + wget https://repo.radeon.com/amdgpu-install/22.10.3/ubuntu/focal/amdgpu-install_22.10.3.50103-1_all.deb + apt-get install -y ./amdgpu-install_22.10.3.50103-1_all.deb apt-get update apt-get install --no-install-recommends -y \ @@ -109,7 +109,7 @@ From: ubuntu:20.04 wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 - apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub + apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" apt-get update diff --git a/tools/valgrind/OpenMP.supp b/tools/valgrind/OpenMP.supp index e1870e668c..15531fa8ec 100644 --- a/tools/valgrind/OpenMP.supp +++ b/tools/valgrind/OpenMP.supp @@ -134,3 +134,31 @@ fun:GOMP_parallel obj:* } +{ + OpnMP_open_part1 + Memcheck:Leak + match-leak-kinds: reachable + fun:malloc + ... + fun:openaux + ... + fun:dl_open_worker_begin + ... + fun:dl_open_worker + ... + fun:_dl_open +} +{ + OpnMP_open_part2 + Memcheck:Leak + match-leak-kinds: reachable + fun:calloc + ... + fun:openaux + ... + fun:dl_open_worker_begin + ... + fun:dl_open_worker + ... + fun:_dl_open +} diff --git a/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml b/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml index b8eae7848b..7229a3cd26 100644 --- a/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml +++ b/unittest/force-styles/tests/atomic-pair-sw_angle_table.yaml @@ -1,6 +1,5 @@ --- lammps_version: 4 May 2022 -tags: generated date_generated: Wed Jun 1 15:17:22 2022 epsilon: 1e-12 skip_tests: single diff --git a/unittest/force-styles/tests/atomic-pair-threebody_table.yaml b/unittest/force-styles/tests/atomic-pair-threebody_table.yaml index 605f18a9a6..bb3c8c1c1b 100644 --- a/unittest/force-styles/tests/atomic-pair-threebody_table.yaml +++ b/unittest/force-styles/tests/atomic-pair-threebody_table.yaml @@ -1,6 +1,5 @@ --- lammps_version: 4 May 2022 -tags: generated date_generated: Wed Jun 1 15:28:13 2022 epsilon: 1e-05 skip_tests: single diff --git a/unittest/force-styles/tests/manybody-pair-pace_product.yaml b/unittest/force-styles/tests/manybody-pair-pace_product.yaml index 9aac9ddcae..1e82029777 100644 --- a/unittest/force-styles/tests/manybody-pair-pace_product.yaml +++ b/unittest/force-styles/tests/manybody-pair-pace_product.yaml @@ -1,7 +1,7 @@ --- lammps_version: 17 Feb 2022 date_generated: Fri Mar 18 22:17:48 2022 -epsilon: 5e-13 +epsilon: 1e-12 skip_tests: prerequisites: ! | pair pace diff --git a/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml b/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml index eef7509606..f20440c85d 100644 --- a/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml +++ b/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml @@ -1,7 +1,7 @@ --- lammps_version: 10 Mar 2021 date_generated: Wed Apr 7 19:30:07 2021 -epsilon: 5e-13 +epsilon: 1e-12 prerequisites: ! | pair pace pre_commands: ! |