diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index f0326c685e9..19d40100ea8 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -245,6 +245,10 @@ lammps/ 5. **Documentation:** All new commands or features must be documented. Put `.. versionadded:: TBD` or `.. versionchanged:: TBD` in front of paragraphs documenting the new or changed functionality. The `TBD` will be manually replaced with the release version string during the release preparation. + This does not apply when the change is only adding an accelerated version of an existing style. + Instead the corresponding code letter should be added to the respective Commands_\*.rst file. + Also the documentation should pass running "make check" in the doc folder without any + output indicating non-ASCII characters, missing entries, or duplicate anchors. ### Testing diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 1254ee9f126..af12ad24fc0 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -867,6 +867,14 @@ else() ${CMAKE_COMMAND} -E echo "Must build LAMMPS as a shared library to use the Python module") endif() +############################################################################### +# Create tarball for download with html and PDF version of manual included +############################################################################### +add_custom_target(tarball + COMMAND ${LAMMPS_DIR}/cmake/packaging/build_tarball.sh ${LAMMPS_DIR}/doc +) + + include(Testing) include(CodeCoverage) include(CodingStandard) diff --git a/cmake/packaging/build_tarball.sh b/cmake/packaging/build_tarball.sh new file mode 100755 index 00000000000..41799429ceb --- /dev/null +++ b/cmake/packaging/build_tarball.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -euo pipefail + +APP_NAME=lammps +DOCDIR="$1" +DESTDIR="${PWD}" + +echo "Delete tar files, if they exist" +rm -rvf "${PWD}"/lammps-src-*.tar.gz +pushd "${DOCDIR}/.." +VERSION=$(grep LAMMPS_VERSION src/version.h | sed 's/^.*LAMMPS_VERSION //' | tr -d \" | tr -d \ ) +TARNAME=lammps-src-${VERSION}.tar +TARPATH="${DESTDIR}/${TARNAME}" +git archive --output="${TARPATH}" --prefix=lammps-${VERSION}/ HEAD + +cd "${DOCDIR}" +make clean-all +make html pdf +rm html/index.html +cp html/Manual.html html/index.html +tar -rf "${TARPATH}" --owner=root --group=root --transform "s,^,lammps-${VERSION}/doc/," html Manual.pdf +popd +gzip -9v "${TARNAME}" +exit 0 diff --git a/cmake/packaging/org.lammps.lammps-gui.yml b/cmake/packaging/org.lammps.lammps-gui.yml index b63b2403873..0502b436b6c 100644 --- a/cmake/packaging/org.lammps.lammps-gui.yml +++ b/cmake/packaging/org.lammps.lammps-gui.yml @@ -61,6 +61,7 @@ modules: - -D PKG_EXTRA-MOLECULE=yes - -D PKG_EXTRA-PAIR=yes - -D PKG_FEP=yes + - -D PKG_GRAPHICS=yes - -D PKG_GRANULAR=yes - -D PKG_GPU=yes - -D GPU_API=opencl diff --git a/doc/Makefile b/doc/Makefile index 4aa573b4612..75ce99b1d97 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -52,7 +52,7 @@ SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocess # we only want to use explicitly listed files. DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//') -.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check style_check char_check link_check role_check xmlgen fasthtml fasthtml-init +.PHONY: help clean-all clean clean-spelling epub mobi html pdf spelling anchor_check style_check char_check link_check role_check xmlgen fasthtml fasthtml-init check FASTHTMLFILES = $(patsubst $(RSTDIR)/%.rst,fasthtml/%.html,$(wildcard $(RSTDIR)/*rst)) # ------------------------------------------ @@ -69,6 +69,7 @@ help: @echo " upgrade upgrade sphinx, extensions, and dependencies to latest supported versions" @echo " clean remove all intermediate files" @echo " clean-all reset the entire build environment" + @echo " check run 'anchor_check', 'style_check', 'package_check', 'char_check', and 'role_check'" @echo " anchor_check scan for duplicate anchor labels" @echo " style_check check for complete and consistent style lists" @echo " package_check check for complete and consistent package lists" @@ -236,6 +237,8 @@ pdf: xmlgen globbed-tocs $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) @rm -rf latex/PDF/.[sg]* @echo "Build finished. Manual.pdf is in this directory." +check : anchor_check style_check package_check char_check role_check + anchor_check : $(ANCHORCHECK) @(\ . $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \ diff --git a/doc/src/Build_manual.rst b/doc/src/Build_manual.rst index fac2c199497..85c2a4df2a6 100644 --- a/doc/src/Build_manual.rst +++ b/doc/src/Build_manual.rst @@ -87,6 +87,7 @@ folder. The following ``make`` commands are available: make clean-all # remove entire build folder and any cached data make upgrade # upgrade the python packages in the virtual environment + make check # run all checks listed in this block make anchor_check # check for duplicate anchor labels make style_check # check for complete and consistent style lists make package_check # check for complete and consistent package lists diff --git a/doc/src/Intro_features.rst b/doc/src/Intro_features.rst index d7b3af38a57..948a39e7da4 100644 --- a/doc/src/Intro_features.rst +++ b/doc/src/Intro_features.rst @@ -29,7 +29,7 @@ General features * spatial decomposition of simulation domain for MPI parallelism * particle decomposition inside spatial decomposition for OpenMP and GPU parallelism * GPLv2 licensed open-source distribution -* highly portable C++-11 (optional packages may require C++17) +* highly portable C++-17 (optional packages may require C++20) * modular code with most functionality in optional packages * only depends on MPI library for basic parallel functionality, MPI stub for serial compilation * other libraries are optional and only required for specific packages diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 80ddae45d13..de35046d719 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -1306,12 +1306,12 @@ Also see the :ref:`GPU `, :ref:`OPT `, :ref:`INTEL `, and :ref:`OPENMP ` packages, which have styles optimized for CPUs, KNLs, and GPUs. -You must have a C++17 compatible compiler to use this package. -KOKKOS makes extensive use of advanced C++ features, which can -expose compiler bugs, especially when compiling for maximum -performance at high optimization levels. Please see the file -``lib/kokkos/README`` for a list of compilers and their respective -platforms, that are known to work. +You must have a C++20 compatible compiler to use this package. KOKKOS +makes extensive use of advanced C++ features, which can expose compiler +bugs, especially when compiling for maximum performance at high +optimization levels. Please see the file ``lib/kokkos/README`` for a +list of compilers and their respective platforms, that are known to +work. **Authors:** The KOKKOS package was created primarily by Christian Trott and Stan Moore (Sandia), with contributions from other folks as well. diff --git a/doc/src/Speed_kokkos.rst b/doc/src/Speed_kokkos.rst index 7e5014faba4..a6dc6f30bff 100644 --- a/doc/src/Speed_kokkos.rst +++ b/doc/src/Speed_kokkos.rst @@ -41,23 +41,24 @@ center GPUs) are under development. You choose the mode at build time to produce an executable compatible with a specific hardware. The following compatibility notes have been last updated for LAMMPS -version 23 November 2023 and Kokkos version 4.2. +version 11 February 2026 and its bundled Kokkos library version 5.0.2. -.. admonition:: C++17 support +.. admonition:: C++20 support :class: note - Kokkos requires using a compiler that supports the c++17 standard. For - some compilers, it may be necessary to add a flag to enable c++17 support. - For example, the GNU compiler uses the ``-std=c++17`` flag. For a list of - compilers that have been tested with the Kokkos library, see the - `requirements document of the Kokkos Wiki + Kokkos requires using a compiler that supports the C++20 + standard. For some compilers, it may be necessary to add a flag to + enable C++20 support. For example, the GNU compiler uses the + ``-std=c++20`` flag. For a list of compilers that have been tested + with the Kokkos library, see the `requirements document of the Kokkos + Wiki `_. .. admonition:: NVIDIA CUDA support :class: note To build with Kokkos support for NVIDIA GPUs, the NVIDIA CUDA toolkit - software version 11.0 or later must be installed on your system. See + software version 12.2 or later must be installed on your system. See the discussion for the :doc:`GPU package ` for details of how to check and do this. @@ -65,15 +66,17 @@ version 23 November 2023 and Kokkos version 4.2. :class: note To build with Kokkos support for AMD GPUs, the AMD ROCm toolkit - software version 5.2.0 or later must be installed on your system. + software version 6.2.0 or later must be installed on your system. .. admonition:: Intel Data Center GPU support :class: note Support for Kokkos with Intel Data Center GPU accelerators (formerly known under the code name "Ponte Vecchio") in LAMMPS is still a work - in progress. Only a subset of the functionality works correctly. - Please contact the LAMMPS developers if you run into problems. + in progress. Minimum required version is the Intel LLVM (not + classic) compiler version 2024.1. The LAMMPS developers do not + regularly test the status of this, so please contact the LAMMPS + developers if you run into problems. .. admonition:: CUDA and MPI library compatibility :class: note diff --git a/src/EXTRA-COMPUTE/compute_hbond_local.cpp b/src/EXTRA-COMPUTE/compute_hbond_local.cpp index b43b4151e2c..ef09ffa82d7 100644 --- a/src/EXTRA-COMPUTE/compute_hbond_local.cpp +++ b/src/EXTRA-COMPUTE/compute_hbond_local.cpp @@ -216,8 +216,8 @@ int ComputeHBondLocal::compute_image(int *&objs, double **&parms) numobjs = 0; for (int i = 0; i < ncount; ++i) { int idonor = atom->map((tagint) alocal[i][DONOR]); - int iacceptor = domain->closest_image(idonor, (tagint) atom->map(alocal[i][ACCEPTOR])); - int ihydrogen = domain->closest_image(idonor, (tagint) atom->map(alocal[i][HYDROGEN])); + int iacceptor = domain->closest_image(idonor, atom->map((tagint) alocal[i][ACCEPTOR])); + int ihydrogen = domain->closest_image(idonor, atom->map((tagint) alocal[i][HYDROGEN])); if ((idonor < 0) || (iacceptor < 0) || (ihydrogen < 0)) continue; // paranoia imgobjs[numobjs] = Graphics::ARROW; diff --git a/src/comm.cpp b/src/comm.cpp index cd6dce4374a..212b64dca63 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -36,6 +36,8 @@ #include "update.h" #include +#include + #ifdef _OPENMP #include #endif @@ -45,6 +47,10 @@ using namespace LAMMPS_NS; enum{ONELEVEL,TWOLEVEL,NUMA,CUSTOM}; enum{CART,CARTREORDER,XYZ}; +namespace { + constexpr double EPSILON = std::numeric_limits::epsilon(); +} + /* ---------------------------------------------------------------------- */ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) @@ -684,7 +690,7 @@ double Comm::get_comm_cutoff() if (!force->pair && (cutghostuser == 0.0)) { maxcommcutoff = MAX(maxcommcutoff,maxbondcutoff); } else { - if ((me == 0) && (maxbondcutoff > maxcommcutoff)) + if ((me == 0) && ((maxbondcutoff - EPSILON) > maxcommcutoff)) error->warning(FLERR,"Communication cutoff {} is shorter than a bond " "length based estimate of {}. This may lead to errors.", maxcommcutoff,maxbondcutoff); @@ -693,7 +699,7 @@ double Comm::get_comm_cutoff() // print warning if neighborlist cutoff overrides user cutoff if ((me == 0) && (update->setupflag == 1)) { - if ((cutghostuser > 0.0) && (maxcommcutoff > cutghostuser)) + if ((cutghostuser > 0.0) && ((maxcommcutoff - EPSILON) > cutghostuser)) error->warning(FLERR,"Communication cutoff adjusted to {}",maxcommcutoff); } diff --git a/src/version.h b/src/version.h index 73986d5f799..cfc657f67cc 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1,2 @@ #define LAMMPS_VERSION "11 Feb 2026" +#define LAMMPS_UPDATE "Development"