diff --git a/.gitattributes b/.gitattributes index f81d32a235..77eb7f93f3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,6 +3,7 @@ .github export-ignore .lgtm.yml export-ignore SECURITY.md export-ignore +CITATION.cff export-ignore * text=auto *.jpg -text *.pdf -text diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ba702784f4..4e8803fc5a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -13,20 +13,21 @@ lib/kim/* @ellio167 lib/mesont/* @iafoss # whole packages +src/AMOEBA/* @sjplimp src/COMPRESS/* @rbberger src/GPU/* @ndtrung81 src/KOKKOS/* @stanmoore1 src/KIM/* @ellio167 src/LATTE/* @cnegre -src/MESSAGE/* @sjplimp src/MLIAP/* @athomps src/SNAP/* @athomps src/SPIN/* @julient31 src/BROWNIAN/* @samueljmcameron src/CG-DNA/* @ohenrich -src/CG-SDK/* @akohlmey +src/CG-SPICA/* @yskmiyazaki src/COLVARS/* @giacomofiorin src/DIELECTRIC/* @ndtrung81 +src/ELECTRODE/* @ludwig-ahrens src/FEP/* @agiliopadua src/ML-HDNNP/* @singraber src/INTEL/* @wmbrownintel @@ -133,6 +134,7 @@ tools/coding_standard/* @rbberger tools/valgrind/* @akohlmey tools/swig/* @akohlmey tools/offline/* @rbberger +tools/vim/* @hammondkd # tests unittest/* @akohlmey @rbberger diff --git a/.github/codecov.yml b/.github/codecov.yml index 4645f52f7f..3c4ff888a4 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -7,7 +7,7 @@ coverage: threshold: 10% only_pulls: false branches: - - "master" + - "develop" flags: - "unit" paths: @@ -16,14 +16,14 @@ coverage: project: default: branches: - - "master" + - "develop" paths: - "src" informational: true patch: default: branches: - - "master" + - "develop" paths: - "src" informational: true diff --git a/.github/workflows/compile-msvc.yml b/.github/workflows/compile-msvc.yml index 7747be7b46..3ec5fc4cb0 100644 --- a/.github/workflows/compile-msvc.yml +++ b/.github/workflows/compile-msvc.yml @@ -3,7 +3,11 @@ name: "Native Windows Compilation and Unit Tests" on: push: - branches: [develop] + branches: + - develop + pull_request: + branches: + - develop workflow_dispatch: diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml new file mode 100644 index 0000000000..7bda3a071f --- /dev/null +++ b/.github/workflows/coverity.yml @@ -0,0 +1,103 @@ +name: "Run Coverity Scan" + +on: + schedule: + - cron: "0 0 * * FRI" + + workflow_dispatch: + +jobs: + analyze: + name: Analyze + if: ${{ github.repository == 'lammps/lammps' }} + runs-on: ubuntu-latest + container: + image: lammps/buildenv:ubuntu20.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - name: Create Build and Download Folder + run: mkdir build download + + - name: Cache Coverity + id: cache-coverity + uses: actions/cache@v3 + with: + path: ./download/ + key: ${{ runner.os }}-download-${{ hashFiles('**/coverity_tool.*') }} + + - name: Download Coverity if necessary + if: steps.cache-coverity.outputs.cache-hit != 'true' + working-directory: download + run: | + wget -nv https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_TOKEN }}&project=LAMMPS" -O coverity_tool.tgz + wget -nv https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_TOKEN }}&project=LAMMPS&md5=1" -O coverity_tool.md5 + echo " coverity_tool.tgz" >> coverity_tool.md5 + md5sum -c coverity_tool.md5 + + - name: Setup Coverity + run: | + tar xzf download/coverity_tool.tgz + ln -s cov-analysis-linux64-* coverity + + - name: Configure LAMMPS via CMake + shell: bash + working-directory: build + run: | + cmake \ + -C ../cmake/presets/clang.cmake \ + -C ../cmake/presets/most.cmake \ + -C ../cmake/presets/kokkos-openmp.cmake \ + -D CMAKE_BUILD_TYPE="RelWithDebug" \ + -D CMAKE_TUNE_FLAGS="-Wall -Wextra -Wno-unused-result" \ + -D BUILD_MPI=on \ + -D BUILD_OMP=on \ + -D BUILD_SHARED_LIBS=on \ + -D LAMMPS_SIZES=SMALLBIG \ + -D LAMMPS_EXCEPTIONS=off \ + -D PKG_MESSAGE=on \ + -D PKG_MPIIO=on \ + -D PKG_ATC=on \ + -D PKG_AWPMD=on \ + -D PKG_BOCS=on \ + -D PKG_EFF=on \ + -D PKG_H5MD=on \ + -D PKG_INTEL=on \ + -D PKG_LATBOLTZ=on \ + -D PKG_MANIFOLD=on \ + -D PKG_MGPT=on \ + -D PKG_ML-PACE=on \ + -D PKG_ML-RANN=on \ + -D PKG_MOLFILE=on \ + -D PKG_NETCDF=on \ + -D PKG_PTM=on \ + -D PKG_QTB=on \ + -D PKG_SMTBQ=on \ + -D PKG_TALLY=on \ + ../cmake + + - name: Run Coverity Scan + shell: bash + working-directory: build + run: | + export PATH=$GITHUB_WORKSPACE/coverity/bin:$PATH + cov-build --dir cov-int cmake --build . --parallel 2 + + - name: Create tarball with scan results + shell: bash + working-directory: build + run: tar czf lammps.tgz cov-int + + - name: Upload scan result to Coverity + shell: bash + run: | + curl --form token=${{ secrets.COVERITY_TOKEN }} \ + --form email=${{ secrets.COVERITY_EMAIL }} \ + --form file=@build/lammps.tgz \ + --form version=${{ github.sha }} \ + --form description="LAMMPS automated build" \ + https://scan.coverity.com/builds?project=LAMMPS diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index e6e5ccfdc8..2d29eac83e 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -3,7 +3,11 @@ name: "Unittest for MacOS" on: push: - branches: [develop] + branches: + - develop + pull_request: + branches: + - develop workflow_dispatch: @@ -39,6 +43,7 @@ jobs: working-directory: build run: | ccache -z + python3 -m pip install numpy python3 -m pip install pyyaml cmake -C ../cmake/presets/clang.cmake \ -C ../cmake/presets/most.cmake \ diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000000..a8712ddcf2 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,91 @@ +# YAML 1.2 +--- +cff-version: 1.2.0 +title: "LAMMPS: Large-scale Atomic/Molecular Massively Parallel Simulator" +type: software +authors: + - family-names: "Plimpton" + given-names: "Steven J." + - family-names: "Kohlmeyer" + given-names: "Axel" + orcid: "https://orcid.org/0000-0001-6204-6475" + - family-names: "Thompson" + given-names: "Aidan P." + orcid: "https://orcid.org/0000-0002-0324-9114" + - family-names: "Moore" + given-names: "Stan G." + - family-names: "Berger" + given-names: "Richard" + orcid: "https://orcid.org/0000-0002-3044-8266" +doi: 10.5281/zenodo.3726416 +license: GPL-2.0-only +url: https://www.lammps.org +repository-code: https://github.com/lammps/lammps/ +keywords: + - "Molecular Dynamics" + - "Materials Modeling" +message: "If you are referencing LAMMPS in a publication, please cite the paper below." +preferred-citation: + type: article + doi: "10.1016/j.cpc.2021.108171" + url: "https://www.sciencedirect.com/science/article/pii/S0010465521002836" + authors: + - family-names: "Thompson" + given-names: "Aidan P." + orcid: "https://orcid.org/0000-0002-0324-9114" + - family-names: "Aktulga" + given-names: "H. Metin" + - family-names: "Berger" + given-names: "Richard" + orcid: "https://orcid.org/0000-0002-3044-8266" + - family-names: "Bolintineanu" + given-names: "Dan S." + - family-names: "Brown" + given-names: "W. Michael" + - family-names: "Crozier" + given-names: "Paul S." + - family-names: "in 't Veld" + given-names: "Pieter J." + - family-names: "Kohlmeyer" + given-names: "Axel" + orcid: "https://orcid.org/0000-0001-6204-6475" + - family-names: "Moore" + given-names: "Stan G." + - family-names: "Nguyen" + given-names: "Trung Dac" + - family-names: "Shan" + given-names: "Ray" + - family-names: "Stevens" + given-names: "Mark J." + - family-names: "Tranchida" + given-names: "Julien" + - family-names: "Trott" + given-names: "Christian" + - family-names: "Plimpton" + given-names: "Steven J." + title: "LAMMPS - a flexible simulation tool for particle-based materials modeling at the atomic, meso, and continuum scales" + journal: "Computer Physics Communications" + keywords: + - Molecular dynamics + - Materials modeling + - Parallel algorithms + - LAMMPS + month: 2 + volume: 271 + issn: 0010-4655 + pages: 108171 + year: 2022 +references: + - title: "Fast Parallel Algorithms for Short-Range Molecular Dynamics" + type: article + journal: Journal of Computational Physics + volume: 117 + number: 1 + pages: "1-19" + year: 1995 + issn: 0021-9991 + doi: 10.1006/jcph.1995.1039 + url: https://www.sciencedirect.com/science/article/pii/S002199918571039X + authors: + - family-names: "Plimpton" + given-names: "Steve" diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index d4dcdcff88..aaa0885072 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -135,13 +135,11 @@ 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) - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")) add_compile_options(/Zc:__cplusplus) add_compile_options(/wd4244) add_compile_options(/wd4267) - if(LAMMPS_EXCEPTIONS) - add_compile_options(/EHsc) - endif() + add_compile_options(/EHsc) endif() add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() diff --git a/cmake/Modules/LAMMPSUtils.cmake b/cmake/Modules/LAMMPSUtils.cmake index 9f624fc007..9b75209e16 100644 --- a/cmake/Modules/LAMMPSUtils.cmake +++ b/cmake/Modules/LAMMPSUtils.cmake @@ -110,14 +110,16 @@ function(FetchPotentials pkgfolder potfolder) math(EXPR plusone "${blank}+1") string(SUBSTRING ${line} 0 ${blank} pot) string(SUBSTRING ${line} ${plusone} -1 sum) - if(EXISTS ${LAMMPS_POTENTIALS_DIR}/${pot}) + if(EXISTS "${LAMMPS_POTENTIALS_DIR}/${pot}") file(MD5 "${LAMMPS_POTENTIALS_DIR}/${pot}" oldsum) endif() if(NOT sum STREQUAL oldsum) - message(STATUS "Checking external potential ${pot} from ${LAMMPS_POTENTIALS_URL}") - file(DOWNLOAD "${LAMMPS_POTENTIALS_URL}/${pot}.${sum}" "${CMAKE_BINARY_DIR}/${pot}" + message(STATUS "Downloading external potential ${pot} from ${LAMMPS_POTENTIALS_URL}") + string(MD5 TMP_EXT "${CMAKE_BINARY_DIR}") + file(DOWNLOAD "${LAMMPS_POTENTIALS_URL}/${pot}.${sum}" "${CMAKE_BINARY_DIR}/${pot}.${TMP_EXT}" EXPECTED_HASH MD5=${sum} SHOW_PROGRESS) - file(COPY "${CMAKE_BINARY_DIR}/${pot}" DESTINATION ${LAMMPS_POTENTIALS_DIR}) + file(COPY "${CMAKE_BINARY_DIR}/${pot}.${TMP_EXT}" DESTINATION "${LAMMPS_POTENTIALS_DIR}") + file(RENAME "${LAMMPS_POTENTIALS_DIR}/${pot}.${TMP_EXT}" "${LAMMPS_POTENTIALS_DIR}/${pot}") endif() endforeach() endif() diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 75569aa55d..243b5111de 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -233,7 +233,8 @@ elseif(GPU_API STREQUAL "OPENCL") elseif(GPU_API STREQUAL "HIP") if(NOT DEFINED HIP_PATH) if(NOT DEFINED ENV{HIP_PATH}) - set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to HIP installation") + message(FATAL_ERROR "GPU_API=HIP requires HIP_PATH to be defined.\n" + "Either pass the HIP_PATH as a CMake option via -DHIP_PATH=... or set the HIP_PATH environment variable.") else() set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to HIP installation") endif() @@ -261,6 +262,8 @@ elseif(GPU_API STREQUAL "HIP") if(HIP_PLATFORM STREQUAL "hcc" OR HIP_PLATFORM STREQUAL "amd") set(HIP_ARCH "gfx906" CACHE STRING "HIP target architecture") + elseif(HIP_PLATFORM STREQUAL "spirv") + set(HIP_ARCH "spirv" CACHE STRING "HIP target architecture") elseif(HIP_PLATFORM STREQUAL "nvcc") find_package(CUDA REQUIRED) set(HIP_ARCH "sm_50" CACHE STRING "HIP primary CUDA architecture (e.g. sm_60)") @@ -340,7 +343,14 @@ elseif(GPU_API STREQUAL "HIP") VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} --fatbin --use_fast_math -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} ${HIP_CUDA_GENCODE} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_FILE} DEPENDS ${CU_FILE} COMMENT "Generating ${CU_NAME}.cubin") - endif() + elseif(HIP_PLATFORM STREQUAL "spirv") + configure_file(${CU_FILE} ${CU_CPP_FILE} COPYONLY) + + add_custom_command(OUTPUT ${CUBIN_FILE} + VERBATIM COMMAND ${HIP_HIPCC_EXECUTABLE} -c -O3 -DUSE_HIP -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES} -I${LAMMPS_LIB_SOURCE_DIR}/gpu -o ${CUBIN_FILE} ${CU_CPP_FILE} + DEPENDS ${CU_CPP_FILE} + COMMENT "Gerating ${CU_NAME}.cubin") + endif() add_custom_command(OUTPUT ${CUBIN_H_FILE} COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D VARNAME=${CU_NAME} -D HEADER_FILE=${CUBIN_H_FILE} -D SOURCE_FILE=${CUBIN_FILE} -P ${CMAKE_CURRENT_SOURCE_DIR}/Modules/GenerateBinaryHeader.cmake diff --git a/doc/Makefile b/doc/Makefile index 8841ae4825..4bbc252fb6 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -242,7 +242,6 @@ $(MATHJAX): $(ANCHORCHECK): $(VENV) @( \ . $(VENV)/bin/activate; \ - (cd utils/converters;\ - python setup.py develop);\ + pip $(PIP_OPTIONS) install -e utils/converters;\ deactivate;\ ) diff --git a/doc/lammps.1 b/doc/lammps.1 index 5f1c25867e..f1a3d0f2f9 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,7 +1,7 @@ -.TH LAMMPS "1" "23 June 2022" "2022-6-23" +.TH LAMMPS "1" "3 August 2022" "2022-8-3" .SH NAME .B LAMMPS -\- Molecular Dynamics Simulator. Version 23 June 2022 +\- Molecular Dynamics Simulator. Version 3 August 2022 .SH SYNOPSIS .B lmp @@ -161,7 +161,7 @@ list references for specific cite-able features used during a run. .TP \fB\-pk