Merge branch 'lammps:develop' into intpos
2
.github/CODEOWNERS
vendored
@ -83,7 +83,7 @@ src/library.* @sjplimp
|
||||
src/main.cpp @sjplimp
|
||||
src/min_*.* @sjplimp
|
||||
src/memory.* @sjplimp
|
||||
src/modify.* @sjplimp
|
||||
src/modify.* @sjplimp @stanmoore1
|
||||
src/molecule.* @sjplimp
|
||||
src/my_page.h @sjplimp
|
||||
src/my_pool_chunk.h @sjplimp
|
||||
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
@ -3,7 +3,7 @@ name: "CodeQL Code Analysis"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
branches: [develop]
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
|
||||
33
.github/workflows/compile-msvc.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
# GitHub action to build LAMMPS on Windows with Visual C++
|
||||
name: "Native Windows Compilation"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [develop]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Windows Compilation Test
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Building LAMMPS via CMake
|
||||
shell: bash
|
||||
run: |
|
||||
cmake -C cmake/presets/windows.cmake \
|
||||
-S cmake -B build \
|
||||
-D BUILD_SHARED_LIBS=on \
|
||||
-D LAMMPS_EXCEPTIONS=on
|
||||
cmake --build build --config Release
|
||||
|
||||
- name: Run LAMMPS executable
|
||||
shell: bash
|
||||
run: |
|
||||
./build/Release/lmp.exe -h
|
||||
./build/Release/lmp.exe -in bench/in.lj
|
||||
2
.github/workflows/unittest-macos.yml
vendored
@ -3,7 +3,7 @@ name: "Unittest for MacOS"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
branches: [develop]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
7
.gitignore
vendored
@ -37,8 +37,8 @@ vgcore.*
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
.clang-format
|
||||
.lammps_history
|
||||
.vs
|
||||
|
||||
#cmake
|
||||
/build*
|
||||
@ -49,3 +49,8 @@ Thumbs.db
|
||||
/Testing
|
||||
/cmake_install.cmake
|
||||
/lmp
|
||||
out/Debug
|
||||
out/RelWithDebInfo
|
||||
out/Release
|
||||
out/x86
|
||||
out/x64
|
||||
|
||||
@ -81,22 +81,40 @@ check_for_autogen_files(${LAMMPS_SOURCE_DIR})
|
||||
include(CheckIncludeFileCXX)
|
||||
|
||||
# set required compiler flags and compiler/CPU arch specific optimizations
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") OR (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM"))
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qrestrict")
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_TUNE_DEFAULT "/QxCOMMON-AVX512")
|
||||
else()
|
||||
set(CMAKE_TUNE_DEFAULT "/QxHost")
|
||||
endif()
|
||||
else()
|
||||
set(CMAKE_TUNE_DEFAULT "-xHost")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 17.4)
|
||||
set(CMAKE_TUNE_DEFAULT "-xCOMMON-AVX512")
|
||||
else()
|
||||
set(CMAKE_TUNE_DEFAULT "-xHost")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# we require C++11 without extensions
|
||||
# we require C++11 without extensions. Kokkos requires at least C++14 (currently)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 14))
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions")
|
||||
# ugly hack for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
||||
# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
|
||||
# and prints lots of pointless warnings about "unsafe" functions
|
||||
if(MSVC)
|
||||
add_compile_options(/Zc:__cplusplus)
|
||||
add_compile_options(/wd4244)
|
||||
add_compile_options(/wd4267)
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
# export all symbols when building a .dll file on windows
|
||||
@ -281,6 +299,11 @@ else()
|
||||
target_include_directories(mpi_stubs PUBLIC $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_link_libraries(lammps PRIVATE mpi_stubs)
|
||||
if(MSVC)
|
||||
target_link_libraries(lmp PRIVATE mpi_stubs)
|
||||
target_include_directories(lmp INTERFACE $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
||||
target_compile_definitions(lmp INTERFACE $<INSTALL_INTERFACE:LAMMPS_LIB_NO_MPI>)
|
||||
endif(MSVC)
|
||||
target_include_directories(lammps INTERFACE $<BUILD_INTERFACE:${LAMMPS_SOURCE_DIR}/STUBS>)
|
||||
target_compile_definitions(lammps INTERFACE $<INSTALL_INTERFACE:LAMMPS_LIB_NO_MPI>)
|
||||
else()
|
||||
@ -468,9 +491,12 @@ foreach(HEADER cmath)
|
||||
endif(NOT FOUND_${HEADER})
|
||||
endforeach(HEADER)
|
||||
|
||||
set(MATH_LIBRARIES "m" CACHE STRING "math library")
|
||||
mark_as_advanced( MATH_LIBRARIES )
|
||||
target_link_libraries(lammps PRIVATE ${MATH_LIBRARIES})
|
||||
# make the standard math library overrideable and autodetected (for systems that don't have it)
|
||||
find_library(STANDARD_MATH_LIB m DOC "Standard Math library")
|
||||
mark_as_advanced(STANDARD_MATH_LIB)
|
||||
if(STANDARD_MATH_LIB)
|
||||
target_link_libraries(lammps PRIVATE ${STANDARD_MATH_LIB})
|
||||
endif()
|
||||
|
||||
######################################
|
||||
# Generate Basic Style files
|
||||
@ -591,15 +617,12 @@ foreach(PKG_WITH_INCL CORESHELL QEQ OPENMP DPD-SMOOTH KOKKOS OPT INTEL GPU)
|
||||
endforeach()
|
||||
|
||||
if(PKG_PLUGIN)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(lammps PRIVATE -DLMP_PLUGIN)
|
||||
else()
|
||||
message(WARNING "Plugin loading will not work unless BUILD_SHARED_LIBS is enabled")
|
||||
endif()
|
||||
# link with -ldl or equivalent for plugin loading; except on Windows
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
target_link_libraries(lammps PRIVATE ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
target_compile_definitions(lammps PRIVATE -DLMP_PLUGIN)
|
||||
endif()
|
||||
|
||||
# link with -ldl or equivalent for plugin loading; except on Windows
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
target_link_libraries(lammps PRIVATE ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
######################################################################
|
||||
@ -608,7 +631,7 @@ endif()
|
||||
# and after everything else that is compiled locally
|
||||
######################################################################
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
target_link_libraries(lammps PRIVATE -lwsock32 -lpsapi)
|
||||
target_link_libraries(lammps PRIVATE "wsock32;psapi")
|
||||
endif()
|
||||
|
||||
######################################################
|
||||
|
||||
55
cmake/CMakeSettings.json
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "x64-Debug-MSVC",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-S ${workspaceRoot}\\cmake -C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_SHARED_LIBS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x64-Debug-Clang",
|
||||
"generator": "Ninja",
|
||||
"configurationType": "Debug",
|
||||
"buildRoot": "${workspaceRoot}\\build\\${name}",
|
||||
"installRoot": "${workspaceRoot}\\install\\${name}",
|
||||
"cmakeCommandArgs": "-S ${workspaceRoot}\\cmake -C ${workspaceRoot}\\cmake\\presets\\windows.cmake",
|
||||
"buildCommandArgs": "",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "clang_cl_x64" ],
|
||||
"variables": [
|
||||
{
|
||||
"name": "BUILD_TOOLS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
},
|
||||
{
|
||||
"name": "LAMMPS_EXCEPTIONS",
|
||||
"value": "True",
|
||||
"type": "BOOL"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -7,8 +7,8 @@ else()
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
set(GTEST_URL "https://github.com/google/googletest/archive/release-1.10.0.tar.gz" CACHE STRING "URL for GTest tarball")
|
||||
set(GTEST_MD5 "ecd1fa65e7de707cd5c00bdac56022cd" CACHE STRING "MD5 checksum of GTest tarball")
|
||||
set(GTEST_URL "https://github.com/google/googletest/archive/release-1.11.0.tar.gz" CACHE STRING "URL of googletest source")
|
||||
set(GTEST_MD5 "e8a8df240b6938bb6384155d4c37d937" CACHE STRING "MD5 sum for googletest source")
|
||||
mark_as_advanced(GTEST_URL)
|
||||
mark_as_advanced(GTEST_MD5)
|
||||
ExternalProject_Add(googletest
|
||||
|
||||
@ -85,7 +85,7 @@ endfunction(GenerateBinaryHeader)
|
||||
|
||||
# fetch missing potential files
|
||||
function(FetchPotentials pkgfolder potfolder)
|
||||
if (EXISTS "${pkgfolder}/potentials.txt")
|
||||
if(EXISTS "${pkgfolder}/potentials.txt")
|
||||
file(STRINGS "${pkgfolder}/potentials.txt" linelist REGEX "^[^#].")
|
||||
foreach(line ${linelist})
|
||||
string(FIND ${line} " " blank)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
message(STATUS "Downloading and building OpenCL loader library")
|
||||
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2021.06.30.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
|
||||
set(OPENCL_LOADER_MD5 "f9e55dd550cfbf77f46507adf7cb8fd2" CACHE STRING "MD5 checksum of OpenCL loader tarball")
|
||||
set(OPENCL_LOADER_URL "${LAMMPS_THIRDPARTY_URL}/opencl-loader-2021.09.18.tar.gz" CACHE STRING "URL for OpenCL loader tarball")
|
||||
set(OPENCL_LOADER_MD5 "3b3882627964bd02e5c3b02065daac3c" CACHE STRING "MD5 checksum of OpenCL loader tarball")
|
||||
mark_as_advanced(OPENCL_LOADER_URL)
|
||||
mark_as_advanced(OPENCL_LOADER_MD5)
|
||||
|
||||
|
||||
@ -71,44 +71,47 @@ if(GPU_API STREQUAL "CUDA")
|
||||
# build arch/gencode commands for nvcc based on CUDA toolkit version and use choice
|
||||
# --arch translates directly instead of JIT, so this should be for the preferred or most common architecture
|
||||
set(GPU_CUDA_GENCODE "-arch=${GPU_ARCH}")
|
||||
# Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0
|
||||
if((CUDA_VERSION VERSION_GREATER_EQUAL "3.2") AND (CUDA_VERSION VERSION_LESS "9.0"))
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20] ")
|
||||
endif()
|
||||
# Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2
|
||||
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0"))
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30] ")
|
||||
endif()
|
||||
# Kepler (GPU Arch 3.5) is supported by CUDA 5 to CUDA 11
|
||||
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "12.0"))
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_35,code=[sm_35,compute_35]")
|
||||
endif()
|
||||
# Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "6.0")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52]")
|
||||
endif()
|
||||
# Pascal (GPU Arch 6.x) is supported by CUDA 8 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "8.0")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61]")
|
||||
endif()
|
||||
# Volta (GPU Arch 7.0) is supported by CUDA 9 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_70,code=[sm_70,compute_70]")
|
||||
endif()
|
||||
# Turing (GPU Arch 7.5) is supported by CUDA 10 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]")
|
||||
endif()
|
||||
# Ampere (GPU Arch 8.0) is supported by CUDA 11 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
|
||||
endif()
|
||||
# Ampere (GPU Arch 8.6) is supported by CUDA 11.1 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
|
||||
endif()
|
||||
|
||||
# apply the following to build "fat" CUDA binaries only for known CUDA toolkits
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0")
|
||||
message(WARNING "Unsupported CUDA version. Use at your own risk.")
|
||||
message(WARNING "Untested CUDA Toolkit version. Use at your own risk")
|
||||
else()
|
||||
# Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0
|
||||
if((CUDA_VERSION VERSION_GREATER_EQUAL "3.2") AND (CUDA_VERSION VERSION_LESS "9.0"))
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20] ")
|
||||
endif()
|
||||
# Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2
|
||||
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0"))
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30] ")
|
||||
endif()
|
||||
# Kepler (GPU Arch 3.5) is supported by CUDA 5 to CUDA 11
|
||||
if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "12.0"))
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_35,code=[sm_35,compute_35]")
|
||||
endif()
|
||||
# Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "6.0")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52]")
|
||||
endif()
|
||||
# Pascal (GPU Arch 6.x) is supported by CUDA 8 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "8.0")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61]")
|
||||
endif()
|
||||
# Volta (GPU Arch 7.0) is supported by CUDA 9 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_70,code=[sm_70,compute_70]")
|
||||
endif()
|
||||
# Turing (GPU Arch 7.5) is supported by CUDA 10 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]")
|
||||
endif()
|
||||
# Ampere (GPU Arch 8.0) is supported by CUDA 11 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]")
|
||||
endif()
|
||||
# Ampere (GPU Arch 8.6) is supported by CUDA 11.1 and later
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
|
||||
string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC}
|
||||
@ -214,13 +217,20 @@ elseif(GPU_API STREQUAL "OPENCL")
|
||||
elseif(GPU_API STREQUAL "HIP")
|
||||
if(NOT DEFINED HIP_PATH)
|
||||
if(NOT DEFINED ENV{HIP_PATH})
|
||||
set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to which HIP has been installed")
|
||||
set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to HIP installation")
|
||||
else()
|
||||
set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to which HIP has been installed")
|
||||
set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to HIP installation")
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH})
|
||||
find_package(HIP REQUIRED)
|
||||
if(NOT DEFINED ROCM_PATH)
|
||||
if(NOT DEFINED ENV{ROCM_PATH})
|
||||
set(ROCM_PATH "/opt/rocm" CACHE PATH "Path to ROCm installation")
|
||||
else()
|
||||
set(ROCM_PATH $ENV{ROCM_PATH} CACHE PATH "Path to ROCm installation")
|
||||
endif()
|
||||
endif()
|
||||
list(APPEND CMAKE_PREFIX_PATH ${HIP_PATH} ${ROCM_PATH})
|
||||
find_package(hip REQUIRED)
|
||||
option(HIP_USE_DEVICE_SORT "Use GPU sorting" ON)
|
||||
|
||||
if(NOT DEFINED HIP_PLATFORM)
|
||||
@ -322,10 +332,11 @@ elseif(GPU_API STREQUAL "HIP")
|
||||
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${LAMMPS_LIB_BINARY_DIR}/gpu/*_cubin.h ${LAMMPS_LIB_BINARY_DIR}/gpu/*.cu.cpp")
|
||||
|
||||
hip_add_library(gpu STATIC ${GPU_LIB_SOURCES})
|
||||
add_library(gpu STATIC ${GPU_LIB_SOURCES})
|
||||
target_include_directories(gpu PRIVATE ${LAMMPS_LIB_BINARY_DIR}/gpu)
|
||||
target_compile_definitions(gpu PRIVATE -D_${GPU_PREC_SETTING} -DMPI_GERYON -DUCL_NO_EXIT)
|
||||
target_compile_definitions(gpu PRIVATE -DUSE_HIP)
|
||||
target_link_libraries(gpu PRIVATE hip::host)
|
||||
|
||||
if(HIP_USE_DEVICE_SORT)
|
||||
# add hipCUB
|
||||
@ -374,8 +385,9 @@ elseif(GPU_API STREQUAL "HIP")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
hip_add_executable(hip_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
||||
add_executable(hip_get_devices ${LAMMPS_LIB_SOURCE_DIR}/gpu/geryon/ucl_get_devices.cpp)
|
||||
target_compile_definitions(hip_get_devices PRIVATE -DUCL_HIP)
|
||||
target_link_libraries(hip_get_devices hip::host)
|
||||
|
||||
if(HIP_PLATFORM STREQUAL "nvcc")
|
||||
target_compile_definitions(gpu PRIVATE -D__HIP_PLATFORM_NVCC__)
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
########################################################################
|
||||
# As of version 3.3.0 Kokkos requires C++14
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
if(CMAKE_CXX_STANDARD LESS 14)
|
||||
message(FATAL_ERROR "The KOKKOS package requires the C++ standard to be set to at least C++14")
|
||||
endif()
|
||||
########################################################################
|
||||
# consistency checks and Kokkos options/settings required by LAMMPS
|
||||
if(Kokkos_ENABLE_CUDA)
|
||||
|
||||
@ -19,6 +19,14 @@ if(DOWNLOAD_LATTE)
|
||||
set(LATTE_MD5 "820e73a457ced178c08c71389a385de7" CACHE STRING "MD5 checksum of LATTE tarball")
|
||||
mark_as_advanced(LATTE_URL)
|
||||
mark_as_advanced(LATTE_MD5)
|
||||
|
||||
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
|
||||
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
|
||||
list(LENGTH LAPACK_LIBRARIES NUM_LAPACK)
|
||||
if((NUM_BLAS GREATER 1) OR (NUM_LAPACK GREATER 1))
|
||||
message(FATAL_ERROR "Cannot compile downloaded LATTE library due to a technical limitation")
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(latte_build
|
||||
URL ${LATTE_URL}
|
||||
|
||||
@ -7,8 +7,9 @@ endif()
|
||||
option(DOWNLOAD_EIGEN3 "Download Eigen3 instead of using an already installed one)" ${DOWNLOAD_EIGEN3_DEFAULT})
|
||||
if(DOWNLOAD_EIGEN3)
|
||||
message(STATUS "Eigen3 download requested - we will build our own")
|
||||
set(EIGEN3_URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz" CACHE STRING "URL for Eigen3 tarball")
|
||||
set(EIGEN3_MD5 "609286804b0f79be622ccf7f9ff2b660" CACHE STRING "MD5 checksum of Eigen3 tarball")
|
||||
|
||||
set(EIGEN3_URL "https://download.lammps.org/thirdparty/eigen-3.4.0.tar.gz" CACHE STRING "URL for Eigen3 tarball")
|
||||
set(EIGEN3_MD5 "4c527a9171d71a72a9d4186e65bea559" CACHE STRING "MD5 checksum of Eigen3 tarball")
|
||||
mark_as_advanced(EIGEN3_URL)
|
||||
mark_as_advanced(EIGEN3_MD5)
|
||||
include(ExternalProject)
|
||||
|
||||
@ -45,12 +45,12 @@ if(DOWNLOAD_N2P2)
|
||||
# get path to MPI include directory when cross-compiling to windows
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)
|
||||
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
||||
set(N2P2_PROJECT_OPTIONS "-I ${N2P2_MPI_INCLUDE} -DMPICH_SKIP_MPICXX=1")
|
||||
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
|
||||
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES)
|
||||
set(N2P2_PROJECT_OPTIONS "-I ${N2P2_MPI_INCLUDE} -DMPICH_SKIP_MPICXX=1")
|
||||
set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}")
|
||||
set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
endif()
|
||||
endif()
|
||||
@ -69,6 +69,12 @@ if(DOWNLOAD_N2P2)
|
||||
# echo final flag for debugging
|
||||
message(STATUS "N2P2 BUILD OPTIONS: ${N2P2_BUILD_OPTIONS}")
|
||||
|
||||
# must have "sed" command to compile n2p2 library (for now)
|
||||
find_program(HAVE_SED sed)
|
||||
if(NOT HAVE_SED)
|
||||
message(FATAL_ERROR "Must have 'sed' program installed to compile 'n2p2' library for ML-HDNNP package")
|
||||
endif()
|
||||
|
||||
# download compile n2p2 library. much patch MPI calls in LAMMPS interface to accommodate MPI-2 (e.g. for cross-compiling)
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(n2p2_build
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.10.25.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.4.9.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
set(PACELIB_MD5 "4db54962fbd6adcf8c18d46e1798ceb5" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
set(PACELIB_MD5 "a2ac3315c41a1a4a5c912bcb1bc9c5cc" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
mark_as_advanced(PACELIB_URL)
|
||||
mark_as_advanced(PACELIB_MD5)
|
||||
|
||||
# download library sources to build folder
|
||||
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz SHOW_PROGRESS EXPECTED_HASH MD5=${PACELIB_MD5})
|
||||
file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5}) #SHOW_PROGRESS
|
||||
|
||||
# uncompress downloaded sources
|
||||
execute_process(
|
||||
@ -14,12 +14,19 @@ execute_process(
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE)
|
||||
file(GLOB PACE_EVALUATOR_SOURCES ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE/*.cpp)
|
||||
file(GLOB lib-pace ${CMAKE_BINARY_DIR}/lammps-user-pace-*)
|
||||
add_subdirectory(${lib-pace}/yaml-cpp build-yaml-cpp)
|
||||
set(YAML_CPP_INCLUDE_DIR ${lib-pace}/yaml-cpp/include)
|
||||
|
||||
file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${lib-pace}/ML-PACE)
|
||||
file(GLOB PACE_EVALUATOR_SOURCES ${lib-pace}/ML-PACE/*.cpp)
|
||||
list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp)
|
||||
|
||||
add_library(pace STATIC ${PACE_EVALUATOR_SOURCES})
|
||||
set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE})
|
||||
target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR})
|
||||
target_link_libraries(lammps PRIVATE pace)
|
||||
target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR} ${YAML_CPP_INCLUDE_DIR})
|
||||
|
||||
|
||||
target_link_libraries(pace PRIVATE yaml-cpp-pace)
|
||||
|
||||
target_link_libraries(lammps PRIVATE pace)
|
||||
|
||||
@ -38,7 +38,7 @@ if(DOWNLOAD_QUIP)
|
||||
set(temp "${temp}HAVE_LOCAL_E_MIX=0\nHAVE_QC=0\nHAVE_GAP=1\nHAVE_DESCRIPTORS_NONCOMMERCIAL=1\n")
|
||||
set(temp "${temp}HAVE_TURBOGAP=0\nHAVE_QR=1\nHAVE_THIRDPARTY=0\nHAVE_FX=0\nHAVE_SCME=0\nHAVE_MTP=0\n")
|
||||
set(temp "${temp}HAVE_MBD=0\nHAVE_TTM_NF=0\nHAVE_CH4=0\nHAVE_NETCDF4=0\nHAVE_MDCORE=0\nHAVE_ASAP=0\n")
|
||||
set(temp "${temp}HAVE_CGAL=0\nHAVE_METIS=0\nHAVE_LMTO_TBE=0\n")
|
||||
set(temp "${temp}HAVE_CGAL=0\nHAVE_METIS=0\nHAVE_LMTO_TBE=0\nHAVE_SCALAPACK=0\n")
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/quip.config "${temp}")
|
||||
|
||||
message(STATUS "QUIP download via git requested - we will build our own")
|
||||
@ -50,7 +50,7 @@ if(DOWNLOAD_QUIP)
|
||||
GIT_TAG origin/public
|
||||
GIT_SHALLOW YES
|
||||
GIT_PROGRESS YES
|
||||
PATCH_COMMAND cp ${CMAKE_BINARY_DIR}/quip.config <SOURCE_DIR>/arch/Makefile.lammps
|
||||
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/quip.config <SOURCE_DIR>/arch/Makefile.lammps
|
||||
CONFIGURE_COMMAND env QUIP_ARCH=lammps make config
|
||||
BUILD_COMMAND env QUIP_ARCH=lammps make libquip
|
||||
INSTALL_COMMAND ""
|
||||
|
||||
@ -12,6 +12,13 @@ if(DOWNLOAD_MSCG)
|
||||
mark_as_advanced(MSCG_URL)
|
||||
mark_as_advanced(MSCG_MD5)
|
||||
|
||||
# CMake cannot pass BLAS or LAPACK library variable to external project if they are a list
|
||||
list(LENGTH BLAS_LIBRARIES} NUM_BLAS)
|
||||
list(LENGTH LAPACK_LIBRARIES NUM_LAPACK)
|
||||
if((NUM_BLAS GREATER 1) OR (NUM_LAPACK GREATER 1))
|
||||
message(FATAL_ERROR "Cannot compile downloaded MSCG library due to a technical limitation")
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(mscg_build
|
||||
URL ${MSCG_URL}
|
||||
|
||||
@ -23,6 +23,11 @@ if(DOWNLOAD_SCAFACOS)
|
||||
file(DOWNLOAD ${LAMMPS_THIRDPARTY_URL}/scafacos-1.0.1-fix.diff ${CMAKE_CURRENT_BINARY_DIR}/scafacos-1.0.1.fix.diff
|
||||
EXPECTED_HASH MD5=4baa1333bb28fcce102d505e1992d032)
|
||||
|
||||
find_program(HAVE_PATCH patch)
|
||||
if(NOT HAVE_PATCH)
|
||||
message(FATAL_ERROR "The 'patch' program is required to build the ScaFaCoS library")
|
||||
endif()
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(scafacos_build
|
||||
URL ${SCAFACOS_URL}
|
||||
|
||||
@ -26,6 +26,11 @@ if(DOWNLOAD_VORO)
|
||||
set(VORO_BUILD_OPTIONS CXX=${CMAKE_CXX_COMPILER} CFLAGS=${VORO_BUILD_CFLAGS})
|
||||
endif()
|
||||
|
||||
find_program(HAVE_PATCH patch)
|
||||
if(NOT HAVE_PATCH)
|
||||
message(FATAL_ERROR "The 'patch' program is required to build the voro++ library")
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(voro_build
|
||||
URL ${VORO_URL}
|
||||
URL_MD5 ${VORO_MD5}
|
||||
|
||||
@ -25,7 +25,9 @@ if(BUILD_TOOLS)
|
||||
get_filename_component(MSI2LMP_SOURCE_DIR ${LAMMPS_TOOLS_DIR}/msi2lmp/src ABSOLUTE)
|
||||
file(GLOB MSI2LMP_SOURCES ${MSI2LMP_SOURCE_DIR}/[^.]*.c)
|
||||
add_executable(msi2lmp ${MSI2LMP_SOURCES})
|
||||
target_link_libraries(msi2lmp PRIVATE ${MATH_LIBRARIES})
|
||||
if(STANDARD_MATH_LIB)
|
||||
target_link_libraries(msi2lmp PRIVATE ${STANDARD_MATH_LIB})
|
||||
endif()
|
||||
install(TARGETS msi2lmp DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
install(FILES ${LAMMPS_DOC_DIR}/msi2lmp.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
endif()
|
||||
|
||||
@ -1,7 +1,28 @@
|
||||
[
|
||||
{ include: [ "<bits/types/struct_rusage.h>", private, "<sys/resource.h>", public ] },
|
||||
{ include: [ "<bits/exception.h>", public, "<exception>", public ] },
|
||||
{ include: [ "@<Eigen/.*>", private, "<Eigen/Eigen>", public ] },
|
||||
{ include: [ "@<gtest/.*>", private, "\"gtest/gtest.h\"", public ] },
|
||||
{ include: [ "@<gmock/.*>", private, "\"gmock/gmock.h\"", public ] },
|
||||
{ include: [ "@<gmock/.*>", private, "\"gmock/gmock.h\"", public ] },
|
||||
{ include: [ "@<(cell|c_loops|container).hh>", private, "<voro++.hh>", public ] },
|
||||
{ include: [ "@\"atom_vec_.*.h\"", public, "\"style_atom.h\"", public ] },
|
||||
{ include: [ "@\"body_.*.h\"", public, "\"style_body.h\"", public ] },
|
||||
{ include: [ "@\"compute_.*.h\"", public, "\"style_compute.h\"", public ] },
|
||||
{ include: [ "@\"fix_.*.h\"", public, "\"style_fix.h\"", public ] },
|
||||
{ include: [ "@\"dump_.*.h\"", public, "\"style_dump.h\"", public ] },
|
||||
{ include: [ "@\"min_.*.h\"", public, "\"style_minimize.h\"", public ] },
|
||||
{ include: [ "@\"reader_.*.h\"", public, "\"style_reader.h\"", public ] },
|
||||
{ include: [ "@\"region_.*.h\"", public, "\"style_region.h\"", public ] },
|
||||
{ include: [ "@\"pair_.*.h\"", public, "\"style_pair.h\"", public ] },
|
||||
{ include: [ "@\"angle_.*.h\"", public, "\"style_angle.h\"", public ] },
|
||||
{ include: [ "@\"bond_.*.h\"", public, "\"style_bond.h\"", public ] },
|
||||
{ include: [ "@\"dihedral_.*.h\"", public, "\"style_dihedral.h\"", public ] },
|
||||
{ include: [ "@\"improper_.*.h\"", public, "\"style_improper.h\"", public ] },
|
||||
{ include: [ "@\"kspace_.*.h\"", public, "\"style_kspace.h\"", public ] },
|
||||
{ include: [ "@\"nbin_.*.h\"", public, "\"style_nbin.h\"", public ] },
|
||||
{ include: [ "@\"npair_.*.h\"", public, "\"style_npair.h\"", public ] },
|
||||
{ include: [ "@\"nstenci_.*.h\"", public, "\"style_nstencil.h\"", public ] },
|
||||
{ include: [ "@\"ntopo_.*.h\"", public, "\"style_ntopo.h\"", public ] },
|
||||
{ include: [ "<float.h>", public, "<cfloat>", public ] },
|
||||
{ include: [ "<limits.h>", public, "<climits>", public ] },
|
||||
{ include: [ "<bits/types/struct_tm.h>", private, "<ctime>", public ] },
|
||||
]
|
||||
|
||||
30
cmake/presets/hip_amd.cmake
Normal file
@ -0,0 +1,30 @@
|
||||
# preset that will enable hip (clang/clang++) with support for MPI and OpenMP (on Linux boxes)
|
||||
|
||||
# prefer flang over gfortran, if available
|
||||
find_program(CLANG_FORTRAN NAMES flang gfortran f95)
|
||||
set(ENV{OMPI_FC} ${CLANG_FORTRAN})
|
||||
|
||||
set(CMAKE_CXX_COMPILER "hipcc" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_COMPILER "hipcc" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_COMPILER ${CLANG_FORTRAN} CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g -std=f2003" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
|
||||
set(MPI_CXX "hipcc" CACHE STRING "" FORCE)
|
||||
set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE)
|
||||
|
||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||
set(OpenMP_C "hipcc" CACHE STRING "" FORCE)
|
||||
set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX "hipcc" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE)
|
||||
set(OpenMP_omp_LIBRARY "libomp.so" CACHE PATH "" FORCE)
|
||||
@ -24,6 +24,7 @@ set(ALL_PACKAGES
|
||||
DRUDE
|
||||
EFF
|
||||
EXTRA-COMPUTE
|
||||
EXTRA-DUMP
|
||||
EXTRA-FIX
|
||||
EXTRA-MOLECULE
|
||||
EXTRA-PAIR
|
||||
|
||||
64
cmake/presets/windows.cmake
Normal file
@ -0,0 +1,64 @@
|
||||
set(WIN_PACKAGES
|
||||
ASPHERE
|
||||
BOCS
|
||||
BODY
|
||||
BROWNIAN
|
||||
CG-DNA
|
||||
CG-SDK
|
||||
CLASS2
|
||||
COLLOID
|
||||
COLVARS
|
||||
CORESHELL
|
||||
DIELECTRIC
|
||||
DIFFRACTION
|
||||
DIPOLE
|
||||
DPD-BASIC
|
||||
DPD-MESO
|
||||
DPD-REACT
|
||||
DPD-SMOOTH
|
||||
DRUDE
|
||||
EFF
|
||||
EXTRA-COMPUTE
|
||||
EXTRA-DUMP
|
||||
EXTRA-FIX
|
||||
EXTRA-MOLECULE
|
||||
EXTRA-PAIR
|
||||
FEP
|
||||
GRANULAR
|
||||
INTERLAYER
|
||||
KSPACE
|
||||
MANIFOLD
|
||||
MANYBODY
|
||||
MC
|
||||
MEAM
|
||||
MISC
|
||||
ML-IAP
|
||||
ML-SNAP
|
||||
MOFFF
|
||||
MOLECULE
|
||||
MOLFILE
|
||||
OPENMP
|
||||
ORIENT
|
||||
PERI
|
||||
PHONON
|
||||
POEMS
|
||||
PTM
|
||||
QEQ
|
||||
QTB
|
||||
REACTION
|
||||
REAXFF
|
||||
REPLICA
|
||||
RIGID
|
||||
SHOCK
|
||||
SMTBQ
|
||||
SPH
|
||||
SPIN
|
||||
SRD
|
||||
TALLY
|
||||
UEF
|
||||
YAFF)
|
||||
|
||||
foreach(PKG ${WIN_PACKAGES})
|
||||
set(PKG_${PKG} ON CACHE BOOL "" FORCE)
|
||||
endforeach()
|
||||
|
||||
@ -435,6 +435,8 @@ INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \
|
||||
@LAMMPS_SOURCE_DIR@/my_pool_chunk.cpp \
|
||||
@LAMMPS_SOURCE_DIR@/my_pool_chunk.h \
|
||||
@LAMMPS_SOURCE_DIR@/math_eigen.h \
|
||||
@LAMMPS_SOURCE_DIR@/platform.h \
|
||||
@LAMMPS_SOURCE_DIR@/platform.cpp \
|
||||
|
||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||
|
||||
@ -33,9 +33,9 @@ when necessary.
|
||||
## Pull Requests
|
||||
|
||||
ALL changes to the LAMMPS code and documentation, however trivial, MUST
|
||||
be submitted as a pull request to GitHub. All changes to the "master"
|
||||
be submitted as a pull request to GitHub. All changes to the "develop"
|
||||
branch must be made exclusively through merging pull requests. The
|
||||
"unstable" and "stable" branches, respectively are only to be updated
|
||||
"release" and "stable" branches, respectively are only to be updated
|
||||
upon patch or stable releases with fast-forward merges based on the
|
||||
associated tags. Pull requests may also be submitted to (long-running)
|
||||
feature branches created by LAMMPS developers inside the LAMMPS project,
|
||||
@ -123,16 +123,16 @@ and thus were this comment should be placed.
|
||||
|
||||
LAMMPS uses a continuous release development model with incremental
|
||||
changes, i.e. significant effort is made - including automated pre-merge
|
||||
testing - that the code in the branch "master" does not get easily
|
||||
testing - that the code in the branch "develop" does not get easily
|
||||
broken. These tests are run after every update to a pull request. More
|
||||
extensive and time consuming tests (including regression testing) are
|
||||
performed after code is merged to the "master" branch. There are patch
|
||||
performed after code is merged to the "develop" branch. There are patch
|
||||
releases of LAMMPS every 3-5 weeks at a point, when the LAMMPS
|
||||
developers feel, that a sufficient amount of changes have happened, and
|
||||
the post-merge testing has been successful. These patch releases are
|
||||
marked with a `patch_<version date>` tag and the "unstable" branch
|
||||
marked with a `patch_<version date>` tag and the "release" branch
|
||||
follows only these versions (and thus is always supposed to be of
|
||||
production quality, unlike "master", which may be temporary broken, in
|
||||
production quality, unlike "develop", which may be temporary broken, in
|
||||
the case of larger change sets or unexpected incompatibilities or side
|
||||
effects.
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
.TH LAMMPS "31 August 2021" "2021-08-31"
|
||||
.TH LAMMPS "1" "29 September 2021" "2021-09-29"
|
||||
.SH NAME
|
||||
.B LAMMPS
|
||||
\- Molecular Dynamics Simulator.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
.TH MSI2LMP "v3.9.9" "2018-11-05"
|
||||
.TH MSI2LMP "1" "v3.9.9" "2018-11-05"
|
||||
.SH NAME
|
||||
.B MSI2LMP
|
||||
\- Converter for Materials Studio files to LAMMPS
|
||||
|
||||
@ -58,13 +58,16 @@ Report missing and unneeded '#include' statements (CMake only)
|
||||
The conventions for how and when to use and order include statements in
|
||||
LAMMPS are documented in :doc:`Modify_style`. To assist with following
|
||||
these conventions one can use the `Include What You Use tool <https://include-what-you-use.org/>`_.
|
||||
This is still under development and for large and complex projects like LAMMPS
|
||||
This tool is still under development and for large and complex projects like LAMMPS
|
||||
there are some false positives, so suggested changes need to be verified manually.
|
||||
It is recommended to use at least version 0.14, which has much fewer incorrect
|
||||
reports than earlier versions.
|
||||
It is recommended to use at least version 0.16, which has much fewer incorrect
|
||||
reports than earlier versions. To install the IWYU toolkit, you need to have
|
||||
the clang compiler **and** its development package installed. Download the IWYU
|
||||
version that matches the version of the clang compiler, configure, build, and
|
||||
install it.
|
||||
|
||||
The necessary steps to generate the report can be enabled via a
|
||||
CMake variable:
|
||||
The necessary steps to generate the report can be enabled via a CMake variable
|
||||
during CMake configuration.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ environments with restricted disk space capacity it may be needed to
|
||||
reduce the storage requirements. Here are some suggestions:
|
||||
|
||||
- Create a so-called shallow repository by cloning only the last commit
|
||||
instead of the full project history by using ``git clone git@github.com:lammps/lammps --depth=1 --branch=master``.
|
||||
instead of the full project history by using ``git clone git@github.com:lammps/lammps --depth=1 --branch=develop``.
|
||||
This reduces the downloaded size to about half. With ``--depth=1`` it is not possible to check out different
|
||||
versions/branches of LAMMPS, using ``--depth=1000`` will make multiple recent versions available at little
|
||||
extra storage needs (the entire git history had nearly 30,000 commits in fall 2021).
|
||||
|
||||
@ -33,12 +33,15 @@ various tools and files. Some of them have to be installed (see below). For
|
||||
the rest the build process will attempt to download and install them into
|
||||
a python virtual environment and local folders.
|
||||
|
||||
A current version of the manual (latest patch release, aka unstable
|
||||
branch) is is available online at:
|
||||
`https://docs.lammps.org/Manual.html <https://docs.lammps.org/Manual.html>`_.
|
||||
A version of the manual corresponding to the ongoing development (aka master branch)
|
||||
is available online at: `https://docs.lammps.org/latest/
|
||||
<https://docs.lammps.org/latest/>`_
|
||||
A current version of the manual (latest patch release, that is the state
|
||||
of the *release* branch) is is available online at:
|
||||
`https://docs.lammps.org/ <https://docs.lammps.org/>`_.
|
||||
A version of the manual corresponding to the ongoing development (that is
|
||||
the state of the *develop* branch) is available online at:
|
||||
`https://docs.lammps.org/latest/ <https://docs.lammps.org/latest/>`_
|
||||
A version of the manual corresponding to the latest stable LAMMPS release
|
||||
(that is the state of the *stable* branch) is available online at:
|
||||
`https://docs.lammps.org/stable/ <https://docs.lammps.org/stable/>`_
|
||||
|
||||
Build using GNU make
|
||||
--------------------
|
||||
|
||||
@ -71,7 +71,8 @@ LAMMPS can use them if they are available on your system.
|
||||
|
||||
-D FFTW3_INCLUDE_DIR=path # path to FFTW3 include files
|
||||
-D FFTW3_LIBRARY=path # path to FFTW3 libraries
|
||||
-D FFT_FFTW_THREADS=on # enable using threaded FFTW3 libraries
|
||||
-D FFTW3_OMP_LIBRARY=path # path to FFTW3 OpenMP wrapper libraries
|
||||
-D FFT_FFTW_THREADS=on # enable using OpenMP threaded FFTW3 libraries
|
||||
-D MKL_INCLUDE_DIR=path # ditto for Intel MKL library
|
||||
-D FFT_MKL_THREADS=on # enable using threaded FFTs with MKL libraries
|
||||
-D MKL_LIBRARY=path # path to MKL libraries
|
||||
@ -320,9 +321,7 @@ following settings:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_JPEG
|
||||
LMP_INC = -DLAMMPS_PNG
|
||||
LMP_INC = -DLAMMPS_FFMPEG
|
||||
LMP_INC = -DLAMMPS_JPEG -DLAMMPS_PNG -DLAMMPS_FFMPEG <other LMP_INC settings>
|
||||
|
||||
JPG_INC = -I/usr/local/include # path to jpeglib.h, png.h, zlib.h header files if make cannot find them
|
||||
JPG_PATH = -L/usr/lib # paths to libjpeg.a, libpng.a, libz.a (.so) files if make cannot find them
|
||||
@ -353,8 +352,10 @@ Read or write compressed files
|
||||
-----------------------------------------
|
||||
|
||||
If this option is enabled, large files can be read or written with
|
||||
gzip compression by several LAMMPS commands, including
|
||||
:doc:`read_data <read_data>`, :doc:`rerun <rerun>`, and :doc:`dump <dump>`.
|
||||
compression by ``gzip`` or similar tools by several LAMMPS commands,
|
||||
including :doc:`read_data <read_data>`, :doc:`rerun <rerun>`, and
|
||||
:doc:`dump <dump>`. Currently supported compression tools are:
|
||||
``gzip``, ``bzip2``, ``zstd``, and ``lzma``.
|
||||
|
||||
.. tabs::
|
||||
|
||||
@ -363,23 +364,23 @@ gzip compression by several LAMMPS commands, including
|
||||
.. code-block:: bash
|
||||
|
||||
-D WITH_GZIP=value # yes or no
|
||||
# default is yes if CMake can find gzip, else no
|
||||
-D GZIP_EXECUTABLE=path # path to gzip executable if CMake cannot find it
|
||||
# default is yes if CMake can find the gzip program, else no
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_GZIP
|
||||
LMP_INC = -DLAMMPS_GZIP <other LMP_INC settings>
|
||||
|
||||
This option requires that your operating system fully supports the "popen()"
|
||||
function in the standard runtime library and that a ``gzip`` executable can be
|
||||
found by LAMMPS during a run.
|
||||
This option requires that your operating system fully supports the
|
||||
"popen()" function in the standard runtime library and that a ``gzip``
|
||||
or other executable can be found by LAMMPS in the standard search path
|
||||
during a run.
|
||||
|
||||
.. note::
|
||||
|
||||
On some clusters with high-speed networks, using the "fork()" library
|
||||
call (required by "popen()") can interfere with the fast communication
|
||||
On clusters with high-speed networks, using the "fork()" library call
|
||||
(required by "popen()") can interfere with the fast communication
|
||||
library and lead to simulations using compressed output or input to
|
||||
hang or crash. For selected operations, compressed file I/O is also
|
||||
available using a compression library instead, which is what the
|
||||
@ -451,7 +452,7 @@ those systems:
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_LONGLONG_TO_LONG
|
||||
LMP_INC = -DLAMMPS_LONGLONG_TO_LONG <other LMP_INC settings>
|
||||
|
||||
----------
|
||||
|
||||
@ -478,7 +479,7 @@ e.g. to Python. Of course, the calling code has to be set up to
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_EXCEPTIONS
|
||||
LMP_INC = -DLAMMPS_EXCEPTIONS <other LMP_INC settings>
|
||||
|
||||
.. note::
|
||||
|
||||
@ -519,7 +520,7 @@ executable, not the library.
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_TRAP_FPE
|
||||
LMP_INC = -DLAMMPS_TRAP_FPE <other LMP_INC settings>
|
||||
|
||||
After compilation with this flag set, the LAMMPS executable will stop
|
||||
and produce a core dump when a division by zero, overflow, illegal math
|
||||
|
||||
@ -4,6 +4,7 @@ Notes for building LAMMPS on Windows
|
||||
* :ref:`General remarks <generic>`
|
||||
* :ref:`Running Linux on Windows <linux>`
|
||||
* :ref:`Using GNU GCC ported to Windows <gnu>`
|
||||
* :ref:`Using Visual Studio <msvc>`
|
||||
* :ref:`Using a cross-compiler <cross>`
|
||||
|
||||
----------
|
||||
@ -31,13 +32,13 @@ pre-compiled Windows binary packages are sufficient for your needs. If
|
||||
it is necessary for you to compile LAMMPS on a Windows machine
|
||||
(e.g. because it is your main desktop), please also consider using a
|
||||
virtual machine software and compile and run LAMMPS in a Linux virtual
|
||||
machine, or - if you have a sufficiently up-to-date Windows 10
|
||||
installation - consider using the Windows subsystem for Linux. This
|
||||
optional Windows feature allows you to run the bash shell from Ubuntu
|
||||
from within Windows and from there on, you can pretty much use that
|
||||
shell like you are running on an Ubuntu Linux machine (e.g. installing
|
||||
software via apt-get and more). For more details on that, please see
|
||||
:doc:`this tutorial <Howto_wsl>`.
|
||||
machine, or - if you have a sufficiently up-to-date Windows 10 or
|
||||
Windows 11 installation - consider using the Windows subsystem for
|
||||
Linux. This optional Windows feature allows you to run the bash shell
|
||||
from Ubuntu from within Windows and from there on, you can pretty much
|
||||
use that shell like you are running on an Ubuntu Linux machine
|
||||
(e.g. installing software via apt-get and more). For more details on
|
||||
that, please see :doc:`this tutorial <Howto_wsl>`.
|
||||
|
||||
.. _gnu:
|
||||
|
||||
@ -67,6 +68,35 @@ requiring changes to the LAMMPS source code, or figure out corrections
|
||||
yourself, please report them on the lammps-users mailing list, or file
|
||||
them as an issue or pull request on the LAMMPS GitHub project.
|
||||
|
||||
.. _msvc:
|
||||
|
||||
Using Microsoft Visual Studio
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Following the integration of the :doc:`platform namespace
|
||||
<Developer_platform>` into the LAMMPS code base, portability of LAMMPS
|
||||
to be compiled on Windows using Visual Studio has been significantly
|
||||
improved. This has been tested with Visual Studio 2019 (aka version
|
||||
16). Not all features and packages in LAMMPS are currently supported
|
||||
out of the box, but a preset ``cmake/presets/windows.cmake`` is provided
|
||||
that contains the packages that have been compiled successfully. You
|
||||
must use the CMake based build procedure, and either use the integrated
|
||||
CMake support of Visual Studio or use an external CMake installation to
|
||||
create build files for the Visual Studio build system. Please note that
|
||||
on launching Visual Studio it will scan the directory tree and likely
|
||||
miss the correct master ``CMakeLists.txt``. Try to open the
|
||||
``cmake/CMakeSettings.json`` and use those CMake configurations as a
|
||||
starting point. It is also possible to configure and compile LAMMPS
|
||||
from the command line with a CMake binary from `cmake.org <https://cmake.org>`_.
|
||||
|
||||
To support running in parallel you can compile with OpenMP enabled using
|
||||
the OPENMP package or install Microsoft MPI (including the SDK) and compile
|
||||
LAMMPS with MPI enabled.
|
||||
|
||||
This is work in progress and you should contact the LAMMPS developers
|
||||
via GitHub, the forum, or the mailing list, if you have questions or
|
||||
LAMMPS specific problems.
|
||||
|
||||
.. _cross:
|
||||
|
||||
Using a cross-compiler
|
||||
|
||||
@ -23,6 +23,7 @@ OPT.
|
||||
:columns: 5
|
||||
|
||||
* :doc:`accelerate/cos <fix_accelerate_cos>`
|
||||
* :doc:`acks2/reaxff (k) <fix_acks2_reaxff>`
|
||||
* :doc:`adapt <fix_adapt>`
|
||||
* :doc:`adapt/fep <fix_adapt_fep>`
|
||||
* :doc:`addforce <fix_addforce>`
|
||||
@ -103,6 +104,7 @@ OPT.
|
||||
* :doc:`manifoldforce <fix_manifoldforce>`
|
||||
* :doc:`mdi/engine <fix_mdi_engine>`
|
||||
* :doc:`meso/move <fix_meso_move>`
|
||||
* :doc:`mol/swap <fix_mol_swap>`
|
||||
* :doc:`momentum (k) <fix_momentum>`
|
||||
* :doc:`momentum/chunk <fix_momentum>`
|
||||
* :doc:`move <fix_move>`
|
||||
|
||||
@ -11,10 +11,12 @@ of time and requests from the LAMMPS user community.
|
||||
:maxdepth: 1
|
||||
|
||||
Developer_org
|
||||
Developer_parallel
|
||||
Developer_flow
|
||||
Developer_write
|
||||
Developer_notes
|
||||
Developer_plugins
|
||||
Developer_unittest
|
||||
Classes
|
||||
Developer_platform
|
||||
Developer_utils
|
||||
|
||||
120
doc/src/Developer_par_comm.rst
Normal file
@ -0,0 +1,120 @@
|
||||
Communication
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
Following the partitioning scheme in use all per-atom data is
|
||||
distributed across the MPI processes, which allows LAMMPS to handle very
|
||||
large systems provided it uses a correspondingly large number of MPI
|
||||
processes. Since The per-atom data (atom IDs, positions, velocities,
|
||||
types, etc.) To be able to compute the short-range interactions MPI
|
||||
processes need not only access to data of atoms they "own" but also
|
||||
information about atoms from neighboring sub-domains, in LAMMPS referred
|
||||
to as "ghost" atoms. These are copies of atoms storing required
|
||||
per-atom data for up to the communication cutoff distance. The green
|
||||
dashed-line boxes in the :ref:`domain-decomposition` figure illustrate
|
||||
the extended ghost-atom sub-domain for one processor.
|
||||
|
||||
This approach is also used to implement periodic boundary
|
||||
conditions: atoms that lie within the cutoff distance across a periodic
|
||||
boundary are also stored as ghost atoms and taken from the periodic
|
||||
replication of the sub-domain, which may be the same sub-domain, e.g. if
|
||||
running in serial. As a consequence of this, force computation in
|
||||
LAMMPS is not subject to minimum image conventions and thus cutoffs may
|
||||
be larger than half the simulation domain.
|
||||
|
||||
.. _ghost-atom-comm:
|
||||
.. figure:: img/ghost-comm.png
|
||||
:align: center
|
||||
|
||||
ghost atom communication
|
||||
|
||||
This figure shows the ghost atom communication patterns between
|
||||
sub-domains for "brick" (left) and "tiled" communication styles for
|
||||
2d simulations. The numbers indicate MPI process ranks. Here the
|
||||
sub-domains are drawn spatially separated for clarity. The
|
||||
dashed-line box is the extended sub-domain of processor 0 which
|
||||
includes its ghost atoms. The red- and blue-shaded boxes are the
|
||||
regions of communicated ghost atoms.
|
||||
|
||||
Efficient communication patterns are needed to update the "ghost" atom
|
||||
data, since that needs to be done at every MD time step or minimization
|
||||
step. The diagrams of the `ghost-atom-comm` figure illustrate how ghost
|
||||
atom communication is performed in two stages for a 2d simulation (three
|
||||
in 3d) for both a regular and irregular partitioning of the simulation
|
||||
box. For the regular case (left) atoms are exchanged first in the
|
||||
*x*-direction, then in *y*, with four neighbors in the grid of processor
|
||||
sub-domains.
|
||||
|
||||
In the *x* stage, processor ranks 1 and 2 send owned atoms in their
|
||||
red-shaded regions to rank 0 (and vice versa). Then in the *y* stage,
|
||||
ranks 3 and 4 send atoms in their blue-shaded regions to rank 0, which
|
||||
includes ghost atoms they received in the *x* stage. Rank 0 thus
|
||||
acquires all its ghost atoms; atoms in the solid blue corner regions
|
||||
are communicated twice before rank 0 receives them.
|
||||
|
||||
For the irregular case (right) the two stages are similar, but a
|
||||
processor can have more than one neighbor in each direction. In the
|
||||
*x* stage, MPI ranks 1,2,3 send owned atoms in their red-shaded regions to
|
||||
rank 0 (and vice versa). These include only atoms between the lower
|
||||
and upper *y*-boundary of rank 0's sub-domain. In the *y* stage, ranks
|
||||
4,5,6 send atoms in their blue-shaded regions to rank 0. This may
|
||||
include ghost atoms they received in the *x* stage, but only if they
|
||||
are needed by rank 0 to fill its extended ghost atom regions in the
|
||||
+/-*y* directions (blue rectangles). Thus in this case, ranks 5 and
|
||||
6 do not include ghost atoms they received from each other (in the *x*
|
||||
stage) in the atoms they send to rank 0. The key point is that while
|
||||
the pattern of communication is more complex in the irregular
|
||||
partitioning case, it can still proceed in two stages (three in 3d)
|
||||
via atom exchanges with only neighboring processors.
|
||||
|
||||
When attributes of owned atoms are sent to neighboring processors to
|
||||
become attributes of their ghost atoms, LAMMPS calls this a "forward"
|
||||
communication. On timesteps when atoms migrate to new owning processors
|
||||
and neighbor lists are rebuilt, each processor creates a list of its
|
||||
owned atoms which are ghost atoms in each of its neighbor processors.
|
||||
These lists are used to pack per-atom coordinates (for example) into
|
||||
message buffers in subsequent steps until the next reneighboring.
|
||||
|
||||
A "reverse" communication is when computed ghost atom attributes are
|
||||
sent back to the processor who owns the atom. This is used (for
|
||||
example) to sum partial forces on ghost atoms to the complete force on
|
||||
owned atoms. The order of the two stages described in the
|
||||
:ref:`ghost-atom-comm` figure is inverted and the same lists of atoms
|
||||
are used to pack and unpack message buffers with per-atom forces. When
|
||||
a received buffer is unpacked, the ghost forces are summed to owned atom
|
||||
forces. As in forward communication, forces on atoms in the four blue
|
||||
corners of the diagrams are sent, received, and summed twice (once at
|
||||
each stage) before owning processors have the full force.
|
||||
|
||||
These two operations are used many places within LAMMPS aside from
|
||||
exchange of coordinates and forces, for example by manybody potentials
|
||||
to share intermediate per-atom values, or by rigid-body integrators to
|
||||
enable each atom in a body to access body properties. Here are
|
||||
additional details about how these communication operations are
|
||||
performed in LAMMPS:
|
||||
|
||||
- When exchanging data with different processors, forward and reverse
|
||||
communication is done using ``MPI_Send()`` and ``MPI_IRecv()`` calls.
|
||||
If a processor is "exchanging" atoms with itself, only the pack and
|
||||
unpack operations are performed, e.g. to create ghost atoms across
|
||||
periodic boundaries when running on a single processor.
|
||||
|
||||
- For forward communication of owned atom coordinates, periodic box
|
||||
lengths are added and subtracted when the receiving processor is
|
||||
across a periodic boundary from the sender. There is then no need to
|
||||
apply a minimum image convention when calculating distances between
|
||||
atom pairs when building neighbor lists or computing forces.
|
||||
|
||||
- The cutoff distance for exchanging ghost atoms is typically equal to
|
||||
the neighbor cutoff. But it can also chosen to be longer if needed,
|
||||
e.g. half the diameter of a rigid body composed of multiple atoms or
|
||||
over 3x the length of a stretched bond for dihedral interactions. It
|
||||
can also exceed the periodic box size. For the regular communication
|
||||
pattern (left), if the cutoff distance extends beyond a neighbor
|
||||
processor's sub-domain, then multiple exchanges are performed in the
|
||||
same direction. Each exchange is with the same neighbor processor,
|
||||
but buffers are packed/unpacked using a different list of atoms. For
|
||||
forward communication, in the first exchange a processor sends only
|
||||
owned atoms. In subsequent exchanges, it sends ghost atoms received
|
||||
in previous exchanges. For the irregular pattern (right) overlaps of
|
||||
a processor's extended ghost-atom sub-domain with all other processors
|
||||
in each dimension are detected.
|
||||
188
doc/src/Developer_par_long.rst
Normal file
@ -0,0 +1,188 @@
|
||||
Long-range interactions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For charged systems, LAMMPS can compute long-range Coulombic
|
||||
interactions via the FFT-based particle-particle/particle-mesh (PPPM)
|
||||
method implemented in :doc:`kspace style pppm and its variants
|
||||
<kspace_style>`. For that Coulombic interactions are partitioned into
|
||||
short- and long-range components. The short-ranged portion is computed
|
||||
in real space as a loop over pairs of charges within a cutoff distance,
|
||||
using neighbor lists. The long-range portion is computed in reciprocal
|
||||
space using a kspace style. For the PPPM implementation the simulation
|
||||
cell is overlaid with a regular FFT grid in 3d. It proceeds in several stages:
|
||||
|
||||
a) each atom's point charge is interpolated to nearby FFT grid points,
|
||||
b) a forward 3d FFT is performed,
|
||||
c) a convolution operation is performed in reciprocal space,
|
||||
d) one or more inverse 3d FFTs are performed, and
|
||||
e) electric field values from grid points near each atom are interpolated to compute
|
||||
its forces.
|
||||
|
||||
For any of the spatial-decomposition partitioning schemes each processor
|
||||
owns the brick-shaped portion of FFT grid points contained within its
|
||||
sub-domain. The two interpolation operations use a stencil of grid
|
||||
points surrounding each atom. To accommodate the stencil size, each
|
||||
processor also stores a few layers of ghost grid points surrounding its
|
||||
brick. Forward and reverse communication of grid point values is
|
||||
performed similar to the corresponding :doc:`atom data communication
|
||||
<Developer_par_comm>`. In this case, electric field values on owned
|
||||
grid points are sent to neighboring processors to become ghost point
|
||||
values. Likewise charge values on ghost points are sent and summed to
|
||||
values on owned points.
|
||||
|
||||
For triclinic simulation boxes, the FFT grid planes are parallel to
|
||||
the box faces, but the mapping of charge and electric field values
|
||||
to/from grid points is done in reduced coordinates where the tilted
|
||||
box is conceptually a unit cube, so that the stencil and FFT
|
||||
operations are unchanged. However the FFT grid size required for a
|
||||
given accuracy is larger for triclinic domains than it is for
|
||||
orthogonal boxes.
|
||||
|
||||
.. _fft-parallel:
|
||||
.. figure:: img/fft-decomp-parallel.png
|
||||
:align: center
|
||||
|
||||
parallel FFT in PPPM
|
||||
|
||||
Stages of a parallel FFT for a simulation domain overlaid
|
||||
with an 8x8x8 3d FFT grid, partitioned across 64 processors.
|
||||
Within each of the 4 diagrams, grid cells of the same color are
|
||||
owned by a single processor; for simplicity only cells owned by 4
|
||||
or 8 of the 64 processors are colored. The two images on the left
|
||||
illustrate brick-to-pencil communication. The two images on the
|
||||
right illustrate pencil-to-pencil communication, which in this
|
||||
case transposes the *y* and *z* dimensions of the grid.
|
||||
|
||||
Parallel 3d FFTs require substantial communication relative to their
|
||||
computational cost. A 3d FFT is implemented by a series of 1d FFTs
|
||||
along the *x-*, *y-*, and *z-*\ direction of the FFT grid. Thus the FFT
|
||||
grid cannot be decomposed like atoms into 3 dimensions for parallel
|
||||
processing of the FFTs but only in 1 (as planes) or 2 (as pencils)
|
||||
dimensions and in between the steps the grid needs to be transposed to
|
||||
have the FFT grid portion "owned" by each MPI process complete in the
|
||||
direction of the 1d FFTs it has to perform. LAMMPS uses the
|
||||
pencil-decomposition algorithm as shown in the :ref:`fft-parallel` figure.
|
||||
|
||||
Initially (far left), each processor owns a brick of same-color grid
|
||||
cells (actually grid points) contained within in its sub-domain. A
|
||||
brick-to-pencil communication operation converts this layout to 1d
|
||||
pencils in the *x*-dimension (center left). Again, cells of the same
|
||||
color are owned by the same processor. Each processor can then compute
|
||||
a 1d FFT on each pencil of data it wholly owns using a call to the
|
||||
configured FFT library. A pencil-to-pencil communication then converts
|
||||
this layout to pencils in the *y* dimension (center right) which
|
||||
effectively transposes the *x* and *y* dimensions of the grid, followed
|
||||
by 1d FFTs in *y*. A final transpose of pencils from *y* to *z* (far
|
||||
right) followed by 1d FFTs in *z* completes the forward FFT. The data
|
||||
is left in a *z*-pencil layout for the convolution operation. One or
|
||||
more inverse FFTs then perform the sequence of 1d FFTs and communication
|
||||
steps in reverse order; the final layout of resulting grid values is the
|
||||
same as the initial brick layout.
|
||||
|
||||
Each communication operation within the FFT (brick-to-pencil or
|
||||
pencil-to-pencil or pencil-to-brick) converts one tiling of the 3d grid
|
||||
to another, where a tiling in this context means an assignment of a
|
||||
small brick-shaped subset of grid points to each processor, the union of
|
||||
which comprise the entire grid. The parallel `fftMPI library
|
||||
<https://lammps.github.io/fftmpi/>`_ written for LAMMPS allows arbitrary
|
||||
definitions of the tiling so that an irregular partitioning of the
|
||||
simulation domain can use it directly. Transforming data from one
|
||||
tiling to another is implemented in `fftMPI` using point-to-point
|
||||
communication, where each processor sends data to a few other
|
||||
processors, since each tile in the initial tiling overlaps with a
|
||||
handful of tiles in the final tiling.
|
||||
|
||||
The transformations could also be done using collective communication
|
||||
across all $P$ processors with a single call to ``MPI_Alltoall()``, but
|
||||
this is typically much slower. However, for the specialized brick and
|
||||
pencil tiling illustrated in :ref:`fft-parallel` figure, collective
|
||||
communication across the entire MPI communicator is not required. In
|
||||
the example an :math:`8^3` grid with 512 grid cells is partitioned
|
||||
across 64 processors; each processor owns a 2x2x2 3d brick of grid
|
||||
cells. The initial brick-to-pencil communication (upper left to upper
|
||||
right) only requires collective communication within subgroups of 4
|
||||
processors, as illustrated by the 4 colors. More generally, a
|
||||
brick-to-pencil communication can be performed by partitioning *P*
|
||||
processors into :math:`P^{\frac{2}{3}}` subgroups of
|
||||
:math:`P^{\frac{1}{3}}` processors each. Each subgroup performs
|
||||
collective communication only within its subgroup. Similarly,
|
||||
pencil-to-pencil communication can be performed by partitioning *P*
|
||||
processors into :math:`P^{\frac{1}{2}}` subgroups of
|
||||
:math:`P^{\frac{1}{2}}` processors each. This is illustrated in the
|
||||
figure for the :math:`y \Rightarrow z` communication (center). An
|
||||
eight-processor subgroup owns the front *yz* plane of data and performs
|
||||
collective communication within the subgroup to transpose from a
|
||||
*y*-pencil to *z*-pencil layout.
|
||||
|
||||
LAMMPS invokes point-to-point communication by default, but also
|
||||
provides the option of partitioned collective communication when using a
|
||||
:doc:`kspace_modify collective yes <kspace_modify>` command to switch to
|
||||
that mode. In the latter case, the code detects the size of the
|
||||
disjoint subgroups and partitions the single *P*-size communicator into
|
||||
multiple smaller communicators, each of which invokes collective
|
||||
communication. Testing on a large IBM Blue Gene/Q machine at Argonne
|
||||
National Labs showed a significant improvement in FFT performance for
|
||||
large processor counts; partitioned collective communication was faster
|
||||
than point-to-point communication or global collective communication
|
||||
involving all *P* processors.
|
||||
|
||||
Here are some additional details about FFTs for long-range and related
|
||||
grid/particle operations that LAMMPS supports:
|
||||
|
||||
- The fftMPI library allows each grid dimension to be a multiple of
|
||||
small prime factors (2,3,5), and allows any number of processors to
|
||||
perform the FFT. The resulting brick and pencil decompositions are
|
||||
thus not always as well-aligned but the size of subgroups of
|
||||
processors for the two modes of communication (brick/pencil and
|
||||
pencil/pencil) still scale as :math:`O(P^{\frac{1}{3}})` and
|
||||
:math:`O(P^{\frac{1}{2}})`.
|
||||
|
||||
- For efficiency in performing 1d FFTs, the grid transpose
|
||||
operations illustrated in Figure \ref{fig:fft} also involve
|
||||
reordering the 3d data so that a different dimension is contiguous
|
||||
in memory. This reordering can be done during the packing or
|
||||
unpacking of buffers for MPI communication.
|
||||
|
||||
- For large systems and particularly a large number of MPI processes,
|
||||
the dominant cost for parallel FFTs is often the communication, not
|
||||
the computation of 1d FFTs, even though the latter scales as :math:`N
|
||||
\log(N)` in the number of grid points *N* per grid direction. This is
|
||||
due to the fact that only a 2d decomposition into pencils is possible
|
||||
while atom data (and their corresponding short-range force and energy
|
||||
computations) can be decomposed efficiently in 3d.
|
||||
|
||||
This can be addressed by reducing the number of MPI processes involved
|
||||
in the MPI communication by using :doc:`hybrid MPI + OpenMP
|
||||
parallelization <Speed_omp>`. This will use OpenMP parallelization
|
||||
inside the MPI domains and while that may have a lower parallel
|
||||
efficiency, it reduces the communication overhead.
|
||||
|
||||
As an alternative it is also possible to start a :ref:`multi-partition
|
||||
<partition>` calculation and then use the :doc:`verlet/split
|
||||
integrator <run_style>` to perform the PPPM computation on a
|
||||
dedicated, separate partition of MPI processes. This uses an integer
|
||||
"1:*p*" mapping of *p* sub-domains of the atom decomposition to one
|
||||
sub-domain of the FFT grid decomposition and where pairwise non-bonded
|
||||
and bonded forces and energies are computed on the larger partition
|
||||
and the PPPM kspace computation concurrently on the smaller partition.
|
||||
|
||||
- LAMMPS also implements PPPM-based solvers for other long-range
|
||||
interactions, dipole and dispersion (Lennard-Jones), which can be used
|
||||
in conjunction with long-range Coulombics for point charges.
|
||||
|
||||
- LAMMPS implements a ``GridComm`` class which overlays the simulation
|
||||
domain with a regular grid, partitions it across processors in a
|
||||
manner consistent with processor sub-domains, and provides methods for
|
||||
forward and reverse communication of owned and ghost grid point
|
||||
values. It is used for PPPM as an FFT grid (as outlined above) and
|
||||
also for the MSM algorithm which uses a cascade of grid sizes from
|
||||
fine to coarse to compute long-range Coulombic forces. The GridComm
|
||||
class is also useful for models where continuum fields interact with
|
||||
particles. For example, the two-temperature model (TTM) defines heat
|
||||
transfer between atoms (particles) and electrons (continuum gas) where
|
||||
spatial variations in the electron temperature are computed by finite
|
||||
differences of a discretized heat equation on a regular grid. The
|
||||
:doc:`fix ttm/grid <fix_ttm>` command uses the ``GridComm`` class
|
||||
internally to perform its grid operations on a distributed grid
|
||||
instead of the original :doc:`fix ttm <fix_ttm>` which uses a
|
||||
replicated grid.
|
||||
159
doc/src/Developer_par_neigh.rst
Normal file
@ -0,0 +1,159 @@
|
||||
Neighbor lists
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
To compute forces efficiently, each processor creates a Verlet-style
|
||||
neighbor list which enumerates all pairs of atoms *i,j* (*i* = owned,
|
||||
*j* = owned or ghost) with separation less than the applicable
|
||||
neighbor list cutoff distance. In LAMMPS the neighbor lists are stored
|
||||
in a multiple-page data structure; each page is a contiguous chunk of
|
||||
memory which stores vectors of neighbor atoms *j* for many *i* atoms.
|
||||
This allows pages to be incrementally allocated or deallocated in blocks
|
||||
as needed. Neighbor lists typically consume the most memory of any data
|
||||
structure in LAMMPS. The neighbor list is rebuilt (from scratch) once
|
||||
every few timesteps, then used repeatedly each step for force or other
|
||||
computations. The neighbor cutoff distance is :math:`R_n = R_f +
|
||||
\Delta_s`, where :math:`R_f` is the (largest) force cutoff defined by
|
||||
the interatomic potential for computing short-range pairwise or manybody
|
||||
forces and :math:`\Delta_s` is a "skin" distance that allows the list to
|
||||
be used for multiple steps assuming that atoms do not move very far
|
||||
between consecutive time steps. Typically the code triggers
|
||||
reneighboring when any atom has moved half the skin distance since the
|
||||
last reneighboring; this and other options of the neighbor list rebuild
|
||||
can be adjusted with the :doc:`neigh_modify <neigh_modify>` command.
|
||||
|
||||
On steps when reneighboring is performed, atoms which have moved outside
|
||||
their owning processor's sub-domain are first migrated to new processors
|
||||
via communication. Periodic boundary conditions are also (only)
|
||||
enforced on these steps to ensure each atom is re-assigned to the
|
||||
correct processor. After migration, the atoms owned by each processor
|
||||
are stored in a contiguous vector. Periodically each processor
|
||||
spatially sorts owned atoms within its vector to reorder it for improved
|
||||
cache efficiency in force computations and neighbor list building. For
|
||||
that atoms are spatially binned and then reordered so that atoms in the
|
||||
same bin are adjacent in the vector. Atom sorting can be disabled or
|
||||
its settings modified with the :doc:`atom_modify <atom_modify>` command.
|
||||
|
||||
.. _neighbor-stencil:
|
||||
.. figure:: img/neigh-stencil.png
|
||||
:align: center
|
||||
|
||||
neighbor list stencils
|
||||
|
||||
A 2d simulation sub-domain (thick black line) and the corresponding
|
||||
ghost atom cutoff region (dashed blue line) for both orthogonal
|
||||
(left) and triclinic (right) domains. A regular grid of neighbor
|
||||
bins (thin lines) overlays the entire simulation domain and need not
|
||||
align with sub-domain boundaries; only the portion overlapping the
|
||||
augmented sub-domain is shown. In the triclinic case it overlaps the
|
||||
bounding box of the tilted rectangle. The blue- and red-shaded bins
|
||||
represent a stencil of bins searched to find neighbors of a particular
|
||||
atom (black dot).
|
||||
|
||||
To build a local neighbor list in linear time, the simulation domain is
|
||||
overlaid (conceptually) with a regular 3d (or 2d) grid of neighbor bins,
|
||||
as shown in the :ref:`neighbor-stencil` figure for 2d models and a
|
||||
single MPI processor's sub-domain. Each processor stores a set of
|
||||
neighbor bins which overlap its sub-domain extended by the neighbor
|
||||
cutoff distance :math:`R_n`. As illustrated, the bins need not align
|
||||
with processor boundaries; an integer number in each dimension is fit to
|
||||
the size of the entire simulation box.
|
||||
|
||||
Most often LAMMPS builds what it calls a "half" neighbor list where
|
||||
each *i,j* neighbor pair is stored only once, with either atom *i* or
|
||||
*j* as the central atom. The build can be done efficiently by using a
|
||||
pre-computed "stencil" of bins around a central origin bin which
|
||||
contains the atom whose neighbors are being searched for. A stencil
|
||||
is simply a list of integer offsets in *x,y,z* of nearby bins
|
||||
surrounding the origin bin which are close enough to contain any
|
||||
neighbor atom *j* within a distance :math:`R_n` from any atom *i* in the
|
||||
origin bin. Note that for a half neighbor list, the stencil can be
|
||||
asymmetric since each atom only need store half its nearby neighbors.
|
||||
|
||||
These stencils are illustrated in the figure for a half list and a bin
|
||||
size of :math:`\frac{1}{2} R_n`. There are 13 red+blue stencil bins in
|
||||
2d (for the orthogonal case, 15 for triclinic). In 3d there would be
|
||||
63, 13 in the plane of bins that contain the origin bin and 25 in each
|
||||
of the two planes above it in the *z* direction (75 for triclinic). The
|
||||
reason the triclinic stencil has extra bins is because the bins tile the
|
||||
bounding box of the entire triclinic domain and thus are not periodic
|
||||
with respect to the simulation box itself. The stencil and logic for
|
||||
determining which *i,j* pairs to include in the neighbor list are
|
||||
altered slightly to account for this.
|
||||
|
||||
To build a neighbor list, a processor first loops over its "owned" plus
|
||||
"ghost" atoms and assigns each to a neighbor bin. This uses an integer
|
||||
vector to create a linked list of atom indices within each bin. It then
|
||||
performs a triply-nested loop over its owned atoms *i*, the stencil of
|
||||
bins surrounding atom *i*'s bin, and the *j* atoms in each stencil bin
|
||||
(including ghost atoms). If the distance :math:`r_{ij} < R_n`, then
|
||||
atom *j* is added to the vector of atom *i*'s neighbors.
|
||||
|
||||
Here are additional details about neighbor list build options LAMMPS
|
||||
supports:
|
||||
|
||||
- The choice of bin size is an option; a size half of :math:`R_n` has
|
||||
been found to be optimal for many typical cases. Smaller bins incur
|
||||
additional overhead to loop over; larger bins require more distance
|
||||
calculations. Note that for smaller bin sizes, the 2d stencil in the
|
||||
figure would be more semi-circular in shape (hemispherical in 3d),
|
||||
with bins near the corners of the square eliminated due to their
|
||||
distance from the origin bin.
|
||||
|
||||
- Depending on the interatomic potential(s) and other commands used in
|
||||
an input script, multiple neighbor lists and stencils with different
|
||||
attributes may be needed. This includes lists with different cutoff
|
||||
distances, e.g. for force computation versus occasional diagnostic
|
||||
computations such as a radial distribution function, or for the
|
||||
r-RESPA time integrator which can partition pairwise forces by
|
||||
distance into subsets computed at different time intervals. It
|
||||
includes "full" lists (as opposed to half lists) where each *i,j* pair
|
||||
appears twice, stored once with *i* and *j*, and which use a larger
|
||||
symmetric stencil. It also includes lists with partial enumeration of
|
||||
ghost atom neighbors. The full and ghost-atom lists are used by
|
||||
various manybody interatomic potentials. Lists may also use different
|
||||
criteria for inclusion of a pair interaction. Typically this simply
|
||||
depends only on the distance between two atoms and the cutoff
|
||||
distance. But for finite-size coarse-grained particles with
|
||||
individual diameters (e.g. polydisperse granular particles), it can
|
||||
also depend on the diameters of the two particles.
|
||||
|
||||
- When using :doc:`pair style hybrid <pair_hybrid>` multiple sub-lists
|
||||
of the master neighbor list for the full system need to be generated,
|
||||
one for each sub-style, which contains only the *i,j* pairs needed to
|
||||
compute interactions between subsets of atoms for the corresponding
|
||||
potential. This means not all *i* or *j* atoms owned by a processor
|
||||
are included in a particular sub-list.
|
||||
|
||||
- Some models use different cutoff lengths for pairwise interactions
|
||||
between different kinds of particles which are stored in a single
|
||||
neighbor list. One example is a solvated colloidal system with large
|
||||
colloidal particles where colloid/colloid, colloid/solvent, and
|
||||
solvent/solvent interaction cutoffs can be dramatically different.
|
||||
Another is a model of polydisperse finite-size granular particles;
|
||||
pairs of particles interact only when they are in contact with each
|
||||
other. Mixtures with particle size ratios as high as 10-100x may be
|
||||
used to model realistic systems. Efficient neighbor list building
|
||||
algorithms for these kinds of systems are available in LAMMPS. They
|
||||
include a method which uses different stencils for different cutoff
|
||||
lengths and trims the stencil to only include bins that straddle the
|
||||
cutoff sphere surface. More recently a method which uses both
|
||||
multiple stencils and multiple bin sizes was developed; it builds
|
||||
neighbor lists efficiently for systems with particles of any size
|
||||
ratio, though other considerations (timestep size, force computations)
|
||||
may limit the ability to model systems with huge polydispersity.
|
||||
|
||||
- For small and sparse systems and as a fallback method, LAMMPS also
|
||||
supports neighbor list construction without binning by using a full
|
||||
:math:`O(N^2)` loop over all *i,j* atom pairs in a sub-domain when
|
||||
using the :doc:`neighbor nsq <neighbor>` command.
|
||||
|
||||
- Dependent on the "pair" setting of the :doc:`newton <newton>` command,
|
||||
the "half" neighbor lists may contain **all** pairs of atoms where
|
||||
atom *j* is a ghost atom (i.e. when the newton pair setting is *off*)
|
||||
For the newton pair *on* setting the atom *j* is only added to the
|
||||
list if its *z* coordinate is larger, or if equal the *y* coordinate
|
||||
is larger, and that is equal, too, the *x* coordinate is larger. For
|
||||
homogeneously dense systems that will result in picking neighbors from
|
||||
a same size sector in always the same direction relative to the
|
||||
"owned" atom and thus it should lead to similar length neighbor lists
|
||||
and thus reduce the chance of a load imbalance.
|
||||
114
doc/src/Developer_par_openmp.rst
Normal file
@ -0,0 +1,114 @@
|
||||
OpenMP Parallelism
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The styles in the INTEL, KOKKOS, and OPENMP package offer to use OpenMP
|
||||
thread parallelism to predominantly distribute loops over local data
|
||||
and thus follow an orthogonal parallelization strategy to the
|
||||
decomposition into spatial domains used by the :doc:`MPI partitioning
|
||||
<Developer_par_part>`. For clarity, this section discusses only the
|
||||
implementation in the OPENMP package as it is the simplest. The INTEL
|
||||
and KOKKOS package offer additional options and are more complex since
|
||||
they support more features and different hardware like co-processors
|
||||
or GPUs.
|
||||
|
||||
One of the key decisions when implementing the OPENMP package was to
|
||||
keep the changes to the source code small, so that it would be easier to
|
||||
maintain the code and keep it in sync with the non-threaded standard
|
||||
implementation. this is achieved by a) making the OPENMP version a
|
||||
derived class from the regular version (e.g. ``PairLJCutOMP`` from
|
||||
``PairLJCut``) and overriding only methods that are multi-threaded or
|
||||
need to be modified to support multi-threading (similar to what was done
|
||||
in the OPT package), b) keeping the structure in the modified code very
|
||||
similar so that side-by-side comparisons are still useful, and c)
|
||||
offloading additional functionality and multi-thread support functions
|
||||
into three separate classes ``ThrOMP``, ``ThrData``, and ``FixOMP``.
|
||||
``ThrOMP`` provides additional, multi-thread aware functionality not
|
||||
available in the corresponding base class (e.g. ``Pair`` for
|
||||
``PairLJCutOMP``) like multi-thread aware variants of the "tally"
|
||||
functions. Those functions are made available through multiple
|
||||
inheritance so those new functions have to have unique names to avoid
|
||||
ambiguities; typically ``_thr`` is appended to the name of the function.
|
||||
``ThrData`` is a classes that manages per-thread data structures.
|
||||
It is used instead of extending the corresponding storage to per-thread
|
||||
arrays to avoid slowdowns due to "false sharing" when multiple threads
|
||||
update adjacent elements in an array and thus force the CPU cache lines
|
||||
to be reset and re-fetched. ``FixOMP`` finally manages the "multi-thread
|
||||
state" like settings and access to per-thread storage, it is activated
|
||||
by the :doc:`package omp <package>` command.
|
||||
|
||||
Avoiding data races
|
||||
"""""""""""""""""""
|
||||
|
||||
A key problem when implementing thread parallelism in an MD code is
|
||||
to avoid data races when updating accumulated properties like forces,
|
||||
energies, and stresses. When interactions are computed, they always
|
||||
involve multiple atoms and thus there are race conditions when multiple
|
||||
threads want to update per-atom data of the same atoms. Five possible
|
||||
strategies have been considered to avoid this:
|
||||
|
||||
1) restructure the code so that there is no overlapping access possible
|
||||
when computing in parallel, e.g. by breaking lists into multiple
|
||||
parts and synchronizing threads in between.
|
||||
2) have each thread be "responsible" for a specific group of atoms and
|
||||
compute these interactions multiple times, once on each thread that
|
||||
is responsible for a given atom and then have each thread only update
|
||||
the properties of this atom.
|
||||
3) use mutexes around functions and regions of code where the data race
|
||||
could happen
|
||||
4) use atomic operations when updating per-atom properties
|
||||
5) use replicated per-thread data structures to accumulate data without
|
||||
conflicts and then use a reduction to combine those results into the
|
||||
data structures used by the regular style.
|
||||
|
||||
Option 5 was chosen for the OPENMP package because it would retain the
|
||||
performance for the case of 1 thread and the code would be more
|
||||
maintainable. Option 1 would require extensive code changes,
|
||||
particularly to the neighbor list code; options 2 would have incurred a
|
||||
2x or more performance penalty for the serial case; option 3 causes
|
||||
significant overhead and would enforce serialization of operations in
|
||||
inner loops and thus defeat the purpose of multi-threading; option 4
|
||||
slows down the serial case although not quite as bad as option 2. The
|
||||
downside of option 5 is that the overhead of the reduction operations
|
||||
grows with the number of threads used, so there would be a crossover
|
||||
point where options 2 or 4 would result in faster executing. That is
|
||||
why option 2 for example is used in the GPU package because a GPU is a
|
||||
processor with a massive number of threads. However, since the MPI
|
||||
parallelization is generally more effective for typical MD systems, the
|
||||
expectation is that thread parallelism is only used for a smaller number
|
||||
of threads (2-8). At the time of its implementation, that number was
|
||||
equivalent to the number of CPU cores per CPU socket on high-end
|
||||
supercomputers.
|
||||
|
||||
Thus arrays like the force array are dimensioned to the number of atoms
|
||||
times the number of threads when enabling OpenMP support and inside the
|
||||
compute functions a pointer to a different chunk is obtained by each thread.
|
||||
Similarly, accumulators like potential energy or virial are kept in
|
||||
per-thread instances of the ``ThrData`` class and then only reduced and
|
||||
stored in their global counterparts at the end of the force computation.
|
||||
|
||||
|
||||
Loop scheduling
|
||||
"""""""""""""""
|
||||
|
||||
Multi-thread parallelization is applied by distributing (outer) loops
|
||||
statically across threads. Typically this would be the loop over local
|
||||
atoms *i* when processing *i,j* pairs of atoms from a neighbor list.
|
||||
The design of the neighbor list code results in atoms having a similar
|
||||
number of neighbors for homogeneous systems and thus load imbalances
|
||||
across threads are not common and typically happen for systems where
|
||||
also the MPI parallelization would be unbalanced, which would typically
|
||||
have a more pronounced impact on the performance. This same loop
|
||||
scheduling scheme can also be applied to the reduction operations on
|
||||
per-atom data to try and reduce the overhead of the reduction operation.
|
||||
|
||||
Neighbor list parallelization
|
||||
"""""""""""""""""""""""""""""
|
||||
|
||||
In addition to the parallelization of force computations, also the
|
||||
generation of the neighbor lists is parallelized. As explained
|
||||
previously, neighbor lists are built by looping over "owned" atoms and
|
||||
storing the neighbors in "pages". In the OPENMP variants of the
|
||||
neighbor list code, each thread operates on a different chunk of "owned"
|
||||
atoms and allocates and fills its own set of pages with neighbor list
|
||||
data. This is achieved by each thread keeping its own instance of the
|
||||
:cpp:class:`MyPage <LAMMPS_NS::MyPage>` page allocator class.
|
||||
89
doc/src/Developer_par_part.rst
Normal file
@ -0,0 +1,89 @@
|
||||
Partitioning
|
||||
^^^^^^^^^^^^
|
||||
|
||||
The underlying spatial decomposition strategy used by LAMMPS for
|
||||
distributed-memory parallelism is set with the :doc:`comm_style command
|
||||
<comm_style>` and can be either "brick" (a regular grid) or "tiled".
|
||||
|
||||
.. _domain-decomposition:
|
||||
.. figure:: img/domain-decomp.png
|
||||
:align: center
|
||||
|
||||
domain decomposition
|
||||
|
||||
This figure shows the different kinds of domain decomposition used
|
||||
for MPI parallelization: "brick" on the left with an orthogonal
|
||||
(left) and a triclinic (middle) simulation domain, and a "tiled"
|
||||
decomposition (right). The black lines show the division into
|
||||
sub-domains and the contained atoms are "owned" by the corresponding
|
||||
MPI process. The green dashed lines indicate how sub-domains are
|
||||
extended with "ghost" atoms up to the communication cutoff distance.
|
||||
|
||||
The LAMMPS simulation box is a 3d or 2d volume, which can be orthogonal
|
||||
or triclinic in shape, as illustrated in the :ref:`domain-decomposition`
|
||||
figure for the 2d case. Orthogonal means the box edges are aligned with
|
||||
the *x*, *y*, *z* Cartesian axes, and the box faces are thus all
|
||||
rectangular. Triclinic allows for a more general parallelepiped shape
|
||||
in which edges are aligned with three arbitrary vectors and the box
|
||||
faces are parallelograms. In each dimension box faces can be periodic,
|
||||
or non-periodic with fixed or shrink-wrapped boundaries. In the fixed
|
||||
case, atoms which move outside the face are deleted; shrink-wrapped
|
||||
means the position of the box face adjusts continuously to enclose all
|
||||
the atoms.
|
||||
|
||||
For distributed-memory MPI parallelism, the simulation box is spatially
|
||||
decomposed (partitioned) into non-overlapping sub-domains which fill the
|
||||
box. The default partitioning, "brick", is most suitable when atom
|
||||
density is roughly uniform, as shown in the left-side images of the
|
||||
:ref:`domain-decomposition` figure. The sub-domains comprise a regular
|
||||
grid and all sub-domains are identical in size and shape. Both the
|
||||
orthogonal and triclinic boxes can deform continuously during a
|
||||
simulation, e.g. to compress a solid or shear a liquid, in which case
|
||||
the processor sub-domains likewise deform.
|
||||
|
||||
|
||||
For models with non-uniform density, the number of particles per
|
||||
processor can be load-imbalanced with the default partitioning. This
|
||||
reduces parallel efficiency, as the overall simulation rate is limited
|
||||
by the slowest processor, i.e. the one with the largest computational
|
||||
load. For such models, LAMMPS supports multiple strategies to reduce
|
||||
the load imbalance:
|
||||
|
||||
- The processor grid decomposition is by default based on the simulation
|
||||
cell volume and tries to optimize the volume to surface ratio for the sub-domains.
|
||||
This can be changed with the :doc:`processors command <processors>`.
|
||||
- The parallel planes defining the size of the sub-domains can be shifted
|
||||
with the :doc:`balance command <balance>`. Which can be done in addition
|
||||
to choosing a more optimal processor grid.
|
||||
- The recursive bisectioning algorithm in combination with the "tiled"
|
||||
communication style can produce a partitioning with equal numbers of
|
||||
particles in each sub-domain.
|
||||
|
||||
|
||||
.. |decomp1| image:: img/decomp-regular.png
|
||||
:width: 24%
|
||||
|
||||
.. |decomp2| image:: img/decomp-processors.png
|
||||
:width: 24%
|
||||
|
||||
.. |decomp3| image:: img/decomp-balance.png
|
||||
:width: 24%
|
||||
|
||||
.. |decomp4| image:: img/decomp-rcb.png
|
||||
:width: 24%
|
||||
|
||||
|decomp1| |decomp2| |decomp3| |decomp4|
|
||||
|
||||
The pictures above demonstrate different decompositions for a 2d system
|
||||
with 12 MPI ranks. The atom colors indicate the load imbalance of each
|
||||
sub-domain with green being optimal and red the least optimal.
|
||||
|
||||
Due to the vacuum in the system, the default decomposition is unbalanced
|
||||
with several MPI ranks without atoms (left). By forcing a 1x12x1
|
||||
processor grid, every MPI rank does computations now, but number of
|
||||
atoms per sub-domain is still uneven and the thin slice shape increases
|
||||
the amount of communication between sub-domains (center left). With a
|
||||
2x6x1 processor grid and shifting the sub-domain divisions, the load
|
||||
imbalance is further reduced and the amount of communication required
|
||||
between sub-domains is less (center right). And using the recursive
|
||||
bisectioning leads to further improved decomposition (right).
|
||||
28
doc/src/Developer_parallel.rst
Normal file
@ -0,0 +1,28 @@
|
||||
Parallel algorithms
|
||||
-------------------
|
||||
|
||||
LAMMPS is designed to enable running simulations in parallel using the
|
||||
MPI parallel communication standard with distributed data via domain
|
||||
decomposition. The parallelization aims to be efficient result in good
|
||||
strong scaling (= good speedup for the same system) and good weak
|
||||
scaling (= the computational cost of enlarging the system is
|
||||
proportional to the system size). Additional parallelization using GPUs
|
||||
or OpenMP can also be applied within the sub-domain assigned to an MPI
|
||||
process. For clarity, most of the following illustrations show the 2d
|
||||
simulation case. The underlying algorithms in those cases, however,
|
||||
apply to both 2d and 3d cases equally well.
|
||||
|
||||
.. note::
|
||||
|
||||
The text and most of the figures in this chapter were adapted
|
||||
for the manual from the section on parallel algorithms in the
|
||||
:ref:`new LAMMPS paper <lammps_paper>`.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
Developer_par_part
|
||||
Developer_par_comm
|
||||
Developer_par_neigh
|
||||
Developer_par_long
|
||||
Developer_par_openmp
|
||||
152
doc/src/Developer_platform.rst
Normal file
@ -0,0 +1,152 @@
|
||||
Platform abstraction functions
|
||||
------------------------------
|
||||
|
||||
The ``platform`` sub-namespace inside the ``LAMMPS_NS`` namespace
|
||||
provides a collection of wrapper and convenience functions and utilities
|
||||
that perform common tasks for which platform specific code would be
|
||||
required or for which a more high-level abstraction would be convenient
|
||||
and reduce duplicated code. This reduces redundant implementations and
|
||||
encourages consistent behavior and thus has some overlap with the
|
||||
:doc:`"utils" sub-namespace <Developer_utils>`.
|
||||
|
||||
Time functions
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: cputime
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: walltime
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: usleep
|
||||
:project: progguide
|
||||
|
||||
Platform information functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: os_info
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compiler_info
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: cxx_standard
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: openmp_standard
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: mpi_vendor
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: mpi_info
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compress_info
|
||||
:project: progguide
|
||||
|
||||
|
||||
File and path functions and global constants
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenvariable:: filepathsep
|
||||
:project: progguide
|
||||
|
||||
.. doxygenvariable:: pathvarsep
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: guesspath
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_basename
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_join
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: file_is_readable
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: is_console
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_is_directory
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: current_directory
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: list_directory
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: chdir
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: mkdir
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: rmdir
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: unlink
|
||||
:project: progguide
|
||||
|
||||
Standard I/O function wrappers
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenvariable:: END_OF_FILE
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: ftell
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: fseek
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: ftruncate
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: popen
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: pclose
|
||||
:project: progguide
|
||||
|
||||
Environment variable functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: putenv
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: list_pathenv
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: find_exe_path
|
||||
:project: progguide
|
||||
|
||||
Dynamically loaded object or library functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: dlopen
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: dlclose
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: dlsym
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: dlerror
|
||||
:project: progguide
|
||||
|
||||
Compressed file I/O functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: has_compress_extension
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compressed_read
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: compressed_write
|
||||
:project: progguide
|
||||
@ -7,7 +7,9 @@ a collection of convenience functions and utilities that perform common
|
||||
tasks that are required repeatedly throughout the LAMMPS code like
|
||||
reading or writing to files with error checking or translation of
|
||||
strings into specific types of numbers with checking for validity. This
|
||||
reduces redundant implementations and encourages consistent behavior.
|
||||
reduces redundant implementations and encourages consistent behavior and
|
||||
thus has some overlap with the :doc:`"platform" sub-namespace
|
||||
<Developer_platform>`.
|
||||
|
||||
I/O with status check and similar functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -60,6 +62,9 @@ silently returning the result of a partial conversion or zero in cases
|
||||
where the string is not a valid number. This behavior allows to more
|
||||
easily detect typos or issues when processing input files.
|
||||
|
||||
Similarly the :cpp:func:`logical() <LAMMPS_NS::utils::logical>` function
|
||||
will convert a string into a boolean and will only accept certain words.
|
||||
|
||||
The *do_abort* flag should be set to ``true`` in case this function
|
||||
is called only on a single MPI rank, as that will then trigger the
|
||||
a call to ``Error::one()`` for errors instead of ``Error::all()``
|
||||
@ -83,6 +88,9 @@ strings for compliance without conversion.
|
||||
.. doxygenfunction:: tnumeric
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: logical
|
||||
:project: progguide
|
||||
|
||||
|
||||
String processing
|
||||
^^^^^^^^^^^^^^^^^
|
||||
@ -95,6 +103,12 @@ and parsing files or arguments.
|
||||
.. doxygenfunction:: strdup
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: lowercase
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: uppercase
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: trim
|
||||
:project: progguide
|
||||
|
||||
@ -137,21 +151,6 @@ and parsing files or arguments.
|
||||
.. doxygenfunction:: is_double
|
||||
:project: progguide
|
||||
|
||||
File and path functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: guesspath
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_basename
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: path_join
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: file_is_readable
|
||||
:project: progguide
|
||||
|
||||
Potential file functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@ -203,6 +202,9 @@ Convenience functions
|
||||
.. doxygenfunction:: date2num
|
||||
:project: progguide
|
||||
|
||||
.. doxygenfunction:: current_date
|
||||
:project: progguide
|
||||
|
||||
Customized standard functions
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@ -29,7 +29,9 @@ of code in the header before include guards:
|
||||
.. code-block:: c
|
||||
|
||||
#ifdef FIX_CLASS
|
||||
FixStyle(print/vel,FixPrintVel)
|
||||
// clang-format off
|
||||
FixStyle(print/vel,FixPrintVel);
|
||||
// clang-format on
|
||||
#else
|
||||
/* the definition of the FixPrintVel class comes here */
|
||||
...
|
||||
|
||||
@ -40,11 +40,10 @@ We use it to show how to identify the origin of a segmentation fault.
|
||||
|
||||
After recompiling LAMMPS and running the input you should get something like this:
|
||||
|
||||
.. code-block:
|
||||
.. code-block::
|
||||
|
||||
$ ./lmp -in in.melt
|
||||
LAMMPS (19 Mar 2020)
|
||||
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94)
|
||||
using 1 OpenMP thread(s) per MPI task
|
||||
Lattice spacing in x,y,z = 1.6796 1.6796 1.6796
|
||||
Created orthogonal box = (0 0 0) to (16.796 16.796 16.796)
|
||||
|
||||
@ -7879,19 +7879,19 @@ keyword to allow for additional bonds to be formed
|
||||
*Unexpected end of -reorder file*
|
||||
Self-explanatory.
|
||||
|
||||
*Unexpected empty line in AngleCoeffs section*
|
||||
*Unexpected empty line in Angle Coeffs section*
|
||||
Read a blank line where there should be coefficient data.
|
||||
|
||||
*Unexpected empty line in BondCoeffs section*
|
||||
*Unexpected empty line in Bond Coeffs section*
|
||||
Read a blank line where there should be coefficient data.
|
||||
|
||||
*Unexpected empty line in DihedralCoeffs section*
|
||||
*Unexpected empty line in Dihedral Coeffs section*
|
||||
Read a blank line where there should be coefficient data.
|
||||
|
||||
*Unexpected empty line in ImproperCoeffs section*
|
||||
*Unexpected empty line in Improper Coeffs section*
|
||||
Read a blank line where there should be coefficient data.
|
||||
|
||||
*Unexpected empty line in PairCoeffs section*
|
||||
*Unexpected empty line in Pair Coeffs section*
|
||||
Read a blank line where there should be coefficient data.
|
||||
|
||||
*Unexpected end of custom file*
|
||||
|
||||
@ -80,7 +80,7 @@ Lowercase directories
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| friction | frictional contact of spherical asperities between 2d surfaces |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| gcmc | Grand Canonical Monte Carlo (GCMC) via the fix gcmc command |
|
||||
| mc | Monte Carlo features via fix gcmc, widom and other commands |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
| granregion | use of fix wall/region/gran as boundary on granular particles |
|
||||
+-------------+------------------------------------------------------------------+
|
||||
@ -205,7 +205,7 @@ Uppercase directories
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
| KAPPA | compute thermal conductivity via several methods |
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
| MC | using LAMMPS in a Monte Carlo mode to relax the energy of a system |
|
||||
| MC-LOOP | using LAMMPS in a Monte Carlo mode to relax the energy of a system in a input script loop |
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
| PACKAGES | examples for specific packages and contributed commands |
|
||||
+------------+--------------------------------------------------------------------------------------------------+
|
||||
|
||||
@ -7,11 +7,11 @@ LAMMPS GitHub tutorial
|
||||
|
||||
This document describes the process of how to use GitHub to integrate
|
||||
changes or additions you have made to LAMMPS into the official LAMMPS
|
||||
distribution. It uses the process of updating this very tutorial as
|
||||
an example to describe the individual steps and options. You need to
|
||||
be familiar with git and you may want to have a look at the
|
||||
`git book <http://git-scm.com/book/>`_ to reacquaint yourself with some
|
||||
of the more advanced git features used below.
|
||||
distribution. It uses the process of updating this very tutorial as an
|
||||
example to describe the individual steps and options. You need to be
|
||||
familiar with git and you may want to have a look at the `git book
|
||||
<http://git-scm.com/book/>`_ to familiarize yourself with some of the
|
||||
more advanced git features used below.
|
||||
|
||||
As of fall 2016, submitting contributions to LAMMPS via pull requests
|
||||
on GitHub is the preferred option for integrating contributed features
|
||||
@ -37,15 +37,15 @@ username or e-mail address and password.
|
||||
**Forking the repository**
|
||||
|
||||
To get changes into LAMMPS, you need to first fork the `lammps/lammps`
|
||||
repository on GitHub. At the time of writing, *master* is the preferred
|
||||
repository on GitHub. At the time of writing, *develop* is the preferred
|
||||
target branch. Thus go to `LAMMPS on GitHub <https://github.com/lammps/lammps>`_
|
||||
and make sure branch is set to "master", as shown in the figure below.
|
||||
and make sure branch is set to "develop", as shown in the figure below.
|
||||
|
||||
.. image:: JPG/tutorial_branch.png
|
||||
:align: center
|
||||
|
||||
If it is not, use the button to change it to *master*\ . Once it is, use the
|
||||
fork button to create a fork.
|
||||
If it is not, use the button to change it to *develop*. Once it is, use
|
||||
the fork button to create a fork.
|
||||
|
||||
.. image:: JPG/tutorial_fork.png
|
||||
:align: center
|
||||
@ -64,11 +64,12 @@ LAMMPS development.
|
||||
**Adding changes to your own fork**
|
||||
|
||||
Additions to the upstream version of LAMMPS are handled using *feature
|
||||
branches*\ . For every new feature, a so-called feature branch is
|
||||
branches*. For every new feature, a so-called feature branch is
|
||||
created, which contains only those modification relevant to one specific
|
||||
feature. For example, adding a single fix would consist of creating a
|
||||
branch with only the fix header and source file and nothing else. It is
|
||||
explained in more detail here: `feature branch workflow <https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow>`_.
|
||||
explained in more detail here: `feature branch workflow
|
||||
<https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow>`_.
|
||||
|
||||
**Feature branches**
|
||||
|
||||
@ -94,8 +95,8 @@ The above command copies ("clones") the git repository to your local
|
||||
machine to a directory with the name you chose. If none is given, it will
|
||||
default to "lammps". Typical names are "mylammps" or something similar.
|
||||
|
||||
You can use this local clone to make changes and
|
||||
test them without interfering with the repository on GitHub.
|
||||
You can use this local clone to make changes and test them without
|
||||
interfering with the repository on GitHub.
|
||||
|
||||
To pull changes from upstream into this copy, you can go to the directory
|
||||
and use git pull:
|
||||
@ -103,28 +104,45 @@ and use git pull:
|
||||
.. code-block:: bash
|
||||
|
||||
$ cd mylammps
|
||||
$ git checkout master
|
||||
$ git pull https://github.com/lammps/lammps
|
||||
$ git checkout develop
|
||||
$ git pull https://github.com/lammps/lammps develop
|
||||
|
||||
You can also add this URL as a remote:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git remote add lammps_upstream https://www.github.com/lammps/lammps
|
||||
$ git remote add upstream https://www.github.com/lammps/lammps
|
||||
|
||||
At this point, you typically make a feature branch from the updated master
|
||||
From then on you can update your upstream branches with:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git fetch upstream
|
||||
|
||||
and then refer to the upstream repository branches with
|
||||
`upstream/develop` or `upstream/release` and so on.
|
||||
|
||||
At this point, you typically make a feature branch from the updated
|
||||
branch for the feature you want to work on. This tutorial contains the
|
||||
workflow that updated this tutorial, and hence we will call the branch
|
||||
"github-tutorial-update":
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout -b github-tutorial-update master
|
||||
$ git fetch upstream
|
||||
$ git checkout -b github-tutorial-update upstream/develop
|
||||
|
||||
Now that we have changed branches, we can make our changes to our local
|
||||
repository. Just remember that if you want to start working on another,
|
||||
unrelated feature, you should switch branches!
|
||||
|
||||
.. note::
|
||||
|
||||
Committing changes to the *develop*, *release*, or *stable* branches
|
||||
is strongly discouraged. While it may be convenient initially, it
|
||||
will create more work in the long run. Various texts and tutorials
|
||||
on using git effectively discuss the motivation for this.
|
||||
|
||||
**After changes are made**
|
||||
|
||||
After everything is done, add the files to the branch and commit them:
|
||||
@ -287,28 +305,32 @@ After each push, the automated checks are run again.
|
||||
|
||||
LAMMPS developers may add labels to your pull request to assign it to
|
||||
categories (mostly for bookkeeping purposes), but a few of them are
|
||||
important: needs_work, work_in_progress, test-for-regression, and
|
||||
full-regression-test. The first two indicate, that your pull request
|
||||
is not considered to be complete. With "needs_work" the burden is on
|
||||
exclusively on you; while "work_in_progress" can also mean, that a
|
||||
LAMMPS developer may want to add changes. Please watch the comments
|
||||
to the pull requests. The two "test" labels are used to trigger
|
||||
extended tests before the code is merged. This is sometimes done by
|
||||
LAMMPS developers, if they suspect that there may be some subtle
|
||||
side effects from your changes. It is not done by default, because
|
||||
those tests are very time consuming.
|
||||
important: *needs_work*, *work_in_progress*, *run_tests*,
|
||||
*test_for_regression*, and *ready_for_merge*. The first two indicate,
|
||||
that your pull request is not considered to be complete. With
|
||||
"needs_work" the burden is on exclusively on you; while
|
||||
"work_in_progress" can also mean, that a LAMMPS developer may want to
|
||||
add changes. Please watch the comments to the pull requests. The two
|
||||
"test" labels are used to trigger extended tests before the code is
|
||||
merged. This is sometimes done by LAMMPS developers, if they suspect
|
||||
that there may be some subtle side effects from your changes. It is not
|
||||
done by default, because those tests are very time consuming. The
|
||||
*ready_for_merge* label is usually attached when the LAMMPS developer
|
||||
assigned to the pull request considers this request complete and to
|
||||
trigger a final full test evaluation.
|
||||
|
||||
**Reviews**
|
||||
|
||||
As of Summer 2018, a pull request needs at least 1 approving review
|
||||
from a LAMMPS developer with write access to the repository.
|
||||
In case your changes touch code that certain developers are associated
|
||||
with, they are auto-requested by the GitHub software. Those associations
|
||||
are set in the file
|
||||
`.github/CODEOWNERS <https://github.com/lammps/lammps/blob/master/.github/CODEOWNERS>`_
|
||||
Thus if you want to be automatically notified to review when anybody
|
||||
changes files or packages, that you have contributed to LAMMPS, you can
|
||||
add suitable patterns to that file, or a LAMMPS developer may add you.
|
||||
As of Fall 2021, a pull request needs to pass all automatic tests and at
|
||||
least 1 approving review from a LAMMPS developer with write access to
|
||||
the repository before it is eligible for merging. In case your changes
|
||||
touch code that certain developers are associated with, they are
|
||||
auto-requested by the GitHub software. Those associations are set in
|
||||
the file `.github/CODEOWNERS
|
||||
<https://github.com/lammps/lammps/blob/develop/.github/CODEOWNERS>`_ Thus
|
||||
if you want to be automatically notified to review when anybody changes
|
||||
files or packages, that **you** have contributed to LAMMPS, you can add
|
||||
suitable patterns to that file, or a LAMMPS developer may add you.
|
||||
|
||||
Otherwise, you can also manually request reviews from specific developers,
|
||||
or LAMMPS developers - in their assessment of your pull request - may
|
||||
@ -329,7 +351,7 @@ LAMMPS developer (including him/herself) or c) Axel Kohlmeyer (akohlmey).
|
||||
After the review, the developer can choose to implement changes directly
|
||||
or suggest them to you.
|
||||
* Case c) means that the pull request has been assigned to the developer
|
||||
overseeing the merging of pull requests into the master branch.
|
||||
overseeing the merging of pull requests into the *develop* branch.
|
||||
|
||||
In this case, Axel assigned the tutorial to Steve:
|
||||
|
||||
@ -351,11 +373,11 @@ Sometimes, however, you might not feel comfortable having other people
|
||||
push changes into your own branch, or maybe the maintainers are not sure
|
||||
their idea was the right one. In such a case, they can make changes,
|
||||
reassign you as the assignee, and file a "reverse pull request", i.e.
|
||||
file a pull request in your GitHub repository to include changes in the
|
||||
branch, that you have submitted as a pull request yourself. In that
|
||||
case, you can choose to merge their changes back into your branch,
|
||||
possibly make additional changes or corrections and proceed from there.
|
||||
It looks something like this:
|
||||
file a pull request in **your** forked GitHub repository to include
|
||||
changes in the branch, that you have submitted as a pull request
|
||||
yourself. In that case, you can choose to merge their changes back into
|
||||
your branch, possibly make additional changes or corrections and proceed
|
||||
from there. It looks something like this:
|
||||
|
||||
.. image:: JPG/tutorial_reverse_pull_request.png
|
||||
:align: center
|
||||
@ -419,7 +441,7 @@ This merge also shows up on the lammps GitHub page:
|
||||
|
||||
**After a merge**
|
||||
|
||||
When everything is fine, the feature branch is merged into the master branch:
|
||||
When everything is fine, the feature branch is merged into the *develop* branch:
|
||||
|
||||
.. image:: JPG/tutorial_merged.png
|
||||
:align: center
|
||||
@ -433,8 +455,8 @@ branch!
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout master
|
||||
$ git pull master
|
||||
$ git checkout develop
|
||||
$ git pull https://github.com/lammps/lammps develop
|
||||
$ git branch -d github-tutorial-update
|
||||
|
||||
If you do not pull first, it is not really a problem but git will warn
|
||||
@ -442,6 +464,7 @@ you at the next statement that you are deleting a local branch that
|
||||
was not yet fully merged into HEAD. This is because git does not yet
|
||||
know your branch just got merged into LAMMPS upstream. If you
|
||||
first delete and then pull, everything should still be fine.
|
||||
You can display all branches that are fully merged by:
|
||||
|
||||
Finally, if you delete the branch locally, you might want to push this
|
||||
to your remote(s) as well:
|
||||
@ -453,14 +476,14 @@ to your remote(s) as well:
|
||||
**Recent changes in the workflow**
|
||||
|
||||
Some changes to the workflow are not captured in this tutorial. For
|
||||
example, in addition to the master branch, to which all new features
|
||||
should be submitted, there is now also an "unstable" and a "stable"
|
||||
branch; these have the same content as "master", but are only updated
|
||||
after a patch release or stable release was made.
|
||||
Furthermore, the naming of the patches now follow the pattern
|
||||
"patch_<Day><Month><Year>" to simplify comparisons between releases.
|
||||
Finally, all patches and submissions are subject to automatic testing
|
||||
and code checks to make sure they at the very least compile.
|
||||
example, in addition to the *develop* branch, to which all new features
|
||||
should be submitted, there is also a *release* and a *stable* branch;
|
||||
these have the same content as *develop*, but are only updated after a
|
||||
patch release or stable release was made. Furthermore, the naming of
|
||||
the patches now follow the pattern "patch_<Day><Month><Year>" to
|
||||
simplify comparisons between releases. Finally, all patches and
|
||||
submissions are subject to automatic testing and code checks to make
|
||||
sure they at the very least compile.
|
||||
|
||||
A discussion of the LAMMPS developer GitHub workflow can be found in the file
|
||||
`doc/github-development-workflow.md <https://github.com/lammps/lammps/blob/master/doc/github-development-workflow.md>`_
|
||||
`doc/github-development-workflow.md <https://github.com/lammps/lammps/blob/develop/doc/github-development-workflow.md>`_
|
||||
|
||||
@ -2,8 +2,8 @@ Thermostats
|
||||
===========
|
||||
|
||||
Thermostatting means controlling the temperature of particles in an MD
|
||||
simulation. :doc:`Barostatting <Howto_barostat>` means controlling the
|
||||
pressure. Since the pressure includes a kinetic component due to
|
||||
simulation. :doc:`Barostatting <Howto_barostat>` means controlling
|
||||
the pressure. Since the pressure includes a kinetic component due to
|
||||
particle velocities, both these operations require calculation of the
|
||||
temperature. Typically a target temperature (T) and/or pressure (P)
|
||||
is specified by the user, and the thermostat or barostat attempts to
|
||||
@ -26,11 +26,13 @@ can be invoked via the *dpd/tstat* pair style:
|
||||
* :doc:`pair_style dpd/tstat <pair_dpd>`
|
||||
|
||||
:doc:`Fix nvt <fix_nh>` only thermostats the translational velocity of
|
||||
particles. :doc:`Fix nvt/sllod <fix_nvt_sllod>` also does this, except
|
||||
that it subtracts out a velocity bias due to a deforming box and
|
||||
integrates the SLLOD equations of motion. See the :doc:`Howto nemd <Howto_nemd>` page for further details. :doc:`Fix nvt/sphere <fix_nvt_sphere>` and :doc:`fix nvt/asphere <fix_nvt_asphere>` thermostat not only translation
|
||||
velocities but also rotational velocities for spherical and aspherical
|
||||
particles.
|
||||
particles. :doc:`Fix nvt/sllod <fix_nvt_sllod>` also does this,
|
||||
except that it subtracts out a velocity bias due to a deforming box
|
||||
and integrates the SLLOD equations of motion. See the :doc:`Howto
|
||||
nemd <Howto_nemd>` page for further details. :doc:`Fix nvt/sphere
|
||||
<fix_nvt_sphere>` and :doc:`fix nvt/asphere <fix_nvt_asphere>`
|
||||
thermostat not only translation velocities but also rotational
|
||||
velocities for spherical and aspherical particles.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -40,25 +42,31 @@ particles.
|
||||
e.g. molecular systems. The latter can be tricky to do correctly.
|
||||
|
||||
DPD thermostatting alters pairwise interactions in a manner analogous
|
||||
to the per-particle thermostatting of :doc:`fix langevin <fix_langevin>`.
|
||||
to the per-particle thermostatting of :doc:`fix langevin
|
||||
<fix_langevin>`.
|
||||
|
||||
Any of the thermostatting fixes can be instructed to use custom temperature
|
||||
computes that remove bias which has two effects: first, the current
|
||||
calculated temperature, which is compared to the requested target temperature,
|
||||
is calculated with the velocity bias removed; second, the thermostat adjusts
|
||||
only the thermal temperature component of the particle's velocities, which are
|
||||
the velocities with the bias removed. The removed bias is then added back
|
||||
to the adjusted velocities. See the doc pages for the individual
|
||||
fixes and for the :doc:`fix_modify <fix_modify>` command for
|
||||
instructions on how to assign a temperature compute to a
|
||||
thermostatting fix. For example, you can apply a thermostat to only
|
||||
the x and z components of velocity by using it in conjunction with
|
||||
:doc:`compute temp/partial <compute_temp_partial>`. Of you could
|
||||
thermostat only the thermal temperature of a streaming flow of
|
||||
particles without affecting the streaming velocity, by using
|
||||
:doc:`compute temp/profile <compute_temp_profile>`.
|
||||
Any of the thermostatting fixes can be instructed to use custom
|
||||
temperature computes that remove bias which has two effects: first,
|
||||
the current calculated temperature, which is compared to the requested
|
||||
target temperature, is calculated with the velocity bias removed;
|
||||
second, the thermostat adjusts only the thermal temperature component
|
||||
of the particle's velocities, which are the velocities with the bias
|
||||
removed. The removed bias is then added back to the adjusted
|
||||
velocities. See the doc pages for the individual fixes and for the
|
||||
:doc:`fix_modify <fix_modify>` command for instructions on how to
|
||||
assign a temperature compute to a thermostatting fix.
|
||||
|
||||
Below is a list of some custom temperature computes that can be used like that:
|
||||
For example, you can apply a thermostat only to atoms in a spatial
|
||||
region by using it in conjunction with :doc:`compute temp/region
|
||||
<compute_temp_region>`. Or you can apply a thermostat to only the x
|
||||
and z components of velocity by using it with :doc:`compute
|
||||
temp/partial <compute_temp_partial>`. Of you could thermostat only
|
||||
the thermal temperature of a streaming flow of particles without
|
||||
affecting the streaming velocity, by using :doc:`compute temp/profile
|
||||
<compute_temp_profile>`.
|
||||
|
||||
Below is a list of custom temperature computes that can be used like
|
||||
that:
|
||||
|
||||
* :doc:`compute_temp_asphere`
|
||||
* :doc:`compute_temp_body`
|
||||
@ -72,8 +80,6 @@ Below is a list of some custom temperature computes that can be used like that:
|
||||
* :doc:`compute_temp_rotate`
|
||||
* :doc:`compute_temp_sphere`
|
||||
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
Only the nvt fixes perform time integration, meaning they update
|
||||
@ -86,17 +92,17 @@ Below is a list of some custom temperature computes that can be used like that:
|
||||
* :doc:`fix nve/sphere <fix_nve_sphere>`
|
||||
* :doc:`fix nve/asphere <fix_nve_asphere>`
|
||||
|
||||
Thermodynamic output, which can be setup via the
|
||||
:doc:`thermo_style <thermo_style>` command, often includes temperature
|
||||
values. As explained on the page for the
|
||||
:doc:`thermo_style <thermo_style>` command, the default temperature is
|
||||
setup by the thermo command itself. It is NOT the temperature
|
||||
associated with any thermostatting fix you have defined or with any
|
||||
compute you have defined that calculates a temperature. The doc pages
|
||||
for the thermostatting fixes explain the ID of the temperature compute
|
||||
they create. Thus if you want to view these temperatures, you need to
|
||||
specify them explicitly via the :doc:`thermo_style custom <thermo_style>` command. Or you can use the
|
||||
:doc:`thermo_modify <thermo_modify>` command to re-define what
|
||||
Thermodynamic output, which can be setup via the :doc:`thermo_style
|
||||
<thermo_style>` command, often includes temperature values. As
|
||||
explained on the page for the :doc:`thermo_style <thermo_style>`
|
||||
command, the default temperature is setup by the thermo command
|
||||
itself. It is NOT the temperature associated with any thermostatting
|
||||
fix you have defined or with any compute you have defined that
|
||||
calculates a temperature. The doc pages for the thermostatting fixes
|
||||
explain the ID of the temperature compute they create. Thus if you
|
||||
want to view these temperatures, you need to specify them explicitly
|
||||
via the :doc:`thermo_style custom <thermo_style>` command. Or you can
|
||||
use the :doc:`thermo_modify <thermo_modify>` command to re-define what
|
||||
temperature compute is used for default thermodynamic output.
|
||||
|
||||
----------
|
||||
|
||||
@ -9,7 +9,8 @@ has several advantages:
|
||||
command.
|
||||
* You can create your own development branches to add code to LAMMPS.
|
||||
* You can submit your new features back to GitHub for inclusion in
|
||||
LAMMPS.
|
||||
LAMMPS. For that you should first create your own :doc:`fork on
|
||||
GitHub <Howto_github>`.
|
||||
|
||||
You must have `git <git_>`_ installed on your system to use the
|
||||
commands explained below to communicate with the git servers on
|
||||
@ -20,35 +21,53 @@ provides `limited support for subversion clients <svn_>`_.
|
||||
|
||||
As of October 2016, the official home of public LAMMPS development is
|
||||
on GitHub. The previously advertised LAMMPS git repositories on
|
||||
git.lammps.org and bitbucket.org are now deprecated or offline.
|
||||
git.lammps.org and bitbucket.org are now offline or deprecated.
|
||||
|
||||
.. _git: https://git-scm.com
|
||||
.. _svn: https://help.github.com/en/github/importing-your-projects-to-github/working-with-subversion-on-github
|
||||
|
||||
You can follow LAMMPS development on 3 different git branches:
|
||||
You can follow the LAMMPS development on 3 different git branches:
|
||||
|
||||
* **stable** : this branch is updated with every stable release
|
||||
* **unstable** : this branch is updated with every patch release
|
||||
* **master** : this branch continuously follows ongoing development
|
||||
* **stable** : this branch is updated with every stable release;
|
||||
updates are always "fast forward" merges from *develop*
|
||||
* **release** : this branch is updated with every patch release;
|
||||
updates are always "fast forward" merges from *develop*
|
||||
* **develop** : this branch follows the ongoing development and
|
||||
is updated with every merge commit of a pull request
|
||||
|
||||
To access the git repositories on your box, use the clone command to
|
||||
create a local copy of the LAMMPS repository with a command like:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git clone -b unstable https://github.com/lammps/lammps.git mylammps
|
||||
$ git clone -b release https://github.com/lammps/lammps.git mylammps
|
||||
|
||||
where "mylammps" is the name of the directory you wish to create on
|
||||
your machine and "unstable" is one of the 3 branches listed above.
|
||||
your machine and "release" is one of the 3 branches listed above.
|
||||
(Note that you actually download all 3 branches; you can switch
|
||||
between them at any time using "git checkout <branch name>".)
|
||||
|
||||
.. note::
|
||||
|
||||
The complete git history of the LAMMPS project is quite large because
|
||||
it contains the entire commit history of the project since fall 2006,
|
||||
which includes the time when LAMMPS was managed with subversion. This
|
||||
also includes commits that have added and removed some large files
|
||||
(mostly by accident). If you do not need access to the entire commit
|
||||
history, you can speed up the "cloning" process and reduce local disk
|
||||
space requirements by using the *--depth* git command line flag thus
|
||||
create a "shallow clone" of the repository that contains only a
|
||||
subset of the git history. Using a depth of 1000 is usually sufficient
|
||||
to include the head commits of the *develop* and the *release* branches.
|
||||
To include the head commit of the *stable* branch you may need a depth
|
||||
of up to 10000.
|
||||
|
||||
Once the command completes, your directory will contain the same files
|
||||
as if you unpacked a current LAMMPS tarball, with the exception, that
|
||||
the HTML documentation files are not included. They can be fetched
|
||||
from the LAMMPS website by typing ``make fetch`` in the doc directory.
|
||||
Or they can be generated from the content provided in doc/src by
|
||||
typing ``make html`` from the doc directory.
|
||||
Or they can be generated from the content provided in ``doc/src`` by
|
||||
typing ``make html`` from the ``doc`` directory.
|
||||
|
||||
After initial cloning, as bug fixes and new features are added to
|
||||
LAMMPS you can stay up-to-date by typing the following git commands
|
||||
@ -56,9 +75,9 @@ from within the "mylammps" directory:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ git checkout unstable # not needed if you always stay in this branch
|
||||
$ git checkout stable # use one of these 3 checkout commands
|
||||
$ git checkout master # to choose the branch to follow
|
||||
$ git checkout release # not needed if you always stay in this branch
|
||||
$ git checkout stable # use one of these 3 checkout commands
|
||||
$ git checkout develop # to choose the branch to follow
|
||||
$ git pull
|
||||
|
||||
Doing a "pull" will not change any files you have added to the LAMMPS
|
||||
@ -81,7 +100,7 @@ Stable versions and what tagID to use for a particular stable version
|
||||
are discussed on `this page <https://www.lammps.org/bug.html#version>`_.
|
||||
Note that this command will print some warnings, because in order to get
|
||||
back to the latest revision and to be able to update with ``git pull``
|
||||
again, you will need to do ``git checkout unstable`` (or
|
||||
again, you will need to do ``git checkout release`` (or
|
||||
check out any other desired branch) first.
|
||||
|
||||
Once you have updated your local files with a ``git pull`` (or ``git
|
||||
|
||||
@ -4,28 +4,41 @@ Citing LAMMPS
|
||||
Core Algorithms
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Since LAMMPS is a community project, there is not a single one
|
||||
publication or reference that describes **all** of LAMMPS.
|
||||
The canonical publication that describes the foundation, that is
|
||||
the basic spatial decomposition approach, the neighbor finding,
|
||||
and basic communications algorithms used in LAMMPS is:
|
||||
The paper mentioned below is the best overview of LAMMPS, but there are
|
||||
also publications describing particular models or algorithms implemented
|
||||
in LAMMPS or complementary software that is has interfaces to. Please
|
||||
see below for how to cite contributions to LAMMPS.
|
||||
|
||||
`S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J Comp Phys, 117, 1-19 (1995). <http://www.sandia.gov/~sjplimp/papers/jcompphys95.pdf>`_
|
||||
.. _lammps_paper:
|
||||
|
||||
So any project using LAMMPS (or a derivative application using LAMMPS as
|
||||
a simulation engine) should cite this paper. A new publication
|
||||
describing the developments and improvements of LAMMPS in the 25 years
|
||||
since then is currently in preparation.
|
||||
The latest canonical publication that describes the basic features, the
|
||||
source code design, the program structure, the spatial decomposition
|
||||
approach, the neighbor finding, basic communications algorithms, and how
|
||||
users and developers have contributed to LAMMPS is:
|
||||
|
||||
`LAMMPS - A flexible simulation tool for particle-based materials modeling at the atomic, meso, and continuum scales, Comp. Phys. Comm. (accepted 09/2021), DOI:10.1016/j.cpc.2021.108171 <https://doi.org/10.1016/j.cpc.2021.108171>`_
|
||||
|
||||
So a project using LAMMPS or a derivative application that uses LAMMPS
|
||||
as a simulation engine should cite this paper. The paper is expected to
|
||||
be published in its final form under the same DOI in the first half
|
||||
of 2022. Please also give the URL of the LAMMPS website in your paper,
|
||||
namely https://www.lammps.org.
|
||||
|
||||
The original publication describing the parallel algorithms used in the
|
||||
initial versions of LAMMPS is:
|
||||
|
||||
`S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J Comp Phys, 117, 1-19 (1995). <http://www.sandia.gov/~sjplimp/papers/jcompphys95.pdf>`_
|
||||
|
||||
|
||||
DOI for the LAMMPS code
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
LAMMPS developers use the `Zenodo service at CERN
|
||||
<https://zenodo.org/>`_ to create digital object identifies (DOI) for
|
||||
stable releases of the LAMMPS code. There are two types of DOIs for the
|
||||
LAMMPS source code: the canonical DOI for **all** versions of LAMMPS,
|
||||
which will always point to the **latest** stable release version is:
|
||||
LAMMPS developers use the `Zenodo service at CERN <https://zenodo.org/>`_
|
||||
to create digital object identifies (DOI) for stable releases of the
|
||||
LAMMPS source code. There are two types of DOIs for the LAMMPS source code.
|
||||
|
||||
The canonical DOI for **all** versions of LAMMPS, which will always
|
||||
point to the **latest** stable release version is:
|
||||
|
||||
- DOI: `10.5281/zenodo.3726416 <https://dx.doi.org/10.5281/zenodo.3726416>`_
|
||||
|
||||
@ -45,11 +58,13 @@ about LAMMPS and its features.
|
||||
Citing contributions
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
LAMMPS has many features and that use either previously published
|
||||
methods and algorithms or novel features. It also includes potential
|
||||
parameter filed for specific models. Where available, a reminder about
|
||||
references for optional features used in a specific run is printed to
|
||||
the screen and log file. Style and output location can be selected with
|
||||
the :ref:`-cite command-line switch <cite>`. Additional references are
|
||||
LAMMPS has many features that use either previously published methods
|
||||
and algorithms or novel features. It also includes potential parameter
|
||||
files for specific models. Where available, a reminder about references
|
||||
for optional features used in a specific run is printed to the screen
|
||||
and log file. Style and output location can be selected with the
|
||||
:ref:`-cite command-line switch <cite>`. Additional references are
|
||||
given in the documentation of the :doc:`corresponding commands
|
||||
<Commands_all>` or in the :doc:`Howto tutorials <Howto>`.
|
||||
<Commands_all>` or in the :doc:`Howto tutorials <Howto>`. So please
|
||||
make certain, that you provide the proper acknowledgments and citations
|
||||
in any published works using LAMMPS.
|
||||
|
||||
@ -19,7 +19,7 @@ software and open-source distribution, see `www.gnu.org <gnuorg_>`_
|
||||
or `www.opensource.org <opensource_>`_. The legal text of the GPL as it
|
||||
applies to LAMMPS is in the LICENSE file included in the LAMMPS distribution.
|
||||
|
||||
.. _gpl: https://github.com/lammps/lammps/blob/master/LICENSE
|
||||
.. _gpl: https://github.com/lammps/lammps/blob/develop/LICENSE
|
||||
|
||||
.. _lgpl: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ available online are listed below.
|
||||
* `Tutorials <https://www.lammps.org/tutorials.html>`_
|
||||
|
||||
* `Pre- and post-processing tools for LAMMPS <https://www.lammps.org/prepost.html>`_
|
||||
* `Other software usable with LAMMPS <https://www.lammps.org/offsite.html>`_
|
||||
* `Other software usable with LAMMPS <https://www.lammps.org/external.html>`_
|
||||
* `Viz tools usable with LAMMPS <https://www.lammps.org/viz.html>`_
|
||||
|
||||
* `Benchmark performance <https://www.lammps.org/bench.html>`_
|
||||
|
||||
@ -34,7 +34,7 @@ simple example demonstrating its use:
|
||||
int lmpargc = sizeof(lmpargv)/sizeof(const char *);
|
||||
|
||||
/* create LAMMPS instance */
|
||||
handle = lammps_open_no_mpi(lmpargc, lmpargv, NULL);
|
||||
handle = lammps_open_no_mpi(lmpargc, (char **)lmpargv, NULL);
|
||||
if (handle == NULL) {
|
||||
printf("LAMMPS initialization failed");
|
||||
lammps_mpi_finalize();
|
||||
|
||||
@ -7,7 +7,7 @@ correctly and reliably at all times. You can follow its development
|
||||
in a public `git repository on GitHub <https://github.com/lammps/lammps>`_.
|
||||
|
||||
Whenever we fix a bug or update or add a feature, it will be merged into
|
||||
the `master` branch of the git repository. When a sufficient number of
|
||||
the *develop* branch of the git repository. When a sufficient number of
|
||||
changes have accumulated *and* the software passes a set of automated
|
||||
tests, we release it in the next *patch* release, which are made every
|
||||
few weeks. Info on patch releases are on `this website page
|
||||
|
||||
@ -115,8 +115,8 @@ External contributions
|
||||
|
||||
If you prefer to do so, you can also develop and support your add-on
|
||||
feature **without** having it included in the LAMMPS distribution, for
|
||||
example as a download from a website of your own. See the `Offsite
|
||||
LAMMPS packages and tools <https://www.lammps.org/offsite.html>`_ page
|
||||
example as a download from a website of your own. See the `External
|
||||
LAMMPS packages and tools <https://www.lammps.org/external.html>`_ page
|
||||
of the LAMMPS website for examples of groups that do this. We are happy
|
||||
to advertise your package and website from that page. Simply email the
|
||||
`developers <https://www.lammps.org/authors.html>`_ with info about your
|
||||
|
||||
@ -305,19 +305,22 @@ you are uncertain, please ask.
|
||||
FILE pointers and only be done on MPI rank 0. Use the :cpp:func:`utils::logmesg`
|
||||
convenience function where possible.
|
||||
|
||||
- header files should only include the absolute minimum number of
|
||||
include files and **must not** contain any ``using`` statements;
|
||||
rather the include statements should be put into the corresponding
|
||||
implementation files. For implementation files, the
|
||||
"include-what-you-use" principle should be employed. However, when
|
||||
including the ``pointers.h`` header (or one of the base classes
|
||||
derived from it) certain headers will be included and thus need to be
|
||||
specified. These are: `mpi.h`, `cstddef`, `cstdio`, `cstdlib`,
|
||||
`string`, `utils.h`, `fmt/format.h`, `climits`, `cinttypes`. This also
|
||||
means any header can assume that `FILE`, `NULL`, and `INT_MAX` are
|
||||
defined.
|
||||
- Header files, especially those defining a "style", should only use
|
||||
the absolute minimum number of include files and **must not** contain
|
||||
any ``using`` statements. Typically that would be only the header for
|
||||
the base class. Instead any include statements should be put into the
|
||||
corresponding implementation files and forward declarations be used.
|
||||
For implementation files, the "include what you use" principle should
|
||||
be employed. However, there is the notable exception that when the
|
||||
``pointers.h`` header is included (or one of the base classes derived
|
||||
from it) certain headers will always be included and thus do not need
|
||||
to be explicitly specified.
|
||||
These are: `mpi.h`, `cstddef`, `cstdio`, `cstdlib`, `string`, `utils.h`,
|
||||
`vector`, `fmt/format.h`, `climits`, `cinttypes`.
|
||||
This also means any such file can assume that `FILE`, `NULL`, and
|
||||
`INT_MAX` are defined.
|
||||
|
||||
- header files that define a new LAMMPS style (i.e. that have a
|
||||
- Header files that define a new LAMMPS style (i.e. that have a
|
||||
``SomeStyle(some/name,SomeName);`` macro in them) should only use the
|
||||
include file for the base class and otherwise use forward declarations
|
||||
and pointers; when interfacing to a library use the PIMPL (pointer
|
||||
@ -325,7 +328,7 @@ you are uncertain, please ask.
|
||||
that contains all library specific data (and thus requires the library
|
||||
header) but use a forward declaration and define the struct only in
|
||||
the implementation file. This is a **strict** requirement since this
|
||||
is where type clashes between packages and hard to fine bugs have
|
||||
is where type clashes between packages and hard to find bugs have
|
||||
regularly manifested in the past.
|
||||
|
||||
- Please use clang-format only to reformat files that you have
|
||||
|
||||
@ -2,17 +2,25 @@ Basics of running LAMMPS
|
||||
========================
|
||||
|
||||
LAMMPS is run from the command line, reading commands from a file via
|
||||
the -in command line flag, or from standard input.
|
||||
Using the "-in in.file" variant is recommended:
|
||||
the -in command line flag, or from standard input. Using the "-in
|
||||
in.file" variant is recommended (see note below). The name of the
|
||||
LAMMPS executable is either ``lmp`` or ``lmp_<machine>`` with
|
||||
`<machine>` being the machine string used when compiling LAMMPS. This
|
||||
is required when compiling LAMMPS with the traditional build system
|
||||
(e.g. with ``make mpi``), but optional when using CMake to configure and
|
||||
build LAMMPS:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ lmp_serial -in in.file
|
||||
$ lmp_serial < in.file
|
||||
$ lmp -in in.file
|
||||
$ lmp < in.file
|
||||
$ /path/to/lammps/src/lmp_serial -i in.file
|
||||
$ mpirun -np 4 lmp_mpi -in in.file
|
||||
$ mpiexec -np 4 lmp -in in.file
|
||||
$ mpirun -np 8 /path/to/lammps/src/lmp_mpi -in in.file
|
||||
$ mpirun -np 6 /usr/local/bin/lmp -in in.file
|
||||
$ mpiexec -n 6 /usr/local/bin/lmp -in in.file
|
||||
|
||||
You normally run the LAMMPS command in the directory where your input
|
||||
script is located. That is also where output files are produced by
|
||||
@ -23,7 +31,7 @@ executable itself can be placed elsewhere.
|
||||
.. note::
|
||||
|
||||
The redirection operator "<" will not always work when running
|
||||
in parallel with mpirun; for those systems the -in form is required.
|
||||
in parallel with mpirun or mpiexec; for those systems the -in form is required.
|
||||
|
||||
As LAMMPS runs it prints info to the screen and a logfile named
|
||||
*log.lammps*\ . More info about output is given on the
|
||||
|
||||
@ -14,7 +14,7 @@ Intel Xeon Phi co-processors.
|
||||
|
||||
The `Benchmark page <https://www.lammps.org/bench.html>`_ of the LAMMPS
|
||||
website gives performance results for the various accelerator
|
||||
packages discussed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
packages discussed on the :doc:`Accelerator packages <Speed_packages>`
|
||||
page, for several of the standard LAMMPS benchmark problems, as a
|
||||
function of problem size and number of compute nodes, on different
|
||||
hardware platforms.
|
||||
|
||||
@ -7,7 +7,7 @@ steps are often necessary to setup and analyze a simulation. A list
|
||||
of such tools can be found on the `LAMMPS webpage <lws_>`_ at these links:
|
||||
|
||||
* `Pre/Post processing <https://www.lammps.org/prepost.html>`_
|
||||
* `Offsite LAMMPS packages & tools <https://www.lammps.org/offsite.html>`_
|
||||
* `External LAMMPS packages & tools <https://www.lammps.org/external.html>`_
|
||||
* `Pizza.py toolkit <pizza_>`_
|
||||
|
||||
The last link for `Pizza.py <pizza_>`_ is a Python-based tool developed at
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Styles with a *gpu*, *intel*, *kk*, *omp*, or *opt* suffix are
|
||||
functionally the same as the corresponding style without the suffix.
|
||||
They have been optimized to run faster, depending on your available
|
||||
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
hardware, as discussed on the :doc:`Accelerator packages <Speed_packages>`
|
||||
page. The accelerated styles take the same arguments and should
|
||||
produce the same results, except for round-off and precision issues.
|
||||
|
||||
@ -13,5 +13,5 @@ You can specify the accelerated styles explicitly in your input script
|
||||
by including their suffix, or you can use the :doc:`-suffix command-line switch <Run_options>` when you invoke LAMMPS, or you can use the
|
||||
:doc:`suffix <suffix>` command in your input script.
|
||||
|
||||
See the :doc:`Speed packages <Speed_packages>` page for more
|
||||
See the :doc:`Accelerator packages <Speed_packages>` page for more
|
||||
instructions on how to use the accelerated styles effectively.
|
||||
|
||||
@ -56,23 +56,7 @@ radian\^2.
|
||||
|
||||
----------
|
||||
|
||||
Styles with a *gpu*, *intel*, *kk*, *omp*, or *opt* suffix are
|
||||
functionally the same as the corresponding style without the suffix.
|
||||
They have been optimized to run faster, depending on your available
|
||||
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
page. The accelerated styles take the same arguments and should
|
||||
produce the same results, except for round-off and precision issues.
|
||||
|
||||
These accelerated styles are part of the GPU, INTEL, KOKKOS,
|
||||
OPENMP and OPT packages, respectively. They are only enabled if
|
||||
LAMMPS was built with those packages. See the :doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
You can specify the accelerated styles explicitly in your input script
|
||||
by including their suffix, or you can use the :doc:`-suffix command-line switch <Run_options>` when you invoke LAMMPS, or you can use the
|
||||
:doc:`suffix <suffix>` command in your input script.
|
||||
|
||||
See :doc:`Speed packages <Speed_packages>` page for more
|
||||
instructions on how to use the accelerated styles effectively.
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -319,28 +319,9 @@ styles; see the :doc:`Modify <Modify>` doc page.
|
||||
|
||||
----------
|
||||
|
||||
Styles with a *kk* suffix are functionally the same as the
|
||||
corresponding style without the suffix. They have been optimized to
|
||||
run faster, depending on your available hardware, as discussed in on
|
||||
the :doc:`Speed packages <Speed_packages>` doc page. The accelerated
|
||||
styles take the same arguments and should produce the same results,
|
||||
except for round-off and precision issues.
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
Note that other acceleration packages in LAMMPS, specifically the GPU,
|
||||
INTEL, OPENMP, and OPT packages do not use accelerated atom
|
||||
styles.
|
||||
|
||||
The accelerated styles are part of the KOKKOS package. They are only
|
||||
enabled if LAMMPS was built with those packages. See the :doc:`Build
|
||||
package <Build_package>` page for more info.
|
||||
|
||||
You can specify the accelerated styles explicitly in your input script
|
||||
by including their suffix, or you can use the :doc:`-suffix command-line
|
||||
switch <Run_options>` when you invoke LAMMPS, or you can use the
|
||||
:doc:`suffix <suffix>` command in your input script.
|
||||
|
||||
See the :doc:`Speed packages <Speed_packages>` page for more
|
||||
instructions on how to use the accelerated styles effectively.
|
||||
----------
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
@ -166,6 +166,7 @@ page are followed by one or more of (g,i,k,o,t) to indicate which
|
||||
accelerated styles exist.
|
||||
|
||||
* :doc:`accelerate/cos <fix_accelerate_cos>` - apply cosine-shaped acceleration to atoms
|
||||
* :doc:`acks2/reaxff <fix_acks2_reaxff>` - apply ACKS2 charge equilibration
|
||||
* :doc:`adapt <fix_adapt>` - change a simulation parameter over time
|
||||
* :doc:`adapt/fep <fix_adapt_fep>` - enhanced version of fix adapt
|
||||
* :doc:`addforce <fix_addforce>` - add a force to each atom
|
||||
@ -246,6 +247,7 @@ accelerated styles exist.
|
||||
* :doc:`manifoldforce <fix_manifoldforce>` - restrain atoms to a manifold during minimization
|
||||
* :doc:`mdi/engine <fix_mdi_engine>` - connect LAMMPS to external programs via the MolSSI Driver Interface (MDI)
|
||||
* :doc:`meso/move <fix_meso_move>` - move mesoscopic SPH/SDPD particles in a prescribed fashion
|
||||
* :doc:`mol/swap <fix_mol_swap>` - Monte Carlo atom type swapping with a molecule
|
||||
* :doc:`momentum <fix_momentum>` - zero the linear and/or angular momentum of a group of atoms
|
||||
* :doc:`momentum/chunk <fix_momentum>` - zero the linear and/or angular momentum of a chunk of atoms
|
||||
* :doc:`move <fix_move>` - move atoms in a prescribed fashion
|
||||
|
||||
118
doc/src/fix_acks2_reaxff.rst
Normal file
@ -0,0 +1,118 @@
|
||||
.. index:: fix acks2/reaxff
|
||||
.. index:: fix acks2/reaxff/kk
|
||||
|
||||
fix acks2/reaxff command
|
||||
========================
|
||||
|
||||
Accelerator Variants: *acks2/reaxff/kk*
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
fix ID group-ID acks2/reaxff Nevery cutlo cuthi tolerance params args
|
||||
|
||||
* ID, group-ID are documented in :doc:`fix <fix>` command
|
||||
* acks2/reaxff = style name of this fix command
|
||||
* Nevery = perform ACKS2 every this many steps
|
||||
* cutlo,cuthi = lo and hi cutoff for Taper radius
|
||||
* tolerance = precision to which charges will be equilibrated
|
||||
* params = reaxff or a filename
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix 1 all acks2/reaxff 1 0.0 10.0 1.0e-6 reaxff
|
||||
fix 1 all acks2/reaxff 1 0.0 10.0 1.0e-6 param.acks2
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
Perform the atom-condensed Kohn-Sham DFT to second order (ACKS2) charge
|
||||
equilibration method as described in :ref:`(Verstraelen) <Verstraelen>`.
|
||||
ACKS2 impedes unphysical long-range charge transfer sometimes seen with
|
||||
QEq (e.g. for dissociation of molecules), at increased computational
|
||||
cost. It is typically used in conjunction with the ReaxFF force field
|
||||
model as implemented in the :doc:`pair_style reaxff <pair_reaxff>`
|
||||
command, but it can be used with any potential in LAMMPS, so long as it
|
||||
defines and uses charges on each atom. For more technical details about
|
||||
the charge equilibration performed by fix acks2/reaxff, see the
|
||||
:ref:`(O'Hearn) <O'Hearn>` paper.
|
||||
|
||||
The ACKS2 method minimizes the electrostatic energy of the system by
|
||||
adjusting the partial charge on individual atoms based on interactions
|
||||
with their neighbors. It requires some parameters for each atom type.
|
||||
If the *params* setting above is the word "reaxff", then these are
|
||||
extracted from the :doc:`pair_style reaxff <pair_reaxff>` command and
|
||||
the ReaxFF force field file it reads in. If a file name is specified
|
||||
for *params*\ , then the parameters are taken from the specified file
|
||||
and the file must contain one line for each atom type. The latter form
|
||||
must be used when performing QeQ with a non-ReaxFF potential. The lines
|
||||
should be formatted as follows:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
bond_softness
|
||||
itype chi eta gamma bcut
|
||||
|
||||
where the first line is the global parameter *bond_softness*. The
|
||||
remaining 1 to Ntypes lines include *itype*, the atom type from 1 to
|
||||
Ntypes, *chi*, the electronegativity in eV, *eta*, the self-Coulomb
|
||||
potential in eV, *gamma*, the valence orbital exponent, and *bcut*, the
|
||||
bond cutoff distance. Note that these 4 quantities are also in the
|
||||
ReaxFF potential file, except that eta is defined here as twice the eta
|
||||
value in the ReaxFF file. Note that unlike the rest of LAMMPS, the units
|
||||
of this fix are hard-coded to be A, eV, and electronic charge.
|
||||
|
||||
**Restart, fix_modify, output, run start/stop, minimize info:**
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`. No global scalar or vector or per-atom quantities are
|
||||
stored by this fix for access by various :doc:`output commands
|
||||
<Howto_output>`. No parameter of this fix can be used with the
|
||||
*start/stop* keywords of the :doc:`run <run>` command.
|
||||
|
||||
This fix is invoked during :doc:`energy minimization <minimize>`.
|
||||
|
||||
----------
|
||||
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
----------
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This fix is part of the REAXFF package. It is only enabled if LAMMPS
|
||||
was built with that package. See the :doc:`Build package
|
||||
<Build_package>` doc page for more info.
|
||||
|
||||
This fix does not correctly handle interactions involving multiple
|
||||
periodic images of the same atom. Hence, it should not be used for
|
||||
periodic cell dimensions less than 10 angstroms.
|
||||
|
||||
This fix may be used in combination with :doc:`fix efield <fix_efield>`
|
||||
and will apply the external electric field during charge equilibration,
|
||||
but there may be only one fix efield instance used, it may only use a
|
||||
constant electric field, and the electric field vector may only have
|
||||
components in non-periodic directions.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`pair_style reaxff <pair_reaxff>`, :doc:`fix qeq/reaxff <fix_qeq_reaxff>`
|
||||
|
||||
**Default:** none
|
||||
|
||||
----------
|
||||
|
||||
.. _O'Hearn:
|
||||
|
||||
**(O'Hearn)** O'Hearn, Alperen, Aktulga, SIAM J. Sci. Comput., 42(1), C1-C22 (2020).
|
||||
|
||||
.. _Verstraelen:
|
||||
|
||||
**(Verstraelen)** Verstraelen, Ayers, Speybroeck, Waroquier, J. Chem. Phys. 138, 074108 (2013).
|
||||
@ -73,51 +73,51 @@ is the same after the swap as it was before the swap, even though the
|
||||
atom masses have changed.
|
||||
|
||||
The *semi-grand* keyword can be set to *yes* to switch to the
|
||||
semi-grand canonical ensemble as discussed in :ref:`(Sadigh) <Sadigh>`. This
|
||||
means that the total number of each particle type does not need to be
|
||||
conserved. The default is *no*, which means that the only kind of swap
|
||||
allowed exchanges an atom of one type with an atom of a different
|
||||
given type. In other words, the relative mole fractions of the swapped
|
||||
atoms remains constant. Whereas in the semi-grand canonical ensemble,
|
||||
the composition of the system can change. Note that when using
|
||||
*semi-grand*, atoms in the fix group whose type is not listed
|
||||
in the *types* keyword are ineligible for attempted
|
||||
conversion. An attempt is made to switch
|
||||
the selected atom (if eligible) to one of the other listed types
|
||||
with equal probability. Acceptance of each attempt depends upon the Metropolis criterion.
|
||||
semi-grand canonical ensemble as discussed in :ref:`(Sadigh)
|
||||
<Sadigh>`. This means that the total number of each particle type does
|
||||
not need to be conserved. The default is *no*, which means that the
|
||||
only kind of swap allowed exchanges an atom of one type with an atom
|
||||
of a different given type. In other words, the relative mole fractions
|
||||
of the swapped atoms remains constant. Whereas in the semi-grand
|
||||
canonical ensemble, the composition of the system can change. Note
|
||||
that when using *semi-grand*, atoms in the fix group whose type is not
|
||||
listed in the *types* keyword are ineligible for attempted
|
||||
conversion. An attempt is made to switch the selected atom (if
|
||||
eligible) to one of the other listed types with equal
|
||||
probability. Acceptance of each attempt depends upon the Metropolis
|
||||
criterion.
|
||||
|
||||
The *mu* keyword allows users to specify chemical
|
||||
potentials. This is required and allowed only when using *semi-grand*\ .
|
||||
All chemical potentials are absolute, so there is one for
|
||||
each swap type listed following the *types* keyword.
|
||||
In semi-grand canonical ensemble simulations the chemical composition
|
||||
of the system is controlled by the difference in these values. So
|
||||
shifting all values by a constant amount will have no effect
|
||||
on the simulation.
|
||||
The *mu* keyword allows users to specify chemical potentials. This is
|
||||
required and allowed only when using *semi-grand*\ . All chemical
|
||||
potentials are absolute, so there is one for each swap type listed
|
||||
following the *types* keyword. In semi-grand canonical ensemble
|
||||
simulations the chemical composition of the system is controlled by
|
||||
the difference in these values. So shifting all values by a constant
|
||||
amount will have no effect on the simulation.
|
||||
|
||||
This command may optionally use the *region* keyword to define swap
|
||||
volume. The specified region must have been previously defined with a
|
||||
:doc:`region <region>` command. It must be defined with side = *in*\ .
|
||||
Swap attempts occur only between atoms that are both within the
|
||||
:doc:`region <region>` command. It must be defined with side = *in*\
|
||||
. Swap attempts occur only between atoms that are both within the
|
||||
specified region. Swaps are not otherwise attempted.
|
||||
|
||||
You should ensure you do not swap atoms belonging to a molecule, or
|
||||
LAMMPS will soon generate an error when it tries to find those atoms.
|
||||
LAMMPS will warn you if any of the atoms eligible for swapping have a
|
||||
non-zero molecule ID, but does not check for this at the time of
|
||||
LAMMPS will eventually generate an error when it tries to find those
|
||||
atoms. LAMMPS will warn you if any of the atoms eligible for swapping
|
||||
have a non-zero molecule ID, but does not check for this at the time of
|
||||
swapping.
|
||||
|
||||
If not using *semi-grand* this fix checks to ensure all atoms of the
|
||||
given types have the same atomic charge. LAMMPS does not enforce this
|
||||
in general, but it is needed for this fix to simplify the
|
||||
swapping procedure. Successful swaps will swap the atom type and charge
|
||||
of the swapped atoms. Conversely, when using *semi-grand*, it is assumed that all the atom
|
||||
types involved in switches have the same charge. Otherwise, charge
|
||||
would not be conserved. As a consequence, no checks on atomic charges are
|
||||
performed, and successful switches update the atom type but not the
|
||||
atom charge. While it is possible to use *semi-grand* with groups of
|
||||
atoms that have different charges, these charges will not be changed when the
|
||||
atom types change.
|
||||
in general, but it is needed for this fix to simplify the swapping
|
||||
procedure. Successful swaps will swap the atom type and charge of the
|
||||
swapped atoms. Conversely, when using *semi-grand*, it is assumed that
|
||||
all the atom types involved in switches have the same
|
||||
charge. Otherwise, charge would not be conserved. As a consequence, no
|
||||
checks on atomic charges are performed, and successful switches update
|
||||
the atom type but not the atom charge. While it is possible to use
|
||||
*semi-grand* with groups of atoms that have different charges, these
|
||||
charges will not be changed when the atom types change.
|
||||
|
||||
Since this fix computes total potential energies before and after
|
||||
proposed swaps, so even complicated potential energy calculations are
|
||||
@ -133,23 +133,24 @@ OK, including the following:
|
||||
Some fixes have an associated potential energy. Examples of such fixes
|
||||
include: :doc:`efield <fix_efield>`, :doc:`gravity <fix_gravity>`,
|
||||
:doc:`addforce <fix_addforce>`, :doc:`langevin <fix_langevin>`,
|
||||
:doc:`restrain <fix_restrain>`, :doc:`temp/berendsen <fix_temp_berendsen>`,
|
||||
:doc:`temp/rescale <fix_temp_rescale>`, and :doc:`wall fixes <fix_wall>`.
|
||||
For that energy to be included in the total potential energy of the
|
||||
system (the quantity used when performing GCMC moves),
|
||||
you MUST enable the :doc:`fix_modify <fix_modify>` *energy* option for
|
||||
that fix. The doc pages for individual :doc:`fix <fix>` commands
|
||||
specify if this should be done.
|
||||
:doc:`restrain <fix_restrain>`, :doc:`temp/berendsen
|
||||
<fix_temp_berendsen>`, :doc:`temp/rescale <fix_temp_rescale>`, and
|
||||
:doc:`wall fixes <fix_wall>`. For that energy to be included in the
|
||||
total potential energy of the system (the quantity used when
|
||||
performing GCMC moves), you MUST enable the :doc:`fix_modify
|
||||
<fix_modify>` *energy* option for that fix. The doc pages for
|
||||
individual :doc:`fix <fix>` commands specify if this should be done.
|
||||
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This fix writes the state of the fix to :doc:`binary restart files <restart>`. This includes information about the random
|
||||
number generator seed, the next timestep for MC exchanges, the number
|
||||
of exchange attempts and successes etc. See
|
||||
the :doc:`read_restart <read_restart>` command for info on how to
|
||||
re-specify a fix in an input script that reads a restart file, so that
|
||||
the operation of the fix continues in an uninterrupted fashion.
|
||||
This fix writes the state of the fix to :doc:`binary restart files
|
||||
<restart>`. This includes information about the random number
|
||||
generator seed, the next timestep for MC exchanges, the number of
|
||||
exchange attempts and successes etc. See the :doc:`read_restart
|
||||
<read_restart>` command for info on how to re-specify a fix in an
|
||||
input script that reads a restart file, so that the operation of the
|
||||
fix continues in an uninterrupted fashion.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -165,12 +166,13 @@ by various :doc:`output commands <Howto_output>`. The vector values are
|
||||
the following global cumulative quantities:
|
||||
|
||||
* 1 = swap attempts
|
||||
* 2 = swap successes
|
||||
* 2 = swap accepts
|
||||
|
||||
The vector values calculated by this fix are "extensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
|
||||
the :doc:`run <run>` command. This fix is not invoked during
|
||||
:doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
@ -184,7 +186,8 @@ Related commands
|
||||
|
||||
:doc:`fix nvt <fix_nh>`, :doc:`neighbor <neighbor>`,
|
||||
:doc:`fix deposit <fix_deposit>`, :doc:`fix evaporate <fix_evaporate>`,
|
||||
:doc:`delete_atoms <delete_atoms>`, :doc:`fix gcmc <fix_gcmc>`
|
||||
:doc:`delete_atoms <delete_atoms>`, :doc:`fix gcmc <fix_gcmc>`,
|
||||
:doc:`fix mol/swap <fix_mol_swap>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -8,9 +8,8 @@ fix brownian command
|
||||
fix brownian/sphere command
|
||||
===========================
|
||||
|
||||
fix brownian/sphere command
|
||||
===========================
|
||||
|
||||
fix brownian/asphere command
|
||||
============================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
@ -138,16 +138,18 @@ temperature with optional time-dependence as well.
|
||||
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. removing the center-of-mass velocity from a
|
||||
group of atoms or removing the x-component of velocity from the
|
||||
calculation. This is not done by default, but only if the
|
||||
:doc:`fix_modify <fix_modify>` command is used to assign a temperature
|
||||
compute to this fix that includes such a bias term. See the doc pages
|
||||
for individual :doc:`compute commands <compute>` to determine which ones
|
||||
include a bias. In this case, the thermostat works in the following
|
||||
manner: bias is removed from each atom, thermostatting is performed on
|
||||
the remaining thermal degrees of freedom, and the bias is added back
|
||||
in.
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
The *damp* parameter is specified in time units and determines how
|
||||
rapidly the temperature is relaxed. For example, a value of 100.0 means
|
||||
@ -183,7 +185,8 @@ omega (which is derived from the angular momentum in the case of
|
||||
aspherical particles).
|
||||
|
||||
The rotational temperature of the particles can be monitored by the
|
||||
:doc:`compute temp/sphere <compute_temp_sphere>` and :doc:`compute temp/asphere <compute_temp_asphere>` commands with their rotate
|
||||
:doc:`compute temp/sphere <compute_temp_sphere>` and :doc:`compute
|
||||
temp/asphere <compute_temp_asphere>` commands with their rotate
|
||||
options.
|
||||
|
||||
For the *omega* keyword there is also a scale factor of
|
||||
|
||||
@ -167,17 +167,20 @@ functions, and include :doc:`thermo_style <thermo_style>` command
|
||||
keywords for the simulation box parameters and timestep and elapsed
|
||||
time. Thus it is easy to specify a time-dependent temperature.
|
||||
|
||||
Like other fixes that perform thermostatting, this fix can be used with
|
||||
:doc:`compute commands <compute>` that remove a "bias" from the atom
|
||||
velocities. E.g. removing the center-of-mass velocity from a group of
|
||||
atoms. This is not done by default, but only if the
|
||||
:doc:`fix_modify <fix_modify>` command is used to assign a temperature
|
||||
compute to this fix that includes such a bias term. See the doc pages
|
||||
for individual :doc:`compute commands <compute>` to determine which ones
|
||||
include a bias. In this case, the thermostat works in the following
|
||||
manner: bias is removed from each atom, thermostatting is performed on
|
||||
the remaining thermal degrees of freedom, and the bias is added back
|
||||
in. NOTE: this feature has not been tested.
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
Note: The temperature thermostatting the core-Drude particle pairs
|
||||
should be chosen low enough, so as to mimic as closely as possible the
|
||||
|
||||
170
doc/src/fix_mol_swap.rst
Normal file
@ -0,0 +1,170 @@
|
||||
.. index:: fix mol/swap
|
||||
|
||||
fix mol/swap command
|
||||
=====================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
fix ID group-ID mol/swap N X itype jtype seed T keyword value ...
|
||||
|
||||
* ID, group-ID are documented in :doc:`fix <fix>` command
|
||||
* atom/swap = style name of this fix command
|
||||
* N = invoke this fix every N steps
|
||||
* X = number of swaps to attempt every N steps
|
||||
* itype,jtype = two atom types to swap with each other
|
||||
* seed = random # seed (positive integer)
|
||||
* T = scaling temperature of the MC swaps (temperature units)
|
||||
* zero or more keyword/value pairs may be appended to args
|
||||
* keyword = *ke*
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
*ke* value = *no* or *yes*
|
||||
*no* = no conservation of kinetic energy after atom swaps
|
||||
*yes* = kinetic energy is conserved after atom swaps
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
fix 2 all mol/swap 100 1 2 3 29494 300.0 ke no
|
||||
fix mySwap fluid mol/swap 500 10 1 2 482798 1.0
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
This fix performs Monte Carlo swaps of two specified atom types within
|
||||
a randomly selected molecule. Two possible use cases are as follows.
|
||||
|
||||
First, consider a mixture of some molecules with atoms of itype and
|
||||
other molecules with atoms of jtype. The fix will select a random
|
||||
molecule and attempt to swap all the itype atoms to jtype for the
|
||||
first kind of molecule, or all the jtype atoms to itype for the second
|
||||
kind. Because the swap will only take place if it is energetically
|
||||
favorable, the fix can be used to determine the miscibility of 2
|
||||
different kinds of molecules much more quickly than just dynamics
|
||||
would do it.
|
||||
|
||||
Second, consider diblock co-polymers with two types of monomers itype
|
||||
and jtype. The fix will select a random molecule and attempt to do a
|
||||
itype <--> jtype swap of all those monomers within the molecule. Thus
|
||||
the fix can be used to find the energetically favorable fractions of
|
||||
two flavors of diblock co-polymers.
|
||||
|
||||
Intra-molecular swaps of atom types are attempted every N timesteps. On
|
||||
that timestep, X swaps are attempted. For each attempt a single
|
||||
molecule ID is randomly selected. The range of possible molecule IDs
|
||||
from loID to hiID is pre-computed before each run begins. The
|
||||
loID/hiID is set for the molecule with the smallest/largest ID which
|
||||
has any itype or jtype atoms in it. Note that if you define a system
|
||||
with many molecule IDs between loID and hiID which have no itype or
|
||||
jtype atoms, then the fix will be inefficient at performing swaps.
|
||||
Also note that if atoms with molecule ID = 0 exist, they are not
|
||||
considered molecules by this fix; they are assumed to be solvent atoms
|
||||
or molecules.
|
||||
|
||||
Candidate atoms for swapping must also be in the fix group. Atoms
|
||||
within the selected molecule which are not itype or jtype are ignored.
|
||||
|
||||
When an atom is swapped from itype to jtype (or vice versa), if
|
||||
charges are defined, the charge values for itype versus jtype atoms
|
||||
are also swapped. This requires that all itype atoms in the system
|
||||
have the same charge value. Likewise all jtype atoms in the system
|
||||
must have the same charge value. If this is not the case, LAMMPS
|
||||
issues a warning that it cannot swap charge values.
|
||||
|
||||
If the *ke* keyword is set to yes, which is the default, and the
|
||||
masses of itype and jtype atoms are different, then when a swap
|
||||
occurs, the velocity of the swapped atom is rescaled by the sqrt of
|
||||
the mass ratio, so as to conserve the kinetic energy of the atom.
|
||||
|
||||
----------
|
||||
|
||||
The potential energy of the entire system is computed before and after
|
||||
each swap is performed within a single molecule. The specified
|
||||
temperature T is used in the Metropolis criterion to accept or reject
|
||||
the attempted swap. If the swap is rejected all swapped values are
|
||||
reversed.
|
||||
|
||||
The potential energy calculations can include systems and models with
|
||||
the following features:
|
||||
|
||||
* manybody pair styles, including EAM
|
||||
* hybrid pair styles
|
||||
* long-range electrostatics (kspace)
|
||||
* triclinic systems
|
||||
* potential energy contributions from other fixes
|
||||
|
||||
For the last bullet point, fixes can have an associated potential
|
||||
energy. Examples of such fixes include: :doc:`efield <fix_efield>`,
|
||||
:doc:`gravity <fix_gravity>`, :doc:`addforce <fix_addforce>`,
|
||||
:doc:`langevin <fix_langevin>`, :doc:`restrain <fix_restrain>`,
|
||||
:doc:`temp/berendsen <fix_temp_berendsen>`, :doc:`temp/rescale
|
||||
<fix_temp_rescale>`, and :doc:`wall fixes <fix_wall>`. For that
|
||||
energy to be included in the total potential energy of the system (the
|
||||
quantity used for the swap accept/reject decision), you MUST enable
|
||||
the :doc:`fix_modify <fix_modify>` *energy* option for that fix. The
|
||||
doc pages for individual :doc:`fix <fix>` commands specify if this
|
||||
should be done.
|
||||
|
||||
.. note::
|
||||
|
||||
One comment on computational efficiency. If the cutoff lengths
|
||||
defined for the pair style are different for itype versus jtype
|
||||
atoms (for any of their interactions with any other atom type), then
|
||||
a new neighbor list needs to be generated for every attempted swap.
|
||||
This is potentially expensive if N is small or X is large.
|
||||
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
This fix writes the state of the fix to :doc:`binary restart files
|
||||
<restart>`. This includes information about the random number
|
||||
generator seed, the next timestep for MC exchanges, the number of
|
||||
exchange attempts and successes etc. See the :doc:`read_restart
|
||||
<read_restart>` command for info on how to re-specify a fix in an
|
||||
input script that reads a restart file, so that the operation of the
|
||||
fix continues in an uninterrupted fashion.
|
||||
|
||||
.. note::
|
||||
|
||||
For this to work correctly, the timestep must **not** be changed
|
||||
after reading the restart with :doc:`reset_timestep <reset_timestep>`.
|
||||
The fix will try to detect it and stop with an error.
|
||||
|
||||
None of the :doc:`fix_modify <fix_modify>` options are relevant to this
|
||||
fix.
|
||||
|
||||
This fix computes a global vector of length 2, which can be accessed
|
||||
by various :doc:`output commands <Howto_output>`. The vector values are
|
||||
the following global cumulative quantities:
|
||||
|
||||
* 1 = swap attempts
|
||||
* 2 = swap accepts
|
||||
|
||||
The vector values calculated by this fix are "extensive".
|
||||
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command. This fix is not invoked during
|
||||
:doc:`energy minimization <minimize>`.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This fix is part of the MC package. It is only enabled if LAMMPS was
|
||||
built with that package. See the :doc:`Build package <Build_package>`
|
||||
doc page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`fix atom/swap <fix_atom_swap>`, :doc:`fix gcmc <fix_gcmc>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
The option default is ke = yes.
|
||||
@ -486,19 +486,20 @@ temperature or pressure during thermodynamic output via the
|
||||
compute-ID. It also means that changing attributes of *thermo_temp*
|
||||
or *thermo_press* will have no effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, fix nvt and fix npt can
|
||||
be used with :doc:`compute commands <compute>` that calculate a
|
||||
temperature after removing a "bias" from the atom velocities.
|
||||
E.g. removing the center-of-mass velocity from a group of atoms or
|
||||
only calculating temperature on the x-component of velocity or only
|
||||
calculating temperature for atoms in a geometric region. This is not
|
||||
done by default, but only if the :doc:`fix_modify <fix_modify>` command
|
||||
is used to assign a temperature compute to this fix that includes such
|
||||
a bias term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal degrees of freedom, and the bias is added back in.
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -48,8 +48,9 @@ can also have a bias velocity removed from them before thermostatting
|
||||
takes place; see the description below.
|
||||
|
||||
Additional parameters affecting the thermostat and barostat are
|
||||
specified by keywords and values documented with the :doc:`fix npt <fix_nh>` command. See, for example, discussion of the *temp*,
|
||||
*iso*, *aniso*, and *dilate* keywords.
|
||||
specified by keywords and values documented with the :doc:`fix npt
|
||||
<fix_nh>` command. See, for example, discussion of the *temp*, *iso*,
|
||||
*aniso*, and *dilate* keywords.
|
||||
|
||||
The particles in the fix group are the only ones whose velocities and
|
||||
positions are updated by the velocity/position update portion of the
|
||||
@ -89,18 +90,19 @@ It also means that changing attributes of *thermo_temp* or
|
||||
*thermo_press* will have no effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that calculate a temperature
|
||||
after removing a "bias" from the atom velocities. E.g. removing the
|
||||
center-of-mass velocity from a group of atoms or only calculating
|
||||
temperature on the x-component of velocity or only calculating
|
||||
temperature for atoms in a geometric region. This is not done by
|
||||
default, but only if the :doc:`fix_modify <fix_modify>` command is used
|
||||
to assign a temperature compute to this fix that includes such a bias
|
||||
term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal degrees of freedom, and the bias is added back in.
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -87,18 +87,19 @@ It also means that changing attributes of *thermo_temp* or
|
||||
*thermo_press* will have no effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that calculate a temperature
|
||||
after removing a "bias" from the atom velocities. E.g. removing the
|
||||
center-of-mass velocity from a group of atoms or only calculating
|
||||
temperature on the x-component of velocity or only calculating
|
||||
temperature for atoms in a geometric region. This is not done by
|
||||
default, but only if the :doc:`fix_modify <fix_modify>` command is used
|
||||
to assign a temperature compute to this fix that includes such a bias
|
||||
term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal degrees of freedom, and the bias is added back in.
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -400,19 +400,20 @@ temperature or pressure during thermodynamic output via the
|
||||
compute-ID. It also means that changing attributes of *thermo_temp*
|
||||
or *thermo_press* will have no effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, fix npt/cauchy can
|
||||
be used with :doc:`compute commands <compute>` that calculate a
|
||||
temperature after removing a "bias" from the atom velocities.
|
||||
E.g. removing the center-of-mass velocity from a group of atoms or
|
||||
only calculating temperature on the x-component of velocity or only
|
||||
calculating temperature for atoms in a geometric region. This is not
|
||||
done by default, but only if the :doc:`fix_modify <fix_modify>` command
|
||||
is used to assign a temperature compute to this fix that includes such
|
||||
a bias term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal degrees of freedom, and the bias is added back in.
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -103,18 +103,19 @@ appropriate compute-ID. It also means that changing attributes of
|
||||
*thermo_temp* or *thermo_press* will have no effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that calculate a temperature
|
||||
after removing a "bias" from the atom velocities. E.g. removing the
|
||||
center-of-mass velocity from a group of atoms or only calculating
|
||||
temperature on the x-component of velocity or only calculating
|
||||
temperature for atoms in a geometric region. This is not done by
|
||||
default, but only if the :doc:`fix_modify <fix_modify>` command is used
|
||||
to assign a temperature compute to this fix that includes such a bias
|
||||
term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal degrees of freedom, and the bias is added back in.
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -72,18 +72,19 @@ It also means that changing attributes of *thermo_temp* will have no
|
||||
effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that calculate a temperature
|
||||
after removing a "bias" from the atom velocities. E.g. removing the
|
||||
center-of-mass velocity from a group of atoms or only calculating
|
||||
temperature on the x-component of velocity or only calculating
|
||||
temperature for atoms in a geometric region. This is not done by
|
||||
default, but only if the :doc:`fix_modify <fix_modify>` command is used
|
||||
to assign a temperature compute to this fix that includes such a bias
|
||||
term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal degrees of freedom, and the bias is added back in.
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -69,18 +69,19 @@ It also means that changing attributes of *thermo_temp* will have no
|
||||
effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that calculate a temperature
|
||||
after removing a "bias" from the atom velocities. E.g. removing the
|
||||
center-of-mass velocity from a group of atoms or only calculating
|
||||
temperature on the x-component of velocity or only calculating
|
||||
temperature for atoms in a geometric region. This is not done by
|
||||
default, but only if the :doc:`fix_modify <fix_modify>` command is used
|
||||
to assign a temperature compute to this fix that includes such a bias
|
||||
term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal degrees of freedom, and the bias is added back in.
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -37,15 +37,16 @@ trajectory consistent with the canonical ensemble.
|
||||
|
||||
This thermostat is used for a simulation box that is changing size
|
||||
and/or shape, for example in a non-equilibrium MD (NEMD) simulation.
|
||||
The size/shape change is induced by use of the :doc:`fix deform <fix_deform>` command, so each point in the simulation box
|
||||
can be thought of as having a "streaming" velocity. This
|
||||
position-dependent streaming velocity is subtracted from each atom's
|
||||
actual velocity to yield a thermal velocity which is used for
|
||||
temperature computation and thermostatting. For example, if the box
|
||||
is being sheared in x, relative to y, then points at the bottom of the
|
||||
box (low y) have a small x velocity, while points at the top of the
|
||||
box (hi y) have a large x velocity. These velocities do not
|
||||
contribute to the thermal "temperature" of the atom.
|
||||
The size/shape change is induced by use of the :doc:`fix deform
|
||||
<fix_deform>` command, so each point in the simulation box can be
|
||||
thought of as having a "streaming" velocity. This position-dependent
|
||||
streaming velocity is subtracted from each atom's actual velocity to
|
||||
yield a thermal velocity which is used for temperature computation and
|
||||
thermostatting. For example, if the box is being sheared in x,
|
||||
relative to y, then points at the bottom of the box (low y) have a
|
||||
small x velocity, while points at the top of the box (hi y) have a
|
||||
large x velocity. These velocities do not contribute to the thermal
|
||||
"temperature" of the atom.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -60,13 +61,15 @@ contribute to the thermal "temperature" of the atom.
|
||||
consistent.
|
||||
|
||||
The SLLOD equations of motion, originally proposed by Hoover and Ladd
|
||||
(see :ref:`(Evans and Morriss) <Evans3>`), were proven to be equivalent to
|
||||
Newton's equations of motion for shear flow by :ref:`(Evans and Morriss) <Evans3>`. They were later shown to generate the desired
|
||||
velocity gradient and the correct production of work by stresses for
|
||||
all forms of homogeneous flow by :ref:`(Daivis and Todd) <Daivis>`. As
|
||||
implemented in LAMMPS, they are coupled to a Nose/Hoover chain
|
||||
thermostat in a velocity Verlet formulation, closely following the
|
||||
implementation used for the :doc:`fix nvt <fix_nh>` command.
|
||||
(see :ref:`(Evans and Morriss) <Evans3>`), were proven to be
|
||||
equivalent to Newton's equations of motion for shear flow by
|
||||
:ref:`(Evans and Morriss) <Evans3>`. They were later shown to generate
|
||||
the desired velocity gradient and the correct production of work by
|
||||
stresses for all forms of homogeneous flow by :ref:`(Daivis and Todd)
|
||||
<Daivis>`. As implemented in LAMMPS, they are coupled to a
|
||||
Nose/Hoover chain thermostat in a velocity Verlet formulation, closely
|
||||
following the implementation used for the :doc:`fix nvt <fix_nh>`
|
||||
command.
|
||||
|
||||
.. note::
|
||||
|
||||
@ -94,27 +97,28 @@ underscore + "temp", and the group for the new compute is the same as
|
||||
the fix group.
|
||||
|
||||
Note that this is NOT the compute used by thermodynamic output (see
|
||||
the :doc:`thermo_style <thermo_style>` command) with ID = *thermo_temp*.
|
||||
This means you can change the attributes of this fix's temperature
|
||||
(e.g. its degrees-of-freedom) via the
|
||||
:doc:`compute_modify <compute_modify>` command or print this temperature
|
||||
during thermodynamic output via the :doc:`thermo_style custom <thermo_style>` command using the appropriate compute-ID.
|
||||
It also means that changing attributes of *thermo_temp* will have no
|
||||
effect on this fix.
|
||||
the :doc:`thermo_style <thermo_style>` command) with ID =
|
||||
*thermo_temp*. This means you can change the attributes of this fix's
|
||||
temperature (e.g. its degrees-of-freedom) via the :doc:`compute_modify
|
||||
<compute_modify>` command or print this temperature during
|
||||
thermodynamic output via the :doc:`thermo_style custom <thermo_style>`
|
||||
command using the appropriate compute-ID. It also means that changing
|
||||
attributes of *thermo_temp* will have no effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that calculate a temperature
|
||||
after removing a "bias" from the atom velocities. E.g. removing the
|
||||
center-of-mass velocity from a group of atoms or only calculating
|
||||
temperature on the x-component of velocity or only calculating
|
||||
temperature for atoms in a geometric region. This is not done by
|
||||
default, but only if the :doc:`fix_modify <fix_modify>` command is used
|
||||
to assign a temperature compute to this fix that includes such a bias
|
||||
term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal degrees of freedom, and the bias is added back in.
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -86,18 +86,19 @@ It also means that changing attributes of *thermo_temp* will have no
|
||||
effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that calculate a temperature
|
||||
after removing a "bias" from the atom velocities. E.g. removing the
|
||||
center-of-mass velocity from a group of atoms or only calculating
|
||||
temperature on the x-component of velocity or only calculating
|
||||
temperature for atoms in a geometric region. This is not done by
|
||||
default, but only if the :doc:`fix_modify <fix_modify>` command is used
|
||||
to assign a temperature compute to this fix that includes such a bias
|
||||
term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal degrees of freedom, and the bias is added back in.
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -230,7 +230,10 @@ These fixes are part of the QEQ package. They are only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package
|
||||
<Build_package>` page for more info.
|
||||
|
||||
The qeq fixes are not compatible with the GPU and USER-INTEL packages.
|
||||
These qeq fixes are not compatible with the GPU and USER-INTEL packages.
|
||||
|
||||
These qeq fixes will ignore electric field contributions from
|
||||
:doc:`fix efield <fix_efield>`.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
@ -116,6 +116,12 @@ This fix does not correctly handle interactions involving multiple
|
||||
periodic images of the same atom. Hence, it should not be used for
|
||||
periodic cell dimensions less than 10 angstroms.
|
||||
|
||||
This fix may be used in combination with :doc:`fix efield <fix_efield>`
|
||||
and will apply the external electric field during charge equilibration,
|
||||
but there may be only one fix efield instance used, it may only use a
|
||||
constant electric field, and the electric field vector may only have
|
||||
components in non-periodic directions.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
|
||||
@ -56,6 +56,17 @@ number of molecules of each species. In this context, "species" means
|
||||
a unique molecule. The chemical formula of each species is given in
|
||||
the first line.
|
||||
|
||||
.. warning::
|
||||
|
||||
In order to compute averaged data, it is required that there are no
|
||||
neighbor list rebuilds between the *Nfreq* steps. For that reason, fix
|
||||
*reaxff/species* may change your neighbor list settings. There will
|
||||
be a warning message showing the new settings. Having an *Nfreq*
|
||||
setting that is larger than what is required for correct computation
|
||||
of the ReaxFF force field interactions can thus lead to incorrect
|
||||
results. For typical ReaxFF calculations a value of 100 is already
|
||||
quite large.
|
||||
|
||||
If the filename ends with ".gz", the output file is written in gzipped
|
||||
format. A gzipped dump file will be about 3x smaller than the text version,
|
||||
but will also take longer to write.
|
||||
|
||||
@ -28,7 +28,6 @@ Syntax
|
||||
Nstart = start averaging on this timestep
|
||||
*file* arg = filename
|
||||
filename = name of file to output time averages to
|
||||
*overwrite* arg = none = overwrite output file with only latest output
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
@ -161,10 +160,6 @@ the *file* keyword and this string is appended with _N.vtk where N is
|
||||
an index (0,1,2...) to account for situations with multiple diffraction
|
||||
intensity outputs.
|
||||
|
||||
The *overwrite* keyword will continuously overwrite the output file
|
||||
with the latest output, so that it only contains one timestep worth of
|
||||
output. This option can only be used with the *ave running* setting.
|
||||
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
|
||||
@ -89,26 +89,13 @@ precession vectors instead of the forces.
|
||||
|
||||
----------
|
||||
|
||||
Styles with a *gpu*, *intel*, *kk*, *omp*, or *opt* suffix are
|
||||
functionally the same as the corresponding style without the suffix.
|
||||
They have been optimized to run faster, depending on your available
|
||||
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
page. The accelerated styles take the same arguments and should
|
||||
produce the same results, except for round-off and precision issues.
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
The region keyword is also supported by Kokkos, but a Kokkos-enabled
|
||||
region must be used. See the region :doc:`region <region>` command for
|
||||
more information.
|
||||
.. note::
|
||||
|
||||
These accelerated styles are part of the r Kokkos package. They are
|
||||
only enabled if LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
You can specify the accelerated styles explicitly in your input script
|
||||
by including their suffix, or you can use the :doc:`-suffix command-line switch <Run_options>` when you invoke LAMMPS, or you can use the
|
||||
:doc:`suffix <suffix>` command in your input script.
|
||||
|
||||
See the :doc:`Speed packages <Speed_packages>` page for more
|
||||
instructions on how to use the accelerated styles effectively.
|
||||
The region keyword is supported by Kokkos, but a Kokkos-enabled
|
||||
region must be used. See the region :doc:`region <region>` command for
|
||||
more information.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -102,18 +102,19 @@ It also means that changing attributes of *thermo_temp* will have no
|
||||
effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that calculate a temperature
|
||||
after removing a "bias" from the atom velocities. E.g. removing the
|
||||
center-of-mass velocity from a group of atoms or only calculating
|
||||
temperature on the x-component of velocity or only calculating
|
||||
temperature for atoms in a geometric region. This is not done by
|
||||
default, but only if the :doc:`fix_modify <fix_modify>` command is used
|
||||
to assign a temperature compute to this fix that includes such a bias
|
||||
term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal degrees of freedom, and the bias is added back in.
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -110,28 +110,29 @@ during thermodynamic output via the :doc:`thermo_style custom <thermo_style>` co
|
||||
It also means that changing attributes of *thermo_temp* will have no
|
||||
effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, these fixes can be used
|
||||
with :doc:`compute commands <compute>` that calculate a temperature
|
||||
after removing a "bias" from the atom velocities. E.g. removing the
|
||||
center-of-mass velocity from a group of atoms or only calculating
|
||||
temperature on the x-component of velocity or only calculating
|
||||
temperature for atoms in a geometric region. This is not done by
|
||||
default, but only if the :doc:`fix_modify <fix_modify>` command is used
|
||||
to assign a temperature compute to this fix that includes such a bias
|
||||
term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal degrees of freedom, and the bias is added back in.
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
An important feature of these thermostats is that they have an
|
||||
associated effective energy that is a constant of motion.
|
||||
The effective energy is the total energy (kinetic + potential) plus
|
||||
the accumulated kinetic energy changes due to the thermostat. The
|
||||
latter quantity is the global scalar computed by these fixes. This
|
||||
feature is useful to check the integration of the equations of motion
|
||||
against discretization errors. In other words, the conservation of
|
||||
the effective energy can be used to choose an appropriate integration
|
||||
associated effective energy that is a constant of motion. The
|
||||
effective energy is the total energy (kinetic + potential) plus the
|
||||
accumulated kinetic energy changes due to the thermostat. The latter
|
||||
quantity is the global scalar computed by these fixes. This feature is
|
||||
useful to check the integration of the equations of motion against
|
||||
discretization errors. In other words, the conservation of the
|
||||
effective energy can be used to choose an appropriate integration
|
||||
:doc:`timestep <timestep>`. This is similar to the usual paradigm of
|
||||
checking the conservation of the total energy in the microcanonical
|
||||
ensemble.
|
||||
|
||||
@ -109,19 +109,19 @@ command using the appropriate compute-ID. It also means that changing
|
||||
attributes of *thermo_temp* will have no effect on this fix.
|
||||
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that calculate a temperature
|
||||
after removing a "bias" from the atom velocities. E.g. removing the
|
||||
center-of-mass velocity from a group of atoms or only calculating
|
||||
temperature on the x-component of velocity or only calculating
|
||||
temperature for atoms in a geometric region. This is not done by
|
||||
default, but only if the :doc:`fix_modify <fix_modify>` command is
|
||||
used to assign a temperature compute to this fix that includes such a
|
||||
bias term. See the doc pages for individual :doc:`compute commands
|
||||
<compute>` to determine which ones include a bias. In this case, the
|
||||
thermostat works in the following manner: the current temperature is
|
||||
calculated taking the bias into account, bias is removed from each
|
||||
atom, thermostatting is performed on the remaining thermal degrees of
|
||||
freedom, and the bias is added back in.
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -187,26 +187,32 @@ barostatting.
|
||||
|
||||
----------
|
||||
|
||||
Like other fixes that perform thermostatting, these fixes can
|
||||
be used with :doc:`compute commands <compute>` that calculate a
|
||||
temperature after removing a "bias" from the atom velocities.
|
||||
This is not done by default, but only if the :doc:`fix_modify <fix_modify>` command
|
||||
is used to assign a temperature compute to this fix that includes such
|
||||
a bias term. See the doc pages for individual :doc:`compute commands <compute>` to determine which ones include a bias. In
|
||||
this case, the thermostat works in the following manner: the current
|
||||
temperature is calculated taking the bias into account, bias is
|
||||
removed from each atom, thermostatting is performed on the remaining
|
||||
thermal DOF, and the bias is added back in.
|
||||
Like other fixes that perform thermostatting, this fix can be used
|
||||
with :doc:`compute commands <compute>` that remove a "bias" from the
|
||||
atom velocities. E.g. to apply the thermostat only to atoms within a
|
||||
spatial :doc:`region <region>`, or to remove the center-of-mass
|
||||
velocity from a group of atoms, or to remove the x-component of
|
||||
velocity from the calculation.
|
||||
|
||||
This is not done by default, but only if the :doc:`fix_modify
|
||||
<fix_modify>` command is used to assign a temperature compute to this
|
||||
fix that includes such a bias term. See the doc pages for individual
|
||||
:doc:`compute temp commands <compute>` to determine which ones include
|
||||
a bias. In this case, the thermostat works in the following manner:
|
||||
bias is removed from each atom, thermostatting is performed on the
|
||||
remaining thermal degrees of freedom, and the bias is added back in.
|
||||
|
||||
.. note::
|
||||
|
||||
However, not all temperature compute commands are valid to be used with these fixes.
|
||||
Precisely, only temperature compute that does not modify the DOF of the group can be used.
|
||||
E.g. :doc:`compute temp/ramp <compute_temp_ramp>` and :doc:`compute viscosity/cos <compute_viscosity_cos>`
|
||||
compute the kinetic energy after remove a velocity gradient without affecting the DOF of the group,
|
||||
then they can be invoked in this way.
|
||||
In contrast, :doc:`compute temp/partial <compute_temp_partial>` may remove the DOF at one or more dimensions,
|
||||
therefore it cannot be used with these fixes.
|
||||
However, not all temperature compute commands are valid to be used
|
||||
with these fixes. Precisely, only temperature compute that does
|
||||
not modify the DOF of the group can be used. E.g. :doc:`compute
|
||||
temp/ramp <compute_temp_ramp>` and :doc:`compute viscosity/cos
|
||||
<compute_viscosity_cos>` compute the kinetic energy after remove a
|
||||
velocity gradient without affecting the DOF of the group, then they
|
||||
can be invoked in this way. In contrast, :doc:`compute
|
||||
temp/partial <compute_temp_partial>` may remove the DOF at one or
|
||||
more dimensions, therefore it cannot be used with these fixes.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ Syntax
|
||||
*intersect* args = two or more group IDs
|
||||
*dynamic* args = parent-ID keyword value ...
|
||||
one or more keyword/value pairs may be appended
|
||||
keyword = *region* or *var* or *every*
|
||||
keyword = *region* or *var* or *property* or *every*
|
||||
*region* value = region-ID
|
||||
*var* value = name of variable
|
||||
*property* value = name of custom integer or floating point vector
|
||||
|
||||
BIN
doc/src/img/decomp-balance.png
Normal file
|
After Width: | Height: | Size: 129 KiB |
BIN
doc/src/img/decomp-processors.png
Normal file
|
After Width: | Height: | Size: 121 KiB |
BIN
doc/src/img/decomp-rcb.png
Normal file
|
After Width: | Height: | Size: 121 KiB |
BIN
doc/src/img/decomp-regular.png
Normal file
|
After Width: | Height: | Size: 121 KiB |
BIN
doc/src/img/domain-decomp.png
Normal file
|
After Width: | Height: | Size: 547 KiB |
BIN
doc/src/img/fft-decomp-parallel.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
doc/src/img/ghost-comm.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
doc/src/img/neigh-stencil.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
@ -64,25 +64,7 @@ radian\^2.
|
||||
|
||||
----------
|
||||
|
||||
Styles with a *gpu*, *intel*, *kk*, *omp*, or *opt* suffix are
|
||||
functionally the same as the corresponding style without the suffix.
|
||||
They have been optimized to run faster, depending on your available
|
||||
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
|
||||
page. The accelerated styles take the same arguments and should
|
||||
produce the same results, except for round-off and precision issues.
|
||||
|
||||
These accelerated styles are part of the GPU, INTEL, KOKKOS,
|
||||
OPENMP and OPT packages, respectively. They are only enabled if
|
||||
LAMMPS was built with those packages. See the :doc:`Build package
|
||||
<Build_package>` page for more info.
|
||||
|
||||
You can specify the accelerated styles explicitly in your input script
|
||||
by including their suffix, or you can use the :doc:`-suffix
|
||||
command-line switch <Run_options>` when you invoke LAMMPS, or you can
|
||||
use the :doc:`suffix <suffix>` command in your input script.
|
||||
|
||||
See the :doc:`Speed packages <Speed_packages>` page for more
|
||||
instructions on how to use the accelerated styles effectively.
|
||||
.. include:: accel_styles.rst
|
||||
|
||||
----------
|
||||
|
||||
|
||||