From 53914162a7240bc9f3d7f292448c4105b1109ce2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 1 Oct 2024 00:24:40 -0400 Subject: [PATCH 1/7] rename log file to match expected naming scheme --- examples/nemd/{log.30Sep24.g++.1 => log.30Sep24.nemd.g++.1} | 0 examples/nemd/{log.30Sep24.g++.4 => log.30Sep24.nemd.g++.4} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename examples/nemd/{log.30Sep24.g++.1 => log.30Sep24.nemd.g++.1} (100%) rename examples/nemd/{log.30Sep24.g++.4 => log.30Sep24.nemd.g++.4} (100%) diff --git a/examples/nemd/log.30Sep24.g++.1 b/examples/nemd/log.30Sep24.nemd.g++.1 similarity index 100% rename from examples/nemd/log.30Sep24.g++.1 rename to examples/nemd/log.30Sep24.nemd.g++.1 diff --git a/examples/nemd/log.30Sep24.g++.4 b/examples/nemd/log.30Sep24.nemd.g++.4 similarity index 100% rename from examples/nemd/log.30Sep24.g++.4 rename to examples/nemd/log.30Sep24.nemd.g++.4 From 0f8b8254245590b393ab38ad45fdd4aa40d26a0d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 2 Oct 2024 19:43:43 -0400 Subject: [PATCH 2/7] fix up spelling issues in CTIP --- doc/src/pair_coul.rst | 25 +++++++++++---------- doc/utils/sphinx-config/false_positives.txt | 2 ++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/doc/src/pair_coul.rst b/doc/src/pair_coul.rst index cccdd466945..17e93587540 100644 --- a/doc/src/pair_coul.rst +++ b/doc/src/pair_coul.rst @@ -182,16 +182,17 @@ coulomb styles in :doc:`hybrid pair styles `. .. versionadded:: TBD -Style *coul/ctip* computes the Coulomb interations as described in +Style *coul/ctip* computes the Coulomb interactions as described in :ref:`Plummer `. It uses the the damped shifted model as in -style *coul/dsf* but is further extended to the second derivative of -the potential and incorporates empirical charge shielding meant to -approximate the more expensive Coulomb integrals used in style *coul/streitz*. -More details can be found in the referenced paper. Like the style *coul/streitz*, -style *coul/ctip* is a variable charge potential and must be hybridized -with a short-range potential via the :doc:`pair_style hybrid/overlay ` -command. Charge equilibration must be performed with the :doc:`fix qeq/ctip -` command. For example: +style *coul/dsf* but is further extended to the second derivative of the +potential and incorporates empirical charge shielding meant to +approximate the more expensive Coulomb integrals used in style +*coul/streitz*. More details can be found in the referenced paper. Like +the style *coul/streitz*, style *coul/ctip* is a variable charge +potential and must be hybridized with a short-range potential via the +:doc:`pair_style hybrid/overlay ` command. Charge +equilibration must be performed with the :doc:`fix qeq/ctip ` +command. For example: .. code-block:: LAMMPS @@ -200,9 +201,9 @@ command. Charge equilibration must be performed with the :doc:`fix qeq/ctip pair_coeff * * coul/ctip NiO.ctip Ni O fix 1 all qeq/ctip 1 12.0 1.0e-8 100 coul/ctip cdamp 0.30 maxrepeat 10 -See the examples/ctip directory for an example input script using the CTIP -potential. An Ni-O CTIP and EAM/FS parametrization are included for use with -the example. +See the examples/ctip directory for an example input script using the +CTIP potential. An Ni-O CTIP and EAM/FS parameterization are included +for use with the example. ---------- diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 70d6b4e3232..2754e4bb1ca 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -639,6 +639,7 @@ cstyle csvr ctest ctilde +ctip ctrl ctrn ctypes @@ -3664,6 +3665,7 @@ Tanmoy Tartakovsky taskset taubi +Tavenner taylor tb tchain From 7e02951fc4d152e41501987b44717830ff9fd101 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 2 Oct 2024 21:48:54 -0400 Subject: [PATCH 3/7] disable making functions in libfmt consteval with C++20 and beyond --- src/fmt/core.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/fmt/core.h b/src/fmt/core.h index 6a53b8c52c0..8515f57ff0a 100644 --- a/src/fmt/core.h +++ b/src/fmt/core.h @@ -219,7 +219,15 @@ # define FMT_UNICODE !FMT_MSC_VERSION #endif +// LAMMPS customization. +// Our use of libfmt is not compatible with making its calls consteval. +// Revise this customization (and the corresponding code) after we have +// updated the minimum C++ standard requirement to C++20. #ifndef FMT_CONSTEVAL +# define FMT_CONSTEVAL +#endif + +#if 0 // FMT_CONSTEVAL # if ((FMT_GCC_VERSION >= 1000 || FMT_CLANG_VERSION >= 1101) && \ (!defined(__apple_build_version__) || \ __apple_build_version__ >= 14000029L) && \ From e4aedfda8529f5739840fbc470e401cf947244a4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 2 Oct 2024 21:56:15 -0400 Subject: [PATCH 4/7] add test for C++20 compatibility --- .github/workflows/check-cpp20.yml | 92 +++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 .github/workflows/check-cpp20.yml diff --git a/.github/workflows/check-cpp20.yml b/.github/workflows/check-cpp20.yml new file mode 100644 index 00000000000..d9dd7754b09 --- /dev/null +++ b/.github/workflows/check-cpp20.yml @@ -0,0 +1,92 @@ +# GitHub action to build LAMMPS on Linux with gcc and C++20 +name: "Check for C++20 Compatibility" + +on: + push: + branches: + - develop + pull_request: + branches: + - develop + + workflow_dispatch: + +jobs: + build: + name: Build with C++20 support enabled + if: ${{ github.repository == 'lammps/lammps' }} + runs-on: ubuntu-latest + env: + CCACHE_DIR: ${{ github.workspace }}/.ccache + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Install extra packages + run: | + sudo apt-get update + sudo apt-get install -y ccache \ + libeigen3-dev \ + libcurl4-openssl-dev \ + mold \ + mpi-default-bin \ + mpi-default-dev \ + ninja-build \ + python3-dev + + - name: Create Build Environment + run: mkdir build + + - name: Set up ccache + uses: actions/cache@v4 + with: + path: ${{ env.CCACHE_DIR }} + key: linux-cpp20-ccache-${{ github.sha }} + restore-keys: linux-cpp20-ccache- + + - name: Building LAMMPS via CMake + shell: bash + run: | + ccache -z + python3 -m venv linuxenv + source linuxenv/bin/activate + python3 -m pip install numpy + python3 -m pip install pyyaml + cmake -S cmake -B build \ + -C cmake/presets/most.cmake \ + -C cmake/presets/kokkos-openmp.cmake \ + -D CMAKE_CXX_COMPILER=g++ \ + -D CMAKE_C_COMPILER=gcc \ + -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -D CMAKE_C_COMPILER_LAUNCHER=ccache \ + -D CMAKE_BUILD_TYPE=Debug \ + -D CMAKE_CXX_FLAGS_DEBUG="-Og -g" \ + -D CMAKE_CXX_STANDARD=20 \ + -D DOWNLOAD_POTENTIALS=off \ + -D BUILD_MPI=on \ + -D BUILD_SHARED_LIBS=on \ + -D BUILD_TOOLS=off \ + -D ENABLE_TESTING=off \ + -D MLIAP_ENABLE_ACE=on \ + -D MLIAP_ENABLE_PYTHON=off \ + -D PKG_AWPMD=on \ + -D PKG_GPU=on \ + -D GPU_API=opencl \ + -D PKG_KOKKOS=on \ + -D PKG_LATBOLTZ=on \ + -D PKG_MDI=on \ + -D PKG_MANIFOLD=on \ + -D PKG_ML-PACE=on \ + -D PKG_ML-RANN=off \ + -D PKG_MOLFILE=on \ + -D PKG_RHEO=on \ + -D PKG_PTM=on \ + -D PKG_PYTHON=on \ + -D PKG_QTB=on \ + -D PKG_SMTBQ=on \ + -G Ninja + cmake --build build + ccache -s From adebe773d0f546a74e3dec5c45111b4019338082 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 3 Oct 2024 07:26:04 -0400 Subject: [PATCH 5/7] bump check to C++23 and rename workflow file --- .../workflows/{check-cpp20.yml => check-cpp23.yml} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename .github/workflows/{check-cpp20.yml => check-cpp23.yml} (89%) diff --git a/.github/workflows/check-cpp20.yml b/.github/workflows/check-cpp23.yml similarity index 89% rename from .github/workflows/check-cpp20.yml rename to .github/workflows/check-cpp23.yml index d9dd7754b09..2cd53f2208f 100644 --- a/.github/workflows/check-cpp20.yml +++ b/.github/workflows/check-cpp23.yml @@ -1,5 +1,5 @@ -# GitHub action to build LAMMPS on Linux with gcc and C++20 -name: "Check for C++20 Compatibility" +# GitHub action to build LAMMPS on Linux with gcc and C++23 +name: "Check for C++23 Compatibility" on: push: @@ -13,7 +13,7 @@ on: jobs: build: - name: Build with C++20 support enabled + name: Build with C++23 support enabled if: ${{ github.repository == 'lammps/lammps' }} runs-on: ubuntu-latest env: @@ -44,8 +44,8 @@ jobs: uses: actions/cache@v4 with: path: ${{ env.CCACHE_DIR }} - key: linux-cpp20-ccache-${{ github.sha }} - restore-keys: linux-cpp20-ccache- + key: linux-cpp23-ccache-${{ github.sha }} + restore-keys: linux-cpp23-ccache- - name: Building LAMMPS via CMake shell: bash @@ -58,13 +58,13 @@ jobs: cmake -S cmake -B build \ -C cmake/presets/most.cmake \ -C cmake/presets/kokkos-openmp.cmake \ + -D CMAKE_CXX_STANDARD=23 \ -D CMAKE_CXX_COMPILER=g++ \ -D CMAKE_C_COMPILER=gcc \ -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ -D CMAKE_C_COMPILER_LAUNCHER=ccache \ -D CMAKE_BUILD_TYPE=Debug \ -D CMAKE_CXX_FLAGS_DEBUG="-Og -g" \ - -D CMAKE_CXX_STANDARD=20 \ -D DOWNLOAD_POTENTIALS=off \ -D BUILD_MPI=on \ -D BUILD_SHARED_LIBS=on \ From a9dd61f62e10685267828abd1bf8753d93175e32 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 3 Oct 2024 07:38:44 -0400 Subject: [PATCH 6/7] detect C++23 standard --- src/platform.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platform.cpp b/src/platform.cpp index efed301db77..71b2035c81a 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -314,8 +314,10 @@ std::string platform::os_info() std::string platform::cxx_standard() { -#if __cplusplus > 202002L - return "newer than C++20"; +#if __cplusplus > 202302L + return "newer than C++23"; +#elif __cplusplus == 202302L + return "C++23"; #elif __cplusplus == 202002L return "C++20"; #elif __cplusplus == 201703L From 4ee07bcdafdeddb31a7842e823f5b2c5e06250db Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 3 Oct 2024 11:54:26 -0600 Subject: [PATCH 7/7] Recreate dump file for MS-MEAM due to changes to the code. --- examples/meam/msmeam/README.md | 4 ++-- examples/meam/msmeam/dump.msmeam.bu | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/meam/msmeam/README.md b/examples/meam/msmeam/README.md index dbf569d4b3f..a21e35aa128 100644 --- a/examples/meam/msmeam/README.md +++ b/examples/meam/msmeam/README.md @@ -1,8 +1,8 @@ -To run Baske's test, do +To run this test, do lmp -in in.msmeam -Then +Then: diff dump.msmeam dump.msmeam.bu diff --git a/examples/meam/msmeam/dump.msmeam.bu b/examples/meam/msmeam/dump.msmeam.bu index 039f6300731..45d17a5228f 100644 --- a/examples/meam/msmeam/dump.msmeam.bu +++ b/examples/meam/msmeam/dump.msmeam.bu @@ -3,22 +3,22 @@ ITEM: TIMESTEP ITEM: NUMBER OF ATOMS 3 ITEM: BOX BOUNDS pp pp pp --4 4 --4 4 --4 4 -ITEM: ATOMS id x y z fx fy fz c_pot_energy c_stress[1] c_stress[2] c_stress[3] c_stress[4] c_stress[5] c_stress[6] -1 0 0 0 -131.925 -88.3005 0 22.9153 -2.147e+08 -1.62661e+08 -0 -2.05301e+07 -0 -0 -2 2.2 0 0 120.809 -0.482171 0 14.7692 -2.12028e+08 -0 -0 403352 -0 -0 -3 0.3 2.3 0 11.1159 88.7827 0 8.61478 -2.67145e+06 -1.62661e+08 -0 -2.09335e+07 -0 -0 +-4.0000000000000000e+00 4.0000000000000000e+00 +-4.0000000000000000e+00 4.0000000000000000e+00 +-4.0000000000000000e+00 4.0000000000000000e+00 +ITEM: ATOMS id x y z fx fy fz c_pot_energy c_stress[1] c_stress[2] c_stress[3] c_stress[4] c_stress[5] c_stress[6] +1 0 0 0 -131.977 -88.3322 0 22.9236 -2.14786e+08 -1.62719e+08 -0 -2.05378e+07 -0 -0 +2 2.2 0 0 120.857 -0.482171 0 14.7745 -2.12113e+08 -0 -0 403352 -0 -0 +3 0.3 2.3 0 11.1201 88.8144 0 8.61773 -2.67245e+06 -1.62719e+08 -0 -2.09411e+07 -0 -0 ITEM: TIMESTEP 1 ITEM: NUMBER OF ATOMS 3 ITEM: BOX BOUNDS pp pp pp --4 4 --4 4 --4 4 -ITEM: ATOMS id x y z fx fy fz c_pot_energy c_stress[1] c_stress[2] c_stress[3] c_stress[4] c_stress[5] c_stress[6] -1 0 0 0 -131.925 -88.3005 0 22.9153 -2.147e+08 -1.62661e+08 -0 -2.05301e+07 -0 -0 -2 2.2 0 0 120.809 -0.482171 0 14.7692 -2.12028e+08 -0 -0 403352 -0 -0 -3 0.3 2.3 0 11.1159 88.7827 0 8.61478 -2.67145e+06 -1.62661e+08 -0 -2.09335e+07 -0 -0 +-4.0000000000000000e+00 4.0000000000000000e+00 +-4.0000000000000000e+00 4.0000000000000000e+00 +-4.0000000000000000e+00 4.0000000000000000e+00 +ITEM: ATOMS id x y z fx fy fz c_pot_energy c_stress[1] c_stress[2] c_stress[3] c_stress[4] c_stress[5] c_stress[6] +1 0 0 0 -131.977 -88.3322 0 22.9236 -2.14786e+08 -1.62719e+08 -0 -2.05378e+07 -0 -0 +2 2.2 0 0 120.857 -0.482171 0 14.7745 -2.12113e+08 -0 -0 403352 -0 -0 +3 0.3 2.3 0 11.1201 88.8144 0 8.61773 -2.67245e+06 -1.62719e+08 -0 -2.09411e+07 -0 -0