Merge branch 'develop' into small-patches
89
.github/workflows/check-vla.yml
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
# GitHub action to build LAMMPS on Linux with gcc and -Werror=vla
|
||||
name: "Check for Variable Length Arrays"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build with -Werror=vla
|
||||
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-vla-ccache-${{ github.sha }}
|
||||
restore-keys: linux-vla-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 \
|
||||
-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 -Werror=vla" \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D BUILD_MPI=on \
|
||||
-D BUILD_SHARED_LIBS=off \
|
||||
-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_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
|
||||
51
.github/workflows/compile-msvc.yml
vendored
@ -1,5 +1,5 @@
|
||||
# GitHub action to build LAMMPS on Windows with Visual C++
|
||||
name: "Native Windows Compilation and Unit Tests"
|
||||
# GitHub action to test LAMMPS on Windows with Visual C++
|
||||
name: "Windows Unit Tests"
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -11,11 +11,17 @@ on:
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Windows Compilation Test
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@ -23,36 +29,41 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Enable MSVC++
|
||||
uses: lammps/setup-msvc-dev@v3
|
||||
with:
|
||||
arch: x64
|
||||
|
||||
- name: Install Ccache
|
||||
run: |
|
||||
choco install ccache ninja -y
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: win-unit-ccache-${{ github.sha }}
|
||||
restore-keys: win-unit-ccache-
|
||||
|
||||
- name: Select Python version
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m pip install numpy
|
||||
python3 -m pip install pyyaml
|
||||
nuget install MSMPIsdk
|
||||
nuget install MSMPIDIST
|
||||
cmake -C cmake/presets/windows.cmake \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D PKG_PYTHON=on \
|
||||
-D WITH_PNG=off \
|
||||
-D WITH_JPEG=off \
|
||||
-S cmake -B build \
|
||||
-D BUILD_SHARED_LIBS=on \
|
||||
-D LAMMPS_EXCEPTIONS=on \
|
||||
-D ENABLE_TESTING=on
|
||||
cmake --build build --config Release --parallel 2
|
||||
cmake -C cmake\presets\windows.cmake -D CMAKE_CXX_COMPILER=cl -D CMAKE_CXX_COMPILER_LAUNCHER=ccache -D CMAKE_C_COMPILER=cl -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_Fortran_COMPILER="" -D DOWNLOAD_POTENTIALS=off -D PKG_PYTHON=on -D WITH_PNG=off -D WITH_JPEG=off -S cmake -B build -D BUILD_SHARED_LIBS=on -D ENABLE_TESTING=on -D CMAKE_BUILD_TYPE=Release -G Ninja
|
||||
cmake --build build
|
||||
ccache -s
|
||||
|
||||
- name: Run LAMMPS executable
|
||||
shell: bash
|
||||
run: |
|
||||
./build/Release/lmp.exe -h
|
||||
./build/Release/lmp.exe -in bench/in.lj
|
||||
build\lmp.exe -h
|
||||
build\lmp.exe -in bench\in.lj
|
||||
|
||||
- name: Run Unit Tests
|
||||
working-directory: build
|
||||
shell: bash
|
||||
run: ctest -V -C Release -E FixTimestep:python_move_nve
|
||||
run: ctest -V -E FixTimestep:python_move_nve
|
||||
|
||||
109
.github/workflows/full-regression.yml
vendored
Normal file
@ -0,0 +1,109 @@
|
||||
# GitHub action to build LAMMPS on Linux and run regression tests
|
||||
name: "Full Regression Test"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build LAMMPS
|
||||
# restrict to official LAMMPS repository
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
strategy:
|
||||
max-parallel: 8
|
||||
matrix:
|
||||
idx: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
show-progress: false
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache ninja-build libeigen3-dev \
|
||||
libcurl4-openssl-dev python3-dev \
|
||||
mpi-default-bin mpi-default-dev
|
||||
|
||||
- name: Create Build Environment
|
||||
run: mkdir build
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: linux-full-ccache-${{ github.sha }}
|
||||
restore-keys: linux-full-ccache-
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m venv linuxenv
|
||||
source linuxenv/bin/activate
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install numpy pyyaml junit_xml
|
||||
cmake -S cmake -B build \
|
||||
-C cmake/presets/gcc.cmake \
|
||||
-C cmake/presets/most.cmake \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D BUILD_SHARED_LIBS=off \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=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
|
||||
|
||||
- name: Run Full Regression Tests
|
||||
shell: bash
|
||||
run: |
|
||||
source linuxenv/bin/activate
|
||||
python3 tools/regression-tests/run_tests.py \
|
||||
--lmp-bin=build/lmp \
|
||||
--config-file=tools/regression-tests/config_serial.yaml \
|
||||
--examples-top-level=examples --analyze --num-workers=8
|
||||
|
||||
python3 tools/regression-tests/run_tests.py \
|
||||
--lmp-bin=build/lmp \
|
||||
--config-file=tools/regression-tests/config_serial.yaml \
|
||||
--list-input=input-list-${{ matrix.idx }}.txt \
|
||||
--output-file=output-${{ matrix.idx }}.xml \
|
||||
--progress-file=progress-${{ matrix.idx }}.yaml \
|
||||
--log-file=run-${{ matrix.idx }}.log
|
||||
|
||||
tar -cvf full-regression-test-${{ matrix.idx }}.tar run-${{ matrix.idx }}.log progress-${{ matrix.idx }}.yaml output-${{ matrix.idx }}.xml
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: full-regression-test-artifact-${{ matrix.idx }}
|
||||
path: full-regression-test-${{ matrix.idx }}.tar
|
||||
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Merge Artifacts
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: merged-full-regresssion-artifact
|
||||
pattern: full-regression-test-artifact-*
|
||||
|
||||
118
.github/workflows/quick-regression.yml
vendored
Normal file
@ -0,0 +1,118 @@
|
||||
# GitHub action to build LAMMPS on Linux and run selected regression tests
|
||||
name: "Quick Regression Test"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build LAMMPS
|
||||
# restrict to official LAMMPS repository
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
strategy:
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
idx: [ 0, 1, 2, 3 ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
show-progress: false
|
||||
|
||||
- name: Install extra packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ccache ninja-build libeigen3-dev \
|
||||
libcurl4-openssl-dev python3-dev \
|
||||
mpi-default-bin mpi-default-dev
|
||||
|
||||
- name: Create Build Environment
|
||||
run: mkdir build
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: linux-quick-ccache-${{ github.sha }}
|
||||
restore-keys: linux-quick-ccache-
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m venv linuxenv
|
||||
source linuxenv/bin/activate
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install numpy pyyaml junit_xml
|
||||
cmake -S cmake -B build \
|
||||
-C cmake/presets/gcc.cmake \
|
||||
-C cmake/presets/most.cmake \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D BUILD_SHARED_LIBS=off \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=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
|
||||
|
||||
- name: Run Regression Tests for Modified Styles
|
||||
shell: bash
|
||||
run: |
|
||||
source linuxenv/bin/activate
|
||||
python3 tools/regression-tests/run_tests.py \
|
||||
--lmp-bin=build/lmp \
|
||||
--config-file=tools/regression-tests/config_quick.yaml \
|
||||
--examples-top-level=examples \
|
||||
--quick-reference=tools/regression-tests/reference.yaml \
|
||||
--quick --quick-branch=origin/develop --quick-max=100 --num-workers=4
|
||||
|
||||
if [ -f input-list-${{ matrix.idx }}.txt ]
|
||||
then \
|
||||
python3 tools/regression-tests/run_tests.py \
|
||||
--lmp-bin=build/lmp \
|
||||
--config-file=tools/regression-tests/config_quick.yaml \
|
||||
--list-input=input-list-${{ matrix.idx }}.txt \
|
||||
--output-file=output-${{ matrix.idx }}.xml \
|
||||
--progress-file=progress-${{ matrix.idx }}.yaml \
|
||||
--log-file=run-${{ matrix.idx }}.log
|
||||
fi
|
||||
|
||||
tar -cvf quick-regression-test-${{ matrix.idx }}.tar run-${{ matrix.idx }}.log progress-${{ matrix.idx }}.yaml output-${{ matrix.idx }}.xml
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: quick-regression-test-artifact-${{ matrix.idx }}
|
||||
path: quick-regression-test-${{ matrix.idx }}.tar
|
||||
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Merge Artifacts
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
name: merged-quick-regresssion-artifact
|
||||
pattern: quick-regression-test-artifact-*
|
||||
|
||||
37
.github/workflows/style-check.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
# GitHub action to run checks from tools/coding_standard
|
||||
name: "Check for Programming Style Conformance"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Programming Style Conformance
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Run Tests
|
||||
working-directory: src
|
||||
shell: bash
|
||||
run: |
|
||||
make check-whitespace
|
||||
make check-permissions
|
||||
make check-homepage
|
||||
make check-errordocs
|
||||
86
.github/workflows/unittest-linux.yml
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
# GitHub action to build LAMMPS on Linux and run standard unit tests
|
||||
name: "Unittest for Linux /w LAMMPS_BIGBIG"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Linux Unit Test
|
||||
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 \
|
||||
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-unit-ccache-${{ github.sha }}
|
||||
restore-keys: linux-unit-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/gcc.cmake \
|
||||
-C cmake/presets/most.cmake \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D BUILD_SHARED_LIBS=on \
|
||||
-D LAMMPS_SIZES=bigbig \
|
||||
-D DOWNLOAD_POTENTIALS=off \
|
||||
-D ENABLE_TESTING=on \
|
||||
-D MLIAP_ENABLE_ACE=on \
|
||||
-D MLIAP_ENABLE_PYTHON=off \
|
||||
-D PKG_MANIFOLD=on \
|
||||
-D PKG_ML-PACE=on \
|
||||
-D PKG_ML-RANN=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
|
||||
|
||||
- name: Run Tests
|
||||
working-directory: build
|
||||
shell: bash
|
||||
run: ctest -V
|
||||
4
.github/workflows/unittest-macos.yml
vendored
@ -11,6 +11,10 @@ on:
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{github.event_name == 'pull_request'}}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: MacOS Unit Test
|
||||
|
||||
@ -12,6 +12,11 @@ endif()
|
||||
if(POLICY CMP0075)
|
||||
cmake_policy(SET CMP0075 NEW)
|
||||
endif()
|
||||
# set policy to silence warnings about requiring execute permission for find_program
|
||||
# we use OLD because the python-config script for the Fedora MinGW cross-compiler requires it currently
|
||||
if(POLICY CMP0109)
|
||||
cmake_policy(SET CMP0109 OLD)
|
||||
endif()
|
||||
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||
if(POLICY CMP0135)
|
||||
cmake_policy(SET CMP0135 OLD)
|
||||
@ -469,13 +474,13 @@ if(BUILD_OMP)
|
||||
if(CMAKE_VERSION VERSION_LESS 3.28)
|
||||
get_filename_component(_exe "${CMAKE_CXX_COMPILER}" NAME)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (_exe STREQUAL "crayCC"))
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_${BTYPE} "${CMAKE_SHARED_LINKER_FLAGS_${BTYPE} -fopenmp")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_${BTYPE} "${CMAKE_STATIC_LINKER_FLAGS_${BTYPE} -fopenmp")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_${BTYPE} "${CMAKE_SHARED_LINKER_FLAGS_${BTYPE}} -fopenmp")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_${BTYPE} "${CMAKE_STATIC_LINKER_FLAGS_${BTYPE}} -fopenmp")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "CrayClang")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_${BTYPE} "${CMAKE_SHARED_LINKER_FLAGS_${BTYPE} -fopenmp")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_${BTYPE} "${CMAKE_STATIC_LINKER_FLAGS_${BTYPE} -fopenmp")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_${BTYPE} "${CMAKE_SHARED_LINKER_FLAGS_${BTYPE}} -fopenmp")
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_${BTYPE} "${CMAKE_STATIC_LINKER_FLAGS_${BTYPE}} -fopenmp")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -492,7 +497,7 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_STANDARD GREATER_EQUA
|
||||
PROPERTIES COMPILE_OPTIONS "-std=c++14")
|
||||
endif()
|
||||
|
||||
if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR BUILD_TOOLS)
|
||||
if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR PKG_RHEO OR BUILD_TOOLS)
|
||||
enable_language(C)
|
||||
if (NOT USE_INTERNAL_LINALG)
|
||||
find_package(LAPACK)
|
||||
@ -510,14 +515,6 @@ if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR BUILD_T
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(CURL QUIET COMPONENTS HTTP HTTPS)
|
||||
option(WITH_CURL "Enable libcurl support" ${CURL_FOUND})
|
||||
if(WITH_CURL)
|
||||
find_package(CURL REQUIRED COMPONENTS HTTP HTTPS)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_CURL)
|
||||
target_link_libraries(lammps PRIVATE CURL::libcurl)
|
||||
endif()
|
||||
|
||||
# tweak jpeg library names to avoid linker errors with MinGW cross-compilation
|
||||
set(JPEG_NAMES libjpeg libjpeg-62)
|
||||
find_package(JPEG QUIET)
|
||||
@ -575,7 +572,7 @@ else()
|
||||
endif()
|
||||
|
||||
foreach(PKG_WITH_INCL KSPACE PYTHON ML-IAP VORONOI COLVARS ML-HDNNP MDI MOLFILE NETCDF
|
||||
PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM COMPRESS ML-PACE LEPTON RHEO)
|
||||
PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM COMPRESS ML-PACE LEPTON EXTRA-COMMAND)
|
||||
if(PKG_${PKG_WITH_INCL})
|
||||
include(Packages/${PKG_WITH_INCL})
|
||||
endif()
|
||||
@ -968,6 +965,9 @@ message(STATUS "<<< Compilers and Flags: >>>
|
||||
C++ Standard: ${CMAKE_CXX_STANDARD}
|
||||
C++ Flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTYPE}}
|
||||
Defines: ${DEFINES}")
|
||||
if(CMAKE_CXX_COMPILER_LAUNCHER)
|
||||
message(STATUS " Launcher: ${CMAKE_CXX_COMPILER_LAUNCHER}")
|
||||
endif()
|
||||
get_target_property(OPTIONS lammps COMPILE_OPTIONS)
|
||||
if(OPTIONS)
|
||||
message(" Options: ${OPTIONS}")
|
||||
@ -986,6 +986,9 @@ if(_index GREATER -1)
|
||||
Type: ${CMAKE_C_COMPILER_ID}
|
||||
Version: ${CMAKE_C_COMPILER_VERSION}
|
||||
C Flags: ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BTYPE}}")
|
||||
if(CMAKE_C_COMPILER_LAUNCHER)
|
||||
message(STATUS " Launcher: ${CMAKE_C_COMPILER_LAUNCHER}")
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "<<< Linker flags: >>>")
|
||||
message(STATUS "Executable name: ${LAMMPS_BINARY}")
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
option(BUILD_DOC "Build LAMMPS HTML documentation" OFF)
|
||||
|
||||
if(BUILD_DOC)
|
||||
option(BUILD_DOC_VENV "Build LAMMPS documentation virtual environment" ON)
|
||||
mark_as_advanced(BUILD_DOC_VENV)
|
||||
# Current Sphinx versions require at least Python 3.8
|
||||
# use default (or custom) Python executable, if version is sufficient
|
||||
if(Python_VERSION VERSION_GREATER_EQUAL 3.8)
|
||||
@ -18,14 +20,6 @@ if(BUILD_DOC)
|
||||
find_package(Doxygen 1.8.10 REQUIRED)
|
||||
file(GLOB DOC_SOURCES CONFIGURE_DEPENDS ${LAMMPS_DOC_DIR}/src/[^.]*.rst)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT docenv
|
||||
COMMAND ${VIRTUALENV} docenv
|
||||
)
|
||||
|
||||
set(DOCENV_BINARY_DIR ${CMAKE_BINARY_DIR}/docenv/bin)
|
||||
set(DOCENV_REQUIREMENTS_FILE ${LAMMPS_DOC_DIR}/utils/requirements.txt)
|
||||
|
||||
set(SPHINX_CONFIG_DIR ${LAMMPS_DOC_DIR}/utils/sphinx-config)
|
||||
set(SPHINX_CONFIG_FILE_TEMPLATE ${SPHINX_CONFIG_DIR}/conf.py.in)
|
||||
set(SPHINX_STATIC_DIR ${SPHINX_CONFIG_DIR}/_static)
|
||||
@ -44,14 +38,32 @@ if(BUILD_DOC)
|
||||
# configure paths in conf.py, since relative paths change when file is copied
|
||||
configure_file(${SPHINX_CONFIG_FILE_TEMPLATE} ${DOC_BUILD_CONFIG_FILE})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${DOC_BUILD_DIR}/requirements.txt
|
||||
DEPENDS docenv ${DOCENV_REQUIREMENTS_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${DOCENV_REQUIREMENTS_FILE} ${DOC_BUILD_DIR}/requirements.txt
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade pip
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade ${LAMMPS_DOC_DIR}/utils/converters
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install -r ${DOC_BUILD_DIR}/requirements.txt --upgrade
|
||||
)
|
||||
if(BUILD_DOC_VENV)
|
||||
add_custom_command(
|
||||
OUTPUT docenv
|
||||
COMMAND ${VIRTUALENV} docenv
|
||||
)
|
||||
|
||||
set(DOCENV_BINARY_DIR ${CMAKE_BINARY_DIR}/docenv/bin)
|
||||
set(DOCENV_REQUIREMENTS_FILE ${LAMMPS_DOC_DIR}/utils/requirements.txt)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${DOC_BUILD_DIR}/requirements.txt
|
||||
DEPENDS docenv ${DOCENV_REQUIREMENTS_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${DOCENV_REQUIREMENTS_FILE} ${DOC_BUILD_DIR}/requirements.txt
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade pip
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install --upgrade ${LAMMPS_DOC_DIR}/utils/converters
|
||||
COMMAND ${DOCENV_BINARY_DIR}/pip $ENV{PIP_OPTIONS} install -r ${DOC_BUILD_DIR}/requirements.txt --upgrade
|
||||
)
|
||||
|
||||
set(DOCENV_DEPS docenv ${DOC_BUILD_DIR}/requirements.txt)
|
||||
if(NOT TARGET Sphinx::sphinx-build)
|
||||
add_executable(Sphinx::sphinx-build IMPORTED GLOBAL)
|
||||
set_target_properties(Sphinx::sphinx-build PROPERTIES IMPORTED_LOCATION "${DOCENV_BINARY_DIR}/sphinx-build")
|
||||
endif()
|
||||
else()
|
||||
find_package(Sphinx)
|
||||
endif()
|
||||
|
||||
set(MATHJAX_URL "https://github.com/mathjax/MathJax/archive/3.1.3.tar.gz" CACHE STRING "URL for MathJax tarball")
|
||||
set(MATHJAX_MD5 "b81661c6e6ba06278e6ae37b30b0c492" CACHE STRING "MD5 checksum of MathJax tarball")
|
||||
@ -97,8 +109,8 @@ if(BUILD_DOC)
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT html
|
||||
DEPENDS ${DOC_SOURCES} docenv ${DOC_BUILD_DIR}/requirements.txt ${DOXYGEN_XML_DIR}/index.xml ${BUILD_DOC_CONFIG_FILE}
|
||||
COMMAND ${DOCENV_BINARY_DIR}/sphinx-build ${SPHINX_EXTRA_OPTS} -b html -c ${DOC_BUILD_DIR} -d ${DOC_BUILD_DIR}/doctrees ${LAMMPS_DOC_DIR}/src ${DOC_BUILD_DIR}/html
|
||||
DEPENDS ${DOC_SOURCES} ${DOCENV_DEPS} ${DOXYGEN_XML_DIR}/index.xml ${BUILD_DOC_CONFIG_FILE}
|
||||
COMMAND Sphinx::sphinx-build ${SPHINX_EXTRA_OPTS} -b html -c ${DOC_BUILD_DIR} -d ${DOC_BUILD_DIR}/doctrees ${LAMMPS_DOC_DIR}/src ${DOC_BUILD_DIR}/html
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink Manual.html ${DOC_BUILD_DIR}/html/index.html
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LAMMPS_DOC_DIR}/src/PDF ${DOC_BUILD_DIR}/html/PDF
|
||||
COMMAND ${CMAKE_COMMAND} -E remove -f ${DOXYGEN_XML_DIR}/run.stamp
|
||||
|
||||
29
cmake/Modules/FindSphinx.cmake
Normal file
@ -0,0 +1,29 @@
|
||||
# Find sphinx-build
|
||||
find_program(Sphinx_EXECUTABLE NAMES sphinx-build
|
||||
PATH_SUFFIXES bin
|
||||
DOC "Sphinx documenation build executable")
|
||||
mark_as_advanced(Sphinx_EXECUTABLE)
|
||||
|
||||
if(Sphinx_EXECUTABLE)
|
||||
execute_process(COMMAND ${Sphinx_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE sphinx_version
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE _sphinx_version_result)
|
||||
|
||||
if(_sphinx_version_result)
|
||||
message(WARNING "Unable to determine sphinx-build verison: ${_sphinx_version_result}")
|
||||
else()
|
||||
string(REGEX REPLACE "sphinx-build ([0-9.]+).*"
|
||||
"\\1"
|
||||
Sphinx_VERSION
|
||||
"${sphinx_version}")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET Sphinx::sphinx-build)
|
||||
add_executable(Sphinx::sphinx-build IMPORTED GLOBAL)
|
||||
set_target_properties(Sphinx::sphinx-build PROPERTIES IMPORTED_LOCATION "${Sphinx_EXECUTABLE}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Sphinx REQUIRED_VARS Sphinx_EXECUTABLE VERSION_VAR Sphinx_VERSION)
|
||||
10
cmake/Modules/Packages/EXTRA-COMMAND.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
# the geturl command needs libcurl
|
||||
|
||||
find_package(CURL QUIET COMPONENTS HTTP HTTPS)
|
||||
option(WITH_CURL "Enable libcurl support" ${CURL_FOUND})
|
||||
if(WITH_CURL)
|
||||
find_package(CURL REQUIRED COMPONENTS HTTP HTTPS)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_CURL)
|
||||
target_link_libraries(lammps PRIVATE CURL::libcurl)
|
||||
endif()
|
||||
|
||||
@ -8,8 +8,24 @@ endif()
|
||||
########################################################################
|
||||
# consistency checks and Kokkos options/settings required by LAMMPS
|
||||
if(Kokkos_ENABLE_CUDA)
|
||||
message(STATUS "KOKKOS: Enabling CUDA LAMBDA function support")
|
||||
set(Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "" FORCE)
|
||||
option(Kokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC "CUDA asynchronous malloc support" OFF)
|
||||
mark_as_advanced(Kokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC)
|
||||
if(Kokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC)
|
||||
message(STATUS "KOKKOS: CUDA malloc async support enabled")
|
||||
else()
|
||||
message(STATUS "KOKKOS: CUDA malloc async support disabled")
|
||||
endif()
|
||||
endif()
|
||||
if(Kokkos_ENABLE_HIP)
|
||||
option(Kokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS "Enable multiple kernel instantiations with HIP" ON)
|
||||
mark_as_advanced(Kokkos_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS)
|
||||
option(Kokkos_ENABLE_ROCTHRUST "Use RoCThrust library" ON)
|
||||
mark_as_advanced(Kokkos_ENABLE_ROCTHRUST)
|
||||
|
||||
if(Kokkos_ARCH_AMD_GFX942 OR Kokkos_ARCH_AMD_GFX940)
|
||||
option(Kokkos_ENABLE_IMPL_HIP_UNIFIED_MEMORY "Enable unified memory with HIP" ON)
|
||||
mark_as_advanced(Kokkos_ENABLE_IMPL_HIP_UNIFIED_MEMORY)
|
||||
endif()
|
||||
endif()
|
||||
# Adding OpenMP compiler flags without the checks done for
|
||||
# BUILD_OMP can result in compile failures. Enforce consistency.
|
||||
@ -18,6 +34,15 @@ if(Kokkos_ENABLE_OPENMP)
|
||||
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(Kokkos_ENABLE_SERIAL)
|
||||
if(NOT (Kokkos_ENABLE_OPENMP OR Kokkos_ENABLE_THREADS OR
|
||||
Kokkos_ENABLE_CUDA OR Kokkos_ENABLE_HIP OR Kokkos_ENABLE_SYCL
|
||||
OR Kokkos_ENABLE_OPENMPTARGET))
|
||||
option(Kokkos_ENABLE_ATOMICS_BYPASS "Disable atomics for Kokkos Serial Backend" ON)
|
||||
mark_as_advanced(Kokkos_ENABLE_ATOMICS_BYPASS)
|
||||
endif()
|
||||
endif()
|
||||
########################################################################
|
||||
|
||||
option(EXTERNAL_KOKKOS "Build against external kokkos library" OFF)
|
||||
@ -45,8 +70,8 @@ if(DOWNLOAD_KOKKOS)
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}")
|
||||
list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
|
||||
include(ExternalProject)
|
||||
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.3.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||
set(KOKKOS_MD5 "243de871b3dc2cf3990c1c404032df83" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||
set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.4.01.tar.gz" CACHE STRING "URL for KOKKOS tarball")
|
||||
set(KOKKOS_MD5 "de6ee80d00b6212b02bfb7f1e71a8392" CACHE STRING "MD5 checksum of KOKKOS tarball")
|
||||
mark_as_advanced(KOKKOS_URL)
|
||||
mark_as_advanced(KOKKOS_MD5)
|
||||
GetFallbackURL(KOKKOS_URL KOKKOS_FALLBACK)
|
||||
@ -71,7 +96,7 @@ if(DOWNLOAD_KOKKOS)
|
||||
add_dependencies(LAMMPS::KOKKOSCORE kokkos_build)
|
||||
add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build)
|
||||
elseif(EXTERNAL_KOKKOS)
|
||||
find_package(Kokkos 4.3.01 REQUIRED CONFIG)
|
||||
find_package(Kokkos 4.4.01 REQUIRED CONFIG)
|
||||
target_link_libraries(lammps PRIVATE Kokkos::kokkos)
|
||||
else()
|
||||
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
|
||||
@ -127,7 +152,7 @@ if(PKG_KSPACE)
|
||||
${KOKKOS_PKG_SOURCES_DIR}/grid3d_kokkos.cpp
|
||||
${KOKKOS_PKG_SOURCES_DIR}/remap_kokkos.cpp)
|
||||
set(FFT_KOKKOS "KISS" CACHE STRING "FFT library for Kokkos-enabled KSPACE package")
|
||||
set(FFT_KOKKOS_VALUES KISS FFTW3 MKL HIPFFT CUFFT)
|
||||
set(FFT_KOKKOS_VALUES KISS FFTW3 MKL NVPL HIPFFT CUFFT MKL_GPU)
|
||||
set_property(CACHE FFT_KOKKOS PROPERTY STRINGS ${FFT_KOKKOS_VALUES})
|
||||
validate_option(FFT_KOKKOS FFT_KOKKOS_VALUES)
|
||||
string(TOUPPER ${FFT_KOKKOS} FFT_KOKKOS)
|
||||
@ -137,10 +162,8 @@ if(PKG_KSPACE)
|
||||
message(FATAL_ERROR "The CUDA backend of Kokkos requires either KISS FFT or CUFFT.")
|
||||
elseif(FFT_KOKKOS STREQUAL "KISS")
|
||||
message(WARNING "Using KISS FFT with the CUDA backend of Kokkos may be sub-optimal.")
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_KOKKOS_KISS)
|
||||
elseif(FFT_KOKKOS STREQUAL "CUFFT")
|
||||
find_package(CUDAToolkit REQUIRED)
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_KOKKOS_CUFFT)
|
||||
target_link_libraries(lammps PRIVATE CUDA::cufft)
|
||||
endif()
|
||||
elseif(Kokkos_ENABLE_HIP)
|
||||
@ -152,10 +175,21 @@ if(PKG_KSPACE)
|
||||
elseif(FFT_KOKKOS STREQUAL "HIPFFT")
|
||||
include(DetectHIPInstallation)
|
||||
find_package(hipfft REQUIRED)
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_KOKKOS_HIPFFT)
|
||||
target_link_libraries(lammps PRIVATE hip::hipfft)
|
||||
endif()
|
||||
elseif(FFT_KOKKOS STREQUAL "MKL_GPU")
|
||||
if(NOT Kokkos_ENABLE_SYCL)
|
||||
message(FATAL_ERROR "Using MKL_GPU FFT currently requires the SYCL backend of Kokkos.")
|
||||
endif()
|
||||
find_package(MKL REQUIRED)
|
||||
target_link_libraries(lammps PRIVATE mkl_sycl_dft mkl_intel_ilp64 mkl_tbb_thread mkl_core tbb)
|
||||
elseif(FFT_KOKKOS STREQUAL "MKL")
|
||||
find_package(MKL REQUIRED)
|
||||
elseif(FFT_KOKKOS STREQUAL "NVPL")
|
||||
find_package(nvpl_fft REQUIRED)
|
||||
target_link_libraries(lammps PRIVATE nvpl::fftw)
|
||||
endif()
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_KOKKOS_${FFT_KOKKOS})
|
||||
endif()
|
||||
|
||||
if(PKG_ML-IAP)
|
||||
|
||||
@ -10,7 +10,7 @@ if(${FFTW}_FOUND)
|
||||
else()
|
||||
set(FFT "KISS" CACHE STRING "FFT library for KSPACE package")
|
||||
endif()
|
||||
set(FFT_VALUES KISS FFTW3 MKL)
|
||||
set(FFT_VALUES KISS FFTW3 MKL NVPL)
|
||||
set_property(CACHE FFT PROPERTY STRINGS ${FFT_VALUES})
|
||||
validate_option(FFT FFT_VALUES)
|
||||
string(TOUPPER ${FFT} FFT)
|
||||
@ -41,6 +41,10 @@ elseif(FFT STREQUAL "MKL")
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_MKL_THREADS)
|
||||
endif()
|
||||
target_link_libraries(lammps PRIVATE MKL::MKL)
|
||||
elseif(FFT STREQUAL "NVPL")
|
||||
find_package(nvpl_fft REQUIRED)
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_NVPL)
|
||||
target_link_libraries(lammps PRIVATE nvpl::fftw)
|
||||
else()
|
||||
# last option is KISSFFT
|
||||
target_compile_definitions(lammps PRIVATE -DFFT_KISS)
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.11.25.fix.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
# PACE library support for ML-PACE package
|
||||
|
||||
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||
if(POLICY CMP0135)
|
||||
cmake_policy(SET CMP0135 OLD)
|
||||
endif()
|
||||
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.11.25.fix.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
set(PACELIB_MD5 "b45de9a633f42ed65422567e3ce56f9f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
mark_as_advanced(PACELIB_URL)
|
||||
mark_as_advanced(PACELIB_MD5)
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
# Plumed2 support for PLUMED package
|
||||
|
||||
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||
if(POLICY CMP0135)
|
||||
cmake_policy(SET CMP0135 OLD)
|
||||
endif()
|
||||
|
||||
# for supporting multiple concurrent plumed2 installations for debugging and testing
|
||||
set(PLUMED_SUFFIX "" CACHE STRING "Suffix for Plumed2 library")
|
||||
mark_as_advanced(PLUMED_SUFFIX)
|
||||
@ -27,9 +32,9 @@ endif()
|
||||
|
||||
# Note: must also adjust check for supported API versions in
|
||||
# fix_plumed.cpp when version changes from v2.n.x to v2.n+1.y
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.9.1/plumed-src-2.9.1.tgz"
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.9.2/plumed-src-2.9.2.tgz"
|
||||
CACHE STRING "URL for PLUMED tarball")
|
||||
set(PLUMED_MD5 "c3b2d31479c1e9ce211719d40e9efbd7" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
set(PLUMED_MD5 "04862602a372c1013bdfee2d6d03bace" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
|
||||
mark_as_advanced(PLUMED_URL)
|
||||
mark_as_advanced(PLUMED_MD5)
|
||||
@ -81,6 +86,9 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND (CMAKE_CROSSCOMPILING))
|
||||
DEPENDS plumed_build
|
||||
COMMENT "Copying Plumed files"
|
||||
)
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||
target_link_libraries(lammps INTERFACE LAMMPS::PLUMED)
|
||||
endif()
|
||||
|
||||
else()
|
||||
|
||||
@ -155,6 +163,9 @@ else()
|
||||
endif()
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
|
||||
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::PLUMED)
|
||||
endif()
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(PLUMED REQUIRED plumed${PLUMED_SUFFIX})
|
||||
@ -169,7 +180,9 @@ else()
|
||||
endif()
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_LINK_LIBRARIES "${PLUMED_LOAD}")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PLUMED_INCLUDE_DIRS}")
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||
target_link_libraries(lammps PUBLIC LAMMPS::PLUMED)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::PLUMED)
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
find_package(GSL 2.6 REQUIRED)
|
||||
target_link_libraries(lammps PRIVATE GSL::gsl)
|
||||
BIN
cmake/packaging/LAMMPS_DMG_Background.xcf
Normal file
18
cmake/presets/kokkos-sycl-intel.cmake
Normal file
@ -0,0 +1,18 @@
|
||||
# preset that enables KOKKOS and selects SYCL compilation with OpenMP
|
||||
# enabled as well. Also sets some performance related compiler flags.
|
||||
set(PKG_KOKKOS ON CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE)
|
||||
set(Kokkos_ENABLE_SYCL ON CACHE BOOL "" FORCE)
|
||||
|
||||
# hide deprecation warnings temporarily for stable release
|
||||
set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE)
|
||||
|
||||
set(CMAKE_CXX_COMPILER icpx CACHE STRING "" FORCE)
|
||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_STANDARD 17 CACHE STRING "" FORCE)
|
||||
# Silence everything
|
||||
set(CMAKE_CXX_FLAGS "-w" CACHE STRING "" FORCE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-fsycl -flink-huge-device-code -fsycl-max-parallel-link-jobs=32 -fsycl-targets=spir64_gen -Xsycl-target-backend \"-device 12.60.7\" " CACHE STRING "" FORCE)
|
||||
set(CMAKE_TUNE_FLAGS "-O3 -fsycl -fsycl-device-code-split=per_kernel -fsycl-targets=spir64_gen" CACHE STRING "" FORCE)
|
||||
@ -67,6 +67,7 @@ set(WIN_PACKAGES
|
||||
REACTION
|
||||
REAXFF
|
||||
REPLICA
|
||||
RHEO
|
||||
RIGID
|
||||
SHOCK
|
||||
SMTBQ
|
||||
|
||||
@ -60,6 +60,7 @@ set(ALL_PACKAGES
|
||||
REACTION
|
||||
REAXFF
|
||||
REPLICA
|
||||
RHEO
|
||||
RIGID
|
||||
SHOCK
|
||||
SPH
|
||||
|
||||
@ -60,6 +60,7 @@ set(WIN_PACKAGES
|
||||
REACTION
|
||||
REAXFF
|
||||
REPLICA
|
||||
RHEO
|
||||
RIGID
|
||||
SHOCK
|
||||
SMTBQ
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
.TH LAMMPS "1" "27 June 2024" "2024-06-27"
|
||||
.TH LAMMPS "1" "29 August 2024" "2024-08-29"
|
||||
.SH NAME
|
||||
.B LAMMPS
|
||||
\- Molecular Dynamics Simulator. Version 27 June 2024
|
||||
\- Molecular Dynamics Simulator. Version 29 August 2024
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B lmp
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
.TH MSI2LMP "1" "v3.9.10" "2023-03-10"
|
||||
.TH MSI2LMP "1" "v3.9.11" "2024-09-06"
|
||||
.SH NAME
|
||||
.B MSI2LMP
|
||||
\- Converter for Materials Studio files to LAMMPS
|
||||
@ -101,7 +101,7 @@ msi2lmp decane -c 0 -f oplsaa
|
||||
|
||||
|
||||
.SH COPYRIGHT
|
||||
© 2003--2022 Sandia Corporation
|
||||
© 2003--2024 Sandia Corporation
|
||||
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 as
|
||||
|
||||
@ -138,12 +138,27 @@ during development:
|
||||
The status of this automated testing can be viewed on `https://ci.lammps.org
|
||||
<https://ci.lammps.org>`_.
|
||||
|
||||
The scripts and inputs for integration, run, and regression testing
|
||||
are maintained in a
|
||||
`separate repository <https://github.com/lammps/lammps-testing>`_
|
||||
of the LAMMPS project on GitHub. A few tests are also run as GitHub
|
||||
Actions and their configuration files are in the ``.github/workflows/``
|
||||
folder of the LAMMPS git tree.
|
||||
The scripts and inputs for integration, run, and legacy regression
|
||||
testing are maintained in a `separate repository
|
||||
<https://github.com/lammps/lammps-testing>`_ of the LAMMPS project on
|
||||
GitHub. A few tests are also run as GitHub Actions and their
|
||||
configuration files are in the ``.github/workflows/`` folder of the
|
||||
LAMMPS git tree.
|
||||
|
||||
Regression tests can also be performed locally with the :ref:`regression
|
||||
tester tool <regression>`. The tool checks if a given LAMMPS binary run
|
||||
with selected input examples produces thermo output that is consistent
|
||||
with the provided log files. The script can be run in one pass over all
|
||||
available input files, but it can also first create multiple lists of
|
||||
inputs or folders that can then be run with multiple workers
|
||||
concurrently to speed things up. Another mode allows to do a quick
|
||||
check of inputs that contain commands that have changes in the current
|
||||
checkout branch relative to a git branch. This works similar to the two
|
||||
pass mode, but will select only shorter runs and no more than 100 inputs
|
||||
that are chosen randomly. This ensures that this test runs
|
||||
significantly faster compared to the full test run. These test runs can
|
||||
also be performed with instrumented LAMMPS binaries (see previous
|
||||
section).
|
||||
|
||||
The unit testing facility is integrated into the CMake build process of
|
||||
the LAMMPS source code distribution itself. It can be enabled by
|
||||
@ -630,11 +645,35 @@ The following target are available for both, GNU make and CMake:
|
||||
GitHub command line interface
|
||||
-----------------------------
|
||||
|
||||
GitHub is developing a `tool for the command line
|
||||
<https://cli.github.com>`_ that interacts with the GitHub website via a
|
||||
command called ``gh``. This can be extremely convenient when working
|
||||
with a Git repository hosted on GitHub (like LAMMPS). It is thus highly
|
||||
recommended to install it when doing LAMMPS development.
|
||||
GitHub has developed a `command line tool <https://cli.github.com>`_
|
||||
to interact with the GitHub website via a command called ``gh``.
|
||||
This is extremely convenient when working with a Git repository hosted
|
||||
on GitHub (like LAMMPS). It is thus highly recommended to install it
|
||||
when doing LAMMPS development. To use ``gh`` you must be within a git
|
||||
checkout of a repository and you must obtain an authentication token
|
||||
to connect your checkout with a GitHub user. This is done with the
|
||||
command: ``gh auth login`` where you then have to follow the prompts.
|
||||
Here are some examples:
|
||||
|
||||
The capabilities of the ``gh`` command is continually expanding, so
|
||||
please see the documentation at https://cli.github.com/manual/
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: 34 66
|
||||
|
||||
* - Command
|
||||
- Description
|
||||
* - ``gh pr list``
|
||||
- List currently open pull requests
|
||||
* - ``gh pr checks 404``
|
||||
- Shows the status of all checks for pull request #404
|
||||
* - ``gh pr view 404``
|
||||
- Shows the description and recent comments for pull request #404
|
||||
* - ``gh co 404``
|
||||
- Check out the branch from pull request #404; set up for pushing changes
|
||||
* - ``gh issue list``
|
||||
- List currently open issues
|
||||
* - ``gh issue view 430 --comments``
|
||||
- Shows the description and all comments for issue #430
|
||||
|
||||
The capabilities of the ``gh`` command are continually expanding, so
|
||||
for more details please see the documentation at https://cli.github.com/manual/
|
||||
or use ``gh --help`` or ``gh <command> --help`` for embedded help.
|
||||
|
||||
@ -7,6 +7,8 @@ in addition to
|
||||
.. list-table::
|
||||
:align: center
|
||||
:header-rows: 1
|
||||
:widths: 50 50
|
||||
:width: 80%
|
||||
|
||||
* - CMake build
|
||||
- Traditional make
|
||||
@ -115,7 +117,7 @@ GPU package
|
||||
|
||||
To build with this package, you must choose options for precision and
|
||||
which GPU hardware to build for. The GPU package currently supports
|
||||
three different types of backends: OpenCL, CUDA and HIP.
|
||||
three different types of back ends: OpenCL, CUDA and HIP.
|
||||
|
||||
CMake build
|
||||
^^^^^^^^^^^
|
||||
@ -205,7 +207,7 @@ necessary for ``hipcc`` and the linker to work correctly.
|
||||
.. versionadded:: 3Aug2022
|
||||
|
||||
Using the CHIP-SPV implementation of HIP is supported. It allows one to
|
||||
run HIP code on Intel GPUs via the OpenCL or Level Zero backends. To use
|
||||
run HIP code on Intel GPUs via the OpenCL or Level Zero back ends. To use
|
||||
CHIP-SPV, you must set ``-DHIP_USE_DEVICE_SORT=OFF`` in your CMake
|
||||
command line as CHIP-SPV does not yet support hipCUB. As of Summer 2022,
|
||||
the use of HIP for Intel GPUs is experimental. You should only use this
|
||||
@ -751,14 +753,27 @@ This list was last updated for version 4.3.0 of the Kokkos library.
|
||||
platform-appropriate vendor library: rocFFT on AMD GPUs or cuFFT on
|
||||
NVIDIA GPUs.
|
||||
|
||||
To simplify compilation, five preset files are included in the
|
||||
For Intel GPUs using SYCL, set these variables:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D Kokkos_ARCH_HOSTARCH=yes # HOSTARCH = HOST from list above
|
||||
-D Kokkos_ARCH_GPUARCH=yes # GPUARCH = GPU from list above
|
||||
-D Kokkos_ENABLE_SYCL=yes
|
||||
-D Kokkos_ENABLE_OPENMP=yes
|
||||
-D FFT_KOKKOS=MKL_GPU
|
||||
|
||||
This will enable FFTs on the GPU using the oneMKL library.
|
||||
|
||||
To simplify compilation, six preset files are included in the
|
||||
``cmake/presets`` folder, ``kokkos-serial.cmake``,
|
||||
``kokkos-openmp.cmake``, ``kokkos-cuda.cmake``,
|
||||
``kokkos-hip.cmake``, and ``kokkos-sycl.cmake``. They will enable
|
||||
the KOKKOS package and enable some hardware choices. For GPU
|
||||
support those preset files must be customized to match the
|
||||
hardware used. So to compile with CUDA device parallelization with
|
||||
some common packages enabled, you can do the following:
|
||||
``kokkos-hip.cmake``, ``kokkos-sycl-nvidia.cmake``, and
|
||||
``kokkos-sycl-intel.cmake``. They will enable the KOKKOS
|
||||
package and enable some hardware choices. For GPU support those
|
||||
preset files must be customized to match the hardware used. So
|
||||
to compile with CUDA device parallelization with some common
|
||||
packages enabled, you can do the following:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -830,6 +845,18 @@ This list was last updated for version 4.3.0 of the Kokkos library.
|
||||
FFT_INC = -DFFT_HIPFFT # enable use of hipFFT (optional)
|
||||
FFT_LIB = -lhipfft # link to hipFFT library
|
||||
|
||||
For Intel GPUs using SYCL:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
KOKKOS_DEVICES = SYCL
|
||||
KOKKOS_ARCH = HOSTARCH,GPUARCH # HOSTARCH = HOST from list above that is
|
||||
# hosting the GPU
|
||||
# GPUARCH = GPU from list above
|
||||
FFT_INC = -DFFT_KOKKOS_MKL_GPU # enable use of oneMKL for Intel GPUs (optional)
|
||||
# link to oneMKL FFT library
|
||||
FFT_LIB = -lmkl_sycl_dft -lmkl_intel_ilp64 -lmkl_tbb_thread -mkl_core -ltbb
|
||||
|
||||
Advanced KOKKOS compilation settings
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@ -1517,6 +1544,11 @@ in lib/pace or somewhere else, which must be done before building
|
||||
LAMMPS with this package. The code for the library can be found
|
||||
at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps-user-pace/>`_
|
||||
|
||||
Instead of including the ML-PACE package directly into LAMMPS, it
|
||||
is also possible to skip this step and build the ML-PACE package as
|
||||
a plugin using the CMake script files in the ``examples/PACKAGE/pace/plugin``
|
||||
folder and then load this plugin at runtime with the :doc:`plugin command <plugin>`.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
@ -1701,6 +1733,11 @@ try a different one, switch to a different build system, consider a
|
||||
global PLUMED installation or consider downloading PLUMED during the
|
||||
LAMMPS build.
|
||||
|
||||
Instead of including the PLUMED package directly into LAMMPS, it
|
||||
is also possible to skip this step and build the PLUMED package as
|
||||
a plugin using the CMake script files in the ``examples/PACKAGE/plumed/plugin``
|
||||
folder and then load this plugin at runtime with the :doc:`plugin command <plugin>`.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
@ -2214,28 +2251,38 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
|
||||
RHEO package
|
||||
------------
|
||||
|
||||
To build with this package you must have the `GNU Scientific Library
|
||||
(GSL) <https://www.gnu.org/software/gsl/>` installed in locations that
|
||||
are accessible in your environment. The GSL library should be at least
|
||||
version 2.7.
|
||||
This package depends on the BPM package.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
If CMake cannot find the GSL library or include files, you can set:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D GSL_ROOT_DIR=path # path to root of GSL installation
|
||||
-D PKG_RHEO=yes # enable the package itself
|
||||
-D PKG_BPM=yes # the RHEO package requires BPM
|
||||
-D USE_INTERNAL_LINALG=value # prefer internal LAPACK if true
|
||||
|
||||
Some features in the RHEO package are dependent on code in the BPM
|
||||
package so the latter one *must* be enabled as well.
|
||||
|
||||
The RHEO package also requires LAPACK (and BLAS) and CMake
|
||||
can identify their locations and pass that info to the RHEO
|
||||
build script. But on some systems this may cause problems when
|
||||
linking or the dependency is not desired. By using the setting
|
||||
``-D USE_INTERNAL_LINALG=yes`` when running the CMake
|
||||
configuration, you will select compiling and linking the bundled
|
||||
linear algebra library and work around the limitations.
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
LAMMPS will try to auto-detect the GSL compiler and linker flags
|
||||
from the corresponding ``pkg-config`` file (``gsl.pc``), otherwise
|
||||
you can edit the file ``lib/rheo/Makefile.lammps``
|
||||
to specify the paths and library names where indicated by comments.
|
||||
This must be done **before** the package is installed.
|
||||
The RHEO package requires LAPACK (and BLAS) which can be either
|
||||
a system provided library or the bundled "linalg" library. This
|
||||
is a subset of LAPACK translated to C++. For that, one of the
|
||||
provided ``Makefile.lammps.<config>`` files needs to be copied
|
||||
to ``Makefile.lammps`` and edited as needed. The default file
|
||||
uses the bundled "linalg" library, which can be built by
|
||||
``make lib-linalg args='-m serial'`` in the ``src`` folder.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -67,10 +67,10 @@ libraries and better pipelining for packing and communication.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D FFT=value # FFTW3 or MKL or KISS, default is FFTW3 if found,
|
||||
# else KISS
|
||||
-D FFT_KOKKOS=value # FFTW3 or MKL or KISS or CUFFT or HIPFFT,
|
||||
# default is KISS
|
||||
-D FFT=value # FFTW3 or MKL or NVPL or KISS,
|
||||
# default is FFTW3 if found, else KISS
|
||||
-D FFT_KOKKOS=value # FFTW3 or MKL or NVPL or KISS or CUFFT
|
||||
# or HIPFFT or MKL_GPU, default is KISS
|
||||
-D FFT_SINGLE=value # yes or no (default), no = double precision
|
||||
-D FFT_PACK=value # array (default) or pointer or memcpy
|
||||
-D FFT_USE_HEFFTE=value # yes or no (default), yes links to heFFTe
|
||||
@ -103,6 +103,8 @@ libraries and better pipelining for packing and communication.
|
||||
-D FFT_HEFFTE_BACKEND=value # FFTW or MKL or empty/undefined for the stock
|
||||
# heFFTe back end
|
||||
-D Heffte_ROOT=path # path to an existing heFFTe installation
|
||||
-D nvpl_fft_INCLUDE_DIR=path # path to NVPL FFT include files
|
||||
-D nvpl_fft_LIBRARY_DIR=path # path to NVPL FFT libraries
|
||||
|
||||
.. note::
|
||||
|
||||
@ -121,9 +123,10 @@ libraries and better pipelining for packing and communication.
|
||||
.. code-block:: make
|
||||
|
||||
FFT_INC = -DFFT_<NAME> # where <NAME> is KISS (default), FFTW3,
|
||||
# FFTW (same as FFTW3), or MKL
|
||||
# FFTW (same as FFTW3), NVPL, or MKL
|
||||
FFT_INC = -DFFT_KOKKOS_<NAME> # where <NAME> is KISS (default), FFTW3,
|
||||
# FFTW (same as FFTW3), MKL, CUFFT, or HIPFFT
|
||||
# FFTW (same as FFTW3), NVPL, MKL, CUFFT,
|
||||
# HIPFFT, or MKL_GPU
|
||||
FFT_INC = -DFFT_SINGLE # do not specify for double precision
|
||||
FFT_INC = -DFFT_FFTW_THREADS # enable using threaded FFTW3 libraries
|
||||
FFT_INC = -DFFT_MKL_THREADS # enable using threaded FFTs with MKL libraries
|
||||
@ -141,6 +144,9 @@ libraries and better pipelining for packing and communication.
|
||||
# cuFFT either precision
|
||||
FFT_LIB = -lcufft
|
||||
|
||||
# MKL_GPU either precision
|
||||
FFT_LIB = -lmkl_sycl_dft -lmkl_intel_ilp64 -lmkl_tbb_thread -lmkl_core -ltbb
|
||||
|
||||
# FFTW3 double precision
|
||||
FFT_LIB = -lfftw3
|
||||
|
||||
@ -165,6 +171,10 @@ libraries and better pipelining for packing and communication.
|
||||
# MKL with automatic runtime selection of interface libs
|
||||
FFT_LIB = -lmkl_rt
|
||||
|
||||
# threaded NVPL FFT
|
||||
FFT_LIB = -lnvpl_fftw
|
||||
|
||||
|
||||
As with CMake, you do not need to set paths in ``FFT_INC`` or
|
||||
``FFT_PATH``, if the compiler can find the FFT header and library
|
||||
files in its default search path. You must specify ``FFT_LIB``
|
||||
@ -218,10 +228,15 @@ The Intel MKL math library is part of the Intel compiler suite. It
|
||||
can be used with the Intel or GNU compiler (see the ``FFT_LIB`` setting
|
||||
above).
|
||||
|
||||
The NVIDIA Performance Libraries (NVPL) FFT library is optimized for NVIDIA
|
||||
Grace Armv9.0 architecture. You can download it from https://docs.nvidia.com/nvpl/
|
||||
|
||||
The cuFFT and hipFFT FFT libraries are packaged with NVIDIA's CUDA and
|
||||
AMD's HIP installations, respectively. These FFT libraries require the
|
||||
Kokkos acceleration package to be enabled and the Kokkos back end to be
|
||||
GPU-resident (i.e., HIP or CUDA).
|
||||
GPU-resident (i.e., HIP or CUDA). Similarly, GPU offload of FFTs on
|
||||
Intel GPUs with oneMKL currently requires the Kokkos acceleration
|
||||
package to be enabled with the SYCL back end.
|
||||
|
||||
Performing 3d FFTs in parallel can be time-consuming due to data access
|
||||
and required communication. This cost can be reduced by performing
|
||||
@ -492,7 +507,7 @@ during a run.
|
||||
Support for downloading files
|
||||
-----------------------------
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
The :doc:`geturl command <geturl>` command uses the `the libcurl library
|
||||
<https://curl.se/libcurl/>`_ to download files. This requires that
|
||||
|
||||
@ -171,7 +171,7 @@ instructions to install i-PI from PyPI via pip are provided.
|
||||
LAMMPS shell
|
||||
------------
|
||||
|
||||
.. versionchanged:: TBD
|
||||
.. versionchanged:: 29Aug2024
|
||||
|
||||
The LAMMPS shell has been removed from the LAMMPS distribution. Users
|
||||
are encouraged to use the :ref:`LAMMPS-GUI <lammps_gui>` tool instead.
|
||||
|
||||
@ -283,7 +283,7 @@ 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=<path/to/lammps/src/folder>. Other
|
||||
with ``-DLAMMPS_SOURCE_DIR=<path/to/lammps/src/folder>``. Other
|
||||
configuration setting are identical to those for compiling LAMMPS.
|
||||
|
||||
A second example for a plugin from a package is in the
|
||||
|
||||
@ -12,3 +12,4 @@ details are provided for writing code for LAMMPS.
|
||||
|
||||
Developer_write_pair
|
||||
Developer_write_fix
|
||||
Developer_write_command
|
||||
|
||||
348
doc/src/Developer_write_command.rst
Normal file
@ -0,0 +1,348 @@
|
||||
Writing a new command style
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Command styles allow to do system manipulations or interfaces to the
|
||||
operating system.
|
||||
|
||||
In the text below, we will discuss the implementation of one example. As
|
||||
shown on the page for :doc:`writing or extending command styles
|
||||
<Modify_command>`, in order to implement a new command style, a new class
|
||||
must be written that is either directly or indirectly derived from the
|
||||
``Command`` class. There is just one method that must be implemented:
|
||||
``Command::command()``. In addition, a custom constructor is needed to get
|
||||
access to the members of the ``LAMMPS`` class like the ``Error`` class to
|
||||
print out error messages. The ``Command::command()`` method processes the
|
||||
arguments passed to the command in the input and executes it. Any other
|
||||
methods would be for the convenience of implementation of the new command.
|
||||
|
||||
In general, new command styles should be added to the :ref:`EXTRA-COMMAND
|
||||
package <PKG-EXTRA-COMMAND>`. If you feel that your contribution should be
|
||||
added to a different package, please consult with the :doc:`LAMMPS
|
||||
developers <Intro_authors>` first. The contributed code needs to support
|
||||
the :doc:`traditional GNU make build process <Build_make>` **and** the
|
||||
:doc:`CMake build process <Build_cmake>`.
|
||||
|
||||
----
|
||||
|
||||
Case 1: Implementing the geturl command
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
In this section, we will describe the procedure of adding a simple command
|
||||
style to LAMMPS: the :doc:`geturl command <geturl>` that allows to download
|
||||
files directly without having to rely on an external program like "wget" or
|
||||
"curl". The complete implementation can be found in the files
|
||||
``src/EXTRA-COMMAND/geturl.cpp`` and ``src/EXTRA-COMMAND/geturl.h`` of the
|
||||
LAMMPS source code.
|
||||
|
||||
Interfacing the *libcurl* library
|
||||
"""""""""""""""""""""""""""""""""
|
||||
|
||||
Rather than implementing the various protocols for downloading files, we
|
||||
rely on an external library: `libcurl library <https:://curl.se/libcurl/>`_.
|
||||
This requires that the library and its headers are installed. For the
|
||||
traditional GNU make build system, this simply requires edits to the machine
|
||||
makefile to add compilation flags like for other libraries. For the CMake
|
||||
based build system, we need to add some lines to the file
|
||||
``cmake/Modules/Packages/EXTRA-COMMAND.cmake``:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
find_package(CURL QUIET COMPONENTS HTTP HTTPS)
|
||||
option(WITH_CURL "Enable libcurl support" ${CURL_FOUND})
|
||||
if(WITH_CURL)
|
||||
find_package(CURL REQUIRED COMPONENTS HTTP HTTPS)
|
||||
target_compile_definitions(lammps PRIVATE -DLAMMPS_CURL)
|
||||
target_link_libraries(lammps PRIVATE CURL::libcurl)
|
||||
endif()
|
||||
|
||||
The first ``find_package()`` command uses a built-in CMake module to find
|
||||
an existing *libcurl* installation with development headers and support for
|
||||
using the HTTP and HTTPS protocols. The "QUIET" flag ensures that there is
|
||||
no screen output and no error if the search fails. The status of the search
|
||||
is recorded in the "${CURL_FOUND}" variable. That variable sets the default
|
||||
of the WITH_CURL option, which toggles whether support for *libcurl* is included
|
||||
or not.
|
||||
|
||||
The second ``find_package()`` uses the "REQUIRED" flag to produce an error
|
||||
if the WITH_CURL option was set to ``True``, but no suitable *libcurl*
|
||||
implementation with development support was found. This construct is used
|
||||
so that the CMake script code inside the ``if(WITH_CURL)`` and ``endif()``
|
||||
block can be expanded later to download and compile *libcurl* as part of the
|
||||
LAMMPS build process, if it is not found locally. The
|
||||
``target_compile_definitions()`` function added the define ``-DLAMMPS_CURL``
|
||||
to the compilation flags when compiling objects for the LAMMPS library.
|
||||
This allows to always compile the :doc:`geturl command <geturl>`, but use
|
||||
pre-processing to compile in the interface to *libcurl* only when it is
|
||||
present and usable and otherwise stop with an error message about the
|
||||
unavailability of *libcurl* to execute the functionality of the command.
|
||||
|
||||
Header file
|
||||
"""""""""""
|
||||
|
||||
The first segment of any LAMMPS source should be the copyright and
|
||||
license statement. Note the marker in the first line to indicate to
|
||||
editors like emacs that this file is a C++ source, even though the .h
|
||||
extension suggests a C source (this is a convention inherited from the
|
||||
very beginning of the C++ version of LAMMPS).
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
/* -*- c++ -*- ----------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
https://www.lammps.org/, Sandia National Laboratories
|
||||
LAMMPS development team: developers@lammps.org
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
Every command style must be registered in LAMMPS by including the following
|
||||
lines of code in the second part of the header after the copyright
|
||||
message and before the include guards for the class definition:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
#ifdef COMMAND_CLASS
|
||||
// clang-format off
|
||||
CommandStyle(geturl,GetURL);
|
||||
// clang-format on
|
||||
#else
|
||||
|
||||
This block between ``#ifdef COMMAND_CLASS`` and ``#else`` will be
|
||||
included by the ``Input`` class in ``input.cpp`` to build a map of
|
||||
"factory functions" that will create an instance of a Command class
|
||||
and call its ``command()`` method. The map connects the name of the
|
||||
command ``geturl`` with the name of the class ``GetURL``. During
|
||||
compilation, LAMMPS constructs a file ``style_command.h`` that contains
|
||||
``#include`` statements for all "installed" command styles. Before
|
||||
including ``style_command.h`` into ``input.cpp``, the ``COMMAND_CLASS``
|
||||
define is set and the ``CommandStyle(name,class)`` macro defined. The
|
||||
code of the macro adds the installed command styles to the "factory map"
|
||||
which enables the ``Input`` to execute the command.
|
||||
|
||||
The list of header files to include in ``style_command.h`` is automatically
|
||||
updated by the build system if there are new files, so the presence of the
|
||||
new header file in the ``src/EXTRA-COMMAND`` folder and the enabling of the
|
||||
EXTRA-COMMAND package will trigger LAMMPS to include the new command style
|
||||
when it is (re-)compiled. The "// clang-format" format comments are needed
|
||||
so that running :ref:`clang-format <clang-format>` on the file will not
|
||||
insert unwanted blanks which would break the ``CommandStyle`` macro.
|
||||
|
||||
The third part of the header file is the actual class definition of the
|
||||
``GetURL`` class. This has the custom constructor and the ``command()``
|
||||
method implemented by this command style. For the constructor there is
|
||||
nothing to do but to pass the ``lmp`` pointer to the base class. Since the
|
||||
``command()`` method is labeled "virtual" in the base class, it must be
|
||||
given the "override" property.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
#ifndef LMP_GETURL_H
|
||||
#define LMP_GETURL_H
|
||||
|
||||
#include "command.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class GetURL : public Command {
|
||||
public:
|
||||
GetURL(class LAMMPS *lmp) : Command(lmp) {};
|
||||
void command(int, char **) override;
|
||||
};
|
||||
} // namespace LAMMPS_NS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
The "override" property helps to detect unexpected mismatches because
|
||||
compilation will stop with an error in case the signature of a function
|
||||
is changed in the base class without also changing it in all derived
|
||||
classes.
|
||||
|
||||
Implementation file
|
||||
"""""""""""""""""""
|
||||
|
||||
We move on to the implementation of the ``GetURL`` class in the
|
||||
``geturl.cpp`` file. This file also starts with a LAMMPS copyright and
|
||||
license header. Below that notice is typically the space where comments may
|
||||
be added with additional information about this specific file, the
|
||||
author(s), affiliation(s), and email address(es). This way the contributing
|
||||
author(s) can be easily contacted, when there are questions about the
|
||||
implementation later. Since the file(s) may be around for a long time, it
|
||||
is beneficial to use some kind of "permanent" email address, if possible.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
https://www.lammps.org/, Sandia National Laboratories
|
||||
LAMMPS development team: developers@lammps.org
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing authors: Axel Kohlmeyer (Temple U),
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "geturl.h"
|
||||
|
||||
#include "comm.h"
|
||||
#include "error.h"
|
||||
|
||||
#if defined(LAMMPS_CURL)
|
||||
#include <curl/curl.h>
|
||||
#endif
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
The second section of the implementation file has various include
|
||||
statements. The include file for the class header has to come first, then a
|
||||
couple of LAMMPS classes (sorted alphabetically) followed by the header for
|
||||
the *libcurl* interface. This is wrapped into an ``#ifdef`` block so that
|
||||
LAMMPS will compile this file without error when the *libcurl* header is not
|
||||
available and thus the define not set. The final statement of this segment
|
||||
imports the ``LAMMPS_NS::`` namespace globally for this file. This way, all
|
||||
LAMMPS specific functions and classes do not have to be prefixed with
|
||||
``LAMMPS_NS::``.
|
||||
|
||||
The command() function (required)
|
||||
"""""""""""""""""""""""""""""""""
|
||||
|
||||
Since the required custom constructor is trivial and implemented in the
|
||||
header, there is only one function that must be implemented for a command
|
||||
style and that is the ``command()`` function.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
void GetURL::command(int narg, char **arg)
|
||||
{
|
||||
#if !defined(LAMMPS_CURL)
|
||||
error->all(FLERR, "LAMMPS has not been compiled with libcurl support");
|
||||
#else
|
||||
if (narg < 1) utils::missing_cmd_args(FLERR, "geturl", error);
|
||||
int verify = 1;
|
||||
int overwrite = 1;
|
||||
int verbose = 0;
|
||||
|
||||
This first part also has the ``#ifdef`` block depending on the LAMMPS_CURL
|
||||
define. This way the command will simply print an error, if *libcurl* is
|
||||
not available but will not fail to compile. Furthermore, it sets the
|
||||
defaults for the following optional arguments.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
// process arguments
|
||||
|
||||
std::string url = arg[0];
|
||||
|
||||
// sanity check
|
||||
|
||||
if ((url.find(':') == std::string::npos) || (url.find('/') == std::string::npos))
|
||||
error->all(FLERR, "URL '{}' is not a supported URL", url);
|
||||
|
||||
std::string output = url.substr(url.find_last_of('/') + 1);
|
||||
if (output.empty()) error->all(FLERR, "URL '{}' must end in a file string", url);
|
||||
|
||||
This block stores the positional, i.e. non-optional argument of the URL to
|
||||
be downloaded and adds a couple of sanity checks on the string to make sure it is
|
||||
a valid URL. Also it derives the default name of the output file from the URL.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
int iarg = 1;
|
||||
while (iarg < narg) {
|
||||
if (strcmp(arg[iarg], "output") == 0) {
|
||||
if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "geturl output", error);
|
||||
output = arg[iarg + 1];
|
||||
++iarg;
|
||||
} else if (strcmp(arg[iarg], "overwrite") == 0) {
|
||||
if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "geturl overwrite", error);
|
||||
overwrite = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||
++iarg;
|
||||
} else if (strcmp(arg[iarg], "verify") == 0) {
|
||||
if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "geturl verify", error);
|
||||
verify = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||
++iarg;
|
||||
} else if (strcmp(arg[iarg], "verbose") == 0) {
|
||||
if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, "geturl verbose", error);
|
||||
verbose = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||
++iarg;
|
||||
} else {
|
||||
error->all(FLERR, "Unknown geturl keyword: {}", arg[iarg]);
|
||||
}
|
||||
++iarg;
|
||||
}
|
||||
|
||||
This block parses the optional arguments following the URL and stops with an
|
||||
error if there are arguments missing or an unknown argument is encountered.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
// only download files from rank 0
|
||||
|
||||
if (comm->me != 0) return;
|
||||
|
||||
if (!overwrite && platform::file_is_readable(output)) return;
|
||||
|
||||
// open output file for writing
|
||||
|
||||
FILE *out = fopen(output.c_str(), "wb");
|
||||
if (!out)
|
||||
error->all(FLERR, "Cannot open output file {} for writing: {}", output, utils::getsyserror());
|
||||
|
||||
Here all MPI ranks other than 0 will return, so that the URL download will
|
||||
only happen from a single MPI rank. For that rank the output file is opened
|
||||
for writing using the C library function ``fopen()``.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
// initialize curl and perform download
|
||||
|
||||
CURL *curl;
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
curl = curl_easy_init();
|
||||
if (curl) {
|
||||
(void) curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
(void) curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *) out);
|
||||
(void) curl_easy_setopt(curl, CURLOPT_FILETIME, 1L);
|
||||
(void) curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
|
||||
if (verbose && screen) {
|
||||
(void) curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
(void) curl_easy_setopt(curl, CURLOPT_STDERR, (void *) screen);
|
||||
}
|
||||
if (!verify) {
|
||||
(void) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
(void) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
}
|
||||
auto res = curl_easy_perform(curl);
|
||||
if (res != CURLE_OK) {
|
||||
long response = 0L;
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response);
|
||||
error->one(FLERR, "Download of {} failed with: {} {}", output, curl_easy_strerror(res),
|
||||
response);
|
||||
}
|
||||
curl_easy_cleanup(curl);
|
||||
|
||||
This block now implements the actual URL download with the selected options
|
||||
via the "easy" interface of *libcurl*. For the details of what these
|
||||
function calls do, please have a look at the `*libcurl documentation
|
||||
<https://curl.se/libcurl/c/allfuncs.html>`_.
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
}
|
||||
curl_global_cleanup();
|
||||
fclose(out);
|
||||
#endif
|
||||
}
|
||||
|
||||
Finally, the previously opened file is closed and the command is complete.
|
||||
@ -160,7 +160,7 @@ message and before the include guards for the class definition:
|
||||
|
||||
#endif
|
||||
|
||||
This block of between ``#ifdef PAIR_CLASS`` and ``#else`` will be
|
||||
This block between ``#ifdef PAIR_CLASS`` and ``#else`` will be
|
||||
included by the ``Force`` class in ``force.cpp`` to build a map of
|
||||
"factory functions" that will create an instance of these classes and
|
||||
return a pointer to it. The map connects the name of the pair style,
|
||||
|
||||
@ -348,7 +348,7 @@ Some common LAMMPS specific variables
|
||||
* - ``FFT``
|
||||
- select which FFT library to use: ``FFTW3``, ``MKL``, ``KISS`` (default, unless FFTW3 is found)
|
||||
* - ``FFT_KOKKOS``
|
||||
- select which FFT library to use in Kokkos-enabled styles: ``FFTW3``, ``MKL``, ``HIPFFT``, ``CUFFT``, ``KISS`` (default)
|
||||
- select which FFT library to use in Kokkos-enabled styles: ``FFTW3``, ``MKL``, ``HIPFFT``, ``CUFFT``, ``MKL_GPU``, ``KISS`` (default)
|
||||
* - ``FFT_SINGLE``
|
||||
- select whether to use single precision FFTs (default: ``off``)
|
||||
* - ``WITH_JPEG``
|
||||
|
||||
@ -19,9 +19,9 @@ to the online LAMMPS documentation for known LAMMPS commands and styles.
|
||||
Pre-compiled, ready-to-use LAMMPS-GUI executables for Linux x86\_64
|
||||
(Ubuntu 20.04LTS or later and compatible), macOS (version 11 aka Big
|
||||
Sur or later), and Windows (version 10 or later) :ref:`are available
|
||||
<lammps_gui_install>` for download. None-MPI LAMMPS executables for
|
||||
running LAMMPS from the command line and :doc:`some LAMMPS tools <Tools>`
|
||||
are also included.
|
||||
<lammps_gui_install>` for download. Non-MPI LAMMPS executables (as
|
||||
``lmp``) for running LAMMPS from the command line and :doc:`some
|
||||
LAMMPS tools <Tools>` compiled executables are also included.
|
||||
|
||||
The source code for LAMMPS-GUI is included in the LAMMPS source code
|
||||
distribution and can be found in the ``tools/lammps-gui`` folder. It
|
||||
@ -29,40 +29,50 @@ to the online LAMMPS documentation for known LAMMPS commands and styles.
|
||||
<Build_cmake>`.
|
||||
|
||||
LAMMPS-GUI tries to provide an experience similar to what people
|
||||
traditionally would have running LAMMPS using a command line window
|
||||
and the console LAMMPS executable but just rolled into a single executable:
|
||||
traditionally would have running LAMMPS using a command line window and
|
||||
the console LAMMPS executable but just rolled into a single executable:
|
||||
|
||||
- writing & editing LAMMPS input files with a text editor
|
||||
- run LAMMPS on those input file with selected command line flags
|
||||
- use or extract data from the created files and visualize it with
|
||||
either a molecular visualization program or a plotting program
|
||||
- extract data from the created files and visualize it with and
|
||||
external software
|
||||
|
||||
That procedure is quite effective for people proficient in using the
|
||||
command line, as that allows them to use tools for the individual steps
|
||||
that they are most comfortable with. It is often *required* to adopt
|
||||
this workflow when running LAMMPS simulations on high-performance
|
||||
that they are most comfortable with. In fact, it is often *required* to
|
||||
adopt this workflow when running LAMMPS simulations on high-performance
|
||||
computing facilities.
|
||||
|
||||
The main benefit of using LAMMPS-GUI is that many basic tasks can be
|
||||
done directly from the GUI without switching to a text console window or
|
||||
using external programs, let alone writing scripts to extract data from
|
||||
the generated output. It also integrates well with graphical desktop
|
||||
environments where the `.lmp` filename extension can be registered with
|
||||
LAMMPS-GUI as the executable to launch when double clicking on such
|
||||
files. Also, LAMMPS-GUI has support for drag-n-drop, i.e. an input
|
||||
file can be selected and then moved and dropped on the LAMMPS-GUI
|
||||
executable, and LAMMPS-GUI will launch and read the file into its
|
||||
buffer.
|
||||
done directly from the GUI **without** switching to a text console
|
||||
window or using external programs, let alone writing scripts to extract
|
||||
data from the generated output. It also integrates well with graphical
|
||||
desktop environments where the `.lmp` filename extension can be
|
||||
registered with LAMMPS-GUI as the executable to launch when double
|
||||
clicking on such files. Also, LAMMPS-GUI has support for drag-n-drop,
|
||||
i.e. an input file can be selected and then moved and dropped on the
|
||||
LAMMPS-GUI executable, and LAMMPS-GUI will launch and read the file into
|
||||
its buffer. In many cases LAMMPS-GUI will be integrated into the
|
||||
graphical desktop environment and can be launched like other
|
||||
applications.
|
||||
|
||||
LAMMPS-GUI thus makes it easier for beginners to get started running
|
||||
simple LAMMPS simulations. It is very suitable for tutorials on LAMMPS
|
||||
since you only need to learn how to use a single program for most tasks
|
||||
and thus time can be saved and people can focus on learning LAMMPS.
|
||||
The tutorials at https://lammpstutorials.github.io/ were specifically
|
||||
The tutorials at https://lammpstutorials.github.io/ are specifically
|
||||
updated for use with LAMMPS-GUI.
|
||||
|
||||
Another design goal is to keep the barrier low when replacing part of
|
||||
the functionality of LAMMPS-GUI with external tools.
|
||||
the functionality of LAMMPS-GUI with external tools. That said, LAMMPS-GUI
|
||||
has some unique functionality that is not found elsewhere:
|
||||
|
||||
- auto-adapting to features available in the integrated LAMMPS library
|
||||
- interactive visualization using the :doc:`dump image <dump_image>`
|
||||
command with the option to copy-paste the resulting settings
|
||||
- automatic slide show generation from dump image out at runtime
|
||||
- automatic plotting of thermodynamics data at runtime
|
||||
- inspection of binary restart files
|
||||
|
||||
The following text provides a detailed tour of the features and
|
||||
functionality of LAMMPS-GUI. Suggestions for new features and
|
||||
@ -134,9 +144,13 @@ When LAMMPS-GUI starts, it shows the main window, labeled *Editor*, with
|
||||
either an empty buffer or the contents of the file used as argument. In
|
||||
the latter case it may look like the following:
|
||||
|
||||
.. image:: JPG/lammps-gui-main.png
|
||||
:align: center
|
||||
:scale: 50%
|
||||
.. |gui-main1| image:: JPG/lammps-gui-main.png
|
||||
:width: 48%
|
||||
|
||||
.. |gui-main2| image:: JPG/lammps-gui-dark.png
|
||||
:width: 48%
|
||||
|
||||
|gui-main1| |gui-main2|
|
||||
|
||||
There is the typical menu bar at the top, then the main editor buffer,
|
||||
and a status bar at the bottom. The input file contents are shown
|
||||
@ -276,8 +290,6 @@ right mouse button into the *Output* window text area.
|
||||
:align: center
|
||||
:scale: 50%
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
Should the *Output* window contain embedded YAML format text (see above for a
|
||||
demonstration), for example from using :doc:`thermo_style yaml
|
||||
<thermo_style>` or :doc:`thermo_modify line yaml <thermo_modify>`, the
|
||||
@ -289,10 +301,6 @@ text area.
|
||||
Charts Window
|
||||
-------------
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
Plot smoothing support
|
||||
|
||||
By default, when starting a run, a *Charts* window opens that displays a
|
||||
plot of thermodynamic output of the LAMMPS calculation as shown below.
|
||||
|
||||
@ -327,10 +335,6 @@ corresponds to. Same as for the *Output* window, the chart window is
|
||||
replaced on each new run, but the behavior can be changed in the
|
||||
*Preferences* dialog.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
Support for YAML export added
|
||||
|
||||
From the *File* menu on the top left, it is possible to save an image
|
||||
of the currently displayed plot or export the data in either plain text
|
||||
columns (for use by plotting tools like `gnuplot
|
||||
@ -371,8 +375,6 @@ zoom in or zoom out of the displayed images. The button on the very
|
||||
left triggers an export of the slide show animation to a movie file,
|
||||
provided the `FFmpeg program <https://ffmpeg.org/>`_ is installed.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
When clicking on the "garbage can" icon, all image files of the slide
|
||||
show will be deleted. Since their number can be large for long
|
||||
simulations, this option enables to safely and quickly clean up the
|
||||
@ -391,7 +393,7 @@ below.
|
||||
|
||||
.. image:: JPG/lammps-gui-variable-info.png
|
||||
:align: center
|
||||
:scale: 75%
|
||||
:scale: 50%
|
||||
|
||||
Like for the *Output* and *Charts* windows, its content is continuously
|
||||
updated during a run. It will show "(none)" if there are no variables
|
||||
@ -435,20 +437,21 @@ instance when using reduced (= 'lj') :doc:`units <units>`, then
|
||||
LAMMPS-GUI will check the current pair style and if it is a
|
||||
Lennard-Jones type potential, it will extract the *sigma* parameter
|
||||
for each atom type and assign atom diameters from those numbers.
|
||||
For cases where atom diameters are not auto-detected, the *Atom size* field
|
||||
can be edited and a suitable value set manually. The default value
|
||||
is inferred from the x-direction lattice spacing.
|
||||
|
||||
Otherwise the default sequence of colors of the :doc:`dump image
|
||||
<dump_image>` command is assigned to the different atom types and the
|
||||
diameters are all the same.
|
||||
If elements cannot be detected the default sequence of colors of the
|
||||
:doc:`dump image <dump_image>` command is assigned to the different atom
|
||||
types.
|
||||
|
||||
.. figure:: JPG/lammps-gui-image.png
|
||||
:align: center
|
||||
:scale: 50%
|
||||
.. |gui-image1| image:: JPG/lammps-gui-image.png
|
||||
:width: 48%
|
||||
|
||||
Visualization of LAMMPS "peptide" example
|
||||
.. |gui-image2| image:: JPG/lammps-gui-funnel.png
|
||||
:width: 48%
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
|
||||
Buttons for toggling shininess and re-centering were added.
|
||||
|gui-image1| |gui-image2|
|
||||
|
||||
The default image size, some default image quality settings, the view
|
||||
style and some colors can be changed in the *Preferences* dialog
|
||||
@ -468,8 +471,6 @@ current image can be saved to a file (keyboard shortcut `Ctrl-S`) or
|
||||
copied to the clipboard (keyboard shortcut `Ctrl-C`) for pasting the
|
||||
image into another application.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
From the *File* menu it is also possible to copy the current
|
||||
:doc:`dump image <dump_image>` and :doc:`dump_modify <dump_image>`
|
||||
commands to the clipboard so they can be pasted into a LAMMPS input file
|
||||
@ -488,8 +489,6 @@ Paste (`Ctrl-V`), Undo (`Ctrl-Z`), Redo (`Ctrl-Shift-Z`), Select All
|
||||
dialog will pop up asking whether to cancel the exit operation, or to
|
||||
save or not save the buffer contents to a file.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
The editor has an auto-save mode that can be enabled or disabled in the
|
||||
*Preferences* dialog. In auto-save mode, the editor buffer is
|
||||
automatically saved before running LAMMPS or before exiting LAMMPS-GUI.
|
||||
@ -553,8 +552,6 @@ context menu that open the corresponding documentation page in the
|
||||
online LAMMPS documentation in a web browser window. When using the
|
||||
keyboard, the first of those entries is chosen.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
If the word under the cursor is a file, then additionally the context
|
||||
menu has an entry to open the file in a read-only text viewer window.
|
||||
If the file is a LAMMPS restart file, instead the menu entry offers to
|
||||
@ -572,8 +569,6 @@ will contain a corresponding message.
|
||||
Inspecting a Restart file
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
When LAMMPS-GUI is asked to "Inspect a Restart", it will read the
|
||||
restart file into a LAMMPS instance and then open three different
|
||||
windows. The first window is a text viewer with the output of an
|
||||
@ -629,9 +624,10 @@ Edit
|
||||
^^^^
|
||||
|
||||
The *Edit* menu offers the usual editor functions like *Undo*, *Redo*,
|
||||
*Cut*, *Copy*, *Paste*. It can also open a *Preferences* dialog
|
||||
(keyboard shortcut `Ctrl-P`) and allows deleting all stored preferences
|
||||
and settings, so they are reset to their default values.
|
||||
*Cut*, *Copy*, *Paste*, and a *Find and Replace* dialog (keyboard
|
||||
shortcut `Ctrl-F`). It can also open a *Preferences* dialog (keyboard
|
||||
shortcut `Ctrl-P`) and allows deleting all stored preferences and
|
||||
settings, so they are reset to their default values.
|
||||
|
||||
Run
|
||||
^^^
|
||||
@ -667,7 +663,7 @@ set *before* a run is started.
|
||||
|
||||
.. image:: JPG/lammps-gui-variables.png
|
||||
:align: center
|
||||
:scale: 75%
|
||||
:scale: 50%
|
||||
|
||||
The *Set Variables* dialog will be pre-populated with entries that
|
||||
are set as index variables in the input and any variables that are
|
||||
@ -716,6 +712,43 @@ https://lammpstutorials.github.io/ in a web browser window.
|
||||
|
||||
-----
|
||||
|
||||
Find and Replace
|
||||
----------------
|
||||
|
||||
.. image:: JPG/lammps-gui-find.png
|
||||
:align: center
|
||||
:scale: 33%
|
||||
|
||||
The *Find and Replace* dialog allows searching for and replacing
|
||||
text in the *Editor* window.
|
||||
|
||||
The dialog can be opened either from the *Edit* menu or with the
|
||||
keyboard shortcut `Ctrl-F`. You can enter the text to search for.
|
||||
Through three check-boxes the search behavior can be adjusted:
|
||||
|
||||
- If checked, "Match case" does a case sensitive search; otherwise
|
||||
the search is case insensitive.
|
||||
|
||||
- If checked, "Wrap around" starts searching from the start of the
|
||||
document, if there is no match found from the current cursor position
|
||||
until the end of the document; otherwise the search will stop.
|
||||
|
||||
- If checked, the "Whole word" setting only finds full word matches
|
||||
(white space and special characters are word boundaries).
|
||||
|
||||
Clicking on the *Next* button will search for the next occurrence of the
|
||||
search text and select / highlight it. Clicking on the *Replace* button
|
||||
will replace an already highlighted search text and find the next one.
|
||||
If no text is selected, or the selected text does not match the
|
||||
selection string, then the first click on the *Replace* button will
|
||||
only search and highlight the next occurrence of the search string.
|
||||
Clicking on the *Replace All* button will replace all occurrences from
|
||||
the cursor position to the end of the file; if the *Wrap around* box is
|
||||
checked, then it will replace **all** occurrences in the **entire**
|
||||
document. Clicking on the *Done* button will dismiss the dialog.
|
||||
|
||||
------
|
||||
|
||||
Preferences
|
||||
-----------
|
||||
|
||||
@ -848,7 +881,7 @@ available (On macOS use the Command key instead of Ctrl/Control).
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: auto
|
||||
:widths: 16 19 13 16 13 22
|
||||
|
||||
* - Shortcut
|
||||
- Function
|
||||
@ -890,32 +923,32 @@ available (On macOS use the Command key instead of Ctrl/Control).
|
||||
- Quit Application
|
||||
- Ctrl+A
|
||||
- Select All
|
||||
- Ctrl+P
|
||||
- Preferences
|
||||
- Ctrl+F
|
||||
- Find and Replace
|
||||
* - Ctrl+W
|
||||
- Close Window
|
||||
- Ctrl+Shift+H
|
||||
- Quick Help
|
||||
- Ctrl+Shift+G
|
||||
- LAMMPS-GUI Howto
|
||||
* - Ctrl+Shift+A
|
||||
- About LAMMPS
|
||||
- Ctrl+?
|
||||
- Context Help
|
||||
- Ctrl+Shift+W
|
||||
- Show Variables
|
||||
* - Ctrl+Shift+M
|
||||
- LAMMPS Manual
|
||||
- TAB
|
||||
- Reformat line
|
||||
- Shift+TAB
|
||||
- Show Completions
|
||||
* - Ctrl+Shift+T
|
||||
- LAMMPS Tutorial
|
||||
- Ctrl+Shift+Enter
|
||||
* - Ctrl+Shift+Enter
|
||||
- Run File
|
||||
-
|
||||
-
|
||||
- Ctrl+Shift+W
|
||||
- Show Variables
|
||||
- Ctrl+P
|
||||
- Preferences
|
||||
* - Ctrl+Shift+A
|
||||
- About LAMMPS
|
||||
- Ctrl+Shift+H
|
||||
- Quick Help
|
||||
- Ctrl+Shift+G
|
||||
- LAMMPS-GUI Howto
|
||||
* - Ctrl+Shift+M
|
||||
- LAMMPS Manual
|
||||
- Ctrl+?
|
||||
- Context Help
|
||||
- Ctrl+Shift+T
|
||||
- LAMMPS Tutorial
|
||||
|
||||
Further editing keybindings `are documented with the Qt documentation
|
||||
<https://doc.qt.io/qt-5/qplaintextedit.html#editing-key-bindings>`_. In
|
||||
|
||||
@ -39,16 +39,18 @@ lammps.lammps
|
||||
* interface modeled after the LAMMPS :ref:`C language library interface API <lammps_c_api>`
|
||||
* requires knowledge of how LAMMPS internally works (C pointers, etc)
|
||||
* full support for running Python with MPI using `mpi4py <https://mpi4py.readthedocs.io>`_
|
||||
* no overhead from creating a more Python-like interface
|
||||
|
||||
lammps.PyLammps
|
||||
"""""""""""""""
|
||||
|
||||
* higher-level abstraction built on *top* of original :py:class:`ctypes based interface <lammps.lammps>`
|
||||
* higher-level abstraction built on *top* of the original :py:class:`ctypes based interface <lammps.lammps>`
|
||||
* manipulation of Python objects
|
||||
* communication with LAMMPS is hidden from API user
|
||||
* shorter, more concise Python
|
||||
* better IPython integration, designed for quick prototyping
|
||||
* designed for serial execution
|
||||
* additional overhead from capturing and parsing the LAMMPS screen output
|
||||
|
||||
Quick Start
|
||||
-----------
|
||||
|
||||
@ -56,7 +56,7 @@ lammps.org". General questions about LAMMPS should be posted in the
|
||||
- SNL
|
||||
- jmgoff at sandia.gov
|
||||
- machine learned potentials, QEq solvers, Python
|
||||
* - Megan McCarthy
|
||||
* - Meg McCarthy
|
||||
- SNL
|
||||
- megmcca at sandia.gov
|
||||
- alloys, micro-structure, machine learned potentials
|
||||
@ -67,7 +67,7 @@ lammps.org". General questions about LAMMPS should be posted in the
|
||||
* - `Trung Nguyen <tn_>`_
|
||||
- U Chicago
|
||||
- ndactrung at gmail.com
|
||||
- soft matter, GPU package
|
||||
- soft matter, GPU package, DIELECTRIC package, regression testing
|
||||
|
||||
.. _rb: https://rbberger.github.io/
|
||||
.. _gc: https://enthalpiste.fr/
|
||||
|
||||
BIN
doc/src/JPG/lammps-gui-dark.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
doc/src/JPG/lammps-gui-find.png
Normal file
|
After Width: | Height: | Size: 113 KiB |
BIN
doc/src/JPG/lammps-gui-funnel.png
Normal file
|
After Width: | Height: | Size: 325 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 77 KiB |
@ -4,6 +4,7 @@ Per-atom properties
|
||||
This section documents the following functions:
|
||||
|
||||
- :cpp:func:`lammps_extract_atom_datatype`
|
||||
- :cpp:func:`lammps_extract_atom_size`
|
||||
- :cpp:func:`lammps_extract_atom`
|
||||
|
||||
-----------------------
|
||||
@ -13,6 +14,11 @@ This section documents the following functions:
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_extract_atom_size
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_extract_atom
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -1823,7 +1823,8 @@ Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1.
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <ml-pace>` on the
|
||||
:doc:`Build extras <Build_extras>` page.
|
||||
:doc:`Build extras <Build_extras>` page. This package may also be compiled
|
||||
as a plugin to avoid licensing conflicts when distributing binaries.
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
@ -2344,7 +2345,9 @@ and Gareth Tribello.
|
||||
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <plumed>` on the :doc:`Build extras <Build_extras>` page.
|
||||
This package has :ref:`specific installation instructions <plumed>` on the
|
||||
:doc:`Build extras <Build_extras>` page. This package may also be compiled
|
||||
as a plugin to avoid licensing conflicts when distributing binaries.
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
@ -2642,7 +2645,7 @@ This package has :ref:`specific installation instructions <rheo>` on the :doc:`B
|
||||
**Authors:** Joel T. Clemmer (Sandia National Labs),
|
||||
Thomas C. O'Connor (Carnegie Mellon University)
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
|
||||
@ -508,7 +508,7 @@ e.g. the *nfile* and *fileper* keywords. See the
|
||||
|
||||
**-restart2info restartfile keyword ...**
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
Write out some info about the restart file and and immediately exit.
|
||||
This is the same operation as if the following 2-line input script were
|
||||
|
||||
@ -590,20 +590,31 @@ and the LAMMPS library, via ``-D LAMMPS_SOURCE_DIR=/path/to/lammps/src``.
|
||||
CMake will try to guess a build folder with the LAMMPS library from that
|
||||
path, but it can also be set with ``-D LAMMPS_LIB_DIR=/path/to/lammps/lib``.
|
||||
|
||||
Plugin version
|
||||
""""""""""""""
|
||||
|
||||
Rather than linking to the LAMMPS library during compilation, it is also
|
||||
possible to compile the GUI with a plugin loader that will load
|
||||
the LAMMPS library dynamically at runtime during the start of the GUI
|
||||
from a shared library; e.g. ``liblammps.so`` or ``liblammps.dylib`` or
|
||||
possible to compile the GUI with a plugin loader that will load the
|
||||
LAMMPS library dynamically at runtime during the start of the GUI from a
|
||||
shared library; e.g. ``liblammps.so`` or ``liblammps.dylib`` or
|
||||
``liblammps.dll`` (depending on the operating system). This has the
|
||||
advantage that the LAMMPS library can be built from updated or modified
|
||||
LAMMPS source without having to recompile the GUI. The ABI of the
|
||||
LAMMPS C-library interface is very stable and generally backward
|
||||
compatible. This feature is enabled by setting
|
||||
``-D LAMMPS_GUI_USE_PLUGIN=on`` and then ``-D
|
||||
compatible. This feature is enabled by setting ``-D
|
||||
LAMMPS_GUI_USE_PLUGIN=on`` and then ``-D
|
||||
LAMMPS_PLUGINLIB_DIR=/path/to/lammps/plugin/loader``. Typically, this
|
||||
would be the ``examples/COUPLE/plugin`` folder of the LAMMPS
|
||||
distribution.
|
||||
|
||||
When compiling LAMMPS-GUI with plugin support, there is an additional
|
||||
command line flag (``-p <path>`` or ``--pluginpath <path>``) which
|
||||
allows to override the path to LAMMPS shared library used by the GUI.
|
||||
This is usually auto-detected on the first run and can be changed in the
|
||||
LAMMPS-GUI *Preferences* dialog. The command line flag allows to reset
|
||||
this path to a valid value in case the original setting has become
|
||||
invalid. An empty path ("") as argument restores the default setting.
|
||||
|
||||
Platform notes
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
@ -671,6 +682,15 @@ folder> --target tgz`` or ``make tgz`` to build a
|
||||
``LAMMPS-Linux-amd64.tar.gz`` file with the executables and their
|
||||
support libraries.
|
||||
|
||||
It is also possible to build a `flatpak bundle
|
||||
<https://docs.flatpak.org/en/latest/single-file-bundles.html>`_ which is
|
||||
a way to distribute applications in a way that is compatible with most
|
||||
Linux distributions. Use the "flatpak" target to trigger a compile
|
||||
(``cmake --build <build folder> --target flatpak`` or ``make flatpak``).
|
||||
Please note that this will not build from the local sources but from the
|
||||
repository and branch listed in the ``org.lammps.lammps-gui.yml``
|
||||
LAMMPS-GUI source folder.
|
||||
|
||||
----------
|
||||
|
||||
.. _arc:
|
||||
@ -1002,7 +1022,7 @@ regression tests with a given LAMMPS binary. The tool launches the
|
||||
LAMMPS binary with any given input script under one of the `examples`
|
||||
subdirectories, and compares the thermo output in the generated log file
|
||||
with those in the provided log file with the same number of processors
|
||||
ub the same subdirectory. If the differences between the actual and
|
||||
in the same subdirectory. If the differences between the actual and
|
||||
reference values are within specified tolerances, the test is considered
|
||||
passed. For each test batch, that is, a set of example input scripts,
|
||||
the mpirun command, the LAMMPS command line arguments, and the
|
||||
|
||||
@ -38,7 +38,7 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
The *rheo/shell* bond style is designed to work with
|
||||
:doc:`fix rheo/oxidation <fix_rheo_oxidation>` which creates candidate
|
||||
|
||||
@ -55,7 +55,7 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
Define a computation that stores atom attributes specific to the RHEO
|
||||
package for each atom in the group. This is useful so that the values
|
||||
|
||||
@ -59,7 +59,7 @@ factor, these tensor components are twice those of the traditional
|
||||
kinetic energy tensor. The six components of the vector are ordered
|
||||
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
||||
:math:`yz`.
|
||||
|
||||
|
||||
The number of atoms contributing to the temperature is assumed to be
|
||||
constant for the duration of the run; use the *dynamic* option of the
|
||||
:doc:`compute_modify <compute_modify>` command if this is not the case.
|
||||
|
||||
@ -319,25 +319,32 @@ all types from 1 to :math:`N`. A leading asterisk means all types from
|
||||
:math:`N` (inclusive). A middle asterisk means all types from m to n
|
||||
(inclusive).
|
||||
|
||||
Currently *bond* does not support bond_style hybrid nor bond_style
|
||||
hybrid/overlay as bond styles. The bond styles that currently work
|
||||
with fix_adapt are
|
||||
If :doc:`bond_style hybrid <bond_hybrid>` is used, *bstyle* should be a
|
||||
sub-style name. The bond styles that currently work with fix adapt are:
|
||||
|
||||
+------------------------------------+------------+------------+
|
||||
| :doc:`class2 <bond_class2>` | r0 | type bonds |
|
||||
+------------------------------------+------------+------------+
|
||||
| :doc:`fene <bond_fene>` | k,r0 | type bonds |
|
||||
+------------------------------------+------------+------------+
|
||||
| :doc:`fene/nm <bond_fene>` | k,r0 | type bonds |
|
||||
+------------------------------------+------------+------------+
|
||||
| :doc:`gromos <bond_gromos>` | k,r0 | type bonds |
|
||||
+------------------------------------+------------+------------+
|
||||
| :doc:`harmonic <bond_harmonic>` | k,r0 | type bonds |
|
||||
+------------------------------------+------------+------------+
|
||||
| :doc:`morse <bond_morse>` | r0 | type bonds |
|
||||
+------------------------------------+------------+------------+
|
||||
| :doc:`nonlinear <bond_nonlinear>` | epsilon,r0 | type bonds |
|
||||
+------------------------------------+------------+------------+
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
| :doc:`class2 <bond_class2>` | r0 | type bonds |
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
| :doc:`fene <bond_fene>` | k,r0 | type bonds |
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
| :doc:`fene/expand <bond_fene_expand>` | k,r0,epsilon,sigma,shift | type bonds |
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
| :doc:`fene/nm <bond_fene>` | k,r0 | type bonds |
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
| :doc:`gromos <bond_gromos>` | k,r0 | type bonds |
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
| :doc:`harmonic <bond_harmonic>` | k,r0 | type bonds |
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
| :doc:`harmonic/shift <bond_harmonic_shift>` | k,r0,r1 | type bonds |
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
| :doc:`harmonic/restrain <bond_harmonic_restrain>` | k | type bonds |
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
| :doc:`mm3 <bond_mm3>` | k,r0 | type bonds |
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
| :doc:`morse <bond_morse>` | r0 | type bonds |
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
| :doc:`nonlinear <bond_nonlinear>` | epsilon,r0 | type bonds |
|
||||
+---------------------------------------------------+---------------------------+------------+
|
||||
|
||||
----------
|
||||
|
||||
@ -357,15 +364,34 @@ all types from 1 to :math:`N`. A leading asterisk means all types from
|
||||
:math:`N` (inclusive). A middle asterisk means all types from m to n
|
||||
(inclusive).
|
||||
|
||||
Currently *angle* does not support angle_style hybrid nor angle_style
|
||||
hybrid/overlay as angle styles. The angle styles that currently work
|
||||
with fix_adapt are
|
||||
If :doc:`angle_style hybrid <angle_hybrid>` is used, *astyle* should be a
|
||||
sub-style name. The angle styles that currently work with fix adapt are:
|
||||
|
||||
+------------------------------------+----------+-------------+
|
||||
| :doc:`harmonic <angle_harmonic>` | k,theta0 | type angles |
|
||||
+------------------------------------+----------+-------------+
|
||||
| :doc:`cosine <angle_cosine>` | k | type angles |
|
||||
+------------------------------------+----------+-------------+
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`harmonic <angle_harmonic>` | k,theta0 | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`charmm <angle_charmm>` | k,theta0 | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`class2 <angle_class2>` | k2,k3,k4,theta0 | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`cosine <angle_cosine>` | k | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`cosine/periodic <angle_cosine_periodic>` | k,b,n | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`cosine/squared/restricted <angle_cosine_squared_restricted>` | k,theta0 | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`dipole <angle_dipole>` | k,gamma0 | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`fourier <angle_fourier>` | k,c0,c1,c2 | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`fourier/simple <angle_fourier_simple>` | k,c,n | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`mm3 <angle_mm3>` | k,theta0 | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`quartic <angle_quartic>` | k2,k3,k4,theta0 | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
| :doc:`spica <angle_spica>` | k,theta0 | type angles |
|
||||
+--------------------------------------------------------------------+-----------------+-------------+
|
||||
|
||||
Note that internally, theta0 is stored in radians, so the variable
|
||||
this fix uses to reset theta0 needs to generate values in radians.
|
||||
|
||||
@ -247,7 +247,7 @@ defined by the :doc:`atom_style sph <atom_style>` command.
|
||||
|
||||
All particles in the group must be mesoscopic SPH/SDPD particles.
|
||||
|
||||
.. versionchanged:: TBD
|
||||
.. versionchanged:: 29Aug2024
|
||||
|
||||
This fix is incompatible with deformation controls that remap velocity,
|
||||
for instance the *remap v* option of :doc:`fix deform <fix_deform>`.
|
||||
|
||||
@ -97,7 +97,7 @@ These fixes are part of the DPD-MESO package. They are only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package
|
||||
<Build_package>` page for more info.
|
||||
|
||||
.. versionchanged:: TBD
|
||||
.. versionchanged:: 29Aug2024
|
||||
|
||||
This fix is incompatible with deformation controls that remap velocity,
|
||||
for instance the *remap v* option of :doc:`fix deform <fix_deform>`.
|
||||
|
||||
@ -43,7 +43,7 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
Perform time integration for RHEO particles, updating positions, velocities,
|
||||
and densities. For an overview of other features available in the RHEO package,
|
||||
|
||||
@ -27,7 +27,7 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
This fix dynamically creates bonds on the surface of fluids to
|
||||
represent physical processes such as oxidation. It is intended
|
||||
|
||||
@ -33,7 +33,7 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
This fix defines a pressure equation of state for RHEO particles. One can
|
||||
define different equations of state for different atom types. An equation
|
||||
|
||||
@ -48,7 +48,7 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
This fix performs time integration of temperature for atom style rheo/thermal.
|
||||
In addition, it defines multiple thermal properties of particles and handles
|
||||
|
||||
@ -38,7 +38,7 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
This fix defines a viscosity for RHEO particles. One can define different
|
||||
viscosities for different atom types, but a viscosity must be specified for
|
||||
|
||||
@ -353,7 +353,7 @@ defined by the :doc:`atom_style sph <atom_style>` command.
|
||||
|
||||
All particles in the group must be mesoscopic SPH/SDPD particles.
|
||||
|
||||
.. versionchanged:: TBD
|
||||
.. versionchanged:: 29Aug2024
|
||||
|
||||
This fix is incompatible with deformation controls that remap velocity,
|
||||
for instance the *remap v* option of :doc:`fix deform <fix_deform>`.
|
||||
|
||||
@ -137,7 +137,7 @@ constrained (within a fudge factor of MASSDELTA specified in
|
||||
both bonds in the angle are constrained then the angle will also be
|
||||
constrained if its type is in the list.
|
||||
|
||||
.. versionchanged:: TBD
|
||||
.. versionchanged:: 29Aug2024
|
||||
|
||||
The types may be given as type labels *only* if there is no atom, bond,
|
||||
or angle type label named *b*, *a*, *t*, or *m* defined in the
|
||||
|
||||
@ -53,7 +53,7 @@ Restrictions
|
||||
This fix is part of the MACHDYN package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
.. versionchanged:: TBD
|
||||
.. versionchanged:: 29Aug2024
|
||||
|
||||
This fix is incompatible with deformation controls that remap velocity,
|
||||
for instance the *remap v* option of :doc:`fix deform <fix_deform>`.
|
||||
|
||||
@ -61,7 +61,7 @@ Restrictions
|
||||
This fix is part of the MACHDYN package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
.. versionchanged:: TBD
|
||||
.. versionchanged:: 29Aug2024
|
||||
|
||||
This fix is incompatible with deformation controls that remap velocity,
|
||||
for instance the *remap v* option of :doc:`fix deform <fix_deform>`.
|
||||
|
||||
@ -32,7 +32,7 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
Download a file from an URL to the local disk. This is implemented with
|
||||
the `libcurl library <https:://curl.se/libcurl/>`_ which supports a
|
||||
|
||||
@ -51,7 +51,7 @@ index file. When specifying group IDs, only those groups will be
|
||||
written to the index file. In order to follow the Gromacs conventions,
|
||||
the group *all* will be renamed to *System* in the index file.
|
||||
|
||||
The *ndx2group* command will create of update group definitions from
|
||||
The *ndx2group* command will create or update group definitions from
|
||||
those stored in an index file. Without specifying any group IDs, all
|
||||
groups except *System* will be read from the index file and the
|
||||
corresponding groups recreated. If a group of the same name already
|
||||
|
||||
@ -159,7 +159,7 @@ sample scenarios where this is useful:
|
||||
* When one or more rigid bodies are specified, interactions within each
|
||||
body can be turned off to save needless computation. See the :doc:`fix rigid <fix_rigid>` command for more details.
|
||||
|
||||
.. versionchanged:: TBD
|
||||
.. versionchanged:: 29Aug2024
|
||||
|
||||
Support for type labels was added.
|
||||
|
||||
|
||||
@ -18,28 +18,27 @@ Syntax
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
pair_style style N inner_distance_cutoff outer_distance_cutoff angle_cutof
|
||||
pair_style style N inner_distance_cutoff outer_distance_cutoff angle_cutoff
|
||||
|
||||
* style = *hbond/dreiding/lj* or *hbond/dreiding/morse*
|
||||
* n = cosine angle periodicity
|
||||
* N = power of cosine of angle theta (integer)
|
||||
* inner_distance_cutoff = global inner cutoff for Donor-Acceptor interactions (distance units)
|
||||
* outer_distance_cutoff = global cutoff for Donor-Acceptor interactions (distance units)
|
||||
* angle_cutoff = global angle cutoff for Acceptor-Hydrogen-Donor
|
||||
* interactions (degrees)
|
||||
* angle_cutoff = global angle cutoff for Acceptor-Hydrogen-Donor interactions (degrees)
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
pair_style hybrid/overlay lj/cut 10.0 hbond/dreiding/lj 4 9.0 11.0 90
|
||||
pair_style hybrid/overlay lj/cut 10.0 hbond/dreiding/lj 4 9.0 11.0 90.0
|
||||
pair_coeff 1 2 hbond/dreiding/lj 3 i 9.5 2.75 4 9.0 11.0 90.0
|
||||
|
||||
pair_style hybrid/overlay lj/cut 10.0 hbond/dreiding/morse 2 9.0 11.0 90
|
||||
pair_coeff 1 2 hbond/dreiding/morse 3 i 3.88 1.7241379 2.9 2 9 11 90
|
||||
pair_style hybrid/overlay lj/cut 10.0 hbond/dreiding/morse 2 9.0 11.0 90.0
|
||||
pair_coeff 1 2 hbond/dreiding/morse 3 i 3.88 1.7241379 2.9 2 9.0 11.0 90.0
|
||||
|
||||
labelmap atom 1 C 2 O 3 H
|
||||
pair_coeff C O hbond/dreiding/morse H i 3.88 1.7241379 2.9 2 9 11 90
|
||||
pair_coeff C O hbond/dreiding/morse H i 3.88 1.7241379 2.9 2 9.0 11.0 90.0
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
@ -65,7 +64,8 @@ force field, given by:
|
||||
|
||||
where :math:`r_{\rm in}` is the inner spline distance cutoff,
|
||||
:math:`r_{\rm out}` is the outer distance cutoff, :math:`\theta_c` is
|
||||
the angle cutoff, and *n* is the cosine periodicity.
|
||||
the angle cutoff, and :math:`n` is the power of the cosine of the angle
|
||||
:math:`\theta`.
|
||||
|
||||
Here, *r* is the radial distance between the donor (D) and acceptor
|
||||
(A) atoms and :math:`\theta` is the bond angle between the acceptor, the
|
||||
@ -217,7 +217,8 @@ These pair styles do not support the :doc:`pair_modify <pair_modify>`
|
||||
tail option for adding long-range tail corrections to energy and
|
||||
pressure.
|
||||
|
||||
These pair styles do not write their information to :doc:`binary restart files <restart>`, so pair_style and pair_coeff commands need to be
|
||||
These pair styles do not write their information to :doc:`binary restart
|
||||
files <restart>`, so pair_style and pair_coeff commands need to be
|
||||
re-specified in an input script that reads a restart file.
|
||||
|
||||
These pair styles can only be used via the *pair* keyword of the
|
||||
|
||||
@ -31,7 +31,7 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
Pair style *rheo* computes pressure and viscous forces between particles
|
||||
in the :doc:`rheo package <Howto_rheo>`. If thermal evolution is turned
|
||||
|
||||
@ -21,7 +21,7 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
Style *rheo/solid* is effectively a copy of pair style
|
||||
:doc:`bpm/spring <pair_bpm_spring>` except it only applies forces
|
||||
|
||||
@ -18,13 +18,13 @@ Syntax
|
||||
*delete* = no args
|
||||
*block* args = xlo xhi ylo yhi zlo zhi
|
||||
xlo,xhi,ylo,yhi,zlo,zhi = bounds of block in all dimensions (distance units)
|
||||
xlo,xhi,ylo,yhi,zlo,zhi can be a variable
|
||||
xlo,xhi,ylo,yhi,zlo,zhi can be a variable (see below)
|
||||
*cone* args = dim c1 c2 radlo radhi lo hi
|
||||
dim = *x* or *y* or *z* = axis of cone
|
||||
c1,c2 = coords of cone axis in other 2 dimensions (distance units)
|
||||
radlo,radhi = cone radii at lo and hi end (distance units)
|
||||
lo,hi = bounds of cone in dim (distance units)
|
||||
c1,c2,radlo,radhi,lo,hi can be a variable (see below)
|
||||
c1,c2,radlo,radhi,lo,hi can be a variable (see below)
|
||||
*cylinder* args = dim c1 c2 radius lo hi
|
||||
dim = *x* or *y* or *z* = axis of cylinder
|
||||
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
|
||||
@ -38,6 +38,7 @@ Syntax
|
||||
*plane* args = px py pz nx ny nz
|
||||
px,py,pz = point on the plane (distance units)
|
||||
nx,ny,nz = direction normal to plane (distance units)
|
||||
px,py,pz can be a variable (see below)
|
||||
*prism* args = xlo xhi ylo yhi zlo zhi xy xz yz
|
||||
xlo,xhi,ylo,yhi,zlo,zhi = bounds of untilted prism (distance units)
|
||||
xy = distance to tilt y in x direction (distance units)
|
||||
@ -166,7 +167,7 @@ extending in the y-direction from -5.0 to the upper box boundary.
|
||||
|
||||
.. versionadded:: 4May2022
|
||||
|
||||
For style *ellipsoid*, an axis-aligned ellipsoid is defined. The
|
||||
For style *ellipsoid*, an axis-aligned ellipsoid is defined. The
|
||||
ellipsoid has its center at (x,y,z) and is defined by 3 axis-aligned
|
||||
vectors given by A = (a,0,0); B = (0,b,0); C = (0,0,c). Note that
|
||||
although the ellipsoid is specified as axis-aligned it can be rotated
|
||||
@ -206,9 +207,10 @@ parameters a,b,c for style *ellipsoid*, can each be specified as an
|
||||
equal-style :doc:`variable <variable>`. Likewise, for style *sphere*
|
||||
and *ellipsoid* the x-, y-, and z- coordinates of the center of the
|
||||
sphere/ellipsoid can be specified as an equal-style variable. And for
|
||||
style *cylinder* the two center positions c1 and c2 for the location
|
||||
of the cylinder axes can be specified as a equal-style variable. For style *cone*
|
||||
all properties can be defined via equal-style variables.
|
||||
style *cylinder* the two center positions c1 and c2 for the location of
|
||||
the cylinder axes can be specified as a equal-style variable. For style
|
||||
*cone* all properties can be defined via equal-style variables. For
|
||||
style *plane* the point can be defined via equal-style variables.
|
||||
|
||||
If the value is a variable, it should be specified as v_name, where
|
||||
name is the variable name. In this case, the variable will be
|
||||
|
||||
@ -1042,7 +1042,7 @@ label2type(), but returns 1 if the type label has been assigned,
|
||||
otherwise it returns 0. This function can be used to check if a
|
||||
particular type label already exists in the simulation.
|
||||
|
||||
.. versionadded:: TBD
|
||||
.. versionadded:: 29Aug2024
|
||||
|
||||
The is_timeout() function returns 1 when the :doc:`timer timeout
|
||||
<timer>` has expired otherwise it returns 0. This function can be used
|
||||
|
||||
@ -141,6 +141,7 @@ arg
|
||||
arge
|
||||
args
|
||||
argv
|
||||
Armv
|
||||
arrhenius
|
||||
Arun
|
||||
arXiv
|
||||
@ -215,7 +216,6 @@ ba
|
||||
Babadi
|
||||
Babaei
|
||||
backcolor
|
||||
backends
|
||||
Baczewski
|
||||
Bagchi
|
||||
Bagi
|
||||
@ -1539,6 +1539,7 @@ idx
|
||||
ie
|
||||
ielement
|
||||
ieni
|
||||
ifdef
|
||||
ifdefs
|
||||
iff
|
||||
ifort
|
||||
@ -2725,6 +2726,7 @@ OMP
|
||||
oneAPI
|
||||
onebody
|
||||
onelevel
|
||||
oneMKL
|
||||
oneway
|
||||
onlysalt
|
||||
ons
|
||||
@ -4130,6 +4132,7 @@ Xiaowang
|
||||
Xie
|
||||
xk
|
||||
xlat
|
||||
xlattice
|
||||
xlo
|
||||
xmax
|
||||
Xmax
|
||||
@ -4181,6 +4184,7 @@ yflag
|
||||
yhi
|
||||
yi
|
||||
ylat
|
||||
ylattice
|
||||
ylo
|
||||
ylz
|
||||
ymax
|
||||
@ -4229,6 +4233,7 @@ Ziegenhain
|
||||
zincblende
|
||||
zj
|
||||
Zj
|
||||
zlattice
|
||||
zlim
|
||||
zlo
|
||||
Zm
|
||||
|
||||
@ -41,7 +41,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
liblammpsplugin_t *liblammpsplugin_load(const char *lib)
|
||||
{
|
||||
liblammpsplugin_t *lmp;
|
||||
@ -106,6 +105,7 @@ liblammpsplugin_t *liblammpsplugin_load(const char *lib)
|
||||
ADDSYM(map_atom);
|
||||
|
||||
ADDSYM(extract_atom_datatype);
|
||||
ADDSYM(extract_atom_size);
|
||||
ADDSYM(extract_atom);
|
||||
|
||||
ADDSYM(extract_compute);
|
||||
@ -191,6 +191,9 @@ liblammpsplugin_t *liblammpsplugin_load(const char *lib)
|
||||
ADDSYM(is_running);
|
||||
ADDSYM(force_timeout);
|
||||
|
||||
// symbol not present
|
||||
if (!lmp->config_has_exceptions) return NULL;
|
||||
|
||||
lmp->has_exceptions = lmp->config_has_exceptions();
|
||||
if (lmp->has_exceptions) {
|
||||
ADDSYM(has_error);
|
||||
|
||||
@ -151,6 +151,7 @@ struct _liblammpsplugin {
|
||||
int (*map_atom)(void *, const void *);
|
||||
|
||||
int (*extract_atom_datatype)(void *, const char *);
|
||||
int (*extract_atom_size)(void *, const char *, int);
|
||||
void *(*extract_atom)(void *, const char *);
|
||||
|
||||
void *(*extract_compute)(void *, const char *, int, int);
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(paceplugin VERSION 1.0 LANGUAGES CXX)
|
||||
project(paceplugin VERSION 1.1 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include(CheckIncludeFileCXX)
|
||||
@ -15,7 +15,11 @@ include(ML-PACE)
|
||||
##########################
|
||||
# building the plugins
|
||||
|
||||
add_library(paceplugin MODULE paceplugin.cpp ${LAMMPS_SOURCE_DIR}/ML-PACE/pair_pace.cpp)
|
||||
add_library(paceplugin MODULE paceplugin.cpp
|
||||
${LAMMPS_SOURCE_DIR}/ML-PACE/pair_pace.cpp
|
||||
${LAMMPS_SOURCE_DIR}/ML-PACE/pair_pace_extrapolation.cpp
|
||||
${LAMMPS_SOURCE_DIR}/ML-PACE/compute_pace.cpp)
|
||||
|
||||
target_link_libraries(paceplugin PRIVATE pace)
|
||||
target_link_libraries(paceplugin PRIVATE lammps)
|
||||
target_include_directories(paceplugin PRIVATE ${LAMMPS_SOURCE_DIR}/ML-PACE)
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
#include "version.h"
|
||||
|
||||
#include "pair_pace.h"
|
||||
#include "pair_pace_extrapolation.h"
|
||||
#include "compute_pace.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
@ -11,6 +13,16 @@ static Pair *pair_pace_creator(LAMMPS *lmp)
|
||||
return new PairPACE(lmp);
|
||||
}
|
||||
|
||||
static Pair *pair_pace_extrapolation_creator(LAMMPS *lmp)
|
||||
{
|
||||
return new PairPACEExtrapolation(lmp);
|
||||
}
|
||||
|
||||
static Compute *compute_pace_creator(LAMMPS *lmp, int argc, char **argv)
|
||||
{
|
||||
return new ComputePACE(lmp, argc, argv);
|
||||
}
|
||||
|
||||
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||
{
|
||||
lammpsplugin_t plugin;
|
||||
@ -25,4 +37,24 @@ extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||
plugin.creator.v1 = (lammpsplugin_factory1 *) &pair_pace_creator;
|
||||
plugin.handle = handle;
|
||||
(*register_plugin)(&plugin, lmp);
|
||||
|
||||
// register pace/extrapolation pair style
|
||||
plugin.version = LAMMPS_VERSION;
|
||||
plugin.style = "pair";
|
||||
plugin.name = "pace/extrapolation";
|
||||
plugin.info = "PACE plugin extrapolation pair style v1.0";
|
||||
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||
plugin.creator.v1 = (lammpsplugin_factory1 *) &pair_pace_extrapolation_creator;
|
||||
plugin.handle = handle;
|
||||
(*register_plugin)(&plugin, lmp);
|
||||
|
||||
// register pace compute style
|
||||
plugin.version = LAMMPS_VERSION;
|
||||
plugin.style = "compute";
|
||||
plugin.name = "pace";
|
||||
plugin.info = "PACE plugin compute style v1.0";
|
||||
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||
plugin.creator.v2 = (lammpsplugin_factory2 *) &compute_pace_creator;
|
||||
plugin.handle = handle;
|
||||
(*register_plugin)(&plugin, lmp);
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ InstallDir "$LOCALAPPDATA\${PACEPLUGIN}"
|
||||
|
||||
ShowInstDetails show
|
||||
ShowUninstDetails show
|
||||
SetCompressor lzma
|
||||
SetCompressor zlib
|
||||
|
||||
!define MUI_ABORTWARNING
|
||||
|
||||
|
||||
59
examples/PACKAGES/plumed/plugin/CMakeLists.txt
Normal file
@ -0,0 +1,59 @@
|
||||
# -*- 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.16)
|
||||
|
||||
project(plumedplugin VERSION 1.0 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include(CheckIncludeFileCXX)
|
||||
include(LAMMPSInterfacePlugin)
|
||||
include(PLUMED)
|
||||
|
||||
##########################
|
||||
# building the plugins
|
||||
|
||||
add_library(plumedplugin MODULE plumedplugin.cpp ${LAMMPS_SOURCE_DIR}/PLUMED/fix_plumed.cpp)
|
||||
target_link_libraries(plumedplugin PRIVATE LAMMPS::PLUMED)
|
||||
target_link_libraries(plumedplugin PRIVATE lammps)
|
||||
target_include_directories(plumedplugin PRIVATE ${LAMMPS_SOURCE_DIR}/PLUMED)
|
||||
set_target_properties(plumedplugin PROPERTIES PREFIX "" SUFFIX ".so")
|
||||
|
||||
# MacOS seems to need this
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||
set_target_properties(plumedplugin 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(plumedplugin PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
set_target_properties(plumedplugin PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
|
||||
endif()
|
||||
|
||||
get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h LAMMPS_VERSION)
|
||||
find_program(MAKENSIS_PATH makensis)
|
||||
if(MAKENSIS_PATH)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/lammps.ico
|
||||
${CMAKE_SOURCE_DIR}/lammps-text-logo-wide.bmp ${CMAKE_SOURCE_DIR}/plumedplugin.nsis
|
||||
${CMAKE_BINARY_DIR})
|
||||
if(BUILD_MPI)
|
||||
if(USE_MSMPI)
|
||||
add_custom_target(package ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION}-MSMPI plumedplugin.nsis
|
||||
DEPENDS plumedplugin plumed_copy lammps.ico lammps-text-logo-wide.bmp plumedplugin.nsis
|
||||
BYPRODUCTS LAMMPS-PLUMED-plugin-${LAMMPS_VERSION}-MSMPI.exe)
|
||||
else()
|
||||
add_custom_target(package ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION}-MPI plumedplugin.nsis
|
||||
DEPENDS plumedplugin plumed_copy lammps.ico lammps-text-logo-wide.bmp plumedplugin.nsis
|
||||
BYPRODUCTS LAMMPS-PLUMED-plugin-${LAMMPS_VERSION}-MPI.exe)
|
||||
endif()
|
||||
else()
|
||||
add_custom_target(package ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION} plumedplugin.nsis
|
||||
COMMAND ${CMAKE_COMMAND} -E echo ${PWD}
|
||||
DEPENDS plumedplugin plumed_copy lammps.ico lammps-text-logo-wide.bmp plumedplugin.nsis
|
||||
BYPRODUCTS LAMMPS-PLUMED-plugin-${LAMMPS_VERSION}.exe)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
set_target_properties(plumedplugin PROPERTIES LINK_FLAGS "-rdynamic")
|
||||
endif()
|
||||
1
examples/PACKAGES/plumed/plugin/LAMMPSInterfacePlugin.cmake
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../cmake/Modules/LAMMPSInterfacePlugin.cmake
|
||||
1
examples/PACKAGES/plumed/plugin/PLUMED.cmake
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../cmake/Modules/Packages/PLUMED.cmake
|
||||
2
examples/PACKAGES/plumed/plugin/README.txt
Normal file
@ -0,0 +1,2 @@
|
||||
This folder contains a loader and support files to build the PLUMED package as plugin.
|
||||
For more information please see: https://docs.lammps.org/Developer_plugins.html
|
||||
BIN
examples/PACKAGES/plumed/plugin/lammps-text-logo-wide.bmp
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
examples/PACKAGES/plumed/plugin/lammps.ico
Normal file
|
After Width: | Height: | Size: 204 KiB |
28
examples/PACKAGES/plumed/plugin/plumedplugin.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
#include "lammpsplugin.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "fix_plumed.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
static Fix *fix_plumed_creator(LAMMPS *lmp, int argc, char **argv)
|
||||
{
|
||||
return new FixPlumed(lmp, argc, argv);
|
||||
}
|
||||
|
||||
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||
{
|
||||
lammpsplugin_t plugin;
|
||||
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
|
||||
|
||||
// register plumed fix style
|
||||
plugin.version = LAMMPS_VERSION;
|
||||
plugin.style = "fix";
|
||||
plugin.name = "plumed";
|
||||
plugin.info = "Plumed2 plugin fix style v1.0";
|
||||
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||
plugin.creator.v1 = (lammpsplugin_factory1 *) &fix_plumed_creator;
|
||||
plugin.handle = handle;
|
||||
(*register_plugin)(&plugin, lmp);
|
||||
}
|
||||
172
examples/PACKAGES/plumed/plugin/plumedplugin.nsis
Normal file
@ -0,0 +1,172 @@
|
||||
#!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 PLUMEDPLUGIN "LAMMPS PLUMED Plugin ${VERSION}"
|
||||
OutFile "LAMMPS-PLUMED-plugin-${VERSION}.exe"
|
||||
|
||||
Name "${PLUMEDPLUGIN}"
|
||||
InstallDir "$LOCALAPPDATA\${PLUMEDPLUGIN}"
|
||||
|
||||
ShowInstDetails show
|
||||
ShowUninstDetails show
|
||||
SetCompressor zlib
|
||||
|
||||
!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-PLUMED" "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-PLUMED" "UninstallString"
|
||||
SetRegView LastUsed
|
||||
${If} ${Errors}
|
||||
DetailPrint "LAMMPS PLUMED plugin not (yet) installed"
|
||||
${Else}
|
||||
MessageBox MB_YESNO "LAMMPS PLUMED 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 "${PLUMEDPLUGIN}" SecPlumedplugin
|
||||
SectionIn RO
|
||||
# Write LAMMPS installation bitness marker. Always use 32-bit registry view
|
||||
SetRegView 32
|
||||
IntFmt $0 "0x%08X" 64
|
||||
WriteRegDWORD HKCU "Software\LAMMPS-PLUMED" "Bits" $0
|
||||
|
||||
# Switch to "native" registry view
|
||||
SetRegView 64
|
||||
SetShellVarContext current
|
||||
|
||||
SetOutPath "$INSTDIR"
|
||||
CreateDirectory "$INSTDIR\patches"
|
||||
CreateDirectory "$INSTDIR\bin"
|
||||
File lammps.ico
|
||||
File plumedplugin.so
|
||||
|
||||
SetOutPath "$INSTDIR\bin"
|
||||
File plumed.exe
|
||||
|
||||
# Register Application and its uninstaller
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"DisplayName" "${PLUMEDPLUGIN}"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"Publisher" "The LAMMPS and PLUMED Developers"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"URLInfoAbout" "lammps.org"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"DisplayIcon" "$INSTDIR\lammps.ico"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"DisplayVersion" "${VERSION}"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"InstallLocation" "$INSTDIR"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"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-PLUMED" \
|
||||
"EstimatedSize" "$0"
|
||||
|
||||
# update path variables
|
||||
EnVar::SetHKCU
|
||||
# add plumed executable path
|
||||
EnVar::AddValue "PATH" "$INSTDIR\bin"
|
||||
# add to LAMMPS plugin search path
|
||||
EnVar::AddValue "LAMMPS_PLUGIN_PATH" "$INSTDIR"
|
||||
# add plumed2 patch files
|
||||
EnVar::AddValue "PLUMED_ROOT" "$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-PLUMED"
|
||||
|
||||
# unregister extension, and uninstall info
|
||||
SetRegView 64
|
||||
SetShellVarContext current
|
||||
# unregister installation
|
||||
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED"
|
||||
|
||||
# update path variables
|
||||
EnVar::SetHKCU
|
||||
# remove plumed executable path
|
||||
EnVar::DeleteValue "PATH" "$INSTDIR\bin"
|
||||
# remove entry from LAMMPS plugin search path
|
||||
EnVar::DeleteValue "LAMMPS_PLUGIN_PATH" "$INSTDIR"
|
||||
# remove plumed patch environment
|
||||
EnVar::Delete "PLUMED_ROOT"
|
||||
|
||||
RMDir /r /REBOOTOK "$INSTDIR\patches"
|
||||
RMDir /r /REBOOTOK "$INSTDIR\bin"
|
||||
Delete /REBOOTOK "$INSTDIR\plumedplugin.so"
|
||||
Delete /REBOOTOK "$INSTDIR\Uninstall.exe"
|
||||
Delete /REBOOTOK "$INSTDIR\lammps.ico"
|
||||
RMDir /REBOOTOK "$INSTDIR"
|
||||
SectionEnd
|
||||
|
||||
# Local Variables:
|
||||
# mode: sh
|
||||
# End:
|
||||
@ -542,6 +542,14 @@ MODULE LIBLAMMPS
|
||||
INTEGER(c_int) :: lammps_extract_atom_datatype
|
||||
END FUNCTION lammps_extract_atom_datatype
|
||||
|
||||
FUNCTION lammps_extract_atom_size(handle, name, dtype) BIND(C)
|
||||
IMPORT :: c_ptr, c_int
|
||||
IMPLICIT NONE
|
||||
TYPE(c_ptr), INTENT(IN), VALUE :: handle, name
|
||||
INTEGER(c_int), INTENT(IN), VALUE :: dtype
|
||||
INTEGER(c_int) :: lammps_extract_atom_size
|
||||
END FUNCTION lammps_extract_atom_size
|
||||
|
||||
FUNCTION lammps_extract_atom(handle, name) BIND(C)
|
||||
IMPORT :: c_ptr
|
||||
IMPLICIT NONE
|
||||
@ -1435,7 +1443,7 @@ CONTAINS
|
||||
IF (SIZE_TAGINT == 8) THEN
|
||||
Cptr = C_LOC(id)
|
||||
ELSE
|
||||
id32 = id
|
||||
id32 = INT(id, c_int)
|
||||
Cptr = C_LOC(id32)
|
||||
END IF
|
||||
lmp_map_atom_big = lammps_map_atom(self%handle, Cptr) + 1
|
||||
@ -1461,43 +1469,35 @@ CONTAINS
|
||||
ntypes = lmp_extract_setting(self, 'ntypes')
|
||||
Cname = f2c_string(name)
|
||||
datatype = lammps_extract_atom_datatype(self%handle, Cname)
|
||||
nrows = lammps_extract_atom_size(self%handle, Cname, LMP_SIZE_ROWS)
|
||||
ncols = lammps_extract_atom_size(self%handle, Cname, LMP_SIZE_COLS)
|
||||
Cptr = lammps_extract_atom(self%handle, Cname)
|
||||
CALL lammps_free(Cname)
|
||||
|
||||
SELECT CASE (name)
|
||||
CASE ('mass')
|
||||
ncols = ntypes + 1
|
||||
nrows = 1
|
||||
CASE ('x','v','f','mu','omega','torque','angmom')
|
||||
ncols = nmax
|
||||
nrows = 3
|
||||
CASE DEFAULT
|
||||
ncols = nmax
|
||||
nrows = 1
|
||||
END SELECT
|
||||
|
||||
peratom_data%lammps_instance => self
|
||||
SELECT CASE (datatype)
|
||||
CASE (LAMMPS_INT)
|
||||
peratom_data%datatype = DATA_INT_1D
|
||||
CALL C_F_POINTER(Cptr, peratom_data%i32_vec, [ncols])
|
||||
CALL C_F_POINTER(Cptr, peratom_data%i32_vec, [nrows])
|
||||
CASE (LAMMPS_INT64)
|
||||
peratom_data%datatype = DATA_INT64_1D
|
||||
CALL C_F_POINTER(Cptr, peratom_data%i64_vec, [ncols])
|
||||
CALL C_F_POINTER(Cptr, peratom_data%i64_vec, [nrows])
|
||||
CASE (LAMMPS_DOUBLE)
|
||||
peratom_data%datatype = DATA_DOUBLE_1D
|
||||
! The mass array is allocated from 0, but only used from 1. We also want to use it from 1.
|
||||
IF (name == 'mass') THEN
|
||||
CALL C_F_POINTER(Cptr, dummy, [ncols])
|
||||
CALL C_F_POINTER(Cptr, dummy, [nrows])
|
||||
peratom_data%r64_vec(0:) => dummy
|
||||
ELSE
|
||||
CALL C_F_POINTER(Cptr, peratom_data%r64_vec, [ncols])
|
||||
CALL C_F_POINTER(Cptr, peratom_data%r64_vec, [nrows])
|
||||
END IF
|
||||
CASE (LAMMPS_DOUBLE_2D)
|
||||
peratom_data%datatype = DATA_DOUBLE_2D
|
||||
! First, we dereference the void** pointer to point to the void*
|
||||
CALL C_F_POINTER(Cptr, Catomptr, [ncols])
|
||||
CALL C_F_POINTER(Cptr, Catomptr, [nrows])
|
||||
! Catomptr(1) now points to the first element of the array
|
||||
CALL C_F_POINTER(Catomptr(1), peratom_data%r64_mat, [nrows,ncols])
|
||||
! rows and columns are swapped in Fortran
|
||||
CALL C_F_POINTER(Catomptr(1), peratom_data%r64_mat, [ncols,nrows])
|
||||
CASE (-1)
|
||||
CALL lmp_error(self, LMP_ERROR_ALL + LMP_ERROR_WORLD, &
|
||||
'per-atom property ' // name // ' not found in extract_setting')
|
||||
@ -2604,6 +2604,8 @@ CONTAINS
|
||||
TYPE(c_ptr) :: Cid, Ctype, Cx, Cv, Cimage
|
||||
INTEGER(c_int) :: tagint_size, atoms_created
|
||||
|
||||
Ctype = c_null_ptr
|
||||
Cx = c_null_ptr
|
||||
! type is actually NOT optional, but we can't make id optional without it,
|
||||
! so we check at run-time
|
||||
IF (.NOT. PRESENT(type)) THEN
|
||||
|
||||
31
lib/gpu/Makefile.aurora
Normal file
@ -0,0 +1,31 @@
|
||||
# /* ----------------------------------------------------------------------
|
||||
# Generic Linux Makefile for OpenCL
|
||||
# ------------------------------------------------------------------------- */
|
||||
|
||||
# which file will be copied to Makefile.lammps
|
||||
|
||||
EXTRAMAKE = Makefile.lammps.opencl
|
||||
|
||||
# OCL_TUNE = -DFERMI_OCL # -- Uncomment for NVIDIA Fermi
|
||||
# OCL_TUNE = -DKEPLER_OCL # -- Uncomment for NVIDIA Kepler
|
||||
# OCL_TUNE = -DCYPRESS_OCL # -- Uncomment for AMD Cypress
|
||||
OCL_TUNE = -DGENERIC_OCL # -- Uncomment for generic device
|
||||
|
||||
# this setting should match LAMMPS Makefile
|
||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
||||
|
||||
LMP_INC = -DLAMMPS_SMALLBIG
|
||||
|
||||
OCL_INC = -I/opt/intel/oneapi/compiler/latest/linux/include/sycl/ # Path to CL directory
|
||||
OCL_CPP = mpicxx -cxx=icpx -DCUDA_PROXY $(DEFAULT_DEVICE) -xHost -O2 -ffp-model=fast -qoverride-limits -DMPI_GERYON -DGERYON_NUMA_FISSION -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC) -DGERYON_NO_PROF
|
||||
OCL_LINK = -L/opt/intel/oneapi/compiler/latest/linux/lib/ -lOpenCL
|
||||
OCL_PREC = -D_SINGLE_DOUBLE
|
||||
|
||||
BIN_DIR = ./
|
||||
OBJ_DIR = ./
|
||||
LIB_DIR = ./
|
||||
AR = ar
|
||||
BSH = /bin/sh
|
||||
|
||||
include Opencl.makefile
|
||||
|
||||
@ -586,8 +586,25 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum,
|
||||
const int b2y=_block_cell_2d;
|
||||
const int g2x=static_cast<int>(ceil(static_cast<double>(_maxspecial)/b2x));
|
||||
const int g2y=static_cast<int>(ceil(static_cast<double>(nt)/b2y));
|
||||
_shared->k_transpose.set_size(g2x,g2y,b2x,b2y);
|
||||
_shared->k_transpose.run(&dev_special,&dev_special_t,&_maxspecial,&nt);
|
||||
// the maximum number of blocks on the device is typically 65535
|
||||
// in principle we can use a lower number to have more resource per block 32768
|
||||
const int max_num_blocks = 65535;
|
||||
int shift = 0;
|
||||
if (g2y < max_num_blocks) {
|
||||
_shared->k_transpose.set_size(g2x,g2y,b2x,b2y);
|
||||
_shared->k_transpose.run(&dev_special,&dev_special_t,&_maxspecial,&nt,&shift);
|
||||
} else {
|
||||
// using a fixed number of blocks
|
||||
int g2y_m = max_num_blocks;
|
||||
_shared->k_transpose.set_size(g2x,g2y_m,b2x,b2y);
|
||||
// number of chunks needed for the whole transpose
|
||||
const int num_chunks = ceil(static_cast<double>(g2y) / g2y_m);
|
||||
for (int i = 0; i < num_chunks; i++) {
|
||||
_shared->k_transpose.run(&dev_special,&dev_special_t,&_maxspecial,&nt,&shift);
|
||||
shift += g2y_m*b2y;
|
||||
}
|
||||
}
|
||||
|
||||
time_transpose.stop();
|
||||
}
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ __kernel void kernel_calc_cell_counts(const unsigned *restrict cell_id,
|
||||
|
||||
__kernel void transpose(__global tagint *restrict out,
|
||||
const __global tagint *restrict in,
|
||||
int columns_in, int rows_in)
|
||||
int columns_in, int rows_in, int shift)
|
||||
{
|
||||
__local tagint block[BLOCK_CELL_2D][BLOCK_CELL_2D+1];
|
||||
|
||||
@ -158,15 +158,15 @@ __kernel void transpose(__global tagint *restrict out,
|
||||
|
||||
unsigned i=bi*BLOCK_CELL_2D+ti;
|
||||
unsigned j=bj*BLOCK_CELL_2D+tj;
|
||||
if ((i<columns_in) && (j<rows_in))
|
||||
block[tj][ti]=in[j*columns_in+i];
|
||||
if ((i<columns_in) && (j+shift<rows_in))
|
||||
block[tj][ti]=in[(j+shift)*columns_in+i];
|
||||
|
||||
__syncthreads();
|
||||
|
||||
i=bj*BLOCK_CELL_2D+ti;
|
||||
j=bi*BLOCK_CELL_2D+tj;
|
||||
if ((i<rows_in) && (j<columns_in))
|
||||
out[j*rows_in+i] = block[ti][tj];
|
||||
if ((i+shift<rows_in) && (j<columns_in))
|
||||
out[j*rows_in+i+shift] = block[ti][tj];
|
||||
}
|
||||
|
||||
#ifndef LAL_USE_OLD_NEIGHBOR
|
||||
|
||||
@ -1,12 +1,103 @@
|
||||
# CHANGELOG
|
||||
|
||||
## [4.4.01](https://github.com/kokkos/kokkos/tree/4.4.01)
|
||||
[Full Changelog](https://github.com/kokkos/kokkos/compare/4.0.00...4.4.01)
|
||||
|
||||
### Features:
|
||||
* Introduce new SequentialHostInit view allocation property [\#7229](https://github.com/kokkos/kokkos/pull/7229)
|
||||
|
||||
### Backend and Architecture Enhancements:
|
||||
|
||||
#### CUDA:
|
||||
* Experimental support for unified memory mode (intended for Grace-Hopper etc.) [\#6823](https://github.com/kokkos/kokkos/pull/6823)
|
||||
|
||||
### Bug Fixes
|
||||
* OpenMP: Fix issue related to the visibility of an internal symbol with shared libraries that affected `ScatterView` in particular [\#7284](https://github.com/kokkos/kokkos/pull/7284)
|
||||
* Fix implicit copy assignment operators in few AVX2 masks being deleted [#7296](https://github.com/kokkos/kokkos/pull/7296)
|
||||
|
||||
## [4.4.00](https://github.com/kokkos/kokkos/tree/4.4.00)
|
||||
[Full Changelog](https://github.com/kokkos/kokkos/compare/4.3.01...4.4.00)
|
||||
|
||||
### Features:
|
||||
* Add `Kokkos::View` conversions from and to [`std::mdspan`](https://en.cppreference.com/w/cpp/container/mdspan) [\#6830](https://github.com/kokkos/kokkos/pull/6830) [\#7069](https://github.com/kokkos/kokkos/pull/7069)
|
||||
|
||||
### Backend and Architecture Enhancements:
|
||||
|
||||
#### CUDA:
|
||||
* `nvcc_wrapper`: Adding ability to process `--disable-warnings` flag [\#6936](https://github.com/kokkos/kokkos/issues/6936)
|
||||
* Use recommended/max team size functions in Cuda ParallelFor and Reduce constructors [\#6891](https://github.com/kokkos/kokkos/issues/6891)
|
||||
* Improve compile-times when building with `Kokkos_ENABLE_DEBUG_BOUNDS_CHECK` in Cuda [\#7013](https://github.com/kokkos/kokkos/pull/7013)
|
||||
|
||||
#### HIP:
|
||||
* Use HIP builtin atomics [\#6882](https://github.com/kokkos/kokkos/pull/6882) [\#7000](https://github.com/kokkos/kokkos/pull/7000)
|
||||
* Enable user-specified compiler and linker flags for AMD GPUs [\#7127](https://github.com/kokkos/kokkos/pull/7127)
|
||||
|
||||
#### SYCL:
|
||||
* Add support for Graphs [\#6912](https://github.com/kokkos/kokkos/pull/6912)
|
||||
* Fix multi-GPU support [\#6887](https://github.com/kokkos/kokkos/pull/6887)
|
||||
* Improve performance of reduction and scan operations [\#6562](https://github.com/kokkos/kokkos/pull/6562), [\#6750](https://github.com/kokkos/kokkos/pull/6750)
|
||||
* Fix lock for guarding scratch space in `TeamPolicy` `parallel_reduce` [\#6988](https://github.com/kokkos/kokkos/pull/6988)
|
||||
* Include submission command queue property information into `SYCL::print_configuration()` [\#7004](https://github.com/kokkos/kokkos/pull/7004)
|
||||
|
||||
#### OpenACC:
|
||||
* Make `TeamPolicy` `parallel_for` execute on the correct async queue [\#7012](https://github.com/kokkos/kokkos/pull/7012)
|
||||
|
||||
#### OpenMPTarget:
|
||||
* Honor user requested loop ordering in `MDRange` policy [\#6925](https://github.com/kokkos/kokkos/pull/6925)
|
||||
* Prevent data races by guarding the scratch space used in `parallel_scan` [\#6998](https://github.com/kokkos/kokkos/pull/6998)
|
||||
|
||||
#### HPX:
|
||||
* Workaround issue with template argument deduction to support compilation with NVCC [\#7015](https://github.com/kokkos/kokkos/pull/7015)
|
||||
|
||||
### General Enhancements
|
||||
* Improve performance of view copies in host parallel regions [\#6730](https://github.com/kokkos/kokkos/pull/6730)
|
||||
* Harmonize convertibility rules of `Kokkos::RandomAccessIterator` with `View`s [\#6929](https://github.com/kokkos/kokkos/pull/6929)
|
||||
* Add a check precondition non-overlapping ranges for the `adjacent_difference` algorithm in debug mode [\#6922](https://github.com/kokkos/kokkos/pull/6922)
|
||||
* Add deduction guides for `TeamPolicy` [\#7030](https://github.com/kokkos/kokkos/pull/7030)
|
||||
* SIMD: Allow flexible vector width for 32 bit types [\#6802](https://github.com/kokkos/kokkos/pull/6802)
|
||||
* Updates for `Kokkos::Array`: add `kokkos_swap(Array<T, N>)` specialization [\#6943](https://github.com/kokkos/kokkos/pull/6943), add `Kokkos::to_array` [\#6375](https://github.com/kokkos/kokkos/pull/6375), make `Kokkos::Array` equality-comparable [\#7148](https://github.com/kokkos/kokkos/pull/7148)
|
||||
* Structured binding support for `Kokkos::complex` [\#7040](https://github.com/kokkos/kokkos/pull/7040)
|
||||
|
||||
### Build System Changes
|
||||
* Do not require OpenMP support for languages other than CXX [\#6965](https://github.com/kokkos/kokkos/pull/6965)
|
||||
* Update Intel GPU architectures in Makefile [\#6895](https://github.com/kokkos/kokkos/pull/6895)
|
||||
* Fix use of OpenMP with Cuda or HIP as compile language [\#6972](https://github.com/kokkos/kokkos/pull/6972)
|
||||
* Define and enforce new minimum compiler versions for C++20 support [\#7128](https://github.com/kokkos/kokkos/pull/7128), [\#7123](https://github.com/kokkos/kokkos/pull/7123)
|
||||
* Add nvidia Grace CPU architecture: `Kokkos_ARCH_ARMV9_GRACE` [\#7158](https://github.com/kokkos/kokkos/pull/7158)
|
||||
* Fix Makefile.kokkos for Threads [\#6896](https://github.com/kokkos/kokkos/pull/6896)
|
||||
* Remove support for NVHPC as CUDA device compiler [\#6987](https://github.com/kokkos/kokkos/pull/6987)
|
||||
* Fix using CUDAToolkit for CMake 3.28.4 and higher [\#7062](https://github.com/kokkos/kokkos/pull/7062)
|
||||
|
||||
### Incompatibilities (i.e. breaking changes)
|
||||
* Drop `Kokkos::Array` special treatment in `View`s [\#6906](https://github.com/kokkos/kokkos/pull/6906)
|
||||
* Drop `Experimental::RawMemoryAllocationFailure` [\#7145](https://github.com/kokkos/kokkos/pull/7145)
|
||||
|
||||
### Deprecations
|
||||
* Remove `Experimental::LayoutTiled` class template and deprecate `is_layouttiled` trait [\#6907](https://github.com/kokkos/kokkos/pull/6907)
|
||||
* Deprecate `Kokkos::layout_iterate_type_selector` [\#7076](https://github.com/kokkos/kokkos/pull/7076)
|
||||
* Deprecate specialization of `Kokkos::pair` for a single element [\#6947](https://github.com/kokkos/kokkos/pull/6947)
|
||||
* Deprecate `deep_copy` of `UnorderedMap` of different size [\#6812](https://github.com/kokkos/kokkos/pull/6812)
|
||||
* Deprecate trailing `Proxy` template argument of `Kokkos::Array` [\#6934](https://github.com/kokkos/kokkos/pull/6934)
|
||||
* Deprecate implicit conversions of integers to `ChunkSize` [\#7151](https://github.com/kokkos/kokkos/pull/7151)
|
||||
* Deprecate implicit conversions to execution spaces [\#7156](https://github.com/kokkos/kokkos/pull/7156)
|
||||
|
||||
### Bug Fixes
|
||||
* Do not return a copy of the input functor in `Experimental::for_each` [\#6910](https://github.com/kokkos/kokkos/pull/6910)
|
||||
* Fix `realloc` on views of non-default constructible element types [\#6993](https://github.com/kokkos/kokkos/pull/6993)
|
||||
* Fix undefined behavior in `View` initialization or fill with zeros [\#7014](https://github.com/kokkos/kokkos/pull/7014)
|
||||
* Fix `sort_by_key` on host execution spaces when building with NVCC [\#7059](https://github.com/kokkos/kokkos/pull/7059)
|
||||
* Fix using shared libraries and -fvisibility=hidden [\#7065](https://github.com/kokkos/kokkos/pull/7065)
|
||||
* Fix view reference counting when functor copy constructor throws in parallel dispatch [\#6289](https://github.com/kokkos/kokkos/pull/6289)
|
||||
* Fix `initialize(InitializationSetting)` for handling `print_configuration` setting [\#7098](https://github.com/kokkos/kokkos/pull/7098)
|
||||
* Thread safety fixes for the Serial and OpenMP backend [\#7080](https://github.com/kokkos/kokkos/pull/7080), [\#6151](https://github.com/kokkos/kokkos/pull/6151)
|
||||
|
||||
## [4.3.01](https://github.com/kokkos/kokkos/tree/4.3.01)
|
||||
[Full Changelog](https://github.com/kokkos/kokkos/compare/4.3.00...4.3.01)
|
||||
|
||||
### Backend and Architecture Enhancements:
|
||||
|
||||
#### HIP:
|
||||
* MI300 support unified memory support [\#6877](https://github.com/kokkos/kokkos/pull/6877)
|
||||
* MI300 support unified memory [\#6877](https://github.com/kokkos/kokkos/pull/6877)
|
||||
|
||||
### Bug Fixes
|
||||
* Serial: Use the provided execution space instance in TeamPolicy [\#6951](https://github.com/kokkos/kokkos/pull/6951)
|
||||
|
||||
65
lib/kokkos/CITATION.cff
Normal file
@ -0,0 +1,65 @@
|
||||
cff-version: 1.2.0
|
||||
title: Kokkos
|
||||
message: >-
|
||||
If you use this software, please cite the overview paper
|
||||
type: software
|
||||
authors:
|
||||
- name: The Kokkos authors
|
||||
website: https://kokkos.org/community/team/
|
||||
identifiers:
|
||||
- type: url
|
||||
website: https://kokkos.org/kokkos-core-wiki/citation.html
|
||||
repository-code: 'https://github.com/kokkos/kokkos'
|
||||
url: 'https://kokkos.org/'
|
||||
license: Apache-2.0
|
||||
preferred-citation:
|
||||
type: article
|
||||
authors:
|
||||
- given-names: Christian R.
|
||||
family-names: Trott
|
||||
- given-names: Damien
|
||||
family-names: Lebrun-Grandié
|
||||
- given-names: Daniel
|
||||
family-names: Arndt
|
||||
- family-names: Ciesko
|
||||
given-names: Jan
|
||||
- given-names: Vinh
|
||||
family-names: Dang
|
||||
- family-names: Ellingwood
|
||||
given-names: Nathan
|
||||
- given-names: Rahulkumar
|
||||
family-names: Gayatri
|
||||
- given-names: Evan
|
||||
family-names: Harvey
|
||||
- given-names: Daisy S.
|
||||
family-names: Hollman
|
||||
- given-names: Dan
|
||||
family-names: Ibanez
|
||||
- given-names: Nevin
|
||||
family-names: Liber
|
||||
- given-names: Jonathan
|
||||
family-names: Madsen
|
||||
- given-names: Jeff
|
||||
family-names: Miles
|
||||
- given-names: David
|
||||
family-names: Poliakoff
|
||||
- given-names: Amy
|
||||
family-names: Powell
|
||||
- given-names: Sivasankaran
|
||||
family-names: Rajamanickam
|
||||
- given-names: Mikael
|
||||
family-names: Simberg
|
||||
- given-names: Dan
|
||||
family-names: Sunderland
|
||||
- given-names: Bruno
|
||||
family-names: Turcksin
|
||||
- given-names: Jeremiah
|
||||
family-names: Wilke
|
||||
doi: 10.1109/TPDS.2021.3097283
|
||||
journal: IEEE Transactions on Parallel and Distributed Systems
|
||||
start: 805
|
||||
end: 817
|
||||
title: "Kokkos 3: Programming Model Extensions for the Exascale Era"
|
||||
volume: 33
|
||||
issue: 4
|
||||
year: 2022
|
||||
@ -150,7 +150,7 @@ ENDIF()
|
||||
|
||||
|
||||
set(Kokkos_VERSION_MAJOR 4)
|
||||
set(Kokkos_VERSION_MINOR 3)
|
||||
set(Kokkos_VERSION_MINOR 4)
|
||||
set(Kokkos_VERSION_PATCH 1)
|
||||
set(Kokkos_VERSION "${Kokkos_VERSION_MAJOR}.${Kokkos_VERSION_MINOR}.${Kokkos_VERSION_PATCH}")
|
||||
message(STATUS "Kokkos version: ${Kokkos_VERSION}")
|
||||
|
||||
@ -11,7 +11,7 @@ CXXFLAGS += $(SHFLAGS)
|
||||
endif
|
||||
|
||||
KOKKOS_VERSION_MAJOR = 4
|
||||
KOKKOS_VERSION_MINOR = 3
|
||||
KOKKOS_VERSION_MINOR = 4
|
||||
KOKKOS_VERSION_PATCH = 1
|
||||
KOKKOS_VERSION = $(shell echo $(KOKKOS_VERSION_MAJOR)*10000+$(KOKKOS_VERSION_MINOR)*100+$(KOKKOS_VERSION_PATCH) | bc)
|
||||
|
||||
@ -21,11 +21,11 @@ KOKKOS_DEVICES ?= "OpenMP"
|
||||
# Options:
|
||||
# Intel: KNC,KNL,SNB,HSW,BDW,SKL,SKX,ICL,ICX,SPR
|
||||
# NVIDIA: Kepler,Kepler30,Kepler32,Kepler35,Kepler37,Maxwell,Maxwell50,Maxwell52,Maxwell53,Pascal60,Pascal61,Volta70,Volta72,Turing75,Ampere80,Ampere86,Ada89,Hopper90
|
||||
# ARM: ARMv80,ARMv81,ARMv8-ThunderX,ARMv8-TX2,A64FX
|
||||
# ARM: ARMv80,ARMv81,ARMv8-ThunderX,ARMv8-TX2,A64FX,ARMv9-Grace
|
||||
# IBM: Power8,Power9
|
||||
# AMD-GPUS: AMD_GFX906,AMD_GFX908,AMD_GFX90A,AMD_GFX940,AMD_GFX942,AMD_GFX1030,AMD_GFX1100,AMD_GFX1103
|
||||
# AMD-GPUS: AMD_GFX906,AMD_GFX908,AMD_GFX90A,AMD_GFX940,AMD_GFX942,AMD_GFX1030,AMD_GFX1100
|
||||
# AMD-CPUS: AMDAVX,Zen,Zen2,Zen3
|
||||
# Intel-GPUs: Gen9,Gen11,Gen12LP,DG1,XeHP,PVC
|
||||
# Intel-GPUs: Intel_Gen,Intel_Gen9,Intel_Gen11,Intel_Gen12LP,Intel_DG1,Intel_XeHP,Intel_PVC
|
||||
KOKKOS_ARCH ?= ""
|
||||
# Options: yes,no
|
||||
KOKKOS_DEBUG ?= "no"
|
||||
@ -41,7 +41,7 @@ KOKKOS_STANDALONE_CMAKE ?= "no"
|
||||
|
||||
# Default settings specific options.
|
||||
# Options: force_uvm,use_ldg,rdc,enable_lambda,enable_constexpr,disable_malloc_async
|
||||
KOKKOS_CUDA_OPTIONS ?= "enable_lambda"
|
||||
KOKKOS_CUDA_OPTIONS ?= "disable_malloc_async"
|
||||
|
||||
# Options: rdc
|
||||
KOKKOS_HIP_OPTIONS ?= ""
|
||||
@ -328,12 +328,43 @@ KOKKOS_INTERNAL_USE_ARCH_ICL := $(call kokkos_has_string,$(KOKKOS_ARCH),ICL)
|
||||
KOKKOS_INTERNAL_USE_ARCH_ICX := $(call kokkos_has_string,$(KOKKOS_ARCH),ICX)
|
||||
KOKKOS_INTERNAL_USE_ARCH_SPR := $(call kokkos_has_string,$(KOKKOS_ARCH),SPR)
|
||||
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN := $(call kokkos_has_string,$(KOKKOS_ARCH),IntelGen)
|
||||
# Traditionally, we supported, e.g., IntelGen9 instead of Intel_Gen9. The latter
|
||||
# matches the CMake option but we also accept the former for backward-compatibility.
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN9 := $(call kokkos_has_string,$(KOKKOS_ARCH),IntelGen9)
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN9), 0)
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN9 := $(call kokkos_has_string,$(KOKKOS_ARCH),Intel_Gen9)
|
||||
endif
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN11 := $(call kokkos_has_string,$(KOKKOS_ARCH),IntelGen11)
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN11), 0)
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN11 := $(call kokkos_has_string,$(KOKKOS_ARCH),Intel_Gen11)
|
||||
endif
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN12LP := $(call kokkos_has_string,$(KOKKOS_ARCH),IntelGen12LP)
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN12LP), 0)
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN12LP := $(call kokkos_has_string,$(KOKKOS_ARCH),Intel_Gen12LP)
|
||||
endif
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN := $(call kokkos_has_string,$(KOKKOS_ARCH),IntelGen9)
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN9), 0)
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN9 := $(call kokkos_has_string,$(KOKKOS_ARCH),Intel_Gen9)
|
||||
endif
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN_SET := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN9) \
|
||||
+ $(KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN11) \
|
||||
+ $(KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN12LP))
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN_SET), 0)
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN := $(call kokkos_has_string,$(KOKKOS_ARCH),IntelGen)
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN), 0)
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_GEN := $(call kokkos_has_string,$(KOKKOS_ARCH),Intel_Gen)
|
||||
endif
|
||||
endif
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_DG1 := $(call kokkos_has_string,$(KOKKOS_ARCH),IntelDG1)
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_INTEL_DG1), 0)
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_DG1 := $(call kokkos_has_string,$(KOKKOS_ARCH),Intel_DG1)
|
||||
endif
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_XEHP := $(call kokkos_has_string,$(KOKKOS_ARCH),IntelXeHP)
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_INTEL_XEHP), 0)
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_XEHP := $(call kokkos_has_string,$(KOKKOS_ARCH),Intel_XeHP)
|
||||
endif
|
||||
# Traditionally the architecture was called PVC instead of Intel_PVC. This
|
||||
# version makes us accept IntelPVC and Intel_PVC as well.
|
||||
KOKKOS_INTERNAL_USE_ARCH_INTEL_PVC := $(call kokkos_has_string,$(KOKKOS_ARCH),PVC)
|
||||
|
||||
# NVIDIA based.
|
||||
@ -394,7 +425,8 @@ KOKKOS_INTERNAL_USE_ARCH_ARMV81 := $(call kokkos_has_string,$(KOKKOS_ARCH),ARMv8
|
||||
KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX := $(call kokkos_has_string,$(KOKKOS_ARCH),ARMv8-ThunderX)
|
||||
KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX2 := $(call kokkos_has_string,$(KOKKOS_ARCH),ARMv8-TX2)
|
||||
KOKKOS_INTERNAL_USE_ARCH_A64FX := $(call kokkos_has_string,$(KOKKOS_ARCH),A64FX)
|
||||
KOKKOS_INTERNAL_USE_ARCH_ARM := $(strip $(shell echo $(KOKKOS_INTERNAL_USE_ARCH_ARMV80)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV81)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX2)+$(KOKKOS_INTERNAL_USE_ARCH_A64FX) | bc))
|
||||
KOKKOS_INTERNAL_USE_ARCH_ARMV9_GRACE := $(call kokkos_has_string,$(KOKKOS_ARCH),ARMv9-Grace)
|
||||
KOKKOS_INTERNAL_USE_ARCH_ARM := $(strip $(shell echo $(KOKKOS_INTERNAL_USE_ARCH_ARMV80)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV81)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX2)+$(KOKKOS_INTERNAL_USE_ARCH_A64FX)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV9_GRACE) | bc))
|
||||
|
||||
# IBM based.
|
||||
KOKKOS_INTERNAL_USE_ARCH_POWER8 := $(call kokkos_has_string,$(KOKKOS_ARCH),Power8)
|
||||
@ -433,7 +465,6 @@ KOKKOS_INTERNAL_USE_ARCH_AMD_GFX1100 := $(call kokkos_has_string,$(KOKKOS_ARCH),
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AMD_GFX1100), 0)
|
||||
KOKKOS_INTERNAL_USE_ARCH_AMD_GFX1100 := $(call kokkos_has_string,$(KOKKOS_ARCH),NAVI1100)
|
||||
endif
|
||||
KOKKOS_INTERNAL_USE_ARCH_AMD_GFX1103 := $(call kokkos_has_string,$(KOKKOS_ARCH),AMD_GFX1103)
|
||||
|
||||
# Any AVX?
|
||||
KOKKOS_INTERNAL_USE_ARCH_AVX := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_SNB) + $(KOKKOS_INTERNAL_USE_ARCH_AMDAVX))
|
||||
@ -758,6 +789,14 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_A64FX), 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV9_GRACE), 1)
|
||||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_ARMV9_GRACE")
|
||||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_ARM_NEON")
|
||||
|
||||
KOKKOS_CXXFLAGS += -mcpu=neoverse-v2 -msve-vector-bits=128
|
||||
KOKKOS_LDFLAGS += -mcpu=neoverse-v2 -msve-vector-bits=128
|
||||
endif
|
||||
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ZEN), 1)
|
||||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_ZEN")
|
||||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AVX2")
|
||||
@ -1119,11 +1158,6 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AMD_GFX1100), 1)
|
||||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GPU")
|
||||
KOKKOS_INTERNAL_HIP_ARCH_FLAG := --offload-arch=gfx1100
|
||||
endif
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AMD_GFX1103), 1)
|
||||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GFX1103")
|
||||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GPU")
|
||||
KOKKOS_INTERNAL_HIP_ARCH_FLAG := --offload-arch=gfx1103
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1)
|
||||
@ -1216,6 +1250,8 @@ ifeq ($(KOKKOS_INTERNAL_DISABLE_BUNDLED_MDSPAN), 0)
|
||||
endif
|
||||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_IMPL_MDSPAN")
|
||||
|
||||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_IMPL_REF_COUNT_BRANCH_UNLIKELY")
|
||||
|
||||
KOKKOS_INTERNAL_LS_CONFIG := $(shell ls KokkosCore_config.h 2>&1)
|
||||
|
||||
ifeq ($(KOKKOS_INTERNAL_LS_CONFIG), KokkosCore_config.h)
|
||||
|
||||
@ -81,7 +81,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_THREADS), 1)
|
||||
Kokkos_Threads_Instance.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/Threads/Kokkos_Threads_Instance.cpp
|
||||
$(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/Threads/Kokkos_Threads_Instance.cpp
|
||||
Kokkos_Threads_Spinwait.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/Threads/Kokkos_Threads_Spinwait.cpp
|
||||
$(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/Threads/Kokkos_Spinwait.cpp
|
||||
$(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/Threads/Kokkos_Threads_Spinwait.cpp
|
||||
endif
|
||||
|
||||
ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||

|
||||
[](https://kokkos.org)
|
||||
|
||||
# Kokkos: Core Libraries
|
||||
|
||||
@ -10,43 +10,66 @@ hierarchies and multiple types of execution resources. It currently can use
|
||||
CUDA, HIP, SYCL, HPX, OpenMP and C++ threads as backend programming models with several other
|
||||
backends in development.
|
||||
|
||||
**Kokkos Core is part of the Kokkos C++ Performance Portability Programming EcoSystem.**
|
||||
**Kokkos Core is part of the [Kokkos C++ Performance Portability Programming Ecosystem](https://kokkos.org/about/abstract/).**
|
||||
|
||||
For the complete documentation, click below:
|
||||
Kokkos is a [Linux Foundation](https://linuxfoundation.org) project.
|
||||
|
||||
# [kokkos.github.io/kokkos-core-wiki](https://kokkos.github.io/kokkos-core-wiki)
|
||||
|
||||
# Learning about Kokkos
|
||||
## Learning about Kokkos
|
||||
|
||||
To start learning about Kokkos:
|
||||
|
||||
- [Kokkos Lectures](https://kokkos.github.io/kokkos-core-wiki/videolectures.html): they contain a mix of lecture videos and hands-on exercises covering all the important Kokkos Ecosystem capabilities.
|
||||
- [Kokkos Lectures](https://kokkos.org/kokkos-core-wiki/videolectures.html): they contain a mix of lecture videos and hands-on exercises covering all the important capabilities.
|
||||
|
||||
- [Programming guide](https://kokkos.github.io/kokkos-core-wiki/programmingguide.html): contains in "narrative" form a technical description of the programming model, machine model, and the main building blocks like the Views and parallel dispatch.
|
||||
- [Programming guide](https://kokkos.org/kokkos-core-wiki/programmingguide.html): contains in "narrative" form a technical description of the programming model, machine model, and the main building blocks like the Views and parallel dispatch.
|
||||
|
||||
- [API reference](https://kokkos.github.io/kokkos-core-wiki/): organized by category, i.e., [core](https://kokkos.github.io/kokkos-core-wiki/API/core-index.html), [algorithms](https://kokkos.github.io/kokkos-core-wiki/API/algorithms-index.html) and [containers](https://kokkos.github.io/kokkos-core-wiki/API/containers-index.html) or, if you prefer, in [alphabetical order](https://kokkos.github.io/kokkos-core-wiki/API/alphabetical.html).
|
||||
- [API reference](https://kokkos.org/kokkos-core-wiki/): organized by category, i.e., [core](https://kokkos.org/kokkos-core-wiki/API/core-index.html), [algorithms](https://kokkos.org/kokkos-core-wiki/API/algorithms-index.html) and [containers](https://kokkos.org/kokkos-core-wiki/API/containers-index.html) or, if you prefer, in [alphabetical order](https://kokkos.org/kokkos-core-wiki/API/alphabetical.html).
|
||||
|
||||
- [Use cases and Examples](https://kokkos.github.io/kokkos-core-wiki/usecases.html): a series of examples ranging from how to use Kokkos with MPI to Fortran interoperability.
|
||||
- [Use cases and Examples](https://kokkos.org/kokkos-core-wiki/usecases.html): a serie of examples ranging from how to use Kokkos with MPI to Fortran interoperability.
|
||||
|
||||
## Obtaining Kokkos
|
||||
|
||||
The latest release of Kokkos can be obtained from the [GitHub releases page](https://github.com/kokkos/kokkos/releases/latest).
|
||||
|
||||
The current release is [4.3.01](https://github.com/kokkos/kokkos/releases/tag/4.3.01).
|
||||
|
||||
```bash
|
||||
curl -OJ -L https://github.com/kokkos/kokkos/archive/refs/tags/4.3.01.tar.gz
|
||||
# Or with wget
|
||||
wget https://github.com/kokkos/kokkos/archive/refs/tags/4.3.01.tar.gz
|
||||
```
|
||||
|
||||
To clone the latest development version of Kokkos from GitHub:
|
||||
|
||||
```bash
|
||||
git clone -b develop https://github.com/kokkos/kokkos.git
|
||||
```
|
||||
|
||||
### Building Kokkos
|
||||
|
||||
To build Kokkos, you will need to have a C++ compiler that supports C++17 or later.
|
||||
All requirements including minimum and primary tested compiler versions can be found [here](https://kokkos.org/kokkos-core-wiki/requirements.html).
|
||||
|
||||
Building and installation instructions are described [here](https://kokkos.org/kokkos-core-wiki/building.html).
|
||||
|
||||
You can also install Kokkos using [Spack](https://spack.io/): `spack install kokkos`. [Available configuration options](https://packages.spack.io/package.html?name=kokkos) can be displayed using `spack info kokkos`.
|
||||
|
||||
## For the complete documentation: [kokkos.org/kokkos-core-wiki/](https://kokkos.org/kokkos-core-wiki/)
|
||||
|
||||
## Support
|
||||
|
||||
For questions find us on Slack: https://kokkosteam.slack.com or open a GitHub issue.
|
||||
|
||||
For non-public questions send an email to: *crtrott(at)sandia.gov*
|
||||
|
||||
# Contributing to Kokkos
|
||||
## Contributing
|
||||
|
||||
Please see [this page](https://kokkos.github.io/kokkos-core-wiki/contributing.html) for details on how to contribute.
|
||||
Please see [this page](https://kokkos.org/kokkos-core-wiki/contributing.html) for details on how to contribute.
|
||||
|
||||
# Requirements, Building and Installing
|
||||
## Citing Kokkos
|
||||
|
||||
All requirements including minimum and primary tested compiler versions can be found [here](https://kokkos.github.io/kokkos-core-wiki/requirements.html).
|
||||
Please see the [following page](https://kokkos.org/kokkos-core-wiki/citation.html).
|
||||
|
||||
Building and installation instructions are described [here](https://kokkos.github.io/kokkos-core-wiki/building.html).
|
||||
|
||||
# Citing Kokkos
|
||||
|
||||
Please see the [following page](https://kokkos.github.io/kokkos-core-wiki/citation.html).
|
||||
|
||||
# License
|
||||
## License
|
||||
|
||||
[](https://spdx.org/licenses/LLVM-exception.html)
|
||||
|
||||
|
||||
@ -189,6 +189,33 @@ void applyPermutation(const ExecutionSpace& space,
|
||||
KOKKOS_LAMBDA(int i) { view(i) = view_copy(permutation(i)); });
|
||||
}
|
||||
|
||||
// FIXME_NVCC: nvcc has trouble compiling lambdas inside a function with
|
||||
// variadic templates (sort_by_key_via_sort). Switch to using functors instead.
|
||||
template <typename Permute>
|
||||
struct IotaFunctor {
|
||||
Permute _permute;
|
||||
KOKKOS_FUNCTION void operator()(int i) const { _permute(i) = i; }
|
||||
};
|
||||
template <typename Keys>
|
||||
struct LessFunctor {
|
||||
Keys _keys;
|
||||
KOKKOS_FUNCTION bool operator()(int i, int j) const {
|
||||
return _keys(i) < _keys(j);
|
||||
}
|
||||
};
|
||||
|
||||
// FIXME_NVCC+MSVC: We can't use a lambda instead of a functor which gave us
|
||||
// "For this host platform/dialect, an extended lambda cannot be defined inside
|
||||
// the 'if' or 'else' block of a constexpr if statement"
|
||||
template <typename Keys, typename Comparator>
|
||||
struct KeyComparisonFunctor {
|
||||
Keys m_keys;
|
||||
Comparator m_comparator;
|
||||
KOKKOS_FUNCTION bool operator()(int i, int j) const {
|
||||
return m_comparator(m_keys(i), m_keys(j));
|
||||
}
|
||||
};
|
||||
|
||||
template <class ExecutionSpace, class KeysDataType, class... KeysProperties,
|
||||
class ValuesDataType, class... ValuesProperties,
|
||||
class... MaybeComparator>
|
||||
@ -207,10 +234,9 @@ void sort_by_key_via_sort(
|
||||
n);
|
||||
|
||||
// iota
|
||||
Kokkos::parallel_for(
|
||||
"Kokkos::sort_by_key_via_sort::iota",
|
||||
Kokkos::RangePolicy<ExecutionSpace>(exec, 0, n),
|
||||
KOKKOS_LAMBDA(int i) { permute(i) = i; });
|
||||
Kokkos::parallel_for("Kokkos::sort_by_key_via_sort::iota",
|
||||
Kokkos::RangePolicy<ExecutionSpace>(exec, 0, n),
|
||||
IotaFunctor<decltype(permute)>{permute});
|
||||
|
||||
using Layout =
|
||||
typename Kokkos::View<unsigned int*, ExecutionSpace>::array_layout;
|
||||
@ -228,16 +254,15 @@ void sort_by_key_via_sort(
|
||||
Kokkos::DefaultHostExecutionSpace host_exec;
|
||||
|
||||
if constexpr (sizeof...(MaybeComparator) == 0) {
|
||||
Kokkos::sort(
|
||||
host_exec, host_permute,
|
||||
KOKKOS_LAMBDA(int i, int j) { return host_keys(i) < host_keys(j); });
|
||||
Kokkos::sort(host_exec, host_permute,
|
||||
LessFunctor<decltype(host_keys)>{host_keys});
|
||||
} else {
|
||||
auto keys_comparator =
|
||||
std::get<0>(std::tuple<MaybeComparator...>(maybeComparator...));
|
||||
Kokkos::sort(
|
||||
host_exec, host_permute, KOKKOS_LAMBDA(int i, int j) {
|
||||
return keys_comparator(host_keys(i), host_keys(j));
|
||||
});
|
||||
host_exec, host_permute,
|
||||
KeyComparisonFunctor<decltype(host_keys), decltype(keys_comparator)>{
|
||||
host_keys, keys_comparator});
|
||||
}
|
||||
host_exec.fence("Kokkos::Impl::sort_by_key_via_sort: after host sort");
|
||||
Kokkos::deep_copy(exec, permute, host_permute);
|
||||
@ -262,16 +287,14 @@ void sort_by_key_via_sort(
|
||||
}
|
||||
#else
|
||||
if constexpr (sizeof...(MaybeComparator) == 0) {
|
||||
Kokkos::sort(
|
||||
exec, permute,
|
||||
KOKKOS_LAMBDA(int i, int j) { return keys(i) < keys(j); });
|
||||
Kokkos::sort(exec, permute, LessFunctor<decltype(keys)>{keys});
|
||||
} else {
|
||||
auto keys_comparator =
|
||||
std::get<0>(std::tuple<MaybeComparator...>(maybeComparator...));
|
||||
Kokkos::sort(
|
||||
exec, permute, KOKKOS_LAMBDA(int i, int j) {
|
||||
return keys_comparator(keys(i), keys(j));
|
||||
});
|
||||
exec, permute,
|
||||
KeyComparisonFunctor<decltype(keys), decltype(keys_comparator)>{
|
||||
keys, keys_comparator});
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -29,49 +29,46 @@ namespace Experimental {
|
||||
template <
|
||||
class ExecutionSpace, class IteratorType, class UnaryFunctorType,
|
||||
std::enable_if_t<Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
|
||||
UnaryFunctorType for_each(const std::string& label, const ExecutionSpace& ex,
|
||||
IteratorType first, IteratorType last,
|
||||
UnaryFunctorType functor) {
|
||||
return Impl::for_each_exespace_impl(label, ex, first, last,
|
||||
std::move(functor));
|
||||
void for_each(const std::string& label, const ExecutionSpace& ex,
|
||||
IteratorType first, IteratorType last, UnaryFunctorType functor) {
|
||||
Impl::for_each_exespace_impl(label, ex, first, last, std::move(functor));
|
||||
}
|
||||
|
||||
template <
|
||||
class ExecutionSpace, class IteratorType, class UnaryFunctorType,
|
||||
std::enable_if_t<Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
|
||||
UnaryFunctorType for_each(const ExecutionSpace& ex, IteratorType first,
|
||||
IteratorType last, UnaryFunctorType functor) {
|
||||
return Impl::for_each_exespace_impl("Kokkos::for_each_iterator_api_default",
|
||||
ex, first, last, std::move(functor));
|
||||
void for_each(const ExecutionSpace& ex, IteratorType first, IteratorType last,
|
||||
UnaryFunctorType functor) {
|
||||
Impl::for_each_exespace_impl("Kokkos::for_each_iterator_api_default", ex,
|
||||
first, last, std::move(functor));
|
||||
}
|
||||
|
||||
template <
|
||||
class ExecutionSpace, class DataType, class... Properties,
|
||||
class UnaryFunctorType,
|
||||
std::enable_if_t<Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
|
||||
UnaryFunctorType for_each(const std::string& label, const ExecutionSpace& ex,
|
||||
const ::Kokkos::View<DataType, Properties...>& v,
|
||||
UnaryFunctorType functor) {
|
||||
void for_each(const std::string& label, const ExecutionSpace& ex,
|
||||
const ::Kokkos::View<DataType, Properties...>& v,
|
||||
UnaryFunctorType functor) {
|
||||
Impl::static_assert_is_admissible_to_kokkos_std_algorithms(v);
|
||||
|
||||
namespace KE = ::Kokkos::Experimental;
|
||||
return Impl::for_each_exespace_impl(label, ex, KE::begin(v), KE::end(v),
|
||||
std::move(functor));
|
||||
Impl::for_each_exespace_impl(label, ex, KE::begin(v), KE::end(v),
|
||||
std::move(functor));
|
||||
}
|
||||
|
||||
template <
|
||||
class ExecutionSpace, class DataType, class... Properties,
|
||||
class UnaryFunctorType,
|
||||
std::enable_if_t<Kokkos::is_execution_space_v<ExecutionSpace>, int> = 0>
|
||||
UnaryFunctorType for_each(const ExecutionSpace& ex,
|
||||
const ::Kokkos::View<DataType, Properties...>& v,
|
||||
UnaryFunctorType functor) {
|
||||
void for_each(const ExecutionSpace& ex,
|
||||
const ::Kokkos::View<DataType, Properties...>& v,
|
||||
UnaryFunctorType functor) {
|
||||
Impl::static_assert_is_admissible_to_kokkos_std_algorithms(v);
|
||||
|
||||
namespace KE = ::Kokkos::Experimental;
|
||||
return Impl::for_each_exespace_impl("Kokkos::for_each_view_api_default", ex,
|
||||
KE::begin(v), KE::end(v),
|
||||
std::move(functor));
|
||||
Impl::for_each_exespace_impl("Kokkos::for_each_view_api_default", ex,
|
||||
KE::begin(v), KE::end(v), std::move(functor));
|
||||
}
|
||||
|
||||
//
|
||||
@ -82,24 +79,23 @@ UnaryFunctorType for_each(const ExecutionSpace& ex,
|
||||
|
||||
template <class TeamHandleType, class IteratorType, class UnaryFunctorType,
|
||||
std::enable_if_t<Kokkos::is_team_handle_v<TeamHandleType>, int> = 0>
|
||||
KOKKOS_FUNCTION UnaryFunctorType for_each(const TeamHandleType& teamHandle,
|
||||
IteratorType first, IteratorType last,
|
||||
UnaryFunctorType functor) {
|
||||
return Impl::for_each_team_impl(teamHandle, first, last, std::move(functor));
|
||||
KOKKOS_FUNCTION void for_each(const TeamHandleType& teamHandle,
|
||||
IteratorType first, IteratorType last,
|
||||
UnaryFunctorType functor) {
|
||||
Impl::for_each_team_impl(teamHandle, first, last, std::move(functor));
|
||||
}
|
||||
|
||||
template <class TeamHandleType, class DataType, class... Properties,
|
||||
class UnaryFunctorType,
|
||||
std::enable_if_t<Kokkos::is_team_handle_v<TeamHandleType>, int> = 0>
|
||||
KOKKOS_FUNCTION UnaryFunctorType
|
||||
for_each(const TeamHandleType& teamHandle,
|
||||
const ::Kokkos::View<DataType, Properties...>& v,
|
||||
UnaryFunctorType functor) {
|
||||
KOKKOS_FUNCTION void for_each(const TeamHandleType& teamHandle,
|
||||
const ::Kokkos::View<DataType, Properties...>& v,
|
||||
UnaryFunctorType functor) {
|
||||
Impl::static_assert_is_admissible_to_kokkos_std_algorithms(v);
|
||||
|
||||
namespace KE = ::Kokkos::Experimental;
|
||||
return Impl::for_each_team_impl(teamHandle, KE::begin(v), KE::end(v),
|
||||
std::move(functor));
|
||||
Impl::for_each_team_impl(teamHandle, KE::begin(v), KE::end(v),
|
||||
std::move(functor));
|
||||
}
|
||||
|
||||
} // namespace Experimental
|
||||
|
||||
@ -82,6 +82,11 @@ OutputIteratorType adjacent_difference_exespace_impl(
|
||||
return first_dest;
|
||||
}
|
||||
|
||||
#ifdef KOKKOS_ENABLE_DEBUG
|
||||
// check for overlapping iterators
|
||||
Impl::expect_no_overlap(first_from, last_from, first_dest);
|
||||
#endif
|
||||
|
||||
// run
|
||||
const auto num_elements =
|
||||
Kokkos::Experimental::distance(first_from, last_from);
|
||||
@ -114,6 +119,11 @@ KOKKOS_FUNCTION OutputIteratorType adjacent_difference_team_impl(
|
||||
return first_dest;
|
||||
}
|
||||
|
||||
#ifdef KOKKOS_ENABLE_DEBUG
|
||||
// check for overlapping iterators
|
||||
Impl::expect_no_overlap(first_from, last_from, first_dest);
|
||||
#endif
|
||||
|
||||
// run
|
||||
const auto num_elements =
|
||||
Kokkos::Experimental::distance(first_from, last_from);
|
||||
|
||||
@ -24,18 +24,21 @@ namespace Kokkos {
|
||||
namespace Experimental {
|
||||
namespace Impl {
|
||||
|
||||
template <class T>
|
||||
class RandomAccessIterator;
|
||||
|
||||
template <typename T, typename enable = void>
|
||||
struct is_admissible_to_kokkos_std_algorithms : std::false_type {};
|
||||
|
||||
template <typename T>
|
||||
struct is_admissible_to_kokkos_std_algorithms<
|
||||
T, std::enable_if_t< ::Kokkos::is_view<T>::value && T::rank() == 1 &&
|
||||
(std::is_same<typename T::traits::array_layout,
|
||||
Kokkos::LayoutLeft>::value ||
|
||||
std::is_same<typename T::traits::array_layout,
|
||||
Kokkos::LayoutRight>::value ||
|
||||
std::is_same<typename T::traits::array_layout,
|
||||
Kokkos::LayoutStride>::value)> >
|
||||
T, std::enable_if_t<::Kokkos::is_view<T>::value && T::rank() == 1 &&
|
||||
(std::is_same<typename T::traits::array_layout,
|
||||
Kokkos::LayoutLeft>::value ||
|
||||
std::is_same<typename T::traits::array_layout,
|
||||
Kokkos::LayoutRight>::value ||
|
||||
std::is_same<typename T::traits::array_layout,
|
||||
Kokkos::LayoutStride>::value)>>
|
||||
: std::true_type {};
|
||||
|
||||
template <class ViewType>
|
||||
@ -58,6 +61,18 @@ using is_iterator = Kokkos::is_detected<iterator_category_t, T>;
|
||||
template <class T>
|
||||
inline constexpr bool is_iterator_v = is_iterator<T>::value;
|
||||
|
||||
template <typename ViewType>
|
||||
struct is_kokkos_iterator : std::false_type {};
|
||||
|
||||
template <typename ViewType>
|
||||
struct is_kokkos_iterator<RandomAccessIterator<ViewType>> {
|
||||
static constexpr bool value =
|
||||
is_admissible_to_kokkos_std_algorithms<ViewType>::value;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
inline constexpr bool is_kokkos_iterator_v = is_kokkos_iterator<T>::value;
|
||||
|
||||
//
|
||||
// are_iterators
|
||||
//
|
||||
@ -215,6 +230,38 @@ KOKKOS_INLINE_FUNCTION void expect_valid_range(IteratorType first,
|
||||
(void)last;
|
||||
}
|
||||
|
||||
//
|
||||
// Check if kokkos iterators are overlapping
|
||||
//
|
||||
template <typename IteratorType1, typename IteratorType2>
|
||||
KOKKOS_INLINE_FUNCTION void expect_no_overlap(
|
||||
[[maybe_unused]] IteratorType1 first, [[maybe_unused]] IteratorType1 last,
|
||||
[[maybe_unused]] IteratorType2 s_first) {
|
||||
if constexpr (is_kokkos_iterator_v<IteratorType1> &&
|
||||
is_kokkos_iterator_v<IteratorType2>) {
|
||||
auto const view1 = first.view();
|
||||
auto const view2 = s_first.view();
|
||||
|
||||
std::size_t stride1 = view1.stride(0);
|
||||
std::size_t stride2 = view2.stride(0);
|
||||
ptrdiff_t first_diff = view1.data() - view2.data();
|
||||
|
||||
// FIXME If strides are not identical, checks may not be made
|
||||
// with the cost of O(1)
|
||||
// Currently, checks are made only if strides are identical
|
||||
// If first_diff == 0, there is already an overlap
|
||||
if (stride1 == stride2 || first_diff == 0) {
|
||||
[[maybe_unused]] bool is_no_overlap = (first_diff % stride1);
|
||||
auto* first_pointer1 = view1.data();
|
||||
auto* first_pointer2 = view2.data();
|
||||
[[maybe_unused]] auto* last_pointer1 = first_pointer1 + (last - first);
|
||||
[[maybe_unused]] auto* last_pointer2 = first_pointer2 + (last - first);
|
||||
KOKKOS_EXPECTS(first_pointer1 >= last_pointer2 ||
|
||||
last_pointer1 <= first_pointer2 || is_no_overlap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Impl
|
||||
} // namespace Experimental
|
||||
} // namespace Kokkos
|
||||
|
||||
@ -150,8 +150,9 @@ KOKKOS_FUNCTION OutputIterator copy_if_team_impl(
|
||||
return d_first + count;
|
||||
}
|
||||
|
||||
#if defined KOKKOS_COMPILER_INTEL || \
|
||||
(defined(KOKKOS_COMPILER_NVCC) && KOKKOS_COMPILER_NVCC >= 1130)
|
||||
#if defined KOKKOS_COMPILER_INTEL || \
|
||||
(defined(KOKKOS_COMPILER_NVCC) && KOKKOS_COMPILER_NVCC >= 1130 && \
|
||||
!defined(KOKKOS_COMPILER_MSVC))
|
||||
__builtin_unreachable();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -42,10 +42,9 @@ struct StdForEachFunctor {
|
||||
};
|
||||
|
||||
template <class HandleType, class IteratorType, class UnaryFunctorType>
|
||||
UnaryFunctorType for_each_exespace_impl(const std::string& label,
|
||||
const HandleType& handle,
|
||||
IteratorType first, IteratorType last,
|
||||
UnaryFunctorType functor) {
|
||||
void for_each_exespace_impl(const std::string& label, const HandleType& handle,
|
||||
IteratorType first, IteratorType last,
|
||||
UnaryFunctorType functor) {
|
||||
// checks
|
||||
Impl::static_assert_random_access_and_accessible(handle, first);
|
||||
Impl::expect_valid_range(first, last);
|
||||
@ -56,8 +55,6 @@ UnaryFunctorType for_each_exespace_impl(const std::string& label,
|
||||
label, RangePolicy<HandleType>(handle, 0, num_elements),
|
||||
StdForEachFunctor<IteratorType, UnaryFunctorType>(first, functor));
|
||||
handle.fence("Kokkos::for_each: fence after operation");
|
||||
|
||||
return functor;
|
||||
}
|
||||
|
||||
template <class ExecutionSpace, class IteratorType, class SizeType,
|
||||
@ -75,7 +72,7 @@ IteratorType for_each_n_exespace_impl(const std::string& label,
|
||||
}
|
||||
|
||||
for_each_exespace_impl(label, ex, first, last, std::move(functor));
|
||||
// no neeed to fence since for_each_exespace_impl fences already
|
||||
// no need to fence since for_each_exespace_impl fences already
|
||||
|
||||
return last;
|
||||
}
|
||||
@ -84,9 +81,9 @@ IteratorType for_each_n_exespace_impl(const std::string& label,
|
||||
// team impl
|
||||
//
|
||||
template <class TeamHandleType, class IteratorType, class UnaryFunctorType>
|
||||
KOKKOS_FUNCTION UnaryFunctorType
|
||||
for_each_team_impl(const TeamHandleType& teamHandle, IteratorType first,
|
||||
IteratorType last, UnaryFunctorType functor) {
|
||||
KOKKOS_FUNCTION void for_each_team_impl(const TeamHandleType& teamHandle,
|
||||
IteratorType first, IteratorType last,
|
||||
UnaryFunctorType functor) {
|
||||
// checks
|
||||
Impl::static_assert_random_access_and_accessible(teamHandle, first);
|
||||
Impl::expect_valid_range(first, last);
|
||||
@ -96,7 +93,6 @@ for_each_team_impl(const TeamHandleType& teamHandle, IteratorType first,
|
||||
TeamThreadRange(teamHandle, 0, num_elements),
|
||||
StdForEachFunctor<IteratorType, UnaryFunctorType>(first, functor));
|
||||
teamHandle.team_barrier();
|
||||
return functor;
|
||||
}
|
||||
|
||||
template <class TeamHandleType, class IteratorType, class SizeType,
|
||||
@ -113,7 +109,7 @@ for_each_n_team_impl(const TeamHandleType& teamHandle, IteratorType first,
|
||||
}
|
||||
|
||||
for_each_team_impl(teamHandle, first, last, std::move(functor));
|
||||
// no neeed to fence since for_each_team_impl fences already
|
||||
// no need to fence since for_each_team_impl fences already
|
||||
|
||||
return last;
|
||||
}
|
||||
|
||||
@ -59,6 +59,30 @@ class RandomAccessIterator< ::Kokkos::View<DataType, Args...> > {
|
||||
ptrdiff_t current_index)
|
||||
: m_view(view), m_current_index(current_index) {}
|
||||
|
||||
#ifndef KOKKOS_ENABLE_CXX17 // C++20 and beyond
|
||||
template <class OtherViewType>
|
||||
requires(std::is_constructible_v<view_type, OtherViewType>) KOKKOS_FUNCTION
|
||||
explicit(!std::is_convertible_v<OtherViewType, view_type>)
|
||||
RandomAccessIterator(const RandomAccessIterator<OtherViewType>& other)
|
||||
: m_view(other.m_view), m_current_index(other.m_current_index) {}
|
||||
#else
|
||||
template <
|
||||
class OtherViewType,
|
||||
std::enable_if_t<std::is_constructible_v<view_type, OtherViewType> &&
|
||||
!std::is_convertible_v<OtherViewType, view_type>,
|
||||
int> = 0>
|
||||
KOKKOS_FUNCTION explicit RandomAccessIterator(
|
||||
const RandomAccessIterator<OtherViewType>& other)
|
||||
: m_view(other.m_view), m_current_index(other.m_current_index) {}
|
||||
|
||||
template <class OtherViewType,
|
||||
std::enable_if_t<std::is_convertible_v<OtherViewType, view_type>,
|
||||
int> = 0>
|
||||
KOKKOS_FUNCTION RandomAccessIterator(
|
||||
const RandomAccessIterator<OtherViewType>& other)
|
||||
: m_view(other.m_view), m_current_index(other.m_current_index) {}
|
||||
#endif
|
||||
|
||||
KOKKOS_FUNCTION
|
||||
iterator_type& operator++() {
|
||||
++m_current_index;
|
||||
@ -152,9 +176,16 @@ class RandomAccessIterator< ::Kokkos::View<DataType, Args...> > {
|
||||
KOKKOS_FUNCTION
|
||||
reference operator*() const { return m_view(m_current_index); }
|
||||
|
||||
KOKKOS_FUNCTION
|
||||
view_type view() const { return m_view; }
|
||||
|
||||
private:
|
||||
view_type m_view;
|
||||
ptrdiff_t m_current_index = 0;
|
||||
|
||||
// Needed for the converting constructor accepting another iterator
|
||||
template <class>
|
||||
friend class RandomAccessIterator;
|
||||
};
|
||||
|
||||
} // namespace Impl
|
||||
|
||||