Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 24 additions & 0 deletions cmake/packaging/build_tarball.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions cmake/packaging/org.lammps.lammps-gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))
# ------------------------------------------
Expand All @@ -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"
Expand Down Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions doc/src/Build_manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/src/Intro_features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions doc/src/Packages_details.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1306,12 +1306,12 @@ Also see the :ref:`GPU <PKG-GPU>`, :ref:`OPT <PKG-OPT>`, :ref:`INTEL
<PKG-INTEL>`, and :ref:`OPENMP <PKG-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.
Expand Down
25 changes: 14 additions & 11 deletions doc/src/Speed_kokkos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,39 +41,42 @@ 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
<https://kokkos.org/kokkos-core-wiki/get-started/requirements.html>`_.

.. 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 <Speed_gpu>` for details of
how to check and do this.

.. admonition:: AMD ROCm (HIP) support
: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
Expand Down
4 changes: 2 additions & 2 deletions src/EXTRA-COMPUTE/compute_hbond_local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 8 additions & 2 deletions src/comm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include "update.h"

#include <cstring>
#include <limits>

#ifdef _OPENMP
#include <omp.h>
#endif
Expand All @@ -45,6 +47,10 @@ using namespace LAMMPS_NS;
enum{ONELEVEL,TWOLEVEL,NUMA,CUSTOM};
enum{CART,CARTREORDER,XYZ};

namespace {
constexpr double EPSILON = std::numeric_limits<double>::epsilon();
}

/* ---------------------------------------------------------------------- */

Comm::Comm(LAMMPS *lmp) : Pointers(lmp)
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions src/version.h
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#define LAMMPS_VERSION "11 Feb 2026"
#define LAMMPS_UPDATE "Development"