diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f99a336dbb..1b4cae3aaa 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -61,6 +61,7 @@ src/GPU/pair_vashishta_gpu.* @andeplane src/KOKKOS/pair_vashishta_kokkos.* @andeplane src/MANYBODY/pair_vashishta_table.* @andeplane src/MANYBODY/pair_atm.* @sergeylishchuk +src/MANYBODY/pair_nb3b_screened.* @flodesani src/REPLICA/*_grem.* @dstelter92 src/EXTRA-COMPUTE/compute_stress_mop*.* @RomainVermorel src/EXTRA-COMPUTE/compute_born_matrix.* @Bibobu @athomps @@ -135,6 +136,7 @@ src/timer.* @akohlmey src/utils.* @akohlmey @rbberger src/verlet.* @sjplimp @stanmoore1 src/math_eigen_impl.h @jewettaij +src/fix_press_langevin.* @Bibobu # tools tools/coding_standard/* @akohlmey @rbberger @@ -151,12 +153,12 @@ tools/vim/* @hammondkd unittest/* @akohlmey # cmake -cmake/* @rbberger +cmake/* @akohlmey cmake/Modules/LAMMPSInterfacePlugin.cmake @akohlmey cmake/Modules/MPI4WIN.cmake @akohlmey cmake/Modules/OpenCLLoader.cmake @akohlmey -cmake/Modules/Packages/COLVARS.cmake @rbberger @giacomofiorin -cmake/Modules/Packages/KIM.cmake @rbberger @ellio167 +cmake/Modules/Packages/COLVARS.cmake @giacomofiorin +cmake/Modules/Packages/KIM.cmake @ellio167 cmake/presets/*.cmake @akohlmey # python diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c7abfebf3a..891d1ad5e5 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -5,9 +5,9 @@ Thank you for considering to contribute to the LAMMPS software project. The following is a set of guidelines as well as explanations of policies and work flows for contributing to the LAMMPS molecular dynamics software project. These guidelines focus on submitting issues or pull requests on the LAMMPS GitHub project. Thus please also have a look at: -* [The guide for submitting new features in the LAMMPS manual](https://www.lammps.org/doc/Modify_contribute.html) -* [The guide on programming style and requirement in the LAMMPS manual](https://www.lammps.org/doc/Modify_style.html) -* [The GitHub tutorial in the LAMMPS manual](http://lammps.sandia.gov/doc/Howto_github.html) +* [The guide for submitting new features in the LAMMPS manual](https://docs.lammps.org/Modify_contribute.html) +* [The guide on programming style and requirement in the LAMMPS manual](https://docs.lammps.org/Modify_requirements.html) +* [The GitHub tutorial in the LAMMPS manual](http://docs.lammps.org/Howto_github.html) ## Table of Contents @@ -27,17 +27,17 @@ __ ## I don't want to read this whole thing I just have a question! -> **Note:** Please do not file an issue to ask a general question about LAMMPS, its features, how to use specific commands, or how perform simulations or analysis in LAMMPS. Instead post your question to either the ['lammps-users' mailing list](https://lammps.sandia.gov/mail.html) or the [LAMMPS Material Science Discourse forum](https://matsci.org/lammps). You do not need to be subscribed to post to the list (but a mailing list subscription avoids having your post delayed until it is approved by a mailing list moderator). Most posts to the mailing list receive a response within less than 24 hours. Before posting to the mailing list, please read the [mailing list guidelines](https://lammps.sandia.gov/guidelines.html). Following those guidelines will help greatly to get a helpful response. Always mention which LAMMPS version you are using. The LAMMPS forum was recently created as part of a larger effort to build a materials science community and have discussions not just about using LAMMPS. Thus the forum may be also used for discussions that would be off-topic for the mailing list. Those will just have to be posted to a more general category. +> **Note:** Please do not file an issue to ask a general question about LAMMPS, its features, how to use specific commands, or how perform simulations or analysis in LAMMPS. Instead post your question to the [LAMMPS Material Science Discourse forum](https://matsci.org/lammps). Before posting to the forum, please read the general [guidelines](https://www.lammps.org/guidelines.html) and the forum specific [suggestions](https://matsci.org/t/please-read-this-first-guidelines-and-suggestions-for-posting-lammps-questions/49913). Following those guidelines and suggestions will help greatly to get a helpful response. *Always* mention which LAMMPS version you are using. The MatSci website may be also used for discussions that would be off-topic for the LAMMPS categories. Those will just have to be posted to a different category. ## How Can I Contribute? There are several ways how you can actively contribute to the LAMMPS project: you can discuss compiling and using LAMMPS, and solving LAMMPS related problems with other LAMMPS users on the lammps-users mailing list or the forum, you can report bugs or suggest enhancements by creating issues on GitHub (or posting them to the lammps-users mailing list or posting in the LAMMPS Materials Science Discourse forum), and you can contribute by submitting pull requests on GitHub or e-mail your code -to one of the [LAMMPS core developers](https://lammps.sandia.gov/authors.html). As you may see from the aforementioned developer page, the LAMMPS software package includes the efforts of a very large number of contributors beyond the principal authors and maintainers. +to one of the [LAMMPS core developers](https://www.lammps.org/authors.html). As you may see from the aforementioned developer page, the LAMMPS software package includes the efforts of a very large number of contributors beyond the principal authors and maintainers. ### Discussing How To Use LAMMPS The LAMMPS mailing list is hosted at SourceForge. The mailing list began in 2005, and now includes tens of thousands of messages in thousands of threads. LAMMPS developers try to respond to posted questions in a timely manner, but there are no guarantees. Please consider that people live in different timezone and may not have time to answer e-mails outside of their work hours. -You can post to list by sending your email to lammps-users at lists.sourceforge.net (no subscription required), but before posting, please read the [mailing list guidelines](https://lammps.sandia.gov/guidelines.html) to maximize your chances to receive a helpful response. +You can post to list by sending your email to lammps-users at lists.sourceforge.net (no subscription required), but before posting, please read the [mailing list guidelines](https://www.lammps.org/guidelines.html) to maximize your chances to receive a helpful response. Anyone can browse/search previous questions/answers in the archives. You do not have to subscribe to the list to post questions, receive answers (to your questions), or browse/search the archives. You **do** need to subscribe to the list if you want emails for **all** the posts (as individual messages or in digest form), or to answer questions yourself. Feel free to sign up and help us out! Answering questions from fellow LAMMPS users is a great way to pay back the community for providing you a useful tool for free, and to pass on the advice you have received yourself to others. It improves your karma and helps you understand your own research better. @@ -47,7 +47,7 @@ The LAMMPS Materials Science Discourse forum was created recently to facilitate ### Reporting Bugs -While developers writing code for LAMMPS are careful to test their code, LAMMPS is such a large and complex software, that it is impossible to test for all combinations of features under all normal and not so normal circumstances. Thus bugs do happen, and if you suspect, that you have encountered one, please try to document it and report it as an [Issue](https://github.com/lammps/lammps/issues) on the LAMMPS GitHub project web page. However, before reporting a bug, you need to check whether this is something that may have already been corrected. The [Latest Features and Bug Fixes in LAMMPS](https://lammps.sandia.gov/bug.html) web page lists all significant changes to LAMMPS over the years. It also tells you what the current latest development version of LAMMPS is, and you should test whether your issue still applies to that version. +While developers writing code for LAMMPS are careful to test their code, LAMMPS is such a large and complex software, that it is impossible to test for all combinations of features under all normal and not so normal circumstances. Thus bugs do happen, and if you suspect, that you have encountered one, please try to document it and report it as an [Issue](https://github.com/lammps/lammps/issues) on the LAMMPS GitHub project web page. However, before reporting a bug, you need to check whether this is something that may have already been corrected. The [Latest Features and Bug Fixes in LAMMPS](https://www.lammps.org/bug.html) web page lists all significant changes to LAMMPS over the years. It also tells you what the current latest development version of LAMMPS is, and you should test whether your issue still applies to that version. When you click on the green "New Issue" button, you will be provided with a text field, where you can enter your message. That text field with contain a template with several headlines and some descriptions. Keep the headlines that are relevant to your reported potential bug and replace the descriptions with the information as suggested by the descriptions. You can also attach small text files (please add the file name extension `.txt` or it will be rejected), images, or small compressed text files (using gzip, do not use RAR or 7-ZIP or similar tools that are uncommon outside of Windows machines). In many cases, bugs are best illustrated by providing a small input deck (do **not** attach your entire production input, but remove everything that is not required to reproduce the issue, and scale down your system size, that the resulting calculation runs fast and can be run on small desktop quickly). @@ -65,9 +65,9 @@ To be able to submit an issue on GitHub, you have to register for an account (fo We encourage users to submit new features or modifications for LAMMPS. Instructions, guidelines, requirements, and recommendations are in the following sections of the LAMMPS manual: -* [The guide for submitting new features in the LAMMPS manual](https://lammps.sandia.gov/doc/Modify_contribute.html) -* [The guide on programming style and requirement in the LAMMPS manual](https://lammps.sandia.gov/doc/Modify_contribute.html) -* [The GitHub tutorial in the LAMMPS manual](http://lammps.sandia.gov/doc/Howto_github.html) +* [The guide for submitting new features in the LAMMPS manual](https://docs.lammps.org/Modify_contribute.html) +* [The guide on programming style and requirement in the LAMMPS manual](https://docs.lammps.org/Modify_requirements.html) +* [The GitHub tutorial in the LAMMPS manual](http://docs.lammps.org/Howto_github.html) ## GitHub Workflows @@ -85,7 +85,7 @@ For bug reports, the next step is that one of the core LAMMPS developers will se ### Pull Requests Pull requests are the **only** way that changes get made to the LAMMPS distribution. So also the LAMMPS core developers will submit pull requests for their own changes and discuss them on GitHub. Thus if you submit a pull request it will be treated in a similar fashion. When you submit a pull request you may opt to submit a "Draft" pull request. That means your changes are visible and will be subject to testing, but reviewers will not be (auto-)assigned and comments will take into account that this is not complete. On the other hand, this is a perfect way to ask the LAMMPS developers for comments on non-obvious changes and get feedback and possible suggestions for improvements or recommendations about what to avoid. -Immediately after the submission, the LAMMPS continuing integration server at ci.lammps.org will download your submitted branch and perform a number of tests: it will tests whether it compiles cleanly under various conditions, it will also do a check on whether your included documentation translates cleanly and run some unit tests and other checks. Whether these tests are successful or fail will be recorded. If a test fails, please inspect the corresponding output on the CI server and take the necessary steps, if needed, so that the code can compile cleanly again. The test will be re-run each time the pull request is updated with a push to the remote branch on GitHub. If you are unsure about what you need to change, ask a question in the discussion area of the pull request. +Immediately after the submission, the LAMMPS continuing integration server at https://ci.lammps.org will download your submitted branch and perform a number of tests: it will tests whether it compiles cleanly under various conditions, it will also do a check on whether your included documentation translates cleanly and run some unit tests and other checks. Whether these tests are successful or fail will be recorded. If a test fails, please inspect the corresponding output on the CI server and take the necessary steps, if needed, so that the code can compile cleanly again. The test will be re-run each time the pull request is updated with a push to the remote branch on GitHub. If you are unsure about what you need to change, ask a question in the discussion area of the pull request. Next a LAMMPS core developer will self-assign and do an overall technical assessment of the submission. If you submitted a draft pull request, this will not happen unless you mark it "ready for review". If you are not yet invited as a LAMMPS collaborator, and your contribution seems significant, you may also receive an invitation for collaboration on the LAMMPS repository. As part of the assessment, the pull request will be categorized with labels. There are two special labels: `needs_work` (indicates that work from the submitter of the pull request is needed) and `work_in_progress` (indicates, that the assigned LAMMPS developer will make changes, if not done by the contributor who made the submit). You may also receive comments and suggestions on the overall submission or specific details and on occasion specific requests for changes as part of the review. If permitted, also additional changes may be pushed into your pull request branch or a pull request may be filed in your LAMMPS fork on GitHub to include those changes. The LAMMPS developer may then decide to assign the pull request to another developer (e.g. when that developer is more knowledgeable about the submitted feature or enhancement or has written the modified code). It may also happen, that additional developers are requested to provide a review and approve the changes. For submissions, that may change the general behavior of LAMMPS, or where a possibility of unwanted side effects exists, additional tests may be requested by the assigned developer. diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c33628ac04..00c0e8642d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -25,12 +25,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' diff --git a/.github/workflows/compile-msvc.yml b/.github/workflows/compile-msvc.yml index 5ae0654ee0..1a0f1ea62f 100644 --- a/.github/workflows/compile-msvc.yml +++ b/.github/workflows/compile-msvc.yml @@ -19,12 +19,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 - name: Select Python version - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.11' diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 7bda3a071f..00a4596cc8 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 @@ -59,16 +59,13 @@ jobs: -D BUILD_SHARED_LIBS=on \ -D LAMMPS_SIZES=SMALLBIG \ -D LAMMPS_EXCEPTIONS=off \ - -D PKG_MESSAGE=on \ - -D PKG_MPIIO=on \ -D PKG_ATC=on \ -D PKG_AWPMD=on \ - -D PKG_BOCS=on \ - -D PKG_EFF=on \ -D PKG_H5MD=on \ -D PKG_INTEL=on \ -D PKG_LATBOLTZ=on \ -D PKG_MANIFOLD=on \ + -D PKG_MDI=on \ -D PKG_MGPT=on \ -D PKG_ML-PACE=on \ -D PKG_ML-RANN=on \ @@ -77,7 +74,6 @@ jobs: -D PKG_PTM=on \ -D PKG_QTB=on \ -D PKG_SMTBQ=on \ - -D PKG_TALLY=on \ ../cmake - name: Run Coverity Scan diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index ea979ca94f..6970faceaa 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index b075fc8f8d..f7e9b314bd 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -2,7 +2,6 @@ ######################################## # CMake build system # This file is part of LAMMPS -# Created by Christoph Junghans and Richard Berger cmake_minimum_required(VERSION 3.16) ######################################## # set policy to silence warnings about ignoring _ROOT but use it @@ -106,7 +105,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") 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 -fp-model fast=2 -no-prec-div -qoverride-limits -diag-disable=10441 -diag-disable=2196") + set(CMAKE_TUNE_DEFAULT "-xHost -fp-model fast=2 -no-prec-div -qoverride-limits -diag-disable=10441 -diag-disable=11074 -diag-disable=11076 -diag-disable=2196") endif() endif() endif() @@ -159,17 +158,20 @@ endif() ######################################################################## # User input options # ######################################################################## -# set path to python interpreter and thus enforcing python version when -# in a virtual environment and PYTHON_EXECUTABLE is not set on command line -if(DEFINED ENV{VIRTUAL_ENV} AND NOT PYTHON_EXECUTABLE) - if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - set(PYTHON_EXECUTABLE "$ENV{VIRTUAL_ENV}/Scripts/python.exe") - else() - set(PYTHON_EXECUTABLE "$ENV{VIRTUAL_ENV}/bin/python") - endif() +# backward compatibility with CMake before 3.12 and older LAMMPS documentation +if (PYTHON_EXECUTABLE) set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}") +endif() +# set path to python interpreter and thus enforcing python version when +# in a virtual environment and Python_EXECUTABLE is not set on command line +if(DEFINED ENV{VIRTUAL_ENV} AND NOT Python_EXECUTABLE) + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + set(Python_EXECUTABLE "$ENV{VIRTUAL_ENV}/Scripts/python.exe") + else() + set(Python_EXECUTABLE "$ENV{VIRTUAL_ENV}/bin/python") + endif() message(STATUS "Running in virtual environment: $ENV{VIRTUAL_ENV}\n" - " Setting Python interpreter to: ${PYTHON_EXECUTABLE}") + " Setting Python interpreter to: ${Python_EXECUTABLE}") endif() set(LAMMPS_MACHINE "" CACHE STRING "Suffix to append to lmp binary (WON'T enable any features automatically") @@ -425,6 +427,18 @@ if(BUILD_OMP) target_link_libraries(lmp PRIVATE OpenMP::OpenMP_CXX) endif() +# lower C++ standard for fmtlib sources when using Intel classic compiler +if((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_STANDARD GREATER_EQUAL 17) + AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2021.10)) + message(STATUS "Lowering C++ standard for compiling fmtlib sources with Intel Classic compiler") + get_filename_component(LMP_UTILS_SRC "${LAMMPS_SOURCE_DIR}/utils.cpp" ABSOLUTE) + get_filename_component(LMP_VARIABLE_SRC "${LAMMPS_SOURCE_DIR}/variable.cpp" ABSOLUTE) + get_filename_component(FMT_FORMAT_SRC "${LAMMPS_SOURCE_DIR}/fmtlib_format.cpp" ABSOLUTE) + get_filename_component(FMT_OS_SRC "${LAMMPS_SOURCE_DIR}/fmtlib_os.cpp" ABSOLUTE) + set_source_files_properties("${FMT_FORMAT_SRC}" "${FMT_OS_SRC}" "${LMP_VARIABLE_SRC}" "${LMP_UTILS_SRC}" + PROPERTIES COMPILE_OPTIONS "-std=c++14") +endif() + if(PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_ML-POD OR PKG_ELECTRODE OR BUILD_TOOLS) enable_language(C) if (NOT USE_INTERNAL_LINALG) @@ -794,9 +808,6 @@ install( ############################################################################### if(BUILD_SHARED_LIBS) # backward compatibility - if(PYTHON_EXECUTABLE) - set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) - endif() find_package(Python COMPONENTS Interpreter) if(BUILD_IS_MULTI_CONFIG) set(MY_BUILD_DIR ${CMAKE_BINARY_DIR}/$) @@ -960,33 +971,53 @@ if(PKG_KOKKOS) endif() endif() if(PKG_KSPACE) - message(STATUS "<<< FFT settings >>> --- Primary FFT lib: ${FFT}") - if(FFT_SINGLE) - message(STATUS "Using single precision FFTs") - else() - message(STATUS "Using double precision FFTs") - endif() - if(FFT_FFTW_THREADS OR FFT_MKL_THREADS) - message(STATUS "Using threaded FFTs") - else() - message(STATUS "Using non-threaded FFTs") - endif() - if(PKG_KOKKOS) - if(Kokkos_ENABLE_CUDA) - if(FFT STREQUAL "KISS") - message(STATUS "Kokkos FFT: KISS") - else() - message(STATUS "Kokkos FFT: cuFFT") - endif() - elseif(Kokkos_ENABLE_HIP) - if(FFT STREQUAL "KISS") - message(STATUS "Kokkos FFT: KISS") - else() - message(STATUS "Kokkos FFT: hipFFT") - endif() + if (LMP_HEFFTE) + message(STATUS "<<< FFT settings >>> +-- Primary FFT lib: heFFTe") + if (HEFFTE_BACKEND) + message(STATUS "heFFTe backend: ${HEFFTE_BACKEND}") else() - message(STATUS "Kokkos FFT: ${FFT}") + message(STATUS "heFFTe backend: stock (builtin FFT implementation, tested for corrected but not optimized for production)") + endif() + if(FFT_SINGLE) + message(STATUS "Using single precision FFTs") + else() + message(STATUS "Using double precision FFTs") + endif() + else() + message(STATUS "<<< FFT settings >>> +-- Primary FFT lib: ${FFT}") + if(FFT_SINGLE) + message(STATUS "Using single precision FFTs") + else() + message(STATUS "Using double precision FFTs") + endif() + if(FFT_FFTW_THREADS OR FFT_MKL_THREADS) + message(STATUS "Using threaded FFTs") + else() + message(STATUS "Using non-threaded FFTs") + endif() + if (FFT_HEFFTE) + message(STATUS "Using distributed algorithms from heFTTe") + else() + message(STATUS "Using builtin distributed algorithms") + endif() + if(PKG_KOKKOS) + if(Kokkos_ENABLE_CUDA) + if(FFT STREQUAL "KISS") + message(STATUS "Kokkos FFT: KISS") + else() + message(STATUS "Kokkos FFT: cuFFT") + endif() + elseif(Kokkos_ENABLE_HIP) + if(FFT STREQUAL "KISS") + message(STATUS "Kokkos FFT: KISS") + else() + message(STATUS "Kokkos FFT: hipFFT") + endif() + else() + message(STATUS "Kokkos FFT: ${FFT}") + endif() endif() endif() endif() diff --git a/cmake/Modules/LAMMPSUtils.cmake b/cmake/Modules/LAMMPSUtils.cmake index bb5ea07609..2ec9d1b706 100644 --- a/cmake/Modules/LAMMPSUtils.cmake +++ b/cmake/Modules/LAMMPSUtils.cmake @@ -83,17 +83,17 @@ function(check_for_autogen_files source_dir) file(GLOB SRC_AUTOGEN_FILES CONFIGURE_DEPENDS ${source_dir}/style_*.h) file(GLOB SRC_AUTOGEN_PACKAGES CONFIGURE_DEPENDS ${source_dir}/packages_*.h) list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/lmpinstalledpkgs.h ${source_dir}/lmpgitversion.h) - list(APPEND SRC_AUTOGEN_FILES ${SRC_AUTOGEN_PACKAGES} ${source_dir}/mliap_model_python_couple.h ${source_dir}/mliap_model_python_couple.cpp) + list(APPEND SRC_AUTOGEN_FILES ${source_dir}/mliap_model_python_couple.h ${source_dir}/mliap_model_python_couple.cpp) foreach(_SRC ${SRC_AUTOGEN_FILES}) get_filename_component(FILENAME "${_SRC}" NAME) if(EXISTS ${source_dir}/${FILENAME}) message(FATAL_ERROR "\n########################################################################\n" - "Found header file(s) generated by the make-based build system\n" - "\n" - "Please run\n" - "make -C ${source_dir} purge\n" - "to remove\n" - "########################################################################") + "Found header file ${source_dir}/${FILENAME} generated by the make-based build system\n" + "\n" + "Please run\n" + "make -C ${source_dir} purge\n" + "to remove\n" + "########################################################################") endif() endforeach() endfunction() diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 47be8b8538..4c3288df84 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -151,10 +151,10 @@ if(GPU_API STREQUAL "CUDA") endif() cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC} - -DUNIX -O3 --use_fast_math -Wno-deprecated-gpu-targets -DNV_KERNEL -DUCL_CUDADR ${GPU_CUDA_GENCODE} -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES}) + -DUNIX -O3 --use_fast_math -Wno-deprecated-gpu-targets -allow-unsupported-compiler -DNV_KERNEL -DUCL_CUDADR ${GPU_CUDA_GENCODE} -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES}) cuda_compile(GPU_OBJS ${GPU_LIB_CUDPP_CU} OPTIONS ${CUDA_REQUEST_PIC} - -DUNIX -O3 --use_fast_math -Wno-deprecated-gpu-targets -DUCL_CUDADR ${GPU_CUDA_GENCODE} -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES}) + -DUNIX -O3 --use_fast_math -Wno-deprecated-gpu-targets -allow-unsupported-compiler -DUCL_CUDADR ${GPU_CUDA_GENCODE} -D_${GPU_PREC_SETTING} -DLAMMPS_${LAMMPS_SIZES}) foreach(CU_OBJ ${GPU_GEN_OBJS}) get_filename_component(CU_NAME ${CU_OBJ} NAME_WE) diff --git a/cmake/Modules/Packages/KOKKOS.cmake b/cmake/Modules/Packages/KOKKOS.cmake index 6359d9e615..0edd9a3baa 100644 --- a/cmake/Modules/Packages/KOKKOS.cmake +++ b/cmake/Modules/Packages/KOKKOS.cmake @@ -50,8 +50,8 @@ if(DOWNLOAD_KOKKOS) list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}") list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") include(ExternalProject) - set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.1.00.tar.gz" CACHE STRING "URL for KOKKOS tarball") - set(KOKKOS_MD5 "a5f096bd8ad01b97fdc7a32583b17a33" CACHE STRING "MD5 checksum of KOKKOS tarball") + set(KOKKOS_URL "https://github.com/kokkos/kokkos/archive/4.2.00.tar.gz" CACHE STRING "URL for KOKKOS tarball") + set(KOKKOS_MD5 "731647b61a4233f568d583702e9cd6d1" CACHE STRING "MD5 checksum of KOKKOS tarball") mark_as_advanced(KOKKOS_URL) mark_as_advanced(KOKKOS_MD5) GetFallbackURL(KOKKOS_URL KOKKOS_FALLBACK) @@ -76,7 +76,7 @@ if(DOWNLOAD_KOKKOS) add_dependencies(LAMMPS::KOKKOSCORE kokkos_build) add_dependencies(LAMMPS::KOKKOSCONTAINERS kokkos_build) elseif(EXTERNAL_KOKKOS) - find_package(Kokkos 4.1.00 REQUIRED CONFIG) + find_package(Kokkos 4.2.00 REQUIRED CONFIG) target_link_libraries(lammps PRIVATE Kokkos::kokkos) else() set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos) diff --git a/cmake/Modules/Packages/KSPACE.cmake b/cmake/Modules/Packages/KSPACE.cmake index de7e7e5b20..9c9c879cd4 100644 --- a/cmake/Modules/Packages/KSPACE.cmake +++ b/cmake/Modules/Packages/KSPACE.cmake @@ -46,6 +46,42 @@ else() target_compile_definitions(lammps PRIVATE -DFFT_KISS) endif() +option(FFT_USE_HEFFTE "Use heFFTe as the distributed FFT engine, overrides the FFT option." OFF) +if(FFT_USE_HEFFTE) + # if FFT_HEFFTE is enabled, switch the builtin FFT engine with Heffte + set(FFT_HEFFTE_BACKEND_VALUES FFTW MKL) + set(FFT_HEFFTE_BACKEND "" CACHE STRING "Select heFFTe backend, e.g., FFTW or MKL") + set_property(CACHE FFT_HEFFTE_BACKEND PROPERTY STRINGS ${FFT_HEFFTE_BACKEND_VALUES}) + + if(FFT_HEFFTE_BACKEND STREQUAL "FFTW") # respect the backend choice, FFTW or MKL + set(HEFFTE_COMPONENTS "FFTW") + set(Heffte_ENABLE_FFTW "ON" CACHE BOOL "Enables FFTW backend for heFFTe") + elseif(FFT_HEFFTE_BACKEND STREQUAL "MKL") + set(HEFFTE_COMPONENTS "MKL") + set(Heffte_ENABLE_MKL "ON" CACHE BOOL "Enables MKL backend for heFFTe") + else() + message(WARNING "FFT_HEFFTE_BACKEND not selected, defaulting to the builtin 'stock' backend, which is intended for testing and is not optimized for production runs") + endif() + + find_package(Heffte 2.4.0 QUIET COMPONENTS ${HEFFTE_COMPONENTS}) + if (NOT Heffte_FOUND) # download and build + include(FetchContent) + FetchContent_Declare(HEFFTE_PROJECT # using v2.4.0 + URL "https://github.com/icl-utk-edu/heffte/archive/refs/tags/v2.4.0.tar.gz" + URL_HASH SHA256=02310fb4f9688df02f7181667e61c3adb7e38baf79611d80919d47452ff7881d + ) + FetchContent_Populate(HEFFTE_PROJECT) + add_subdirectory(${heffte_project_SOURCE_DIR} ${heffte_project_BINARY_DIR}) + set_target_properties(lmp PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + set_target_properties(lammps PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") + add_library(Heffte::Heffte INTERFACE IMPORTED GLOBAL) + target_link_libraries(Heffte::Heffte INTERFACE Heffte) + endif() + + target_compile_definitions(lammps PRIVATE -DFFT_HEFFTE "-DFFT_HEFFTE_${FFT_HEFFTE_BACKEND}") + target_link_libraries(lammps PRIVATE Heffte::Heffte) +endif() + set(FFT_PACK "array" CACHE STRING "Optimization for FFT") set(FFT_PACK_VALUES array pointer memcpy) set_property(CACHE FFT_PACK PROPERTY STRINGS ${FFT_PACK_VALUES}) diff --git a/cmake/Modules/Packages/ML-PACE.cmake b/cmake/Modules/Packages/ML-PACE.cmake index 6cdb751617..248b8eea76 100644 --- a/cmake/Modules/Packages/ML-PACE.cmake +++ b/cmake/Modules/Packages/ML-PACE.cmake @@ -1,33 +1,40 @@ -set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.01.3.fix.tar.gz" CACHE STRING "URL for PACE evaluator library sources") +set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.11.25.fix.tar.gz" CACHE STRING "URL for PACE evaluator library sources") -set(PACELIB_MD5 "4f0b3b5b14456fe9a73b447de3765caa" CACHE STRING "MD5 checksum of PACE evaluator library tarball") +set(PACELIB_MD5 "b45de9a633f42ed65422567e3ce56f9f" CACHE STRING "MD5 checksum of PACE evaluator library tarball") mark_as_advanced(PACELIB_URL) mark_as_advanced(PACELIB_MD5) GetFallbackURL(PACELIB_URL PACELIB_FALLBACK) -# download library sources to build folder -if(EXISTS ${CMAKE_BINARY_DIR}/libpace.tar.gz) - file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5) -endif() -if(NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}") - message(STATUS "Downloading ${PACELIB_URL}") - file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz STATUS DL_STATUS SHOW_PROGRESS) - file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5) - if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}")) - message(WARNING "Download from primary URL ${PACELIB_URL} failed\nTrying fallback URL ${PACELIB_FALLBACK}") - file(DOWNLOAD ${PACELIB_FALLBACK} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5} SHOW_PROGRESS) - endif() +# LOCAL_ML-PACE points to top-level dir with local lammps-user-pace repo, +# to make it easier to check local build without going through the public github releases +if(LOCAL_ML-PACE) + set(lib-pace "${LOCAL_ML-PACE}") else() - message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/libpace.tar.gz") -endif() + # download library sources to build folder + if(EXISTS ${CMAKE_BINARY_DIR}/libpace.tar.gz) + file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5) + endif() + if(NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}") + message(STATUS "Downloading ${PACELIB_URL}") + file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz STATUS DL_STATUS SHOW_PROGRESS) + file(MD5 ${CMAKE_BINARY_DIR}/libpace.tar.gz DL_MD5) + if((NOT DL_STATUS EQUAL 0) OR (NOT "${DL_MD5}" STREQUAL "${PACELIB_MD5}")) + message(WARNING "Download from primary URL ${PACELIB_URL} failed\nTrying fallback URL ${PACELIB_FALLBACK}") + file(DOWNLOAD ${PACELIB_FALLBACK} ${CMAKE_BINARY_DIR}/libpace.tar.gz EXPECTED_HASH MD5=${PACELIB_MD5} SHOW_PROGRESS) + endif() + else() + message(STATUS "Using already downloaded archive ${CMAKE_BINARY_DIR}/libpace.tar.gz") + endif() -# uncompress downloaded sources -execute_process( - COMMAND ${CMAKE_COMMAND} -E remove_directory lammps-user-pace* - COMMAND ${CMAKE_COMMAND} -E tar xzf libpace.tar.gz - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} -) -get_newest_file(${CMAKE_BINARY_DIR}/lammps-user-pace-* lib-pace) + + # uncompress downloaded sources + execute_process( + COMMAND ${CMAKE_COMMAND} -E remove_directory lammps-user-pace* + COMMAND ${CMAKE_COMMAND} -E tar xzf libpace.tar.gz + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + get_newest_file(${CMAKE_BINARY_DIR}/lammps-user-pace-* lib-pace) +endif() add_subdirectory(${lib-pace} build-pace) set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE}) diff --git a/cmake/Modules/Packages/PYTHON.cmake b/cmake/Modules/Packages/PYTHON.cmake index 59260e39d5..e05edadbf3 100644 --- a/cmake/Modules/Packages/PYTHON.cmake +++ b/cmake/Modules/Packages/PYTHON.cmake @@ -1,6 +1,6 @@ if(NOT Python_INTERPRETER) - # backward compatibility + # backward compatibility with CMake before 3.12 and older LAMMPS documentation if(PYTHON_EXECUTABLE) set(Python_EXECUTABLE ${PYTHON_EXECUTABLE}) endif() diff --git a/cmake/packaging/LAMMPS_DMG_Background.png b/cmake/packaging/LAMMPS_DMG_Background.png index 5ceb55c5e7..978b7d1987 100644 Binary files a/cmake/packaging/LAMMPS_DMG_Background.png and b/cmake/packaging/LAMMPS_DMG_Background.png differ diff --git a/cmake/packaging/MacOSXBundleInfo.plist.in b/cmake/packaging/MacOSXBundleInfo.plist.in index 33ce5a602b..bc08591e97 100644 --- a/cmake/packaging/MacOSXBundleInfo.plist.in +++ b/cmake/packaging/MacOSXBundleInfo.plist.in @@ -17,7 +17,7 @@ CFBundleLongVersionString ${MACOSX_BUNDLE_LONG_VERSION_STRING} CFBundleName - LAMMPS + LAMMPS_GUI CFBundlePackageType APPL CFBundleShortVersionString diff --git a/cmake/packaging/README.macos b/cmake/packaging/README.macos index 0325045983..d7583e7034 100644 --- a/cmake/packaging/README.macos +++ b/cmake/packaging/README.macos @@ -9,7 +9,7 @@ of the available packages. The following individual commands are included: binary2txt lammps-gui lmp msi2lmp phana stl_bin2txt -After copying the lammps-gui folder into your Applications folder, please follow +After copying the LAMMPS_GUI folder into your Applications folder, please follow these steps: 1. Open the Terminal app @@ -23,7 +23,7 @@ these steps: 3. Add the following lines to the end of the file, save it, and close the editor - LAMMPS_INSTALL_DIR=/Applications/LAMMPS.app/Contents + LAMMPS_INSTALL_DIR=/Applications/LAMMPS_GUI.app/Contents LAMMPS_POTENTIALS=${LAMMPS_INSTALL_DIR}/share/lammps/potentials LAMMPS_BENCH_DIR=${LAMMPS_INSTALL_DIR}/share/lammps/bench MSI2LMP_LIBRARY=${LAMMPS_INSTALL_DIR}/share/lammps/frc_files @@ -38,9 +38,9 @@ these steps: the changes from .zprofile automatically. Note: the above assumes you use the default shell (zsh) that comes with - MacOS. If you customized MacOS to use a different shell, you'll need to modify - that shell's init file (.cshrc, .bashrc, etc.) instead with appropiate commands - to modify the same environment variables. + MacOS. If you customized MacOS to use a different shell, you'll need to + modify that shell's init file (.cshrc, .bashrc, etc.) instead with + appropiate commands to modify the same environment variables. 5. Try running LAMMPS (which might fail, see step 7) @@ -50,10 +50,10 @@ these steps: lammps-gui ${LAMMPS_BENCH_DIR}/in.rhodo - Depending on the size and resolution of your screen, the fonts may - be too small to read. This can be adjusted by setting the environment - variable QT_FONT_DPI. The default value would be 72, so to increase - the fonts by a third one can add to the .zprofile file the line + Depending on the size and resolution of your screen, the fonts may be too + small to read. This can be adjusted by setting the environment variable + QT_FONT_DPI. The default value would be 72, so to increase the fonts by a + third, one can add to the .zprofile file the line export QT_FONT_DPI=96 @@ -61,9 +61,9 @@ these steps: 7. Give permission to execute the commands (lmp, lammps-gui, msi2lmp, binary2txt, phana, stl_bin2txt) - MacOS will likely block the initial run of the executables, since they - were downloaded from the internet and are missing a known signature from an - identified developer. Go to "Settings" and search for "Security settings". It - should display a message that an executable like "lmp" was blocked. Press + MacOS will likely block the initial run of the executables, since they were + downloaded from the internet and are missing a known signature from an + identified developer. Go to "Settings" and search for "Security settings". + It should display a message that an executable like "lmp" was blocked. Press "Open anyway", which might prompt you for your admin credentials. Afterwards "lmp" and the other executables should work as expected. diff --git a/cmake/packaging/build_linux_tgz.sh b/cmake/packaging/build_linux_tgz.sh index e0222858ce..48e3017f61 100755 --- a/cmake/packaging/build_linux_tgz.sh +++ b/cmake/packaging/build_linux_tgz.sh @@ -4,7 +4,7 @@ APP_NAME=lammps-gui DESTDIR=${PWD}/../LAMMPS_GUI echo "Delete old files, if they exist" -rm -rf ${DESTDIR} ../LAMMPS-Linux-amd64.tar.gz +rm -rf ${DESTDIR} ../LAMMPS_GUI-Linux-amd64.tar.gz echo "Create staging area for deployment and populate" DESTDIR=${DESTDIR} cmake --install . --prefix "/" @@ -69,7 +69,7 @@ do \ done pushd .. -tar -czvvf LAMMPS-Linux-amd64.tar.gz LAMMPS_GUI +tar -czvvf LAMMPS_GUI-Linux-amd64.tar.gz LAMMPS_GUI popd echo "Cleanup dir" diff --git a/cmake/packaging/build_macos_dmg.sh b/cmake/packaging/build_macos_dmg.sh index 5204e519c2..4da3e40eaf 100755 --- a/cmake/packaging/build_macos_dmg.sh +++ b/cmake/packaging/build_macos_dmg.sh @@ -3,7 +3,7 @@ APP_NAME=lammps-gui echo "Delete old files, if they exist" -rm -f ${APP_NAME}.dmg ${APP_NAME}-rw.dmg LAMMPS-macOS-multiarch.dmg +rm -f ${APP_NAME}.dmg ${APP_NAME}-rw.dmg LAMMPS_GUI-macOS-multiarch.dmg echo "Create initial dmg file with macdeployqt" macdeployqt lammps-gui.app -dmg @@ -22,8 +22,8 @@ ln -s /Applications . mv ${APP_NAME}.app/Contents/Resources/README.txt . mkdir .background mv ${APP_NAME}.app/Contents/Resources/LAMMPS_DMG_Background.png .background/background.png -mv ${APP_NAME}.app LAMMPS.app -cd LAMMPS.app/Contents +mv ${APP_NAME}.app LAMMPS_GUI.app +cd LAMMPS_GUI.app/Contents echo "Attach icons to LAMMPS console and GUI executables" echo "read 'icns' (-16455) \"Resources/lammps.icns\";" > icon.rsrc @@ -75,7 +75,7 @@ echo ' set statusbar visible to false set toolbar visible to false set the bounds to { 100, 40, 868, 640 } - set position of item "'LAMMPS'.app" to { 190, 216 } + set position of item "'LAMMPS_GUI'.app" to { 190, 216 } set position of item "Applications" to { 576, 216 } set position of item "README.txt" to { 190, 400 } end tell @@ -96,12 +96,12 @@ sync echo "Unmount modified disk image and convert to compressed read-only image" hdiutil detach "${DEVICE}" -hdiutil convert "${APP_NAME}-rw.dmg" -format UDZO -o "LAMMPS-macOS-multiarch.dmg" +hdiutil convert "${APP_NAME}-rw.dmg" -format UDZO -o "LAMMPS_GUI-macOS-multiarch.dmg" echo "Attach icon to .dmg file" echo "read 'icns' (-16455) \"lammps-gui.app/Contents/Resources/lammps.icns\";" > icon.rsrc -Rez -a icon.rsrc -o LAMMPS-macOS-multiarch.dmg -SetFile -a C LAMMPS-macOS-multiarch.dmg +Rez -a icon.rsrc -o LAMMPS_GUI-macOS-multiarch.dmg +SetFile -a C LAMMPS_GUI-macOS-multiarch.dmg rm icon.rsrc echo "Delete temporary disk images" diff --git a/cmake/packaging/build_windows_vs.cmake b/cmake/packaging/build_windows_vs.cmake index f051ff351f..283425ff65 100644 --- a/cmake/packaging/build_windows_vs.cmake +++ b/cmake/packaging/build_windows_vs.cmake @@ -1,7 +1,7 @@ # CMake script to be run post installation to build zipped package # clean up old zipfile and deployment tree -file(REMOVE LAMMPS-Win10-amd64.zip) +file(REMOVE LAMMPS_GUI-Win10-amd64.zip) file(REMOVE_RECURSE LAMMPS_GUI) file(RENAME ${INSTNAME} LAMMPS_GUI) @@ -21,8 +21,15 @@ file(WRITE qtdeploy.bat "@ECHO OFF\r\nset VSCMD_DEBUG=0\r\nCALL ${VC_INIT} x64\r execute_process(COMMAND cmd.exe /c qtdeploy.bat COMMAND_ECHO STDERR) file(REMOVE qtdeploy.bat) +# download and uncompress static FFMpeg and gzip binaries +file(DOWNLOAD "https://download.lammps.org/thirdparty/ffmpeg-gzip.zip" ffmpeg-gzip.zip) +file(WRITE unpackzip.ps1 "Expand-Archive -Path ffmpeg-gzip.zip -DestinationPath LAMMPS_GUI") +execute_process(COMMAND powershell -ExecutionPolicy Bypass -File unpackzip.ps1) +file(REMOVE unpackzip.ps1) +file(REMOVE ffmpeg-gzip.zip) + # create zip archive -file(WRITE makearchive.ps1 "Compress-Archive -Path LAMMPS_GUI -CompressionLevel Optimal -DestinationPath LAMMPS-Win10-amd64.zip") +file(WRITE makearchive.ps1 "Compress-Archive -Path LAMMPS_GUI -CompressionLevel Optimal -DestinationPath LAMMPS_GUI-Win10-amd64.zip") execute_process(COMMAND powershell -ExecutionPolicy Bypass -File makearchive.ps1) file(REMOVE makearchive.ps1) file(REMOVE_RECURSE LAMMPS_GUI) diff --git a/cmake/presets/gpu-cuda.cmake b/cmake/presets/gpu-cuda.cmake new file mode 100644 index 0000000000..2ac6bd9ea6 --- /dev/null +++ b/cmake/presets/gpu-cuda.cmake @@ -0,0 +1,11 @@ +# preset that enables GPU and selects CUDA API + +set(PKG_GPU ON CACHE BOOL "Build GPU package" FORCE) +set(GPU_API "cuda" CACHE STRING "APU used by GPU package" FORCE) +set(GPU_PREC "mixed" CACHE STRING "" FORCE) + +set(CUDA_NVCC_FLAGS "-allow-unsupported-compiler" CACHE STRING "" FORCE) +set(CUDA_NVCC_FLAGS_DEBUG "-allow-unsupported-compiler" CACHE STRING "" FORCE) +set(CUDA_NVCC_FLAGS_MINSIZEREL "-allow-unsupported-compiler" CACHE STRING "" FORCE) +set(CUDA_NVCC_FLAGS_RELWITHDEBINFO "-allow-unsupported-compiler" CACHE STRING "" FORCE) +set(CUDA_NVCC_FLAGS_RELEASE "-allow-unsupported-compiler" CACHE STRING "" FORCE) diff --git a/cmake/presets/kokkos-cuda.cmake b/cmake/presets/kokkos-cuda.cmake index ace8ff0879..c3ee081898 100644 --- a/cmake/presets/kokkos-cuda.cmake +++ b/cmake/presets/kokkos-cuda.cmake @@ -6,6 +6,8 @@ set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE) set(Kokkos_ENABLE_CUDA ON CACHE BOOL "" FORCE) set(Kokkos_ARCH_PASCAL60 ON CACHE BOOL "" FORCE) set(BUILD_OMP ON CACHE BOOL "" FORCE) +get_filename_component(NVCC_WRAPPER_CMD ${CMAKE_CURRENT_SOURCE_DIR}/../lib/kokkos/bin/nvcc_wrapper ABSOLUTE) +set(CMAKE_CXX_COMPILER ${NVCC_WRAPPER_CMD} CACHE FILEPATH "" FORCE) # hide deprecation warnings temporarily for stable release set(Kokkos_ENABLE_DEPRECATION_WARNINGS OFF CACHE BOOL "" FORCE) diff --git a/cmake/presets/macos-multiarch.cmake b/cmake/presets/macos-multiarch.cmake index 58ef013f68..8ceaec11f8 100644 --- a/cmake/presets/macos-multiarch.cmake +++ b/cmake/presets/macos-multiarch.cmake @@ -10,5 +10,3 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) set(BUILD_MPI FALSE CACHE BOOL "" FORCE) -set(BUILD_SHARED_LIBS FALSE CACHE BOOL "" FORCE) -set(LAMMPS_EXCEPTIONS TRUE CACHE BOOL "" FORCE) diff --git a/doc/Makefile b/doc/Makefile index 2a4edc70f3..b652c515e1 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -63,6 +63,7 @@ help: @echo " anchor_check scan for duplicate anchor labels" @echo " style_check check for complete and consistent style lists" @echo " package_check check for complete and consistent package lists" + @echo " role_check check for misformatted role keywords" @echo " spelling spell-check the manual" # ------------------------------------------ @@ -98,6 +99,7 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX) env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\ env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\ env LC_ALL=C grep -n ' `[^`]\+<[a-z][^`]\+`[^_]' $(RSTDIR)/*.rst ;\ + env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst ;\ $(PYTHON) $(BUILDDIR)/utils/check-styles.py -s ../src -d src ;\ echo "############################################" ;\ deactivate ;\ @@ -179,6 +181,7 @@ pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\ env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\ env LC_ALL=C grep -n ' `[^`]\+<[a-z][^`]\+`[^_]' $(RSTDIR)/*.rst ;\ + env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst ;\ $(PYTHON) utils/check-styles.py -s ../src -d src ;\ echo "############################################" ;\ deactivate ;\ @@ -227,6 +230,7 @@ char_check : role_check : @( env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst && exit 1 || : ) @( env LC_ALL=C grep -n ' `[^`]\+<[a-z][^`]\+`[^_]' $(RSTDIR)/*.rst && exit 1 || : ) + @( env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst && exit 1 || : ) link_check : $(VENV) html @(\ diff --git a/doc/lammps.1 b/doc/lammps.1 index 79964d1680..100ea9b663 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,7 +1,7 @@ -.TH LAMMPS "1" "2 August 2023" "2023-08-2" +.TH LAMMPS "1" "21 November 2023" "2023-11-21" .SH NAME .B LAMMPS -\- Molecular Dynamics Simulator. Version 2 August 2023 +\- Molecular Dynamics Simulator. Version 21 November 2023 .SH SYNOPSIS .B lmp diff --git a/doc/src/Bibliography.rst b/doc/src/Bibliography.rst index e9ea8b0925..4ed8e73dfe 100644 --- a/doc/src/Bibliography.rst +++ b/doc/src/Bibliography.rst @@ -562,6 +562,9 @@ Bibliography **(Kumar)** Kumar and Skinner, J. Phys. Chem. B, 112, 8311 (2008) +**(Lafourcade)** + Lafourcade, Maillet, Denoual, Duval, Allera, Goryaeva, and Marinica, `Comp. Mat. Science, 230, 112534 (2023) `_ + **(Lamoureux and Roux)** G.\ Lamoureux, B. Roux, J. Chem. Phys 119, 3025 (2003) diff --git a/doc/src/Build_basics.rst b/doc/src/Build_basics.rst index e250b3ec7c..233b825d01 100644 --- a/doc/src/Build_basics.rst +++ b/doc/src/Build_basics.rst @@ -488,8 +488,9 @@ using CMake or Make. .. code-block:: bash - -D BUILD_TOOLS=value # yes or no (default) - -D BUILD_LAMMPS_SHELL=value # yes or no (default) + -D BUILD_TOOLS=value # yes or no (default). Build binary2txt, chain.x, micelle2d.x, msi2lmp, phana, stl_bin2txt + -D BUILD_LAMMPS_SHELL=value # yes or no (default). Build lammps-shell + -D BUILD_LAMMPS_GUI=value # yes or no (default). Build lammps-gui The generated binaries will also become part of the LAMMPS installation (see below). @@ -503,7 +504,6 @@ using CMake or Make. make binary2txt # build only binary2txt tool make chain # build only chain tool make micelle2d # build only micelle2d tool - make thermo_extract # build only thermo_extract tool cd lammps/tools/lammps-shell make # build LAMMPS shell diff --git a/doc/src/Build_cmake.rst b/doc/src/Build_cmake.rst index 6c46f6d672..e622f9f208 100644 --- a/doc/src/Build_cmake.rst +++ b/doc/src/Build_cmake.rst @@ -177,13 +177,13 @@ configuration is selected with the *-C* flag: ctest -C Debug -The CMake scripts in LAMMPS have basic support for being compiled using a -multi-config build system, but not all of it has been ported. This is in -particular applicable to compiling packages that require additional libraries -that would be downloaded and compiled by CMake. The "windows" preset file -tries to keep track of which packages can be compiled natively with the -MSVC compilers out-of-the box. Not all of those external libraries are -portable to Windows, either. +The CMake scripts in LAMMPS have basic support for being compiled using +a multi-config build system, but not all of it has been ported. This is +in particular applicable to compiling packages that require additional +libraries that would be downloaded and compiled by CMake. The +``windows.cmake`` preset file tries to keep track of which packages can +be compiled natively with the MSVC compilers out-of-the box. Not all of +the external libraries are portable to Windows, either. Installing CMake diff --git a/doc/src/Build_development.rst b/doc/src/Build_development.rst index c75c7a6a41..d30a433d62 100644 --- a/doc/src/Build_development.rst +++ b/doc/src/Build_development.rst @@ -518,6 +518,8 @@ The following options are available. make fix-errordocs # remove error docs in header files make check-permissions # search for files with permissions issues make fix-permissions # correct permissions issues in files + make check-docs # search for several issues in the manual + make check-version # list files with pending release version tags make check # run all check targets from above These should help to make source and documentation files conforming diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 6e2069c0ec..1f643a9d14 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -626,22 +626,22 @@ They must be specified in uppercase. * - HOPPER90 - GPU - NVIDIA Hopper generation CC 9.0 GPU - * - VEGA900 + * - AMD_GFX906 - GPU - - AMD GPU MI25 GFX900 - * - VEGA906 + - AMD GPU MI50/MI60 + * - AMD_GFX908 - GPU - - AMD GPU MI50/MI60 GFX906 - * - VEGA908 + - AMD GPU MI100 + * - AMD_GFX90A - GPU - - AMD GPU MI100 GFX908 - * - VEGA90A + - AMD GPU MI200 + * - AMD_GFX942 - GPU - - AMD GPU MI200 GFX90A - * - NAVI1030 + - AMD GPU MI300 + * - AMD_GFX1030 - GPU - AMD GPU V620/W6800 - * - NAVI1100 + * - AMD_GFX1100 - GPU - AMD GPU RX7900XTX * - INTEL_GEN @@ -666,7 +666,7 @@ They must be specified in uppercase. - GPU - Intel GPU Ponte Vecchio -This list was last updated for version 4.0.1 of the Kokkos library. +This list was last updated for version 4.2 of the Kokkos library. .. tabs:: @@ -722,9 +722,10 @@ This list was last updated for version 4.0.1 of the Kokkos library. ``cmake/presets`` folder, ``kokkos-serial.cmake``, ``kokkos-openmp.cmake``, ``kokkos-cuda.cmake``, ``kokkos-hip.cmake``, and ``kokkos-sycl.cmake``. They will enable - the KOKKOS package and enable some hardware choice. So to compile - with CUDA device parallelization (for GPUs with CC 5.0 and up) - with some common packages enabled, you can do the following: + the KOKKOS package and enable some hardware choices. For GPU + support those preset files must be customized to match the + hardware used. So to compile with CUDA device parallelization with + some common packages enabled, you can do the following: .. code-block:: bash @@ -886,6 +887,50 @@ included in the LAMMPS source distribution in the ``lib/lepton`` folder. ---------- +.. _machdyn: + +MACHDYN package +------------------------------- + +To build with this package, you must download the Eigen3 library. +Eigen3 is a template library, so you do not need to build it. + +.. tabs:: + + .. tab:: CMake build + + .. code-block:: bash + + -D DOWNLOAD_EIGEN3 # download Eigen3, value = no (default) or yes + -D EIGEN3_INCLUDE_DIR=path # path to Eigen library (only needed if a custom location) + + If ``DOWNLOAD_EIGEN3`` is set, the Eigen3 library will be + downloaded and inside the CMake build directory. If the Eigen3 + library is already on your system (in a location where CMake + cannot find it), set ``EIGEN3_INCLUDE_DIR`` to the directory the + ``Eigen3`` include file is in. + + .. tab:: Traditional make + + You can download the Eigen3 library manually if you prefer; follow + the instructions in ``lib/machdyn/README``. You can also do it in one + step from the ``lammps/src`` dir, using a command like these, + which simply invokes the ``lib/machdyn/Install.py`` script with the + specified args: + + .. code-block:: bash + + make lib-machdyn # print help message + make lib-machdyn args="-b" # download to lib/machdyn/eigen3 + make lib-machdyn args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3 + + Note that a symbolic (soft) link named ``includelink`` is created + in ``lib/machdyn`` to point to the Eigen dir. When LAMMPS builds it + will use this link. You should not need to edit the + ``lib/machdyn/Makefile.lammps`` file. + +---------- + .. _mliap: ML-IAP package @@ -1011,12 +1056,12 @@ additional details. .. code-block:: bash - -D PYTHON_EXECUTABLE=path # path to Python executable to use + -D Python_EXECUTABLE=path # path to Python executable to use Without this setting, CMake will guess the default Python version on your system. To use a different Python version, you can either create a virtualenv, activate it and then run cmake. Or you can - set the PYTHON_EXECUTABLE variable to specify which Python + set the Python_EXECUTABLE variable to specify which Python interpreter should be used. Note note that you will also need to have the development headers installed for this version, e.g. python2-devel. @@ -1431,6 +1476,55 @@ ML-POD package ---------- +.. _ml-quip: + +ML-QUIP package +--------------------------------- + +To build with this package, you must download and build the QUIP +library. It can be obtained from GitHub. For support of GAP +potentials, additional files with specific licensing conditions need +to be downloaded and configured. The automatic download will from +within CMake will download the non-commercial use version. + +.. tabs:: + + .. tab:: CMake build + + .. code-block:: bash + + -D DOWNLOAD_QUIP=value # download QUIP library for build, value = no (default) or yes + -D QUIP_LIBRARY=path # path to libquip.a (only needed if a custom location) + -D USE_INTERNAL_LINALG=value # Use the internal linear algebra library instead of LAPACK + # value = no (default) or yes + + CMake will try to download and build the QUIP library from GitHub, + if it is not found on the local machine. This requires to have git + installed. It will use the same compilers and flags as used for + compiling LAMMPS. Currently this is only supported for the GNU + and the Intel compilers. Set the ``QUIP_LIBRARY`` variable if you + want to use a previously compiled and installed QUIP library and + CMake cannot find it. + + The QUIP library requires LAPACK (and BLAS) and CMake can identify + their locations and pass that info to the QUIP build script. But + on some systems this triggers a (current) limitation of CMake and + the configuration will fail. Try enabling ``USE_INTERNAL_LINALG`` in + those cases to use the bundled linear algebra library and work around + the limitation. + + .. tab:: Traditional make + + The download/build procedure for the QUIP library, described in + ``lib/quip/README`` file requires setting two environment + variables, ``QUIP_ROOT`` and ``QUIP_ARCH``. These are accessed by + the ``lib/quip/Makefile.lammps`` file which is used when you + compile and link LAMMPS with this package. You should only need + to edit ``Makefile.lammps`` if the LAMMPS build can not use its + settings to successfully build on your system. + +---------- + .. _plumed: PLUMED package @@ -1952,55 +2046,6 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to ---------- -.. _ml-quip: - -ML-QUIP package ---------------------------------- - -To build with this package, you must download and build the QUIP -library. It can be obtained from GitHub. For support of GAP -potentials, additional files with specific licensing conditions need -to be downloaded and configured. The automatic download will from -within CMake will download the non-commercial use version. - -.. tabs:: - - .. tab:: CMake build - - .. code-block:: bash - - -D DOWNLOAD_QUIP=value # download QUIP library for build, value = no (default) or yes - -D QUIP_LIBRARY=path # path to libquip.a (only needed if a custom location) - -D USE_INTERNAL_LINALG=value # Use the internal linear algebra library instead of LAPACK - # value = no (default) or yes - - CMake will try to download and build the QUIP library from GitHub, - if it is not found on the local machine. This requires to have git - installed. It will use the same compilers and flags as used for - compiling LAMMPS. Currently this is only supported for the GNU - and the Intel compilers. Set the ``QUIP_LIBRARY`` variable if you - want to use a previously compiled and installed QUIP library and - CMake cannot find it. - - The QUIP library requires LAPACK (and BLAS) and CMake can identify - their locations and pass that info to the QUIP build script. But - on some systems this triggers a (current) limitation of CMake and - the configuration will fail. Try enabling ``USE_INTERNAL_LINALG`` in - those cases to use the bundled linear algebra library and work around - the limitation. - - .. tab:: Traditional make - - The download/build procedure for the QUIP library, described in - ``lib/quip/README`` file requires setting two environment - variables, ``QUIP_ROOT`` and ``QUIP_ARCH``. These are accessed by - the ``lib/quip/Makefile.lammps`` file which is used when you - compile and link LAMMPS with this package. You should only need - to edit ``Makefile.lammps`` if the LAMMPS build can not use its - settings to successfully build on your system. - ----------- - .. _scafacos: SCAFACOS package @@ -2048,50 +2093,6 @@ To build with this package, you must download and build the ---------- -.. _machdyn: - -MACHDYN package -------------------------------- - -To build with this package, you must download the Eigen3 library. -Eigen3 is a template library, so you do not need to build it. - -.. tabs:: - - .. tab:: CMake build - - .. code-block:: bash - - -D DOWNLOAD_EIGEN3 # download Eigen3, value = no (default) or yes - -D EIGEN3_INCLUDE_DIR=path # path to Eigen library (only needed if a custom location) - - If ``DOWNLOAD_EIGEN3`` is set, the Eigen3 library will be - downloaded and inside the CMake build directory. If the Eigen3 - library is already on your system (in a location where CMake - cannot find it), set ``EIGEN3_INCLUDE_DIR`` to the directory the - ``Eigen3`` include file is in. - - .. tab:: Traditional make - - You can download the Eigen3 library manually if you prefer; follow - the instructions in ``lib/smd/README``. You can also do it in one - step from the ``lammps/src`` dir, using a command like these, - which simply invokes the ``lib/smd/Install.py`` script with the - specified args: - - .. code-block:: bash - - make lib-smd # print help message - make lib-smd args="-b" # download to lib/smd/eigen3 - make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3 - - Note that a symbolic (soft) link named ``includelink`` is created - in ``lib/smd`` to point to the Eigen dir. When LAMMPS builds it - will use this link. You should not need to edit the - ``lib/smd/Makefile.lammps`` file. - ----------- - .. _vtk: VTK package diff --git a/doc/src/Build_package.rst b/doc/src/Build_package.rst index bc6445f813..63ccac534d 100644 --- a/doc/src/Build_package.rst +++ b/doc/src/Build_package.rst @@ -182,6 +182,7 @@ make a copy of one of them and modify it to suit your needs. cmake -C ../cmake/presets/all_on.cmake [OPTIONS] ../cmake # enable all packages cmake -C ../cmake/presets/all_off.cmake [OPTIONS] ../cmake # disable all packages mingw64-cmake -C ../cmake/presets/mingw-cross.cmake [OPTIONS] ../cmake # compile with MinGW cross-compilers + cmake -C ../cmake/presets/macos-multiarch.cmake [OPTIONS] ../cmake # compile serial multi-arch binaries on macOS Presets that have names starting with "windows" are specifically for compiling LAMMPS :doc:`natively on Windows ` and diff --git a/doc/src/Build_settings.rst b/doc/src/Build_settings.rst index 7576cae3eb..7fb7539506 100644 --- a/doc/src/Build_settings.rst +++ b/doc/src/Build_settings.rst @@ -44,6 +44,14 @@ require use of an FFT library to compute 1d FFTs. The KISS FFT library is included with LAMMPS, but other libraries can be faster. LAMMPS can use them if they are available on your system. +.. versionadded:: TBD + +Alternatively, LAMMPS can use the `heFFTe +`_ library for the MPI +communication algorithms, which comes with many optimizations for +special cases, e.g. leveraging available 2D and 3D FFTs in the back end +libraries and better pipelining for packing and communication. + .. tabs:: .. tab:: CMake build @@ -53,6 +61,7 @@ LAMMPS can use them if they are available on your system. -D FFT=value # FFTW3 or MKL or KISS, default is FFTW3 if found, else KISS -D FFT_SINGLE=value # yes or no (default), no = double precision -D FFT_PACK=value # array (default) or pointer or memcpy + -D FFT_USE_HEFFTE=value # yes or no (default), yes links to heFFTe .. note:: @@ -76,6 +85,16 @@ LAMMPS can use them if they are available on your system. -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 + -D FFT_HEFFTE_BACKEND=value # FFTW or MKL or empty/undefined for the stock heFFTe back end + -D Heffte_ROOT=path # path to an existing heFFTe installation + + .. note:: + + heFFTe comes with a builtin (= stock) back end for FFTs, i.e. a + default internal FFT implementation; however, this stock back + end is intended for testing purposes only and is not optimized + for production runs. + .. tab:: Traditional make @@ -111,6 +130,24 @@ LAMMPS can use them if they are available on your system. files in its default search path. You must specify ``FFT_LIB`` with the appropriate FFT libraries to include in the link. + Traditional make can also link to heFFTe using an existing installation + + .. code-block:: make + + include /share/heffte/HeffteMakefile.in + FFT_INC = -DFFT_HEFFTE -DFFT_HEFFTE_FFTW $(heffte_include) + FFT_PATH = + FFT_LIB = $(heffte_link) $(heffte_libs) + + The heFFTe install path will contain `HeffteMakefile.in`. + which will define the `heffte_` include variables needed to link to heFFTe from + an external project using traditional make. + The `-DFFT_HEFFTE` is required to switch to using heFFTe, while the optional `-DFFT_HEFFTE_FFTW` + selects the desired heFFTe back end, e.g., `-DFFT_HEFFTE_FFTW` or `-DFFT_HEFFTE_MKL`, + omitting the variable will default to the `stock` back end. + The heFFTe `stock` back end is intended to be used for testing and debugging, + but is not performance optimized for large scale production runs. + The `KISS FFT library `_ is included in the LAMMPS distribution. It is portable across all platforms. Depending on the size of the FFTs and the number of @@ -170,6 +207,16 @@ Depending on the machine, the size of the FFT grid, the number of processors used, one option may be slightly faster. The default is ARRAY mode. +When using ``-DFFT_HEFFTE`` CMake will first look for an existing +install with hints provided by ``-DHeffte_ROOT``, as recommended by the +CMake standard and note that the name is case sensitive. If CMake cannot +find a heFFTe installation with the correct back end (e.g., FFTW or +MKL), it will attempt to download and build the library automatically. +In this case, LAMMPS CMake will also accept all heFFTe specific +variables listed in the `heFFTe documentation +`_ +and those variables will be passed into the heFFTe build. + ---------- .. _size: @@ -463,8 +510,8 @@ Exception handling when using LAMMPS as a library LAMMPS errors do not kill the calling code, but throw an exception. In the C-library interface, the call stack is unwound and control returns -to the caller, e.g. to Python or a code that is coupled to LAMMPS and -the error status can be queried. When using C++ directly, the calling +to the caller, e.g. to Python or a code that is coupled to LAMMPS. The +error status can then be queried. When using C++ directly, the calling code has to be set up to *catch* exceptions thrown from within LAMMPS. .. note:: diff --git a/doc/src/Commands_compute.rst b/doc/src/Commands_compute.rst index dbd6b58ce7..0352ad5374 100644 --- a/doc/src/Commands_compute.rst +++ b/doc/src/Commands_compute.rst @@ -100,6 +100,7 @@ KOKKOS, o = OPENMP, t = OPT. * :doc:`nbond/atom ` * :doc:`omega/chunk ` * :doc:`orientorder/atom (k) ` + * :doc:`pace ` * :doc:`pair ` * :doc:`pair/local ` * :doc:`pe ` @@ -115,12 +116,15 @@ KOKKOS, o = OPENMP, t = OPT. * :doc:`property/grid ` * :doc:`property/local ` * :doc:`ptm/atom ` + * :doc:`rattlers/atom ` * :doc:`rdf ` + * :doc:`reaxff/atom (k) ` * :doc:`reduce ` * :doc:`reduce/chunk ` * :doc:`reduce/region ` * :doc:`rigid/local ` * :doc:`saed ` + * :doc:`slcsa/atom ` * :doc:`slice ` * :doc:`smd/contact/radius ` * :doc:`smd/damage ` diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 5aabb7967c..e89e302673 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -69,7 +69,7 @@ OPT. * :doc:`drude/transform/inverse ` * :doc:`dt/reset (k) ` * :doc:`edpd/source ` - * :doc:`efield ` + * :doc:`efield (k) ` * :doc:`efield/tip4p ` * :doc:`ehex ` * :doc:`electrode/conp (i) ` @@ -122,6 +122,7 @@ OPT. * :doc:`mvv/tdpd ` * :doc:`neb ` * :doc:`neb/spin ` + * :doc:`nonaffine/displacement ` * :doc:`nph (ko) ` * :doc:`nph/asphere (o) ` * :doc:`nph/body ` @@ -181,6 +182,7 @@ OPT. * :doc:`pour ` * :doc:`precession/spin ` * :doc:`press/berendsen ` + * :doc:`press/langevin ` * :doc:`print ` * :doc:`propel/self ` * :doc:`property/atom (k) ` @@ -232,15 +234,15 @@ OPT. * :doc:`spring ` * :doc:`spring/chunk ` * :doc:`spring/rg ` - * :doc:`spring/self ` + * :doc:`spring/self (k) ` * :doc:`srd ` * :doc:`store/force ` * :doc:`store/state ` * :doc:`tdpd/source ` - * :doc:`temp/berendsen ` + * :doc:`temp/berendsen (k) ` * :doc:`temp/csld ` * :doc:`temp/csvr ` - * :doc:`temp/rescale ` + * :doc:`temp/rescale (k) ` * :doc:`temp/rescale/eff ` * :doc:`tfmc ` * :doc:`tgnpt/drude ` diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index c45a1d778c..e7761e7bee 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -87,7 +87,7 @@ OPT. * :doc:`coul/long/soft (o) ` * :doc:`coul/msm (o) ` * :doc:`coul/slater/cut ` - * :doc:`coul/slater/long ` + * :doc:`coul/slater/long (g) ` * :doc:`coul/shield ` * :doc:`coul/streitz ` * :doc:`coul/tt ` @@ -110,7 +110,7 @@ OPT. * :doc:`eam/he ` * :doc:`edip (o) ` * :doc:`edip/multi ` - * :doc:`edpd ` + * :doc:`edpd (g) ` * :doc:`eff/cut ` * :doc:`eim (o) ` * :doc:`exp6/rx (k) ` @@ -158,14 +158,14 @@ OPT. * :doc:`lj/cut (gikot) ` * :doc:`lj/cut/coul/cut (gko) ` * :doc:`lj/cut/coul/cut/dielectric (o) ` - * :doc:`lj/cut/coul/cut/soft (o) ` + * :doc:`lj/cut/coul/cut/soft (go) ` * :doc:`lj/cut/coul/debye (gko) ` * :doc:`lj/cut/coul/debye/dielectric (o) ` * :doc:`lj/cut/coul/dsf (gko) ` * :doc:`lj/cut/coul/long (gikot) ` * :doc:`lj/cut/coul/long/cs ` * :doc:`lj/cut/coul/long/dielectric (o) ` - * :doc:`lj/cut/coul/long/soft (o) ` + * :doc:`lj/cut/coul/long/soft (go) ` * :doc:`lj/cut/coul/msm (go) ` * :doc:`lj/cut/coul/msm/dielectric ` * :doc:`lj/cut/coul/wolf (o) ` @@ -202,7 +202,7 @@ OPT. * :doc:`lubricate/poly (o) ` * :doc:`lubricateU ` * :doc:`lubricateU/poly ` - * :doc:`mdpd ` + * :doc:`mdpd (g) ` * :doc:`mdpd/rhosum ` * :doc:`meam (k) ` * :doc:`meam/ms (k) ` @@ -220,7 +220,8 @@ OPT. * :doc:`morse/soft ` * :doc:`multi/lucy ` * :doc:`multi/lucy/rx (k) ` - * :doc:`nb3b/harmonic ` + * :doc:`nb3b/harmonic ` + * :doc:`nb3b/screened ` * :doc:`nm/cut (o) ` * :doc:`nm/cut/coul/cut (o) ` * :doc:`nm/cut/coul/long (o) ` @@ -265,13 +266,13 @@ OPT. * :doc:`smd/tri_surface ` * :doc:`smd/ulsph ` * :doc:`smtbq ` - * :doc:`snap (k) ` + * :doc:`snap (ik) ` * :doc:`soft (go) ` - * :doc:`sph/heatconduction ` + * :doc:`sph/heatconduction (g) ` * :doc:`sph/idealgas ` - * :doc:`sph/lj ` + * :doc:`sph/lj (g) ` * :doc:`sph/rhosum ` - * :doc:`sph/taitwater ` + * :doc:`sph/taitwater (g) ` * :doc:`sph/taitwater/morris ` * :doc:`spin/dipole/cut ` * :doc:`spin/dipole/long ` @@ -305,5 +306,5 @@ OPT. * :doc:`wf/cut ` * :doc:`ylz ` * :doc:`yukawa (gko) ` - * :doc:`yukawa/colloid (go) ` + * :doc:`yukawa/colloid (gko) ` * :doc:`zbl (gko) ` diff --git a/doc/src/Commands_removed.rst b/doc/src/Commands_removed.rst index 84cc534304..98a52fc2d7 100644 --- a/doc/src/Commands_removed.rst +++ b/doc/src/Commands_removed.rst @@ -88,7 +88,7 @@ The same functionality is available through MPIIO package ------------- -.. deprecated:: TBD +.. deprecated:: 21Nov2023 The MPIIO package has been removed from LAMMPS since it was unmaintained for many years and thus not updated to incorporate required changes that @@ -107,7 +107,7 @@ see :doc:`restart `, :doc:`read_restart `, MSCG package ------------ -.. deprecated:: TBD +.. deprecated:: 21Nov2023 The MSCG package has been removed from LAMMPS since it was unmaintained for many years and instead superseded by the `OpenMSCG software @@ -126,6 +126,17 @@ syntax compatible with the removed reax pair style, so input files will have to be adapted. The REAXFF package was originally called USER-REAXC. +USER-REAXC package +------------------ + +.. deprecated:: TBD + +The USER-REAXC package has been renamed to :ref:`REAXFF `. +In the process also the pair style and related fixes were renamed to use +the "reaxff" string instead of "reax/c". For a while LAMMPS was maintaining +backward compatibility by providing aliases for the styles. These have +been removed, so using "reaxff" is now *required*. + USER-CUDA package ----------------- diff --git a/doc/src/Developer_unittest.rst b/doc/src/Developer_unittest.rst index 9886e9e4b4..e311fcdfc5 100644 --- a/doc/src/Developer_unittest.rst +++ b/doc/src/Developer_unittest.rst @@ -180,19 +180,11 @@ discarded but by setting the verbose flag (via setting the ``TEST_ARGS`` environment variable, ``TEST_ARGS=-v``) it can be printed and used to understand why tests fail unexpectedly. -Another complexity of these tests stems from the need to capture -situations where LAMMPS will stop with an error, i.e. handle so-called -"death tests". Here the LAMMPS code will operate differently depending -on whether it was configured to throw C++ exceptions on errors or call -either ``exit()`` or ``MPI_Abort()``. In the latter case, the test code -also needs to detect whether LAMMPS was compiled with the OpenMPI -library, as OpenMPI is **only** compatible the death test options of the -GoogleTest library when C++ exceptions are enabled; otherwise those -"death tests" must be skipped to avoid reporting bogus failures. The -specifics of this step are implemented in the ``TEST_FAILURE()`` -macro. These tests operate by capturing the screen output when executing -the failing command and then comparing that with a provided regular -expression string pattern. Example: +The specifics of so-called "death tests", i.e. conditions where LAMMPS +should fail and throw an exception, are implemented in the +``TEST_FAILURE()`` macro. These tests operate by capturing the screen +output when executing the failing command and then comparing that with a +provided regular expression string pattern. Example: .. code-block:: c++ @@ -282,9 +274,7 @@ Tests for using the Fortran module are in the ``unittest/fortran`` folder. Since they are also using the GoogleTest library, they require to also implement test wrappers in C++ that will call fortran functions which provide a C function interface through ISO_C_BINDINGS that will in -turn call the functions in the LAMMPS Fortran module. This part of the -unit tests is incomplete since the Fortran module it is based on is -incomplete as well. +turn call the functions in the LAMMPS Fortran module. Tests for the C++-style library interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -405,10 +395,10 @@ compare with the reference and also start from the data file. A final check will use multi-cutoff r-RESPA (if supported by the pair style) at a 1:1 split and compare to the Verlet results. These sets of tests are run with multiple test fixtures for accelerated styles (OPT, OPENMP, -INTEL) and for the latter two with 4 OpenMP threads enabled. For -these tests the relative error (epsilon) is lowered by a common factor -due to the additional numerical noise, but the tests are still comparing -to the same reference data. +INTEL, KOKKOS (OpenMP only)) and for the latter three with 4 OpenMP +threads enabled. For these tests the relative error (epsilon) is lowered +by a common factor due to the additional numerical noise, but the tests +are still comparing to the same reference data. Additional tests will check whether all listed extract keywords are supported and have the correct dimensionality and the final set of tests @@ -442,17 +432,19 @@ The ``test_pair_style`` tester is used with 4 categories of test inputs: pair style is defined, but the computation of the pair style contributions is disabled. -The ``test_bond_style`` and ``test_angle_style`` are set up in a similar -fashion and share support functions with the pair style tester. The final -group of tests in this section is for fix styles that add/manipulate forces -and velocities, e.g. for time integration, thermostats and more. +The ``test_bond_style``, ``test_angle_style``, ``test_dihedral_style``, and +``test_improper_style`` tester programs are set up in a similar fashion and +share support functions with the pair style tester. The final group of +tests in this section is for fix styles that add/manipulate forces and +velocities, e.g. for time integration, thermostats and more. -Adding a new test is easiest done by copying and modifying an existing test -for a style that is similar to one to be tested. The file name should follow -the naming conventions described above and after copying the file, the first -step is to replace the style names where needed. The coefficient values -do not have to be meaningful, just in a reasonable range for the given system. -It does not matter if some forces are large, for as long as they do not diverge. +Adding a new test is easiest done by copying and modifying an existing YAML +file for a style that is similar to one to be tested. The file name should +follow the naming conventions described above and after copying the file, +the first step is to replace the style names where needed. The coefficient +values do not have to be meaningful, just in a reasonable range for the +given system. It does not matter if some forces are large, for as long as +they do not diverge. The template input files define a large number of index variables at the top that can be modified inside the YAML file to control the behavior. For example, @@ -480,7 +472,7 @@ Note that this disables computing the kspace contribution, but still will run the setup. The "gewald" parameter should be set explicitly to speed up the run. For styles with long-range electrostatics, typically two tests are added one using the (slower) analytic approximation of the erfc() function and the other using -the tabulated coulomb, to test both code paths. The reference results in the YAML +the tabulated coulomb, to test both code paths. The reference results in the YAML files then should be compared manually, if they agree well enough within the limits of those two approximations. diff --git a/doc/src/Fortran.rst b/doc/src/Fortran.rst index 913c31842e..76fdff753a 100644 --- a/doc/src/Fortran.rst +++ b/doc/src/Fortran.rst @@ -3038,14 +3038,6 @@ Procedures Bound to the :f:type:`lammps` Derived Type This function can be used to query if an error inside of LAMMPS has thrown a :ref:`C++ exception `. - .. note:: - - This function will always report "no error" when the LAMMPS library - has been compiled without ``-DLAMMPS_EXCEPTIONS``, which turns fatal - errors aborting LAMMPS into C++ exceptions. You can use the library - function :cpp:func:`lammps_config_has_exceptions` to check if this is - the case. - :to: :cpp:func:`lammps_has_error` :r has_error: ``.TRUE.`` if there is an error. :rtype has_error: logical @@ -3068,13 +3060,6 @@ Procedures Bound to the :f:type:`lammps` Derived Type would happen only in a single MPI rank and thus may not be recoverable, as other MPI ranks may be waiting on the failing MPI rank(s) to send messages. - .. note:: - - This function will do nothing when the LAMMPS library has been - compiled without ``-DLAMMPS_EXCEPTIONS``, which turns errors aborting - LAMMPS into C++ exceptions. You can use the function - :f:func:`config_has_exceptions` to check whether this is the case. - :p character(len=\*) buffer: string buffer to copy the error message into :o integer(c_int) status [optional]: 1 when all ranks had the error, 2 on a single-rank error. diff --git a/doc/src/Howto.rst b/doc/src/Howto.rst index b1f5da8abc..85c98bd6de 100644 --- a/doc/src/Howto.rst +++ b/doc/src/Howto.rst @@ -101,6 +101,7 @@ Tutorials howto Howto_cmake Howto_github Howto_lammps_gui + Howto_moltemplate Howto_pylammps Howto_wsl diff --git a/doc/src/Howto_body.rst b/doc/src/Howto_body.rst index 88fa2d9c97..968e10edd8 100644 --- a/doc/src/Howto_body.rst +++ b/doc/src/Howto_body.rst @@ -170,9 +170,9 @@ with this body style to compute body/body and body/non-body interactions. The *rounded/polygon* body style represents body particles as a 2d polygon with a variable number of N vertices. This style can only be used for 2d models; see the :doc:`boundary ` command. See the -"pair_style body/rounded/polygon" page for a diagram of two -squares with rounded circles at the vertices. Special cases for N = 1 -(circle) and N = 2 (rod with rounded ends) can also be specified. +:doc:`pair_style body/rounded/polygon ` page for +a diagram of two squares with rounded circles at the vertices. Special cases +for N = 1 (circle) and N = 2 (rod with rounded ends) can also be specified. One use of this body style is for 2d discrete element models, as described in :ref:`Fraige `. @@ -335,7 +335,7 @@ faces are listed, so that M = 6 + 3\*N + 1. The integer line has three values: number of vertices (N), number of edges (E) and number of faces (F). The floating point line(s) list 6 moments of inertia followed by the coordinates of the N vertices (x1 -to zN) as 3N values, followed by 2N vertex indices corresponding to +to zN) as 3N values, followed by 2E vertex indices corresponding to the end points of the E edges, then 4\*F vertex indices defining F faces. The last value is the diameter value = the rounded diameter of the sphere that surrounds each vertex. The diameter value can be diff --git a/doc/src/Howto_lammps_gui.rst b/doc/src/Howto_lammps_gui.rst index 4b89af53b7..165ed84d95 100644 --- a/doc/src/Howto_lammps_gui.rst +++ b/doc/src/Howto_lammps_gui.rst @@ -1,111 +1,310 @@ Using the LAMMPS GUI ==================== -LAMMPS GUI is a simple graphical text editor that is linked to the -:ref:`LAMMPS C-library interface ` and thus can run LAMMPS -directly using the contents of the editor's text buffer as input. - -This is similar to what people traditionally would do to run LAMMPS: -using a regular text editor to edit the input and run the necessary -commands, possibly including the text editor, too, from a command line -terminal window. That is quite effective when running LAMMPS on -high-performance computing facilities and when you are very proficient -in using the command line. The main benefit of a GUI application is -that this integrates well with graphical desktop environments and many -basic tasks can be done directly from within the GUI without switching -to a text console or requiring external programs or scripts to extract -data from the generated output. This makes it easier for beginners to -get started running simple LAMMPS simulations and thus very suitable for -tutorials on LAMMPS. But also makes it easier to switch to a full -featured text editor and more sophisticated visualization and analysis -tools. +This document describes **LAMMPS GUI version 1.5**. ----- +LAMMPS GUI is a graphical text editor customized for editing LAMMPS +input files that is linked to the :ref:`LAMMPS library ` +and thus can run LAMMPS directly using the contents of the editor's text +buffer as input. It can retrieve and display information from LAMMPS +while it is running, display visualizations created with the :doc:`dump +image command `, and is adapted specifically for editing +LAMMPS input files through text completion and reformatting, and linking +to the online LAMMPS documentation for known LAMMPS commands and styles. + +.. note:: + + Pre-compiled, ready-to-use LAMMPS GUI executables for Linux (Ubuntu + 20.04LTS or later and compatible), macOS (version 11 aka Big Sur or + later), and Windows (version 10 or later) :ref:`are available + ` for download. They may be linked to a + development version of LAMMPS in case they need features not yet + available in a released version. Serial LAMMPS executables of the + same LAMMPS version are included as well. The source code for the + LAMMPS GUI is included in the LAMMPS source code and can be found in + the ``tools/lammps-gui`` folder. It can be compiled alongside LAMMPS + when :doc:`compiling with CMake `. + +LAMMPS GUI tries to provide an experience similar to what people +traditionally would do to run LAMMPS using a command line window: + +- editing inputs with a text editor +- run LAMMPS on the input with selected command line flags +- and then use or extract data from the created files and visualize it + +That procedure is quite effective for people proficient in using the +command line, as that allows them to use tools for the individual steps +which they are most comfortable with. It is often required when running +LAMMPS on high-performance computing facilities. + +The main benefit of using the LAMMPS GUI application instead is that +many basic tasks can be done directly from the GUI without switching to +a text console window or using external programs, let alone writing +scripts to extract data from the generated output. It also integrates +well with graphical desktop environments. + +LAMMPS GUI thus makes it easier for beginners to get started running +simple LAMMPS simulations. It is very suitable for tutorials on LAMMPS +since you only need to learn how to use a single program for most tasks +and thus time can be saved and people can focus on learning LAMMPS. It +is also designed to keep the barrier low when you decide to switch to a +full featured, standalone programming editor and more sophisticated +visualization and analysis tools and run LAMMPS from a command line. + The following text provides a detailed tour of the features and -functionality of the LAMMPS GUI. This document describes LAMMPS GUI -version 1.2. +functionality of the LAMMPS GUI. + +Suggestions for new features and reports of bugs are always welcome. +You can use the :doc:`the same channels as for LAMMPS itself +` for that purpose. + +----- Main window ----------- -When LAMMPS GUI starts, it will show the main window with either an -empty buffer, or have a file loaded. In the latter case it may look like -the following: +When LAMMPS GUI starts, it will show a main window with either an +empty buffer or the contents of a loaded file. In the latter case it +may look like the following: .. image:: JPG/lammps-gui-main.png :align: center :scale: 50% -There is the menu bar at the top, then the main editor buffer with the -input file contents in the center with line numbers on the left and the -input colored according to the LAMMPS input file syntax. At the bottom -is the status bar, which shows the status of LAMMPS execution on the -left ("Ready." when idle) and the current working directory on the -right. The size of the main window will be stored when exiting and -restored when starting again. The name of the current file in the -buffer is shown in the window title and the text `*modified*` is added -in case the buffer has modifications that are not yet saved to a file. +There is the typical menu bar at the top, then the main editor buffer, +and a status bar at the bottom. The input file contents are shown +with line numbers on the left and the input is colored according to +the LAMMPS input file syntax. The status bar shows the status of +LAMMPS execution on the left (e.g. "Ready." when idle) and the current +working directory on the right. The name of the current file in the +buffer is shown in the window title; the word `*modified*` is added if +the buffer edits have not yet saved to a file. The size of the main +window will be stored when exiting and restored when starting again. Opening Files ^^^^^^^^^^^^^ The LAMMPS GUI application will try to open the first command line -argument as input file, further arguments are ignored. When no -argument is given LAMMPS GUI will start with an empty buffer. -Files can also be opened via the ``File`` menu or by drag-and-drop -of a file from a file manager to the editor window. Only one -file can be open at a time, so opening a new file with a filled -buffer will close this buffer and in case the buffer has unsaved -modifications will ask to either cancel the load, discard the -changes or save them. - +argument as a LAMMPS input script, further arguments are ignored. +When no argument is given, LAMMPS GUI will start with an empty buffer. +Files can also be opened via the ``File`` menu or by drag-and-drop of +a file from a graphical file manager into the editor window. Only one +file can be open at a time, so opening a new file with a filled buffer +will close the buffer. If the buffer has unsaved modifications, you +will be asked to either cancel the operation, discard the changes, or +save them. Running LAMMPS ^^^^^^^^^^^^^^ From within the LAMMPS GUI main window LAMMPS can be started either from -the ``Run`` menu, by the hotkey `Ctrl-Enter` (`Command-Enter` on macOS), -or by clicking on the green button in the status bar. LAMMPS runs in a -separate thread, so the GUI stays responsive and thus it is able to -interact with the calculation and access its data. It is important to -note, that LAMMPS is using the contents of the input buffer for the run, -**not** the file it was read from. If there are unsaved changes in the -buffer, they *will* be used. +the ``Run`` menu using the ``Run LAMMPS from Editor Buffer`` entry, by +the keyboard shortcut `Ctrl-Enter` (`Command-Enter` on macOS), or by +clicking on the green "Run" button in the status bar. All of these +operations will cause LAMMPS to process the entire input script, which +may contain multiple :doc:`run ` or :doc:`minimize ` +commands. + +LAMMPS runs in a separate thread, so the GUI stays responsive and is +able to interact with the running calculation and access data it +produces. It is important to note that running LAMMPS this way is +using the contents of the input buffer for the run (via the +:cpp:func:`lammps_commands_string()` function of the LAMMPS C-library +interface), and **not** the original file it was read from. Thus, if +there are unsaved changes in the buffer, they *will* be used. As an +alternative, it is also possible to run LAMMPS by reading the contents +of a file from the ``Run LAMMPS from File`` menu entry or with +`Ctrl-Shift-Enter`. This option may be required in some rare cases +where the input uses some functionality that is not compatible with +running LAMMPS from a string buffer. For consistency, any unsaved +changes in the buffer must be either saved to the file or undone +before LAMMPS can be run from a file. .. image:: JPG/lammps-gui-running.png :align: center :scale: 75% -While LAMMPS is running, the contents of the status bar change: on the -left side there is a text indicating that LAMMPS is running, which will -contain the selected number of threads, if thread-parallel acceleration -was selected in the ``Preferences`` dialog. On the right side, a -progress bar is shown that displays the estimated progress on the -current :doc:`run command `. Additionally, two windows will open: -the log window with the captured screen output and the chart window with -a line graph created from the thermodynamic output of the run. +While LAMMPS is running, the contents of the status bar change. On +the left side there is a text indicating that LAMMPS is running, which +will also show the number of active threads, if thread-parallel +acceleration was selected in the ``Preferences`` dialog. On the right +side, a progress bar is shown that displays the estimated progress for +the current :doc:`run command `. -The run can be stopped cleanly by using either the ``Stop LAMMPS`` entry -in the ``Run`` menu, the hotkey `Ctrl-/` (`Command-/` on macOS), or -clicking on the red button in the status bar. This will cause that the -running LAMMPS process will complete the current iteration and then -stop. This is equivalent to the command :doc:`timer timeout 0 ` -and implemented by calling the :cpp:func:`lammps_force_timeout()` -function of the LAMMPS C-library interface. +Also, the line number of the currently executed command will be +highlighted in green. +.. image:: JPG/lammps-gui-run-highlight.png + :align: center + :scale: 75% + +If an error occurs (in the example below the command :doc:`label +