Merge branch release-2021
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 18 Dec 2020 07:23:07 +0000 (08:23 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 18 Dec 2020 07:41:23 +0000 (08:41 +0100)
Some reformatting changes needed for the difference in
.clang-format in the two branches

74 files changed:
CMakeLists.txt
admin/containers/buildall.sh
admin/containers/scripted_gmx_docker_builds.py
admin/containers/utility.py
admin/gitlab-ci/global.gitlab-ci.yml
admin/gitlab-ci/gromacs.gitlab-ci.yml
admin/gitlab-ci/python-gmxapi02.gitlab-ci.yml
admin/gitlab-ci/python-gmxapi03.gitlab-ci.yml
admin/gitlab-ci/sample_restraint.gitlab-ci.yml
api/CMakeLists.txt
api/nblib/gmxsetup.cpp
cmake/gmxCFlags.cmake
cmake/gmxDetectTargetArchitecture.cmake
cmake/gmxManageFujitsuSparc64.cmake
cmake/gmxManageSimd.cmake
cmake/gmxVersionInfo.cmake
docs/dev-manual/reportstyle.rst
docs/gmxapi/userguide/install.rst
docs/install-guide/index.rst
docs/reference-manual/algorithms/group-concept.rst
docs/reference-manual/functions/nonbonded-interactions.rst
docs/release-notes/2016/major/bugs-fixed.rst
docs/release-notes/2020/major/deprecated-functionality.rst
docs/release-notes/2021/major/bugs-fixed.rst
docs/release-notes/2021/major/deprecated-functionality.rst
docs/user-guide/mdp-options.rst
python_packaging/README.md
python_packaging/src/setup.py
python_packaging/src/test/pytest.ini
python_packaging/test/README.md [deleted file]
python_packaging/test/pytest.ini
src/external/boost/stl_interfaces/fwd.hpp
src/external/googletest/CMakeLists.txt
src/external/googletest/README.Gromacs
src/external/googletest/googlemock/CMakeLists.txt
src/external/googletest/googletest/CMakeLists.txt
src/gromacs/ewald/pme_load_balancing.cpp
src/gromacs/fileio/checkpoint.cpp
src/gromacs/fileio/tests/CMakeLists.txt
src/gromacs/fileio/tests/checkpoint.cpp
src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp
src/gromacs/math/tests/optimization.cpp
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/forcerec.h
src/gromacs/mdrun/runner.cpp
src/gromacs/mdrun/runner.h
src/gromacs/mdtypes/checkpointdata.cpp
src/gromacs/mdtypes/checkpointdata.h
src/gromacs/mdtypes/tests/checkpointdata.cpp
src/gromacs/modularsimulator/checkpointhelper.h
src/gromacs/modularsimulator/energydata.cpp
src/gromacs/modularsimulator/freeenergyperturbationdata.cpp
src/gromacs/modularsimulator/freeenergyperturbationdata.h
src/gromacs/modularsimulator/modularsimulator.cpp
src/gromacs/modularsimulator/modularsimulator.h
src/gromacs/modularsimulator/statepropagatordata.cpp
src/gromacs/modularsimulator/statepropagatordata.h
src/gromacs/nbnxm/benchmark/bench_setup.cpp
src/gromacs/nbnxm/cuda/nbnxm_cuda_kernel.cuh
src/gromacs/nbnxm/opencl/nbnxm_ocl_kernel.clh
src/gromacs/simd/impl_arm_neon/impl_arm_neon_simd_float.h
src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_simd_double.h
src/gromacs/simd/impl_arm_sve/impl_arm_sve_simd_double.h
src/gromacs/simd/impl_arm_sve/impl_arm_sve_simd_float.h
src/gromacs/timing/cyclecounter.cpp
src/gromacs/utility/any.h
src/gromacs/utility/baseversion.cpp
src/gromacs/utility/keyvaluetree.cpp
src/programs/CMakeLists.txt
src/programs/mdrun/tests/CMakeLists.txt
src/programs/mdrun/tests/checkpoint.cpp [new file with mode: 0644]
src/programs/mdrun/tests/exactcontinuation.cpp
src/programs/mdrun/tests/freeenergy.cpp
src/programs/mdrun/tests/simulator.cpp

index 945cacd0c9ec6fa879afeefa200e8b93ccd7fa85..cb6a6d15cffa48eaf9a1b6084c891103a695d052 100644 (file)
@@ -510,6 +510,10 @@ if (GMX_HWLOC)
         message(FATAL_ERROR "HWLOC package support required, but not found.")
     endif()
 
+    if (HWLOC_VERSION VERSION_LESS "2")
+        message(STATUS "Support for hwloc versions 1.x is deprecated")
+    endif()
+
     set(HWLOC_FIND_QUIETLY_AFTER_FIRST_RUN TRUE CACHE INTERNAL "Be quiet during future attempts to find HWLOC")
 endif()
 
@@ -573,6 +577,9 @@ if(GMX_GPU)
     if(${_gmx_gpu_uppercase} STREQUAL "CUDA")
         include(gmxManageCuda)
     elseif(${_gmx_gpu_uppercase} STREQUAL "OPENCL")
+        message(STATUS "GPU support with OpenCL is deprecated. It is still fully supported (and " 
+            "recommended for AMD and Intel GPUs). It may be replaced by different approaches in "
+            "future releases of GROMACS.")
         include(gmxManageOpenCL)
     elseif(${_gmx_gpu_uppercase} STREQUAL "SYCL")
         include(gmxManageSYCL)
index c36b07de165716eb17887c3e2fd8966b0acb4104..ba8759ee64b4c11ddba9179a968132fea1098354 100644 (file)
@@ -9,14 +9,16 @@ SCRIPT=$PWD/scripted_gmx_docker_builds.py
 # images needed, because the same one can test library,
 # thread and no MPI configurations.
 
+args[${#args[@]}]="--gcc 10 --clfft --mpi openmpi --ubuntu 20.04"
+args[${#args[@]}]="--gcc 9 --clfft --mpi openmpi"
 args[${#args[@]}]="--gcc 8 --cuda 11.0 --clfft --mpi openmpi"
-args[${#args[@]}]="--gcc 7 --clfft --mpi openmpi --ubuntu 18.04"
+args[${#args[@]}]="--gcc 7 --cuda 10.2 --clfft --mpi openmpi --ubuntu 18.04"
 args[${#args[@]}]="--llvm 8 --tsan"
 args[${#args[@]}]="--llvm 8 --cuda 10.0 --clfft --mpi openmpi"
 args[${#args[@]}]="--llvm 8 --cuda 10.1 --clfft --mpi openmpi"
 args[${#args[@]}]="--llvm 8 --cuda 11.0 --clfft --mpi openmpi"
 args[${#args[@]}]="--llvm 9 --clfft --mpi openmpi --ubuntu 18.04"
-args[${#args[@]}]="--oneapi 2021.1-beta09"
+args[${#args[@]}]="--oneapi 2021.1.1"
 args[${#args[@]}]="--llvm --doxygen"
 
 echo "Building the following images."
index 1b820805bdce2683f03e6fb535d1705fa76a237e..2e3bb6a1e26fedb20314bd816a23c8d9b834fda7 100755 (executable)
@@ -347,7 +347,7 @@ def add_oneapi_compiler_build_stage(input_args, output_stages: typing.Mapping[st
         apt_keys=['https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB'],
         apt_repositories=['deb https://apt.repos.intel.com/oneapi all main'],
         # Add minimal packages (not the whole HPC toolkit!)
-        ospackages=['intel-oneapi-dpcpp-cpp-compiler-pro-{}'.format(version),
+        ospackages=['intel-oneapi-dpcpp-cpp-{}'.format(version),
             'intel-oneapi-openmp-{}'.format(version),
             'intel-oneapi-mkl-{}'.format(version),
             'intel-oneapi-mkl-devel-{}'.format(version)]
index 66d8af6fd320645008cdf145c8e1220204272f13..046a8982452961fefa37460de0d1707889fa9c1f 100644 (file)
@@ -104,7 +104,7 @@ compiler_group.add_argument('--icc', type=int, nargs='?', const=19, default=None
 # oneAPI makes an official release. Also, the resulting container is a mix
 # of packages with different betaXY version numbers, which hopefully works and
 # is what Intel intends...
-compiler_group.add_argument('--oneapi', type=str, nargs='?', const="2021.1-beta09", default=None,
+compiler_group.add_argument('--oneapi', type=str, nargs='?', const="2021.1.1", default=None,
                             help='Select Intel oneAPI package version.')
 
 linux_group = parser.add_mutually_exclusive_group()
index 2463fa96b43269894b04ab2cc947fa9171e4f116..ffa7d3a21077c62102ffb95d60a0120fe67c7dda 100644 (file)
     - mkdir -p ccache
     - export CCACHE_BASEDIR=${PWD}
     - export CCACHE_DIR=${PWD}/ccache
+
+# Base definition for using the classic Intel compiler
+.use-icc-oneapi:base:
+  variables:
+    CMAKE_COMPILER_SCRIPT: -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc #-DCMAKE_PREFIX_PATH=/opt/intel/oneapi/compiler/latest/linux
+    CMAKE_EXTRA_OPTIONS: -DGMX_FFT_LIBRARY=mkl
+  before_script:
+    # Necessary to override gitlab default 'set -e' which breaks Intel's
+    # setvar.sh script
+    - set +e
+    - source /opt/intel/oneapi/setvars.sh
+    - set -e
+    - mkdir -p ccache
+#    - export CCACHE_BASEDIR=${PWD}
+#    - export CCACHE_DIR=${PWD}/ccache
index 939b51142de68461cbb6563f1d59f6281b1f45dc..b55d9fd323e63939c4701e9311d547dcca35d54f 100644 (file)
@@ -220,18 +220,18 @@ simple-build:
 
 # Templates for configuration stage
 
-gromacs:gcc-7:configure:
+gromacs:gcc-10:configure:
   extends:
     - .gromacs:base:configure
     - .use-gcc:base
     - .use-opencl
     - .rules:merge-and-post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
   variables:
     CMAKE: /usr/local/cmake-3.13.0/bin/cmake
     CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=AVX2_256"
     CMAKE_EXTRA_OPTIONS: "-DGMX_EXTERNAL_CLFFT=ON -DGMX_INSTALL_LEGACY_API=ON"
-    COMPILER_MAJOR_VERSION: 7
+    COMPILER_MAJOR_VERSION: 10
 
 gromacs:clang-8-cuda-10.0:configure:
   extends:
@@ -247,17 +247,17 @@ gromacs:clang-8-cuda-10.0:configure:
     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
     COMPILER_MAJOR_VERSION: 8
 
-gromacs:gcc-8-cuda-11.0:configure:
+gromacs:gcc-7-cuda-10.2:configure:
   extends:
     - .gromacs:base:configure
     - .use-gcc:base
     - .use-cuda
     - .rules:merge-and-post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-8-cuda-11.0
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-cuda-10.2
   variables:
     CMAKE: /usr/local/cmake-3.15.7/bin/cmake
     CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=SSE4.1"
-    COMPILER_MAJOR_VERSION: 8
+    COMPILER_MAJOR_VERSION: 7
 
 gromacs:gcc-8-cuda-11.0:configureMPI:
   extends:
@@ -283,6 +283,16 @@ gromacs:clang-TSAN:configure:
     COMPILER_MAJOR_VERSION: 8
     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=TSAN"
 
+gromacs:icc-2021.1:configure:
+  extends:
+   - .gromacs:base:configure
+   - .use-icc-oneapi:base
+   - .rules:merge-and-post-merge-acceptance
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
+  variables:
+    CMAKE: /usr/local/cmake-3.17.2/bin/cmake
+    COMPILER_MAJOR_VERSION: 2021
+
 gromacs:clang-8:configure:
   extends:
     - .gromacs:base:configure
@@ -327,24 +337,24 @@ gromacs:clang-ASAN:configure:
     COMPILER_MAJOR_VERSION: 8
     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=ASAN"
 
-gromacs:oneapi-2021.1-beta09-opencl:configure:
+gromacs:oneapi-2021.1.1-opencl:configure:
   extends:
    - .gromacs:base:configure
    - .use-oneapi:base
    - .use-opencl
    - .rules:merge-requests
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   variables:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
     COMPILER_MAJOR_VERSION: 2021
 
-gromacs:oneapi-2021.1-beta09-sycl:configure:
+gromacs:oneapi-2021.1.1-sycl:configure:
   extends:
    - .gromacs:base:configure
    - .use-oneapi:base
    - .use-sycl
    - .rules:merge-and-post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   variables:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
     COMPILER_MAJOR_VERSION: 2021
@@ -380,17 +390,16 @@ gromacs:gcc-8-cuda-11.0:release:configure:
     - regressiontests:package
     - prepare-release-version
 
-gromacs:gcc-7:release:configure:
+gromacs:gcc-9:release:configure:
   extends:
     - .gromacs:base:release:configure
     - .use-gcc:base
     - .use-opencl
     - .rules:nightly-only-for-release
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-9
   variables:
     CMAKE: /usr/local/cmake-3.13.0/bin/cmake
-    COMPILER_MAJOR_VERSION: 7
-    CMAKE_EXTRA_OPTIONS: "-DGMX_EXTERNAL_CLFFT=ON"
+    COMPILER_MAJOR_VERSION: 9
     RELEASE_BUILD_DIR: release-builds-gcc
     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=RelWithAssert"
   dependencies:
@@ -428,13 +437,13 @@ gromacs:clang-8-cuda-10.1:release:configure:
     RELEASE_BUILD_DIR: release-builds-clang
     CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=RelWithAssert"
 
-gromacs:oneapi-2021.1-beta09-opencl:release:configure:
+gromacs:oneapi-2021.1.1-opencl:release:configure:
   extends:
    - .gromacs:base:release:configure
    - .use-oneapi:base
    - .use-opencl
    - .rules:nightly-only-for-release
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   variables:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
     COMPILER_MAJOR_VERSION: 2021
@@ -478,18 +487,18 @@ gromacs:oneapi-2021.1-beta09-opencl:release:configure:
     paths:
       - $BUILD_DIR/scan_html
 
-gromacs:gcc-7:build:
+gromacs:gcc-10:build:
   extends:
     - .variables:default
     - .gromacs:base:build
     - .before_script:default
     - .use-ccache
     - .rules:merge-and-post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
   variables:
     CMAKE: /usr/local/cmake-3.13.0/bin/cmake
   needs:
-    - job: gromacs:gcc-7:configure
+    - job: gromacs:gcc-10:configure
 
 gromacs:clang-8-cuda-10.0:build:
   extends:
@@ -504,18 +513,18 @@ gromacs:clang-8-cuda-10.0:build:
   needs:
     - job: gromacs:clang-8-cuda-10.0:configure
 
-gromacs:gcc-8-cuda-11.0:build:
+gromacs:gcc-7-cuda-10.2:build:
   extends:
     - .variables:default
     - .gromacs:base:build
     - .before_script:default
     - .use-ccache
     - .rules:merge-and-post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-8-cuda-11.0
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-cuda-10.2
   variables:
     CMAKE: /usr/local/cmake-3.15.7/bin/cmake
   needs:
-    - job: gromacs:gcc-8-cuda-11.0:configure
+    - job: gromacs:gcc-7-cuda-10.2:configure
 
 gromacs:gcc-8-cuda-11.0:buildMPI:
   extends:
@@ -543,6 +552,18 @@ gromacs:clang-TSAN:build:
   needs:
     - job: gromacs:clang-TSAN:configure
 
+gromacs:icc-2021.1:build:
+  extends:
+    - .variables:default
+    - .gromacs:base:build
+    - .use-icc-oneapi:base
+    - .rules:post-merge-acceptance
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
+  variables:
+    CMAKE: /usr/local/cmake-3.17.2/bin/cmake
+  needs:
+    - job: gromacs:icc-2021.1:configure
+
 gromacs:clang-ASAN:build:
   extends:
     - .variables:default
@@ -599,31 +620,31 @@ gromacs:clang-8:build:
   needs:
     - job: gromacs:clang-8:configure
 
-gromacs:oneapi-2021.1-beta09-opencl:build:
+gromacs:oneapi-2021.1.1-opencl:build:
   extends:
     - .variables:default
     - .gromacs:base:build
     - .use-ccache
     - .use-oneapi:base
     - .rules:merge-requests
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   variables:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
   needs:
-    - job: gromacs:oneapi-2021.1-beta09-opencl:configure
+    - job: gromacs:oneapi-2021.1.1-opencl:configure
 
-gromacs:oneapi-2021.1-beta09-sycl:build:
+gromacs:oneapi-2021.1.1-sycl:build:
   extends:
     - .variables:default
     - .gromacs:base:build
     - .use-ccache
     - .use-oneapi:base
     - .rules:merge-and-post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   variables:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
   needs:
-    - job: gromacs:oneapi-2021.1-beta09-sycl:configure
+    - job: gromacs:oneapi-2021.1.1-sycl:configure
 
 gromacs:clang-9-mpi:build:
   extends:
@@ -653,7 +674,7 @@ gromacs:gcc-8-cuda-11.0:release:build:
   needs:
     - job: gromacs:gcc-8-cuda-11.0:release:configure
 
-gromacs:gcc-7:release:build:
+gromacs:gcc-9:release:build:
   extends:
     - .variables:default
     - .gromacs:base:build
@@ -664,9 +685,9 @@ gromacs:gcc-7:release:build:
   variables:
     CMAKE: /usr/local/cmake-3.13.0/bin/cmake
     BUILD_DIR: release-builds-gcc
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-9
   needs:
-    - job: gromacs:gcc-7:release:configure
+    - job: gromacs:gcc-9:release:configure
 
 gromacs:clang-9:release:build:
   extends:
@@ -697,7 +718,7 @@ gromacs:clang-8-cuda-10.1:release:build:
   needs:
     - job: gromacs:clang-8-cuda-10.1:release:configure
 
-gromacs:oneapi-2021.1-beta09-opencl:release:build:
+gromacs:oneapi-2021.1.1-opencl:release:build:
   extends:
     - .variables:default
     - .gromacs:base:build
@@ -710,9 +731,9 @@ gromacs:oneapi-2021.1-beta09-opencl:release:build:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
     BUILD_DIR: release-builds-oneapi
     COMPILER_MAJOR_VERSION: 2021
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   needs:
-    - job: gromacs:oneapi-2021.1-beta09-opencl:release:configure
+    - job: gromacs:oneapi-2021.1.1-opencl:release:configure
 
 # Jobs running during test stage
 
@@ -794,11 +815,11 @@ gromacs:oneapi-2021.1-beta09-opencl:release:build:
     when: always
     expire_in: 1 week
 
-gromacs:gcc-7:test:
+gromacs:gcc-10:test:
   extends:
     - .gromacs:base:test
     - .rules:merge-requests
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
   variables:
     CMAKE: /usr/local/cmake-3.13.0/bin/cmake
     KUBERNETES_EXTENDED_RESOURCE_NAME: "amd.com/gpu"
@@ -807,7 +828,7 @@ gromacs:gcc-7:test:
   tags:
     - k8s-scilifelab
   needs:
-    - job: gromacs:gcc-7:build
+    - job: gromacs:gcc-10:build
 
 gromacs:clang-8-cuda-10.0:test:
   extends:
@@ -823,11 +844,11 @@ gromacs:clang-8-cuda-10.0:test:
   needs:
     - job: gromacs:clang-8-cuda-10.0:build
 
-gromacs:gcc-8-cuda-11.0:test:
+gromacs:gcc-7-cuda-10.2:test:
   extends:
     - .gromacs:base:test
     - .rules:merge-requests
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-8-cuda-11.0
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-cuda-10.2
   variables:
     CMAKE: /usr/local/cmake-3.15.7/bin/cmake
     KUBERNETES_EXTENDED_RESOURCE_NAME: "nvidia.com/gpu"
@@ -835,13 +856,13 @@ gromacs:gcc-8-cuda-11.0:test:
   tags:
     - k8s-scilifelab
   needs:
-    - job: gromacs:gcc-8-cuda-11.0:build
+    - job: gromacs:gcc-7-cuda-10.2:build
 
-gromacs:gcc-8-cuda-11.0:test-gpucommupd:
+gromacs:gcc-8-cuda-10.2:test-gpucommupd:
   extends:
     - .gromacs:base:test
     - .rules:post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-8-cuda-11.0
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-cuda-10.2
   variables:
     CMAKE: /usr/local/cmake-3.15.7/bin/cmake
     KUBERNETES_EXTENDED_RESOURCE_NAME: "nvidia.com/gpu"
@@ -852,7 +873,7 @@ gromacs:gcc-8-cuda-11.0:test-gpucommupd:
   tags:
     - k8s-scilifelab
   needs:
-    - job: gromacs:gcc-8-cuda-11.0:build
+    - job: gromacs:gcc-7-cuda-10.2:build
 
 gromacs:clang-8:test:
   extends:
@@ -872,6 +893,17 @@ gromacs:clang-TSAN:test:
   needs:
     - job: gromacs:clang-TSAN:build
 
+gromacs:icc-2021.1:test:
+  extends:
+    - .gromacs:base:test
+    - .use-icc-oneapi:base
+    - .rules:post-merge-acceptance
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
+  variables:
+    CMAKE: /usr/local/cmake-3.17.2/bin/cmake
+  needs:
+    - job: gromacs:icc-2021.1:build
+
 gromacs:clang-ASAN:test:
   extends:
     - .gromacs:base:test
@@ -899,27 +931,27 @@ gromacs:clang-UBSAN:test:
   needs:
     - job: gromacs:clang-UBSAN:build
 
-gromacs:oneapi-2021.1-beta09-opencl:test:
+gromacs:oneapi-2021.1.1-opencl:test:
   extends:
     - .gromacs:base:test
     - .use-oneapi:base
     - .rules:merge-requests
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   variables:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
   needs:
-    - job: gromacs:oneapi-2021.1-beta09-opencl:build
+    - job: gromacs:oneapi-2021.1.1-opencl:build
 
-gromacs:oneapi-2021.1-beta09-sycl:test:
+gromacs:oneapi-2021.1.1-sycl:test:
   extends:
     - .gromacs:base:test
     - .use-oneapi:base
     - .rules:post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   variables:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
   needs:
-    - job: gromacs:oneapi-2021.1-beta09-sycl:build
+    - job: gromacs:oneapi-2021.1.1-sycl:build
 
 gromacs:clang-9-mpi:test:
   extends:
@@ -933,11 +965,11 @@ gromacs:clang-9-mpi:test:
   needs:
     - job: gromacs:clang-9-mpi:build
 
-gromacs:gcc-7:regressiontest:
+gromacs:gcc-10:regressiontest:
   extends:
     - .gromacs:base:regressiontest
     - .rules:post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
   variables:
     CMAKE: /usr/local/cmake-3.13.0/bin/cmake
     KUBERNETES_EXTENDED_RESOURCE_NAME: "amd.com/gpu"
@@ -949,7 +981,7 @@ gromacs:gcc-7:regressiontest:
   tags:
     - k8s-scilifelab
   needs:
-    - job: gromacs:gcc-7:build
+    - job: gromacs:gcc-10:build
     - job: regressiontests:prepare
 
 gromacs:clang-8-cuda-10.0:regressiontest:
@@ -971,11 +1003,11 @@ gromacs:clang-8-cuda-10.0:regressiontest:
     - job: regressiontests:prepare
 
 
-gromacs:gcc-8-cuda-11.0:regressiontest:
+gromacs:gcc-7-cuda-10.2:regressiontest:
   extends:
     - .gromacs:base:regressiontest
     - .rules:merge-requests
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-8-cuda-11.0
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-cuda-10.2
   variables:
     CMAKE: /usr/local/cmake-3.15.7/bin/cmake
     KUBERNETES_EXTENDED_RESOURCE_NAME: "nvidia.com/gpu"
@@ -986,14 +1018,14 @@ gromacs:gcc-8-cuda-11.0:regressiontest:
   tags:
     - k8s-scilifelab
   needs:
-    - job: gromacs:gcc-8-cuda-11.0:build
+    - job: gromacs:gcc-7-cuda-10.2:build
     - job: regressiontests:prepare
 
-gromacs:gcc-8-cuda-11.0:regressiontest-gpucommupd-tMPI:
+gromacs:gcc-7-cuda-10.2:regressiontest-gpucommupd-tMPI:
   extends:
     - .gromacs:base:regressiontest
     - .rules:post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-8-cuda-11.0
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-cuda-10.2
   variables:
     CMAKE: /usr/local/cmake-3.15.7/bin/cmake
     KUBERNETES_EXTENDED_RESOURCE_NAME: "nvidia.com/gpu"
@@ -1007,7 +1039,7 @@ gromacs:gcc-8-cuda-11.0:regressiontest-gpucommupd-tMPI:
   tags:
     - k8s-scilifelab
   needs:
-    - job: gromacs:gcc-8-cuda-11.0:build
+    - job: gromacs:gcc-7-cuda-10.2:build
     - job: regressiontests:prepare
   artifacts:
     paths:
@@ -1015,11 +1047,11 @@ gromacs:gcc-8-cuda-11.0:regressiontest-gpucommupd-tMPI:
     when: always
     expire_in: 1 week
 
-gromacs:gcc-8-cuda-11.0:regressiontest-upd-tMPI:
+gromacs:gcc-7-cuda-10.2:regressiontest-upd-tMPI:
   extends:
     - .gromacs:base:regressiontest
     - .rules:post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-8-cuda-11.0
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-cuda-10.2
   variables:
     KUBERNETES_EXTENDED_RESOURCE_NAME: "nvidia.com/gpu"
     KUBERNETES_EXTENDED_RESOURCE_LIMIT: 2
@@ -1030,7 +1062,7 @@ gromacs:gcc-8-cuda-11.0:regressiontest-upd-tMPI:
   tags:
     - k8s-scilifelab
   needs:
-    - job: gromacs:gcc-8-cuda-11.0:build
+    - job: gromacs:gcc-7-cuda-10.2:build
     - job: regressiontests:prepare
   artifacts:
     paths:
@@ -1089,6 +1121,18 @@ gromacs:clang-TSAN:regressiontest:
     - job: gromacs:clang-TSAN:build
     - job: regressiontests:prepare
 
+gromacs:icc-2021.1:regressiontest:
+  extends:
+    - .gromacs:base:regressiontest
+    - .use-icc-oneapi:base
+    - .rules:post-merge-acceptance
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
+  variables:
+    CMAKE: /usr/local/cmake-3.17.2/bin/cmake
+  needs:
+    - job: gromacs:icc-2021.1:build
+    - job: regressiontests:prepare
+
 gromacs:clang-ASAN:regressiontest:
   extends:
     - .gromacs:base:regressiontest
@@ -1118,28 +1162,28 @@ gromacs:clang-9:regressiontest:
     - job: gromacs:clang-9-mpi:build
     - job: regressiontests:prepare
 
-gromacs:oneapi-2021.1-beta09-opencl:regressiontest:
+gromacs:oneapi-2021.1.1-opencl:regressiontest:
   extends:
     - .gromacs:base:regressiontest
     - .use-oneapi:base
     - .rules:merge-requests
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   variables:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
   needs:
-    - job: gromacs:oneapi-2021.1-beta09-opencl:build
+    - job: gromacs:oneapi-2021.1.1-opencl:build
     - job: regressiontests:prepare
 
-gromacs:oneapi-2021.1-beta09-sycl:regressiontest:
+gromacs:oneapi-2021.1.1-sycl:regressiontest:
   extends:
     - .gromacs:base:regressiontest
     - .use-oneapi:base
     - .rules:post-merge-acceptance
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   variables:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
   needs:
-    - job: gromacs:oneapi-2021.1-beta09-sycl:build
+    - job: gromacs:oneapi-2021.1.1-sycl:build
     - job: regressiontests:prepare
 
 gromacs:gcc-8-cuda-11.0:release:test:
@@ -1159,12 +1203,12 @@ gromacs:gcc-8-cuda-11.0:release:test:
     - job: gromacs:gcc-8-cuda-11.0:release:configure
     - job: gromacs:gcc-8-cuda-11.0:release:build
 
-gromacs:gcc-7:release:test:
+gromacs:gcc-9:release:test:
   extends:
     - .gromacs:base:test
     - .rules:nightly-only-for-release
   stage: release-tests
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-9
   variables:
     CMAKE: /usr/local/cmake-3.13.0/bin/cmake
     BUILD_DIR: release-builds-gcc
@@ -1174,8 +1218,8 @@ gromacs:gcc-7:release:test:
   tags:
     - k8s-scilifelab
   needs:
-    - job: gromacs:gcc-7:release:configure
-    - job: gromacs:gcc-7:release:build
+    - job: gromacs:gcc-9:release:configure
+    - job: gromacs:gcc-9:release:build
 
 gromacs:clang-9:release:test:
   extends:
@@ -1206,26 +1250,26 @@ gromacs:clang-8-cuda-10.1:release:test:
     - job: gromacs:clang-8-cuda-10.1:release:configure
     - job: gromacs:clang-8-cuda-10.1:release:build
 
-gromacs:oneapi-2021.1-beta09-opencl:release:test:
+gromacs:oneapi-2021.1.1-opencl:release:test:
   extends:
     - .gromacs:base:test
     - .use-oneapi:base
     - .rules:nightly-only-for-release
   stage: release-tests
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   variables:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
     BUILD_DIR: release-builds-oneapi
   needs:
-    - job: gromacs:oneapi-2021.1-beta09-opencl:release:configure
-    - job: gromacs:oneapi-2021.1-beta09-opencl:release:build
+    - job: gromacs:oneapi-2021.1.1-opencl:release:configure
+    - job: gromacs:oneapi-2021.1.1-opencl:release:build
 
-gromacs:gcc-7:release:regressiontest:
+gromacs:gcc-9:release:regressiontest:
   extends:
     - .gromacs:base:regressiontest
     - .rules:nightly-only-for-release
   stage: release-tests
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-9
   variables:
     CMAKE: /usr/local/cmake-3.13.0/bin/cmake
     BUILD_DIR: release-builds-gcc
@@ -1235,7 +1279,7 @@ gromacs:gcc-7:release:regressiontest:
   tags:
     - k8s-scilifelab
   needs:
-    - job: gromacs:gcc-7:release:build
+    - job: gromacs:gcc-9:release:build
     - job: regressiontests:package
 
 gromacs:clang-9:release:regressiontest:
@@ -1274,13 +1318,13 @@ gromacs:clang-8-cuda-10.1:release:regressiontest:
     - job: gromacs:clang-8-cuda-10.1:release:build
     - job: regressiontests:package
 
-gromacs:oneapi-2021.1-beta09-opencl:release:regressiontest:
+gromacs:oneapi-2021.1.1-opencl:release:regressiontest:
   extends:
     - .gromacs:base:regressiontest
     - .use-oneapi:base
     - .rules:nightly-only-for-release
   stage: release-tests
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1-beta09
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7-oneapi-2021.1.1
   variables:
     CMAKE: /usr/local/cmake-3.17.2/bin/cmake
     BUILD_DIR: release-builds-oneapi
@@ -1288,5 +1332,5 @@ gromacs:oneapi-2021.1-beta09-opencl:release:regressiontest:
     REGRESSIONTEST_TOTAL_RANK_NUMBER: 2
     REGRESSIONTEST_OMP_RANK_NUMBER: 1
   needs:
-    - job: gromacs:oneapi-2021.1-beta09-opencl:release:build
+    - job: gromacs:oneapi-2021.1.1-opencl:release:build
     - job: regressiontests:package
index 8f0588cdb6ac220337345e214ed16c22dd8fbc2b..fc267ecfa7e993db009f40ed381bf6662686e633 100644 (file)
@@ -2,11 +2,11 @@
 # Jobs to test gmxapi client (Python) packages
 #
 
-.gmxapi-0.2:gcc-7:gmx2021:
+.gmxapi-0.2:gcc-10:gmx2021:
   extends:
     - .variables:default
     - .use-clang:base
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
   stage: test
   variables:
     KUBERNETES_CPU_LIMIT: 2
     - k8s-scilifelab
   # The dependency means we need to use the same tag restriction as upstream.
   needs:
-    - job: gromacs:gcc-7:build
+    - job: gromacs:gcc-10:build
       artifacts: true
 
-gmxapi-0.2:gcc-7:gmx2021:py-3.6.10:
+gmxapi-0.2:gcc-10:gmx2021:py-3.6.10:
   extends:
-    - .gmxapi-0.2:gcc-7:gmx2021
+    - .gmxapi-0.2:gcc-10:gmx2021
     - .rules:merge-requests:release-2021
   variables:
     VENVPATH: "/root/venv/py3.6"
     PY_VER: "3.6.10"
 
-gmxapi-0.2:gcc-7:gmx2021:py-3.7.7:
+gmxapi-0.2:gcc-10:gmx2021:py-3.7.7:
   extends:
-    - .gmxapi-0.2:gcc-7:gmx2021
+    - .gmxapi-0.2:gcc-10:gmx2021
     - .rules:merge-requests:release-2021
   variables:
     VENVPATH: "/root/venv/py3.7"
     PY_VER: "3.7.7"
 
-gmxapi-0.2:gcc-7:gmx2021:py-3.8.2:
+gmxapi-0.2:gcc-10:gmx2021:py-3.8.2:
   extends:
-    - .gmxapi-0.2:gcc-7:gmx2021
+    - .gmxapi-0.2:gcc-10:gmx2021
     - .rules:merge-requests:release-2021
   variables:
     VENVPATH: "/root/venv/py3.8"
index d88b74f4ceb3f18b82b3000e79aa8537d16bfd41..53a8605d01c98e0ee122e48135ca227aac530a47 100644 (file)
@@ -2,11 +2,11 @@
 # Jobs to test gmxapi client (Python) packages
 #
 
-.gmxapi-0.3:gcc-7:gmx2022:
+.gmxapi-0.3:gcc-10:gmx2022:
   extends:
     - .variables:default
     - .use-clang:base
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
   stage: test
   variables:
     KUBERNETES_CPU_LIMIT: 2
     - k8s-scilifelab
   # The dependency means we need to use the same tag restriction as upstream.
   needs:
-    - job: gromacs:gcc-7:build
+    - job: gromacs:gcc-10:build
       artifacts: true
 
-gmxapi-0.3:gcc-7:gmx2022:py-3.7.7:
+gmxapi-0.3:gcc-10:gmx2022:py-3.7.7:
   extends:
-    - .gmxapi-0.3:gcc-7:gmx2022
+    - .gmxapi-0.3:gcc-10:gmx2022
     - .rules:merge-requests:master
   variables:
     VENVPATH: "/root/venv/py3.7"
     PY_VER: "3.7.7"
 
-gmxapi-0.3:gcc-7:gmx2022:py-3.8.2:
+gmxapi-0.3:gcc-10:gmx2022:py-3.8.2:
   extends:
-    - .gmxapi-0.3:gcc-7:gmx2022
+    - .gmxapi-0.3:gcc-10:gmx2022
     - .rules:merge-requests:master
   variables:
     VENVPATH: "/root/venv/py3.8"
index 8926edddeee26383dc17c6eb032598bdbecea49c..454a079627f258339723bd0b0d17667491febab6 100644 (file)
@@ -1,9 +1,9 @@
 # Base job definition for sample_restraint tests against GROMACS 2021.
-.sample_restraint:gcc-7:gmx2021:
+.sample_restraint:gcc-10:gmx2021:
   extends:
     - .variables:default
     - .use-clang:base
-  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-gcc-7
+  image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-gcc-10
   stage: test
   variables:
     KUBERNETES_CPU_LIMIT: 2
     - k8s-scilifelab
   # The dependency means we need to use the same tag restriction as upstream.
   needs:
-    - job: gromacs:gcc-7:build
+    - job: gromacs:gcc-10:build
       artifacts: true
 
-sample_restraint:gcc-7:gmx2021:py-3.6.10:
+sample_restraint:gcc-10:gmx2021:py-3.6.10:
   extends:
-    - .sample_restraint:gcc-7:gmx2021
-    - .rules:merge-requests:master
+    - .sample_restraint:gcc-10:gmx2021
+    - .rules:merge-requests:release-2021
   variables:
     VENVPATH: "/root/venv/py3.6"
     PY_VER: "3.6.10"
 
-sample_restraint:gcc-7:gmx2021:py-3.7.7:
+sample_restraint:gcc-10:gmx2021:py-3.7.7:
   extends:
-    - .sample_restraint:gcc-7:gmx2021
-    - .rules:merge-requests:master
+    - .sample_restraint:gcc-10:gmx2021
+    - .rules:merge-requests:release-2021
   variables:
     VENVPATH: "/root/venv/py3.7"
     PY_VER: "3.7.7"
 
-sample_restraint:gcc-7:gmx2021:py-3.8.2:
+sample_restraint:gcc-10:gmx2021:py-3.8.2:
   extends:
-    - .sample_restraint:gcc-7:gmx2021
-    - .rules:merge-requests:master
+    - .sample_restraint:gcc-10:gmx2021
+    - .rules:merge-requests:release-2021
   variables:
     VENVPATH: "/root/venv/py3.8"
     PY_VER: "3.8.2"
index c71f607fe6ca29d73e2fcbd05b6d6dfdc8f6189f..69d44285d0224eb50a78fc9597a690b756ffb2ef 100644 (file)
@@ -51,10 +51,11 @@ if (GMXAPI)
 endif()
 
 # Activate targets NBLIB
-if(GMX_NATIVE_WINDOWS OR GMX_BUILD_MDRUN_ONLY)
+if(GMX_NATIVE_WINDOWS OR GMX_BUILD_MDRUN_ONLY OR NOT BUILD_SHARED_LIBS OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
     # NBLIB has not been tested in Microsoft environments.
     # NBLIB relies on libgromacs and is incompatible with an `mdrun`-only build.
     # NBLIB requires position-independent code
+    # NBLIB causes an ICE in icc 19.1.2.20200623
     set(_NBLIB_DEFAULT OFF)
 else()
     set(_NBLIB_DEFAULT ON)
index 52cbf0f0beb4bd2e278793fe605fac2a06872df0..0853099e7c73bc28a1d74084ae135924caf7935a 100644 (file)
@@ -285,7 +285,7 @@ void NbvSetupUtil::setupInteractionConst(const NBKernelOptions& options)
         }
         gmxForceCalculator_->interactionConst_->coulombEwaldTables =
                 std::make_unique<EwaldCorrectionTables>();
-        init_interaction_const_tables(nullptr, gmxForceCalculator_->interactionConst_.get(), 0);
+        init_interaction_const_tables(nullptr, gmxForceCalculator_->interactionConst_.get(), 0, 0);
     }
 }
 
index 7e42383db61c647f539891d59c27efd39be45300..287c56bbddf6eba764a69d9c9166b74c918438f1 100644 (file)
@@ -316,7 +316,8 @@ GMX_TEST_CFLAG(CFLAGS_WARN "/W3;/wd161;/wd177;/wd411;/wd593;/wd981;/wd1418;/wd14
 # 444: destructor for base class ".." is not virtual
 # 869: was never referenced (false positives)
 #2282: unrecognized GCC pragma
-                GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3;-wd177;-wd280;-wd304;-wd383;-wd411;-wd444;-wd869;-wd981;-wd1418;-wd1572;-wd1599;-wd2259;-wd2547;-wd3280;-wd11074;-wd11076;-wd2282" GMXC_CXXFLAGS)
+#2621: attribute "unused" does not apply here
+                GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3;-wd177;-wd280;-wd304;-wd383;-wd411;-wd444;-wd869;-wd981;-wd1418;-wd1572;-wd1599;-wd2259;-wd2547;-wd2621;-wd3280;-wd11074;-wd11076;-wd2282" GMXC_CXXFLAGS)
             endif()
             GMX_TEST_CXXFLAG(CXXFLAGS_OPT "-ip;-funroll-all-loops;-alias-const;-ansi-alias;-no-prec-div;-fimf-domain-exclusion=14;-qoverride-limits" GMXC_CXXFLAGS_RELEASE)
             GMX_TEST_CXXFLAG(CXXFLAGS_DEBUG "-O0" GMXC_CXXFLAGS_DEBUG)
index 8b44c7dcb07039b8b54be03ce6460e992c32b79a..ad5734db7a6f211e1124f0112e3380e4b0da208a 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2013,2014,2016,2018,2019, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2016,2018,2019,2020, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -48,8 +48,14 @@ function(gmx_detect_target_architecture)
         try_compile(GMX_TARGET_MIC ${CMAKE_BINARY_DIR}
             "${CMAKE_SOURCE_DIR}/cmake/TestMIC.cpp")
     endif()
+    if (GMX_TARGET_MIC)
+        message(STATUS "The Intel MIC KNC target is deprecated")
+    endif()
     if (NOT DEFINED GMX_TARGET_FUJITSU_SPARC64)
         try_compile(GMX_TARGET_FUJITSU_SPARC64 ${CMAKE_BINARY_DIR}
             "${CMAKE_SOURCE_DIR}/cmake/TestFujitsuSparc64.cpp")
     endif()
+    if (GMX_TARGET_FUJITSU_SPARC64)
+        message(STATUS "The Fujitsu Sparc64 target is deprecated")
+    endif()
 endfunction()
index e0b705ceee1aa686b97c5d5a4a0ac88d281bf7b6..ac8ad950a5ba97572f5154b4cab85cefdb9071c4 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2020, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -34,7 +34,7 @@
 
 # Managing configuration for Fujitsu PrimeHPC Sparc64
 # For now this is mainly used for K computer.
-message(STATUS "Configuring for Fujitsu Sparc64")
+message(STATUS "Configuring for Fujitsu Sparc64 (deprecated)")
 
 set(BUILD_SHARED_LIBS OFF CACHE BOOL "Use static linking by default on Fujitsu Sparc64" FORCE)
 set(GMX_GPU OFF CACHE BOOL "Cannot do GPU acceleration on Fujitsu Sparc64" FORCE)
index b10e1a18f352e515cf079c5ea28fb407bebac68a..af870d4fbaaffea8d0458be57d211b2c80833a47 100644 (file)
@@ -178,10 +178,9 @@ elseif(GMX_SIMD_ACTIVE MATCHES "AVX2_")
     endif()
 
 elseif(GMX_SIMD_ACTIVE STREQUAL "MIC")
-
     # No flags needed. Not testing.
     set(GMX_SIMD_X86_MIC 1)
-    set(SIMD_STATUS_MESSAGE "Enabling MIC (Xeon Phi) SIMD instructions without special flags.")
+    set(SIMD_STATUS_MESSAGE "Enabling MIC (Xeon Phi) SIMD instructions without special flags. This SIMD support is deprecated.")
 
 elseif(GMX_SIMD_ACTIVE STREQUAL "AVX_512")
 
@@ -230,7 +229,7 @@ elseif(GMX_SIMD_ACTIVE STREQUAL "ARM_NEON")
     string(REPLACE " " ";" SIMD_C_FLAGS ${SIMD_ARM_NEON_C_FLAGS})
     string(REPLACE " " ";" SIMD_CXX_FLAGS ${SIMD_ARM_NEON_CXX_FLAGS})
     set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
-    set(SIMD_STATUS_MESSAGE "Enabling 32-bit ARM NEON SIMD instructions using CXX flags: ${SIMD_ARM_NEON_CXX_FLAGS}")
+    set(SIMD_STATUS_MESSAGE "Enabling 32-bit ARM NEON SIMD instructions using CXX flags: ${SIMD_ARM_NEON_CXX_FLAGS}. This SIMD support is deprecated.")
 
 elseif(GMX_SIMD_ACTIVE STREQUAL "ARM_NEON_ASIMD")
 
@@ -299,7 +298,7 @@ elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_VMX")
     string(REPLACE " " ";" SIMD_C_FLAGS ${SIMD_IBM_VMX_C_FLAGS})
     string(REPLACE " " ";" SIMD_CXX_FLAGS ${SIMD_IBM_VMX_CXX_FLAGS})
     set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
-    set(SIMD_STATUS_MESSAGE "Enabling IBM VMX SIMD instructions using CXX flags: ${SIMD_IBM_VMX_CXX_FLAGS}")
+    set(SIMD_STATUS_MESSAGE "Enabling IBM VMX SIMD instructions using CXX flags: ${SIMD_IBM_VMX_CXX_FLAGS}. This SIMD support is deprecated.")
 
 elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_VSX")
 
@@ -333,7 +332,7 @@ elseif(GMX_SIMD_ACTIVE STREQUAL "SPARC64_HPC_ACE")
     # Note that GMX_RELAXED_DOUBLE_PRECISION is enabled by default in the top-level CMakeLists.txt
 
     set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
-    set(SIMD_STATUS_MESSAGE "Enabling Sparc64 HPC-ACE SIMD instructions without special flags.")
+    set(SIMD_STATUS_MESSAGE "Enabling Sparc64 HPC-ACE SIMD instructions without special flags. This SIMD support is deprecated.")
 
 elseif(GMX_SIMD_ACTIVE STREQUAL "REFERENCE")
 
index 73295bdd962bacf31f8b85ed8f08f3d67a14c45c..99ed210e4b2efd43f67c77b4158b4711306fab92 100644 (file)
@@ -263,7 +263,7 @@ set(REGRESSIONTEST_BRANCH "master")
 # build the regressiontests tarball with all the right naming. The
 # naming affects the md5sum that has to go here, and if it isn't right
 # release workflow will report a failure.
-set(REGRESSIONTEST_MD5SUM "168992305e10b44c58cd22130558e5fc" CACHE INTERNAL "MD5 sum of the regressiontests tarball for this GROMACS version")
+set(REGRESSIONTEST_MD5SUM "ca12c40c20575df76b1b8b1a351cb7b0" CACHE INTERNAL "MD5 sum of the regressiontests tarball for this GROMACS version")
 
 math(EXPR GMX_VERSION_NUMERIC
      "${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_PATCH}")
index 07f11f72041a82fbfd9e5182bc66d9cb6f6f0818..ab10d377b770ff20fc2ad0f06fa80db0ae68081c 100644 (file)
@@ -34,7 +34,8 @@ does not result in any warnings or errors in itself. If your example generates e
 not be considered as *real*, or at the minimum it will be much harder to analyse to find the actual issue.
 
 
-If your inputs are sensitive, then it is possible to create private `issues <issue tracker>`_
+If your inputs are sensitive, then it is possible to create private
+`issues <https://gitlab.com/gromacs/gromacs/-/issues/>`_
 so that the developer team can have access to solve the problem, while preventing widespread
 visibility on the internet.
 
index 65d80d88186fed2d510dc680aabc4cf649662d8e..7e96486f7f45f467a73cdbcfebaef108d0599422 100644 (file)
@@ -196,16 +196,21 @@ Documentation build requirements
 
 See :ref:`gmxapi_package_documentation`
 
-.. _testing_requirements:
+.. _testing requirements:
 
 Testing requirements
 --------------------
 
+Note that the test suite is only available in the GROMACS source tree.
+(It is not part of the installed package.)
+Acquire the GROMACS sources with :command:`git` or by downloading an archive, as documented elsewhere.
+
 Testing is performed with `pytest <https://docs.pytest.org/en/latest/>`_.
-Tests also require numpy_.
-You can probably install both with pip_::
 
-    pip install pytest numpy
+:file:`python_packaging/requirements-test.txt` lists additional requirements for testing.
+With pip_::
+
+    pip install -r python_packaging/requirements-test.txt
 
 To test the full functionality also requires an MPI parallel environment.
 You will need the mpi4py_ Python package and an MPI launcher
@@ -514,6 +519,20 @@ https://hub.docker.com/r/gmxapi/docs for more information.
     Document sample_restraint package. Reference issue
     `3027 <https://gitlab.com/gromacs/gromacs/-/issues/3027>`_
 
+Testing
+=======
+
+Note `testing requirements`_ above.
+
+After installing the :py:mod:`gmxapi` Python package,
+you can run the Python test suite from the GROMACS source tree.
+Example::
+
+    # Assuming you are in the root directory of the repository:
+    pytest python_packaging/src/test/
+
+Refer to :file:`python_packaging/README.md` for more detailed information.
+
 .. _gmxapi install troubleshooting:
 
 Troubleshooting
index 02c05b950e655234e7e942d34af48afad55b5c5c..420c40271c03abd56ae90dff70130582fc54292c 100644 (file)
@@ -967,13 +967,13 @@ supported by ``cmake`` (e.g. ``ninja``) also work well.
 Building only mdrun
 ~~~~~~~~~~~~~~~~~~~
 
-This is now supported with the ``cmake`` option
+This is now deprecated, but still supported with the ``cmake`` option
 ``-DGMX_BUILD_MDRUN_ONLY=ON``, which will build a different version of
-``libgromacs`` and the ``mdrun`` program.
-Naturally, now ``make install`` installs only those
-products. By default, mdrun-only builds will default to static linking
-against |Gromacs| libraries, because this is generally a good idea for
-the targets for which an mdrun-only build is desirable.
+``libgromacs`` and the ``mdrun`` program.  Naturally, now ``make
+install`` installs only those products. By default, mdrun-only builds
+will default to static linking against |Gromacs| libraries, because
+this is generally a good idea for the targets for which an mdrun-only
+build is desirable.
 
 Installing |Gromacs|
 ^^^^^^^^^^^^^^^^^^^^
@@ -1318,7 +1318,7 @@ a beta version of oneAPI containing Intel's compiler.
 For this testing, we use Ubuntu 18.04 or 20.04 operating system.
 Other compiler, library, and OS versions are tested less frequently.
 For details, you can have a look at the
-`continuous integration server used by GROMACS <gitlab>`_,
+`continuous integration server used by GROMACS <https://gitlab.com/gromacs/gromacs/>`_,
 which uses GitLab runner on a local k8s x86 cluster with NVIDIA and
 AMD GPU support.
 
index c9b363ce74021b53a3b73217de4fae4e0c6c0745..2df2655a2ee764314bccf5a35f5a1849f14461e3 100644 (file)
@@ -47,6 +47,7 @@ accelerate group
     an external force. This feature makes it possible to drive the
     system into a non-equilibrium state and enables the performance of
     non-equilibrium MD and hence to obtain transport properties.
+    (Deprecated)
 
 energy-monitor group
 
index b7669bce70f2af9343929bdd6c2f724786783009..a8183cd54c1dc0291b95d9deb1be5551bade939d 100644 (file)
@@ -47,7 +47,7 @@ cut-off distance.
 
 The force derived from this potential is:
 
-.. math:: \mathbf{F}_i(\mathbf{r}_{ij}) = \left( 12~\frac{C_{ij}^{(12)}}{{r_{ij}}^{13}} -
+.. math:: \mathbf{F}_i(\mathbf{r}_{ij}) = -\left( 12~\frac{C_{ij}^{(12)}}{{r_{ij}}^{13}} -
                                     6~\frac{C_{ij}^{(6)}}{{r_{ij}}^7} \right) {\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}}
           :label: eqnljforce
 
@@ -138,7 +138,7 @@ See also :numref:`Fig. %s <fig-coul>`, where
 
 The force derived from this potential is:
 
-.. math:: \mathbf{F}_i(\mathbf{r}_{ij}) = f \frac{q_i q_j}{{\varepsilon_r}{r_{ij}}^2}{\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}}
+.. math:: \mathbf{F}_i(\mathbf{r}_{ij}) = -f \frac{q_i q_j}{{\varepsilon_r}{r_{ij}}^2}{\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}}
           :label: eqnfcoul
 
 A plain Coulomb interaction should only be used without cut-off or when
@@ -197,7 +197,7 @@ modified interaction is plotted, and it is clear that the derivative
 with respect to :math:`{r_{ij}}` (= -force) goes to zero at the cut-off
 distance. The force derived from this potential reads:
 
-.. math:: \mathbf{F}_i(\mathbf{r}_{ij}) = f \frac{q_i q_j}{{\varepsilon_r}}\left[\frac{1}{{r_{ij}}^2} - 2 k_{rf}{r_{ij}}\right]{\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}}
+.. math:: \mathbf{F}_i(\mathbf{r}_{ij}) = -f \frac{q_i q_j}{{\varepsilon_r}}\left[\frac{1}{{r_{ij}}^2} - 2 k_{rf}{r_{ij}}\right]{\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}}
           :label: eqnfcrf
 
 The reaction-field correction should also be applied to all excluded
index 62108c17874a3bd41a767f8c22c534deca2fb44f..4ee485ec728a03fde3599eaa5dbc6518f47e3d5d 100644 (file)
@@ -160,7 +160,8 @@ These document fixes for issues that were identified as having been
 introduced into the release-2016 branch since it diverged from
 release-5-1. These will not appear in the final release notes, because
 no formal release is thought to have had the problem. Of course, the
-tracked `issues <issue tracker>`_ remain available should further discussion arise.
+tracked `issues <https://gitlab.com/gromacs/gromacs/-/issues/>`_
+remain available should further discussion arise.
 
 Fixed bug in v-rescale thermostat & replica exchange
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
index 7ffeaea3abd1e4a0c9ca158eda2f31e6715caed7..0c9e70c71f4d4f1e7acd284ed219c7d865cfde11 100644 (file)
@@ -6,9 +6,49 @@
    Also, please use the syntax :issue:`number` to reference issues on GitLab, without the
    a space between the colon and number!
 
+The core |Gromacs| team wants to let users and downstream developers
+know about impending changes so that disruption is minimized. Do get
+in touch if you feel something inappropriate is planned!
+
+Deprecated functionality often remains in |Gromacs| for a year or
+more, but this should not be relied upon.
+
 Changes anticipated to |Gromacs| 2020 functionality
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+``gmx mdrun -membed``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+The feature for embedding a protein in a membrane will be retained,
+but probably in a different form, such as ``gmx membed``.
+
+``gmx mdrun -rerun``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+The feature for computing potential energy quantities from a
+trajectory will be retained, but probably in a different form, such as
+``gmx rerun`` and ``gmx test-particle-insertion``.
+
+Integrator .mdp options will only contain dynamical integrators
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+Energy minimization will be accessed in a differt form, perhaps with
+``gmx minimize`` and interpret an .mdp field for which minimizer to
+use. Normal-mode analysis may be accessed with e.g. ``gmx
+normal-modes``. The command-line help for these tools will then
+be better able to document which functionality is supported when.
+
+Much functionality in ``trjconv``, ``editconf``, ``eneconv`` and ``trjcat``
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+The functionality in such tools is being separated to make it
+available in composable modules, that we plan to make available as
+simpler tools, and eventually via the GROMACS API that is under
+development.
+
+``gmx do_dssp`` to be replaced
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+This tool is deprecated, because it is problematic for some users to
+obtain and install a separate DSSP binary, so we plan to replace the
+implementation at some point with a native implementation, likely
+based upon xssp, and make it available under a new gmx tool name.
+
 Functionality deprecated in |Gromacs| 2020
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
index cd2f2c78b33bd140697889ff11b18d8a7e18c99c..5fec2401a9589292747a9c5a0df8cc60c85492c8 100644 (file)
@@ -25,6 +25,18 @@ H atoms in particular.
 
 :issue:`3469`
 
+Correct excluded perturbed interactions beyond the non-bonded cut-off distance
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+With free-energy calculations without coupling of intermolecular interactions,
+non-bonded pair interactions at distance longer than the cut-off distance can
+be excluded. These interactions would still have PME long-range contributions.
+The contributions are now removed. In addition, mdrun will stop with a fatal
+error when interactions beyond the pair-list cut-off are present.
+
+:issue:`3403`
+:issue:`3808`
+
 Corrected AWH initial histogram size
 """"""""""""""""""""""""""""""""""""
 
@@ -37,3 +49,11 @@ dimensions. The, now simplified, formula for the initial histogram size is
 given in the reference manual.
 
 :issue:`3751`
+
+Fixed LJ Ewald exclusions when used with cut-off electrostatics
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+The exclusion forces in CUDA and OpenCL kernels were computed incorrectly
+if LJ Ewald was used together with cut-off electrostatics.
+
+:issue:`3840`
index d2348ec3a97e5b6d0f1c4cda08c62c419d94a95b..b250914028dddb367f5f6844f9765485303a6894 100644 (file)
@@ -4,9 +4,165 @@
    Also, please use the syntax :issue:`number` to reference issues on GitLab, without the
    a space between the colon and number!
 
+The core |Gromacs| team wants to let users and downstream developers
+know about impending changes so that disruption is minimized. Do get
+in touch if you feel something inappropriate is planned!
+
+Deprecated functionality often remains in |Gromacs| for a year or
+more, but this should not be relied upon.
+
+.. Note to maintainers!
+   The sections below should general copy the contents from the previous major release,
+   except where appropriate when code or planning changes have happened.
+
 Changes anticipated to |Gromacs| 2021 functionality
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+``gmx mdrun -membed``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+The feature for embedding a protein in a membrane will be retained,
+but probably in a different form, such as ``gmx membed``.
+
+``gmx mdrun -rerun``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+The feature for computing potential energy quantities from a
+trajectory will be retained, but probably in a different form, such as
+``gmx rerun`` and ``gmx test-particle-insertion``.
+
+Integrator .mdp options will only contain dynamical integrators
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+Energy minimization will be accessed in a differt form, perhaps with
+``gmx minimize`` and interpret an .mdp field for which minimizer to
+use. Normal-mode analysis may be accessed with e.g. ``gmx
+normal-modes``. The command-line help for these tools will then
+be better able to document which functionality is supported when.
+
+Much functionality in ``trjconv``, ``editconf``, ``eneconv`` and ``trjcat``
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+The functionality in such tools is being separated to make it
+available in composable modules, that we plan to make available as
+simpler tools, and eventually via the GROMACS API that is under
+development.
+
+``gmx do_dssp`` to be replaced
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+This tool is deprecated, because it is problematic for some users to
+obtain and install a separate DSSP binary, so we plan to replace the
+implementation at some point with a native implementation, likely
+based upon xssp, and make it available under a new gmx tool name.
+
 Functionality deprecated in |Gromacs| 2021
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+OpenCL to be removed as a GPU framework
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+:issue:`3818` Work is underway for ports to AMD and Intel GPUs, and it
+is likely that those ports will not be based on the current |Gromacs|
+OpenCL port. Nvidia GPUs are targeted by the CUDA port, and no changes
+are expectd there. The core team can't maintain, test, and extend up
+to 4 ports with current resource levels. Since there are no prospects
+of an emerging GPU vendor in HPC needing OpenCL support, we will
+remove the OpenCL port once AMD and Intel support is established in
+other ways.
+
+Intel KNC (MIC) support
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+:issue:`3818` This architecture is nearly extinct in HPC. Note that
+KNL support will continue and is not affected by this deprecation.
+
+Sparc64 HPC ACE
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+This architecture is nearly extinct in HPC.
+
+Legacy SIMD architecture support
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+:issue:`3818` We occasionally need to extend the |Gromacs| SIMD
+framework, and so should slowly remove older architectures that are
+difficult or impossible to test. The following implementations are
+deprecated and will not support new functionality in future.
+
+* Power 7
+* ARMv7 (this platform was deprecated in |Gromacs| 2020)
+* x86 MIC (this platform was deprecated in |Gromacs| 2021)
+* Sparc64 HPC ACE  (this platform was deprecated in |Gromacs| 2021)
+
+The mdrun-only build of |Gromacs|
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+:issue:`3808` Before |Gromacs| had the ``gmx`` wrapper binary, the
+``mdrun`` binary could be built independently of the many other binary
+tools that were built by default. That was useful for installing on
+compute clusters because dependencies for ``mdrun`` were
+minimized. However, we now manage such dependencies better with CMake,
+and an mdrun-only build is no longer easier to build. The mdrun-only
+build is also harder to test, and introduces complexity into
+documenting |Gromacs| and teaching users to use it. So it is time to
+remove that build.
+
+Support for version 1 of the hardware locality library ``hwloc``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+:issue:`3818` Version 2 has been supported in |Gromacs| for several
+years. The capabilities of newer hardware and hardware-support APIs
+are of most interest for |Gromacs| moving forward, so we should
+minimize our testing work and encourage clusters to upgrade older
+``hwloc`` installations.
+
+Legacy API
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+:issue:`3818` The legacy installed headers have been deprecated for a
+while, however we wish to state more broadly that all headers found
+within the ``src`` directory tree of |Gromacs| are intended for
+internal consumption only, and are thus subject to change without
+notice. Further, the form and contents of the ``libgromacs`` library
+and related CMake targets may change as we move towards building APIs
+and supporting machinery that can be stable and supported in the long
+term.
+
+Constant-acceleration MD
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+:issue:`1354` This has been broken for many years, and will be removed
+as nobody has been found with interest to fix it.
+
+Functionality deprecated in |Gromacs| 2020
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Support for 32bit architectures
+"""""""""""""""""""""""""""""""
+:issue:`3252` There are no current or planned large scale resources using 32bit architectures,
+and we have no ability to properly test and evaluate them.
+
+Free-energy soft-core power 48
+""""""""""""""""""""""""""""""
+:issue:`3253` Free-energy soft-core power 48 is almost never used and is therefore deprecated.
+
+Support for Armv7
+"""""""""""""""""
+:issue:`2990` There are several issues with current code for the architecture, and we don't
+have the resources for support and fix issues related to it. As the architecture has no
+large HPC impact it is thus deprecated.
+
+Functionality deprecated in |Gromacs| 2019
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Generation of virtual sites to replace aromatic rings in standard residues
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+:issue:`3254` These are thought to produce artefacts under some circumstances
+(unpublished results), were never well tested, are not widely used,
+and we need to simplify pdb2gmx.
+
+Benchmarking options only available with ``gmx benchmark``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+:issue:`3255` Options such as ``-confout``, ``-resethway``, ``-resetstep`` are not
+intended for use by regular mdrun users, so making them only available
+with a dedicated tool is more clear. Also, this permits us to customize
+defaults for e.g. writing files at the end of a simulation part in ways
+that suit the respective mdrun and benchmark use cases, so ``-confout``
+will no longer be required.
+
+``gmx mdrun -nsteps``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+:issue:`3256` The number of simulation steps described by the .tpr file can be
+changed with ``gmx convert-tpr``, or altered in .mdp file before the
+call to ``gmx grompp``. The convenience of this mdrun option was
+outweighted by the doubtful quality of its implementation, no clear
+record in the log file, and lack of maintenance.
+
index e547ec841812bea5bfaae306c5df118672ca36cf..6a6fd20750a62b2e24a85e3d5668369e9aa0ff5f 100644 (file)
@@ -2958,7 +2958,7 @@ Non-equilibrium MD
 
    groups for constant acceleration (*e.g.* ``Protein Sol``) all atoms
    in groups Protein and Sol will experience constant acceleration as
-   specified in the :mdp:`accelerate` line
+   specified in the :mdp:`accelerate` line. (Deprecated)
 
 .. mdp:: accelerate
 
@@ -2966,7 +2966,7 @@ Non-equilibrium MD
    acceleration for :mdp:`acc-grps`; x, y and z for each group
    (*e.g.* ``0.1 0.0 0.0 -0.1 0.0 0.0`` means that first group has
    constant acceleration of 0.1 nm ps\ :sup:`-2` in X direction, second group
-   the opposite).
+   the opposite). (Deprecated)
 
 .. mdp:: freezegrps
 
index faa48c6a165ee33aa48809accd37b07ad768b597..e6824acb443f86a8fe07ae3863e0f6b4696c4b7c 100644 (file)
@@ -155,3 +155,42 @@ satisfying dependencies for a new virtualenv does not require network access or
 Some dependencies (notably, a Python installation itself) may require some fiddling
 with the XCode SDK.
 https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035624
+
+# Tests for gmxapi Python packages distributed with GROMACS
+
+## Requirements
+
+Python tests use the `unittest` standard library module and the `unittest.mock`
+submodule, included in Python 3.3+.
+
+The additional `pytest` package allows tests to be written more easily and
+concisely, with easier test fixtures (through decorators), log handling, and
+other output handling.
+
+## Files
+
+Python files beginning with `test_` are collected by the Python testing
+framework during automatic test discovery.
+
+`conftest.py` and `pytest.ini` provide configuration for `pytest`.
+
+## Usage
+
+For basic tests, install the Python package(s) (presumably into a virtualenv),
+then use the `pytest` executable to run these tests against the installed
+package(s).
+
+`pytest $LOCAL_REPO_DIR/python_packaging/src/test`
+
+where `$LOCAL_REPO_DIR` is the path to the local copy of the GROMACS source repository.
+
+For multi-process tests, run with an MPI execution wrapper and the `mpi4py` module.
+
+`mpiexec -n 2 python -m mpi4py -m pytest $LOCAL_REPO_DIR/python_packaging/test`
+
+## Controlling output
+
+Refer to pytest documentation for command line options to control the type and detail of output.
+Some high level overview and basic tasks are online at https://docs.pytest.org/en/3.9.3/usage.html
+but you should run `pytest -h` in a terminal to get the complete set of available options
+(in particular, note *log_cli* and *log_level*).
index 612f5d8c16970b59fca71e366248a5b1d9b6ceb3..e1246075cc436d08ccb0192e26a949ae4f99f03d 100644 (file)
 
 import os
 
+# Import setuptools early to avoid UserWarning from Distutils.
+# Ref: https://gitlab.com/gromacs/gromacs/-/issues/3715
+import setuptools
+
 # Allow setup.py to be run when scikit-build is not installed, such as to
 # produce source distribution archives with `python setup.py sdist`
 try:
@@ -101,12 +105,14 @@ if gmxapi_DIR is None:
     # Infer from GMXRC exports, if available.
     gmxapi_DIR = os.getenv('GROMACS_DIR')
 
+
 def _find_first_gromacs_suffix(directory):
     dir_contents = os.listdir(directory)
     for entry in dir_contents:
         if entry.startswith('gromacs'):
             return entry.strip('gromacs')
 
+
 if gmx_toolchain_dir is None:
     # Try to guess from standard GMXRC environment variables.
     if gmxapi_DIR is not None:
index 56711bbf764025d8d7bac7663a6614f1cb70b32e..fe55d2ed64b588f65868a485437a69503b58e2b2 100644 (file)
@@ -1,2 +1,2 @@
 [pytest]
-junit_family=xunit1
+junit_family=xunit2
diff --git a/python_packaging/test/README.md b/python_packaging/test/README.md
deleted file mode 100644 (file)
index 413faf8..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# Tests for gmxapi Python packages distributed with GROMACS
-
-Potentially longer-running than the unit tests in the Python package directory
-and broader in scope. Intended to include more thorough and complete integration
-testing than in the `acceptance` subdirectory.
-
-## Requirements
-
-Python tests use the `unittest` standard library module and the `unittest.mock`
-submodule, included in Python 3.3+.
-
-The additional `pytest` package allows tests to be written more easily and
-concisely, with easier test fixtures (through decorators), log handling, and
-other output handling.
-
-## Files
-
-Python files beginning with `test_` are collected by the Python testing
-framework during automatic test discovery.
-
-`conftest.py` and `pytest.ini` provide configuration for `pytest`.
-
-Tests are organized according to the functional requirements
-documented in `roadmap.rst` in the `python_packaging` directory.
-
-## Usage
-
-For basic tests, install the Python package(s) (presumably into a virtualenv),
-then use the `pytest` executable to run these tests against the installed
-package(s).
-
-`pytest $LOCAL_REPO_DIR/python_packaging/test`
-
-where `$LOCAL_REPO_DIR` is the path to the local copy of the GROMACS source repository.
-
-For multi-process tests, run with an MPI execution wrapper and the `mpi4py` module.
-
-`mpiexec -n 2 python -m mpi4py -m pytest $LOCAL_REPO_DIR/python_packaging/test`
-
-## Controlling output
-
-Refer to pytest documentation for command line options to control the type and detail of output.
-Some high level overview and basic tasks are online at https://docs.pytest.org/en/3.9.3/usage.html
-but you should run `pytest -h` in a terminal to get the complete set of available options
-(in particular, note *log_cli* and *log_level*).
index 56711bbf764025d8d7bac7663a6614f1cb70b32e..fe55d2ed64b588f65868a485437a69503b58e2b2 100644 (file)
@@ -1,2 +1,2 @@
 [pytest]
-junit_family=xunit1
+junit_family=xunit2
index 6c41833fbcd805f58335675088c16ee8549cc384..aa2f4782e3fd05c804702bd1323960c9273d3365 100644 (file)
 
 #ifndef BOOST_STL_INTERFACES_DOXYGEN
 
-#if defined(_MSC_VER) || defined(__GNUC__) && __GNUC__ < 8
+// It is not known whether intel has fixed this issue, but it was
+// observed to be present in icc 19.1.2.20200623. Update the version
+// check when it is fixed.
+#if defined(_MSC_VER) || defined(__GNUC__) && __GNUC__ < 8 || defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1920
 #define BOOST_STL_INTERFACES_NO_HIDDEN_FRIEND_CONSTEXPR
 #define BOOST_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR
 #else
index 695d057dd3e6e1176d2733c58bc1ce3bdde1f888..9edd625f9da7a6f32236bf147c790f0aa8c78251 100644 (file)
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.6.2)
+#cmake_minimum_required(VERSION 2.6.2)
 
 project( googletest-distribution )
 
index e3637b4d01c7ff3bfa0e2bc58dace63ba3bb78b6..2af82650f8ef70c4f472596bf3408c10a7b8986a 100644 (file)
@@ -59,3 +59,10 @@ such as for the clang static analyzer, and some lines are removed
 from consideration by wrapping with `#ifndef __clang_analyzer__`
 or marking them with `/*NOLINT*/` comment.
 ... `#endif`.
+
+GoogleTest declares quite old minimum CMake versions, which newer
+CMake versions warn about. In practice, the CMake version requirement
+for GROMACS is greater than these minimums, and that version will be
+used for GoogleTest also. The warnings aren't useful for GROMACS
+developers, so those declarations by GoogleTest have been commented
+out.
index ceece30fe108dae5cd482a7ecf267b5cfae8bbcf..0eaa9ea4356993e53228d6b99082e8b86cae0ff5 100644 (file)
@@ -38,7 +38,7 @@ endif()
 # ${gmock_BINARY_DIR}.
 # Language "C" is required for find_package(Threads).
 project(gmock CXX C)
-cmake_minimum_required(VERSION 2.6.2)
+#cmake_minimum_required(VERSION 2.6.2)
 
 if (COMMAND set_up_hermetic_build)
   set_up_hermetic_build()
index c35931f22c30de599b294f697a521b78fe75c1f5..e7923ba82e795bf2ce995c93fda8c8a75f71cd75 100644 (file)
@@ -46,7 +46,7 @@ else()
   cmake_policy(SET CMP0048 NEW)
   project(gtest VERSION 1.8.1 LANGUAGES CXX C)
 endif()
-cmake_minimum_required(VERSION 2.6.4)
+#cmake_minimum_required(VERSION 2.6.4)
 
 if (POLICY CMP0063) # Visibility
   cmake_policy(SET CMP0063 NEW)
index cae4afbc2deae46170542d6a3d567f2e7dba6ef6..027895d348ae6ee82d9aba2f0c087cbf2c9f798b 100644 (file)
@@ -854,7 +854,7 @@ static void pme_load_balance(pme_load_balancing_t*          pme_lb,
     }
 
     /* We always re-initialize the tables whether they are used or not */
-    init_interaction_const_tables(nullptr, ic, ir.tabext);
+    init_interaction_const_tables(nullptr, ic, set->rlistOuter, ir.tabext);
 
     Nbnxm::gpu_pme_loadbal_update_param(nbv, ic);
 
index 8976350b59e4eac52b40ce9f4faabf25984a77e6..c88a7526e99f43497913276698056081acfa653a 100644 (file)
@@ -72,6 +72,7 @@
 #include "gromacs/mdtypes/pullhistory.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/mdtypes/swaphistory.h"
+#include "gromacs/modularsimulator/modularsimulator.h"
 #include "gromacs/trajectory/trajectoryframe.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/baseversion.h"
@@ -87,6 +88,7 @@
 #include "gromacs/utility/programcontext.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/sysinfo.h"
+#include "gromacs/utility/textwriter.h"
 #include "gromacs/utility/txtdump.h"
 
 #define CPT_MAGIC1 171817
@@ -2137,13 +2139,19 @@ static int do_cpt_awh(XDR* xd, gmx_bool bRead, int fflags, gmx::AwhHistory* awhH
 
 static void do_cpt_mdmodules(int                           fileVersion,
                              t_fileio*                     checkpointFileHandle,
-                             const gmx::MdModulesNotifier& mdModulesNotifier)
+                             const gmx::MdModulesNotifier& mdModulesNotifier,
+                             FILE*                         outputFile)
 {
     if (fileVersion >= cptv_MdModules)
     {
         gmx::FileIOXdrSerializer serializer(checkpointFileHandle);
         gmx::KeyValueTreeObject  mdModuleCheckpointParameterTree =
                 gmx::deserializeKeyValueTree(&serializer);
+        if (outputFile)
+        {
+            gmx::TextWriter textWriter(outputFile);
+            gmx::dumpKeyValueTree(&textWriter, mdModuleCheckpointParameterTree);
+        }
         gmx::MdModulesCheckpointReadingDataOnMaster mdModuleCheckpointReadingDataOnMaster = {
             mdModuleCheckpointParameterTree, fileVersion
         };
@@ -2606,12 +2614,24 @@ static void read_checkpoint(const char*                    fn,
                   fn);
     }
 
-    GMX_ASSERT(!(headerContents->isModularSimulatorCheckpoint && !useModularSimulator),
-               "Checkpoint file was written by modular simulator, but the current simulation uses "
-               "the legacy simulator.");
-    GMX_ASSERT(!(!headerContents->isModularSimulatorCheckpoint && useModularSimulator),
-               "Checkpoint file was written by legacy simulator, but the current simulation uses "
-               "the modular simulator.");
+    GMX_RELEASE_ASSERT(!(headerContents->isModularSimulatorCheckpoint && !useModularSimulator),
+                       "Checkpoint file was written by modular simulator, but the current "
+                       "simulation uses the legacy simulator.\n\n"
+                       "Try the following steps:\n"
+                       "1. Make sure the GMX_DISABLE_MODULAR_SIMULATOR environment variable is not "
+                       "set to return to the default behavior. Retry running the simulation.\n"
+                       "2. If the problem persists, set the environment variable "
+                       "GMX_USE_MODULAR_SIMULATOR=ON to overwrite the default behavior and use "
+                       "modular simulator for all implemented use cases.");
+    GMX_RELEASE_ASSERT(!(!headerContents->isModularSimulatorCheckpoint && useModularSimulator),
+                       "Checkpoint file was written by legacy simulator, but the current "
+                       "simulation uses the modular simulator.\n\n"
+                       "Try the following steps:\n"
+                       "1. Make sure the GMX_USE_MODULAR_SIMULATOR environment variable is not set "
+                       "to return to the default behavior. Retry running the simulation.\n"
+                       "2. If the problem persists, set the environment variable "
+                       "GMX_DISABLE_MODULAR_SIMULATOR=ON to overwrite the default behavior and use "
+                       "legacy simulator for all implemented use cases.");
 
     if (MASTER(cr))
     {
@@ -2718,7 +2738,7 @@ static void read_checkpoint(const char*                    fn,
     {
         cp_error();
     }
-    do_cpt_mdmodules(headerContents->file_version, fp, mdModulesNotifier);
+    do_cpt_mdmodules(headerContents->file_version, fp, mdModulesNotifier, nullptr);
     if (headerContents->file_version >= cptv_ModularSimulator)
     {
         gmx::FileIOXdrSerializer serializer(fp);
@@ -2826,7 +2846,8 @@ void read_checkpoint_part_and_step(const char* filename, int* simulation_part, i
 
 static CheckpointHeaderContents read_checkpoint_data(t_fileio*                         fp,
                                                      t_state*                          state,
-                                                     std::vector<gmx_file_position_t>* outputfiles)
+                                                     std::vector<gmx_file_position_t>* outputfiles,
+                                                     gmx::ReadCheckpointDataHolder* modularSimulatorCheckpointData)
 {
     CheckpointHeaderContents headerContents;
     do_cpt_header(gmx_fio_getxdr(fp), TRUE, nullptr, &headerContents);
@@ -2894,14 +2915,12 @@ static CheckpointHeaderContents read_checkpoint_data(t_fileio*
         cp_error();
     }
     gmx::MdModulesNotifier mdModuleNotifier;
-    do_cpt_mdmodules(headerContents.file_version, fp, mdModuleNotifier);
+    do_cpt_mdmodules(headerContents.file_version, fp, mdModuleNotifier, nullptr);
     if (headerContents.file_version >= cptv_ModularSimulator)
     {
-        // In the scope of the current function, we can just throw away the content
-        // of the modular checkpoint, but we need to read it to move the file pointer
-        gmx::FileIOXdrSerializer      serializer(fp);
-        gmx::ReadCheckpointDataHolder modularSimulatorCheckpointData;
-        modularSimulatorCheckpointData.deserialize(&serializer);
+        // Store modular checkpoint data into modularSimulatorCheckpointData
+        gmx::FileIOXdrSerializer serializer(fp);
+        modularSimulatorCheckpointData->deserialize(&serializer);
     }
     ret = do_cpt_footer(gmx_fio_getxdr(fp), headerContents.file_version);
     if (ret)
@@ -2915,7 +2934,14 @@ void read_checkpoint_trxframe(t_fileio* fp, t_trxframe* fr)
 {
     t_state                          state;
     std::vector<gmx_file_position_t> outputfiles;
-    CheckpointHeaderContents headerContents = read_checkpoint_data(fp, &state, &outputfiles);
+    gmx::ReadCheckpointDataHolder    modularSimulatorCheckpointData;
+    CheckpointHeaderContents         headerContents =
+            read_checkpoint_data(fp, &state, &outputfiles, &modularSimulatorCheckpointData);
+    if (headerContents.isModularSimulatorCheckpoint)
+    {
+        gmx::ModularSimulator::readCheckpointToTrxFrame(fr, &modularSimulatorCheckpointData, headerContents);
+        return;
+    }
 
     fr->natoms    = state.natoms;
     fr->bStep     = TRUE;
@@ -3008,6 +3034,15 @@ void list_checkpoint(const char* fn, FILE* out)
         std::vector<gmx_file_position_t> outputfiles;
         ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE, &outputfiles, out, headerContents.file_version);
     }
+    gmx::MdModulesNotifier mdModuleNotifier;
+    do_cpt_mdmodules(headerContents.file_version, fp, mdModuleNotifier, out);
+    if (headerContents.file_version >= cptv_ModularSimulator)
+    {
+        gmx::FileIOXdrSerializer      serializer(fp);
+        gmx::ReadCheckpointDataHolder modularSimulatorCheckpointData;
+        modularSimulatorCheckpointData.deserialize(&serializer);
+        modularSimulatorCheckpointData.dump(out);
+    }
 
     if (ret == 0)
     {
@@ -3028,8 +3063,10 @@ void list_checkpoint(const char* fn, FILE* out)
 CheckpointHeaderContents read_checkpoint_simulation_part_and_filenames(t_fileio* fp,
                                                                        std::vector<gmx_file_position_t>* outputfiles)
 {
-    t_state                  state;
-    CheckpointHeaderContents headerContents = read_checkpoint_data(fp, &state, outputfiles);
+    t_state                       state;
+    gmx::ReadCheckpointDataHolder modularSimulatorCheckpointData;
+    CheckpointHeaderContents      headerContents =
+            read_checkpoint_data(fp, &state, outputfiles, &modularSimulatorCheckpointData);
     if (gmx_fio_close(fp) != 0)
     {
         gmx_file("Cannot read/write checkpoint; corrupt file, or maybe you are out of disk space?");
index 6b9186057719abb2861b35f147389d500b118b93..577a09c1099815b816ddaaf7149da2df3241c4df 100644 (file)
@@ -38,6 +38,7 @@ if (GMX_USE_TNG)
 endif()
 gmx_add_unit_test(FileIOTests fileio-test
     CPP_SOURCE_FILES
+        checkpoint.cpp
         confio.cpp
         filemd5.cpp
         mrcserializer.cpp
index f368954036101a422623ab19714e76cbc47af65b..693ff2af1bae17af9c6abc40b604020174b67c71 100644 (file)
@@ -47,6 +47,8 @@
 
 #include "gromacs/utility/exceptions.h"
 
+#include "testutils/testasserts.h"
+
 namespace gmx
 {
 namespace test
@@ -57,27 +59,27 @@ namespace
 TEST(Checkpoint, ReadingThrowsWhenValueNotPresent)
 {
     KeyValueTreeObject kvtObject;
-    std::int64_t       readValue;
+    std::int64_t       readValue = 0;
     EXPECT_THROW_GMX(readKvtCheckpointValue(compat::make_not_null(&readValue), "non", "sense", kvtObject),
-                     InternalError);
+                     gmx::InternalError);
 }
 
 TEST(Checkpoint, ReadingDoesNotThrowWhenValuePresent)
 {
-    int64_t             value;
+    int64_t             value      = 37;
     std::string         name       = "checkpointedInteger";
     std::string         identifier = "testingmodule";
     KeyValueTreeBuilder kvtBuilder;
     writeKvtCheckpointValue(value, name, identifier, kvtBuilder.rootObject());
     const auto kvtObject = kvtBuilder.build();
     int64_t    readValue = 0;
-    EXPECT_NO_THROW_GMX(readKvtCheckpointValue(compat::make_not_null(&readValue), "non", "sense", kvtObject),
-                        InternalError);
+    EXPECT_NO_THROW_GMX(
+            readKvtCheckpointValue(compat::make_not_null(&readValue), name, identifier, kvtObject));
 }
 
 TEST(Checkpoint, KvtRoundTripInt64)
 {
-    int64_t             value;
+    int64_t             value      = INT64_MAX;
     std::string         name       = "checkpointedInteger";
     std::string         identifier = "testingmodule";
     KeyValueTreeBuilder kvtBuilder;
@@ -90,8 +92,8 @@ TEST(Checkpoint, KvtRoundTripInt64)
 
 TEST(Checkpoint, KvtRoundTripReal)
 {
-    real                value;
-    std::string         name       = "checkpointedInteger";
+    real                value      = 926.7;
+    std::string         name       = "checkpointedReal";
     std::string         identifier = "testingmodule";
     KeyValueTreeBuilder kvtBuilder;
     writeKvtCheckpointValue(value, name, identifier, kvtBuilder.rootObject());
index 5c62efc57d4cd660dc1293eab9e59117579c209e..3c9b933758a5b4d5f77f0812f8cf01f867e69113 100644 (file)
@@ -375,6 +375,10 @@ static void nb_free_energy_kernel(const t_nblist* gmx_restrict nlist,
     real* gmx_restrict f      = &(forceWithShiftForces->force()[0][0]);
     real* gmx_restrict fshift = &(forceWithShiftForces->shiftForces()[0][0]);
 
+    const real rlistSquared = gmx::square(fr->rlist);
+
+    int numExcludedPairsBeyondRlist = 0;
+
     for (int n = 0; n < nri; n++)
     {
         int npair_within_cutoff = 0;
@@ -431,6 +435,11 @@ static void nb_free_energy_kernel(const t_nblist* gmx_restrict nlist,
             }
             npair_within_cutoff++;
 
+            if (rSq > rlistSquared)
+            {
+                numExcludedPairsBeyondRlist++;
+            }
+
             if (rSq > 0)
             {
                 /* Note that unlike in the nbnxn kernels, we do not need
@@ -722,7 +731,7 @@ static void nb_free_energy_kernel(const t_nblist* gmx_restrict nlist,
                 }
             }
 
-            if (vdwInteractionTypeIsEwald && r < rVdw)
+            if (vdwInteractionTypeIsEwald && (r < rVdw || !bPairIncluded))
             {
                 /* See comment in the preamble. When using LJ-Ewald interactions
                  * (unless we use a switch modifier) we subtract the reciprocal-space
@@ -839,6 +848,20 @@ static void nb_free_energy_kernel(const t_nblist* gmx_restrict nlist,
      */
 #pragma omp atomic
     inc_nrnb(nrnb, eNR_NBKERNEL_FREE_ENERGY, nlist->nri * 12 + nlist->jindex[nri] * 150);
+
+    if (numExcludedPairsBeyondRlist > 0)
+    {
+        gmx_fatal(FARGS,
+                  "There are %d perturbed non-bonded pair interactions beyond the pair-list cutoff "
+                  "of %g nm, which is not supported. This can happen because the system is "
+                  "unstable or because intra-molecular interactions at long distances are "
+                  "excluded. If the "
+                  "latter is the case, you can try to increase nstlist or rlist to avoid this."
+                  "The error is likely triggered by the use of couple-intramol=no "
+                  "and the maximal distance in the decoupled molecule exceeding rlist.",
+                  numExcludedPairsBeyondRlist,
+                  fr->rlist);
+    }
 }
 
 typedef void (*KernelFunction)(const t_nblist* gmx_restrict nlist,
index 2f31d7e0a581b0bf4b3ace3ab72e886ec91e6515..d153459a08a0492c92e54053b59763e557a290ec 100644 (file)
@@ -72,7 +72,7 @@ struct RosenBrock3d
     }
 };
 
-TEST(NelderMeat, Optimizes2DFunctionCorrectly)
+TEST(NelderMead, Optimizes2DFunctionCorrectly)
 {
     std::vector<real> initalPoint = { 1, 1 };
     auto              result      = nelderMead(mcCormick, initalPoint);
@@ -83,13 +83,13 @@ TEST(NelderMeat, Optimizes2DFunctionCorrectly)
     EXPECT_REAL_EQ_TOL(result.functionValue_, -1.91329, relativeToleranceAsFloatingPoint(1, 5e-5));
 }
 
-TEST(NelderMeat, Optimizes3DFunctorCorrectly)
+TEST(NelderMead, Optimizes3DFunctorCorrectly)
 {
     std::vector<real> initalPoint = { 0, 0, 0 };
     auto              result      = nelderMead(RosenBrock3d(), initalPoint);
     EXPECT_REAL_EQ_TOL(result.coordinates_[0], 1.00, relativeToleranceAsFloatingPoint(1, 1e-6));
-    EXPECT_REAL_EQ_TOL(result.coordinates_[1], 1.00, relativeToleranceAsFloatingPoint(1, 1e-6));
-    EXPECT_REAL_EQ_TOL(result.coordinates_[2], 1.00, relativeToleranceAsFloatingPoint(1, 1e-6));
+    EXPECT_REAL_EQ_TOL(result.coordinates_[1], 1.00, relativeToleranceAsFloatingPoint(1, 2e-6));
+    EXPECT_REAL_EQ_TOL(result.coordinates_[2], 1.00, relativeToleranceAsFloatingPoint(1, 5e-6));
     EXPECT_REAL_EQ_TOL(result.functionValue_, 0, relativeToleranceAsFloatingPoint(1, 1e-7));
 }
 
index c743b77c914b35b7b0e684d2e6a029e22dab6e29..a0af9e6e7f2be0e60736dfcfbc4464295649403d 100644 (file)
@@ -728,7 +728,8 @@ static void initVdwEwaldParameters(FILE* fp, const t_inputrec* ir, interaction_c
  * both accuracy requirements, when relevant.
  */
 static void init_ewald_f_table(const interaction_const_t& ic,
-                               const real                 tableExtensionLength,
+                               const real                 rlist,
+                               const real                 tabext,
                                EwaldCorrectionTables*     coulombTables,
                                EwaldCorrectionTables*     vdwTables)
 {
@@ -743,7 +744,7 @@ static void init_ewald_f_table(const interaction_const_t& ic,
     const bool havePerturbedNonbondeds = (ic.softCoreParameters != nullptr);
 
     real tableLen = ic.rcoulomb;
-    if (useCoulombTable && havePerturbedNonbondeds && tableExtensionLength > 0.0)
+    if ((useCoulombTable || useVdwTable) && havePerturbedNonbondeds && rlist + tabext > 0.0)
     {
         /* TODO: Ideally this should also check if couple-intramol == no, but that isn't
          * stored in ir. Grompp puts that info into an opts structure that doesn't make it into the tpr.
@@ -751,7 +752,7 @@ static void init_ewald_f_table(const interaction_const_t& ic,
          * couple-intramol == no. Meanwhile, always having larger tables should only affect
          * memory consumption, not speed (barring cache issues).
          */
-        tableLen = ic.rcoulomb + tableExtensionLength;
+        tableLen = rlist + tabext;
     }
     const int tableSize = static_cast<int>(tableLen * tableScale) + 2;
 
@@ -767,12 +768,12 @@ static void init_ewald_f_table(const interaction_const_t& ic,
     }
 }
 
-void init_interaction_const_tables(FILE* fp, interaction_const_t* ic, const real tableExtensionLength)
+void init_interaction_const_tables(FILE* fp, interaction_const_t* ic, const real rlist, const real tableExtensionLength)
 {
     if (EEL_PME_EWALD(ic->eeltype) || EVDW_PME(ic->vdwtype))
     {
         init_ewald_f_table(
-                *ic, tableExtensionLength, ic->coulombEwaldTables.get(), ic->vdwEwaldTables.get());
+                *ic, rlist, tableExtensionLength, ic->coulombEwaldTables.get(), ic->vdwEwaldTables.get());
         if (fp != nullptr)
         {
             fprintf(fp,
@@ -1087,7 +1088,7 @@ void init_forcerec(FILE*                            fp,
 
     /* fr->ic is used both by verlet and group kernels (to some extent) now */
     init_interaction_const(fp, &fr->ic, ir, mtop, systemHasNetCharge);
-    init_interaction_const_tables(fp, fr->ic, ir->tabext);
+    init_interaction_const_tables(fp, fr->ic, fr->rlist, ir->tabext);
 
     const interaction_const_t* ic = fr->ic;
 
index aed645f1867def785f18a22fd570c5953069ca4b..1a01ff141330ba927ce925138fa8a53c39e7d0fa 100644 (file)
@@ -82,9 +82,10 @@ void forcerec_set_ranges(t_forcerec* fr, int natoms_force, int natoms_force_cons
  * Initializes the tables in the interaction constant data structure.
  * \param[in] fp                     File for debugging output
  * \param[in] ic                     Structure holding the table constant
+ * \param[in] rlist                  Length of the neighbour list
  * \param[in] tableExtensionLength   Length by which to extend the tables. Taken from the input record.
  */
-void init_interaction_const_tables(FILE* fp, interaction_const_t* ic, real tableExtensionLength);
+void init_interaction_const_tables(FILE* fp, interaction_const_t* ic, real rlist, real tableExtensionLength);
 
 /*! \brief Initialize forcerec structure.
  *
index 2b1445ef554d713aff972a3f1b99229fd8749024..6ce5fd61f8ae8ed5e1833c3e562e07f0e02c18cb 100644 (file)
@@ -2090,7 +2090,8 @@ Mdrunner::Mdrunner(std::unique_ptr<MDModules> mdModules) : mdModules_(std::move(
 
 Mdrunner::Mdrunner(Mdrunner&&) noexcept = default;
 
-Mdrunner& Mdrunner::operator=(Mdrunner&& /*handle*/) noexcept = default;
+//NOLINTNEXTLINE(performance-noexcept-move-constructor) working around GCC bug 58265 in CentOS 7
+Mdrunner& Mdrunner::operator=(Mdrunner&& /*handle*/) noexcept(BUGFREE_NOEXCEPT_STRING) = default;
 
 class Mdrunner::BuilderImplementation
 {
index 703e632b34cf4bf18e1f35d9f6d8f85e0709945d..a0c9cdc95df85401ec2b10a98db393cc0f13cc84 100644 (file)
@@ -78,6 +78,9 @@ class RestraintManager;
 class SimulationContext;
 class StopHandlerBuilder;
 
+//! Work-around for GCC bug 58265 still present in CentOS 7 devtoolset-7
+constexpr bool BUGFREE_NOEXCEPT_STRING = std::is_nothrow_move_assignable<std::string>::value;
+
 /*! \libinternal \brief Runner object for supporting setup and execution of mdrun.
  *
  * This class has responsibility for the lifetime of data structures
@@ -143,7 +146,8 @@ public:
      * \{
      */
     Mdrunner(Mdrunner&& handle) noexcept;
-    Mdrunner& operator=(Mdrunner&& handle) noexcept;
+    //NOLINTNEXTLINE(performance-noexcept-move-constructor) working around GCC bug 58265 in CentOS 7
+    Mdrunner& operator=(Mdrunner&& handle) noexcept(BUGFREE_NOEXCEPT_STRING);
     /* \} */
 
     /*! \brief Driver routine, that calls the different simulation methods. */
index 10ed32cef778dddef602fefd5a41e3009dd7e16a..f3816c62c2e29226a6220ee3b2632fb5ee7b4832 100644 (file)
@@ -45,6 +45,7 @@
 
 #include "gromacs/utility/iserializer.h"
 #include "gromacs/utility/keyvaluetreeserializer.h"
+#include "gromacs/utility/textwriter.h"
 
 namespace gmx
 {
@@ -89,6 +90,15 @@ ReadCheckpointData ReadCheckpointDataHolder::checkpointData(const std::string& k
     return ReadCheckpointData(checkpointTree_[key].asObject());
 }
 
+void ReadCheckpointDataHolder::dump(FILE* out) const
+{
+    if (out != nullptr)
+    {
+        TextWriter textWriter(out);
+        dumpKeyValueTree(&textWriter, checkpointTree_);
+    }
+}
+
 WriteCheckpointData WriteCheckpointDataHolder::checkpointData(const std::string& key)
 {
     hasCheckpointDataBeenRequested_ = true;
index d8ae5e02fc056483b3639a7cdb1f66a0406d03c3..c63de6bb90c8434ecedd89dcccc48c500e06bacd 100644 (file)
@@ -323,7 +323,15 @@ VersionEnum checkpointVersion(WriteCheckpointData* checkpointData,
     return programVersion;
 }
 
+inline ReadCheckpointData::CheckpointData(const KeyValueTreeObject& inputTree) :
+    inputTree_(&inputTree)
+{
+}
 
+inline WriteCheckpointData::CheckpointData(KeyValueTreeObjectBuilder&& outputTreeBuilder) :
+    outputTreeBuilder_(outputTreeBuilder)
+{
+}
 /*! \libinternal
  * \brief Holder for read checkpoint data
  *
@@ -351,6 +359,9 @@ public:
      */
     [[nodiscard]] ReadCheckpointData checkpointData(const std::string& key) const;
 
+    //! Write the contents of the Checkpoint to file
+    void dump(FILE* out) const;
+
 private:
     //! KV-tree read from checkpoint
     KeyValueTreeObject checkpointTree_;
@@ -518,15 +529,6 @@ inline WriteCheckpointData WriteCheckpointData::subCheckpointData(const std::str
     return CheckpointData(outputTreeBuilder_->addObject(key));
 }
 
-inline ReadCheckpointData::CheckpointData(const KeyValueTreeObject& inputTree) :
-    inputTree_(&inputTree)
-{
-}
-
-inline WriteCheckpointData::CheckpointData(KeyValueTreeObjectBuilder&& outputTreeBuilder) :
-    outputTreeBuilder_(outputTreeBuilder)
-{
-}
 //! \endcond
 
 } // namespace gmx
index f3a899d3a97ce8973ca02146ead07ef3ee312688..e296535ca2d033463a103756a6f9094f1c0d2d41 100644 (file)
@@ -153,17 +153,17 @@ private:
     template<typename T>
     static std::enable_if_t<std::is_same<T, tensor>::value, void> increment(const T** ptr);
 
-    constexpr static bool   testTrue    = true;
-    constexpr static bool   testFalse   = false;
-    constexpr static tensor testTensor1 = { { 1.6234, 2.4632, 3.1112 },
+    static constexpr bool   testTrue    = true;
+    static constexpr bool   testFalse   = false;
+    static constexpr tensor testTensor1 = { { 1.6234, 2.4632, 3.1112 },
                                             { 4.66234, 5.9678, 6.088 },
                                             { 7.00001, 8.43535, 9.11233 } };
 #if GMX_DOUBLE
-    constexpr static tensor testTensor2 = { { 1, GMX_DOUBLE_EPS, 3 },
+    static constexpr tensor testTensor2 = { { 1, GMX_DOUBLE_EPS, 3 },
                                             { GMX_DOUBLE_MIN, 5, 6 },
                                             { 7, 8, GMX_DOUBLE_MAX } };
 #else
-    constexpr static tensor testTensor2 = { { 1, GMX_FLOAT_EPS, 3 },
+    static constexpr tensor testTensor2 = { { 1, GMX_FLOAT_EPS, 3 },
                                             { GMX_FLOAT_MIN, 5, 6 },
                                             { 7, 8, GMX_FLOAT_MAX } };
 #endif
index f73e4b5cb186d0ccc4cd2e2dd1c6d9722617f47c..80b184f598384dedae278383651c498796402bba 100644 (file)
@@ -74,7 +74,7 @@ class TrajectoryElement;
  * every 15 minutes), and needs two NS steps to take effect - on the first
  * NS step, the checkpoint helper on master rank signals to all other ranks
  * that checkpointing is about to occur. At the next NS step, the checkpoint
- * is written. On the last step, checkpointing happens immediately after the
+ * is written. On the last step, checkpointing happens immediately before the
  * step (no signalling). To be able to react to last step being signalled,
  * the CheckpointHelper does also implement the `ISimulatorElement` interface,
  * but does only register a function if the last step has been called. It
index 53f72f6090521cd66a3afbff63b719e5a911d386..3cda75f3cea59a49e5a6d861b9d8558285072894 100644 (file)
@@ -154,6 +154,7 @@ void EnergyData::teardown()
 {
     if (inputrec_->nstcalcenergy > 0 && isMasterRank_)
     {
+        energyOutput_->printEnergyConservation(fplog_, inputrec_->simulation_part, EI_MD(inputrec_->eI));
         energyOutput_->printAverages(fplog_, groups_);
     }
 }
index 352ab3e39f6587c021c36de26dac62e5b8ceed24..7065c44b175ffb2e9f1c5eaf76fd730f9be112f2 100644 (file)
@@ -52,6 +52,7 @@
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/mdatom.h"
 #include "gromacs/mdtypes/state.h"
+#include "gromacs/trajectory/trajectoryframe.h"
 
 #include "modularsimulator.h"
 #include "simulatoralgorithm.h"
@@ -128,13 +129,12 @@ constexpr auto c_currentVersion = CheckpointVersion(int(CheckpointVersion::Count
 } // namespace
 
 template<CheckpointDataOperation operation>
-void FreeEnergyPerturbationData::Element::doCheckpointData(CheckpointData<operation>* checkpointData)
+void FreeEnergyPerturbationData::doCheckpointData(CheckpointData<operation>* checkpointData)
 {
     checkpointVersion(checkpointData, "FreeEnergyPerturbationData version", c_currentVersion);
 
-    checkpointData->scalar("current FEP state", &freeEnergyPerturbationData_->currentFEPState_);
-    checkpointData->arrayRef("lambda vector",
-                             makeCheckpointArrayRef<operation>(freeEnergyPerturbationData_->lambda_));
+    checkpointData->scalar("current FEP state", &currentFEPState_);
+    checkpointData->arrayRef("lambda vector", makeCheckpointArrayRef<operation>(lambda_));
 }
 
 void FreeEnergyPerturbationData::Element::saveCheckpointState(std::optional<WriteCheckpointData> checkpointData,
@@ -142,7 +142,8 @@ void FreeEnergyPerturbationData::Element::saveCheckpointState(std::optional<Writ
 {
     if (MASTER(cr))
     {
-        doCheckpointData<CheckpointDataOperation::Write>(&checkpointData.value());
+        freeEnergyPerturbationData_->doCheckpointData<CheckpointDataOperation::Write>(
+                &checkpointData.value());
     }
 }
 
@@ -151,7 +152,8 @@ void FreeEnergyPerturbationData::Element::restoreCheckpointState(std::optional<R
 {
     if (MASTER(cr))
     {
-        doCheckpointData<CheckpointDataOperation::Read>(&checkpointData.value());
+        freeEnergyPerturbationData_->doCheckpointData<CheckpointDataOperation::Read>(
+                &checkpointData.value());
     }
     if (DOMAINDECOMP(cr))
     {
@@ -164,7 +166,7 @@ void FreeEnergyPerturbationData::Element::restoreCheckpointState(std::optional<R
 
 const std::string& FreeEnergyPerturbationData::Element::clientID()
 {
-    return identifier_;
+    return FreeEnergyPerturbationData::checkpointID();
 }
 
 FreeEnergyPerturbationData::Element::Element(FreeEnergyPerturbationData* freeEnergyPerturbationElement,
@@ -195,4 +197,28 @@ ISimulatorElement* FreeEnergyPerturbationData::Element::getElementPointerImpl(
     return freeEnergyPerturbationData->element();
 }
 
+void FreeEnergyPerturbationData::readCheckpointToTrxFrame(t_trxframe* trxFrame,
+                                                          std::optional<ReadCheckpointData> readCheckpointData)
+{
+    if (readCheckpointData)
+    {
+        FreeEnergyPerturbationData freeEnergyPerturbationData;
+        freeEnergyPerturbationData.doCheckpointData(&readCheckpointData.value());
+        trxFrame->lambda    = freeEnergyPerturbationData.lambda_[efptFEP];
+        trxFrame->fep_state = freeEnergyPerturbationData.currentFEPState_;
+    }
+    else
+    {
+        trxFrame->lambda    = 0;
+        trxFrame->fep_state = 0;
+    }
+    trxFrame->bLambda = true;
+}
+
+const std::string& FreeEnergyPerturbationData::checkpointID()
+{
+    static const std::string identifier = "FreeEnergyPerturbationData";
+    return identifier;
+}
+
 } // namespace gmx
index b1291dfde672b3a3004c4fbe01c4b7291e8827b4..25c2a52916e6bfaa2b6430ccfa5205fdd10d1515 100644 (file)
@@ -51,6 +51,7 @@
 #include "modularsimulatorinterfaces.h"
 
 struct t_inputrec;
+struct t_trxframe;
 
 namespace gmx
 {
@@ -91,9 +92,20 @@ public:
     //! Get pointer to element (whose lifetime is managed by this)
     Element* element();
 
+    //! Read everything that can be stored in t_trxframe from a checkpoint file
+    static void readCheckpointToTrxFrame(t_trxframe*                       trxFrame,
+                                         std::optional<ReadCheckpointData> readCheckpointData);
+    //! CheckpointHelper identifier
+    static const std::string& checkpointID();
+
 private:
+    //! Default constructor - only used internally
+    FreeEnergyPerturbationData() = default;
     //! Update the lambda values
     void updateLambdas(Step step);
+    //! Helper function to read from / write to CheckpointData
+    template<CheckpointDataOperation operation>
+    void doCheckpointData(CheckpointData<operation>* checkpointData);
 
     //! The element
     std::unique_ptr<Element> element_;
@@ -166,13 +178,6 @@ private:
     FreeEnergyPerturbationData* freeEnergyPerturbationData_;
     //! Whether lambda values are non-static
     const bool lambdasChange_;
-
-
-    //! CheckpointHelper identifier
-    const std::string identifier_ = "FreeEnergyPerturbationElement";
-    //! Helper function to read from / write to CheckpointData
-    template<CheckpointDataOperation operation>
-    void doCheckpointData(CheckpointData<operation>* checkpointData);
 };
 
 } // namespace gmx
index f660dfd7af9b6d278ab87758b250f5018403ceff..f0bb4100b963453842e8f680a31a0ec4c0232f00 100644 (file)
@@ -48,6 +48,7 @@
 #include "gromacs/ewald/pme.h"
 #include "gromacs/ewald/pme_load_balancing.h"
 #include "gromacs/ewald/pme_pp.h"
+#include "gromacs/fileio/checkpoint.h"
 #include "gromacs/gmxlib/nrnb.h"
 #include "gromacs/listed_forces/listed_forces.h"
 #include "gromacs/mdlib/checkpointhandler.h"
@@ -71,7 +72,9 @@
 #include "gromacs/nbnxm/nbnxm.h"
 #include "gromacs/topology/mtop_util.h"
 #include "gromacs/topology/topology.h"
+#include "gromacs/trajectory/trajectoryframe.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/int64_to_int.h"
 
 #include "computeglobalselement.h"
 #include "constraintelement.h"
@@ -216,6 +219,11 @@ bool ModularSimulator::isInputCompatible(bool                             exitOn
                         && conditionalAssert(inputrec->eI != eiMD || modularSimulatorExplicitlyTurnedOn,
                                              "Set GMX_USE_MODULAR_SIMULATOR=ON to use the modular "
                                              "simulator with integrator md.");
+    isInputCompatible =
+            isInputCompatible
+            && conditionalAssert(
+                       !inputrec->useMts,
+                       "Multiple time stepping is not supported by the modular simulator.");
     isInputCompatible =
             isInputCompatible
             && conditionalAssert(!doRerun, "Rerun is not supported by the modular simulator.");
@@ -349,6 +357,11 @@ bool ModularSimulator::isInputCompatible(bool                             exitOn
     isInputCompatible = isInputCompatible
                         && conditionalAssert(!GMX_FAHCORE,
                                              "GMX_FAHCORE not supported by the modular simulator.");
+    GMX_RELEASE_ASSERT(
+            isInputCompatible || !(inputrec->eI == eiVV && inputrec->epc == epcPARRINELLORAHMAN),
+            "Requested Parrinello-Rahman barostat with md-vv, but other options are not compatible "
+            "with the modular simulator. The Parrinello-Rahman barostat is not implemented for "
+            "md-vv in the legacy simulator. Use a different pressure control algorithm.");
 
     return isInputCompatible;
 }
@@ -381,4 +394,31 @@ void ModularSimulator::checkInputForDisabledFunctionality()
     }
 }
 
+void ModularSimulator::readCheckpointToTrxFrame(t_trxframe*               fr,
+                                                ReadCheckpointDataHolder* readCheckpointDataHolder,
+                                                const CheckpointHeaderContents& checkpointHeaderContents)
+{
+    GMX_RELEASE_ASSERT(checkpointHeaderContents.isModularSimulatorCheckpoint,
+                       "ModularSimulator::readCheckpointToTrxFrame can only read checkpoints "
+                       "written by modular simulator.");
+    fr->bStep = true;
+    fr->step = int64_to_int(checkpointHeaderContents.step, "conversion of checkpoint to trajectory");
+    fr->bTime = true;
+    fr->time  = checkpointHeaderContents.t;
+
+    fr->bAtoms = false;
+
+    StatePropagatorData::readCheckpointToTrxFrame(
+            fr, readCheckpointDataHolder->checkpointData(StatePropagatorData::checkpointID()));
+    if (readCheckpointDataHolder->keyExists(FreeEnergyPerturbationData::checkpointID()))
+    {
+        FreeEnergyPerturbationData::readCheckpointToTrxFrame(
+                fr, readCheckpointDataHolder->checkpointData(FreeEnergyPerturbationData::checkpointID()));
+    }
+    else
+    {
+        FreeEnergyPerturbationData::readCheckpointToTrxFrame(fr, std::nullopt);
+    }
+}
+
 } // namespace gmx
index a46b52ebdef235bc457101076b00528463f82bc5..42d170e2e7ce0c2414b333f36f7c7ff8fc1dbb27 100644 (file)
@@ -52,7 +52,9 @@
 
 #include "gromacs/mdrun/isimulator.h"
 
+struct CheckpointHeaderContents;
 struct t_fcdata;
+struct t_trxframe;
 
 namespace gmx
 {
@@ -86,6 +88,11 @@ public:
                                   bool                             doEssentialDynamics,
                                   bool                             doMembed);
 
+    //! Read everything that can be stored in t_trxframe from a checkpoint file
+    static void readCheckpointToTrxFrame(t_trxframe*                     fr,
+                                         ReadCheckpointDataHolder*       readCheckpointDataHolder,
+                                         const CheckpointHeaderContents& checkpointHeaderContents);
+
     // Only builder can construct
     friend class SimulatorBuilder;
 
index 28e4ef9a250b26c6e1196fba1eaad3aa1286a443..866136a80959732268aff8236cb68bb270ceffc0 100644 (file)
@@ -64,6 +64,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/atoms.h"
 #include "gromacs/topology/topology.h"
+#include "gromacs/trajectory/trajectoryframe.h"
 
 #include "freeenergyperturbationdata.h"
 #include "modularsimulator.h"
@@ -489,60 +490,62 @@ constexpr auto c_currentVersion = CheckpointVersion(int(CheckpointVersion::Count
 } // namespace
 
 template<CheckpointDataOperation operation>
-void StatePropagatorData::Element::doCheckpointData(CheckpointData<operation>* checkpointData,
-                                                    const t_commrec*           cr)
+void StatePropagatorData::doCheckpointData(CheckpointData<operation>* checkpointData)
+{
+    checkpointVersion(checkpointData, "StatePropagatorData version", c_currentVersion);
+    checkpointData->scalar("numAtoms", &totalNumAtoms_);
+
+    if (operation == CheckpointDataOperation::Read)
+    {
+        xGlobal_.resizeWithPadding(totalNumAtoms_);
+        vGlobal_.resizeWithPadding(totalNumAtoms_);
+    }
+
+    checkpointData->arrayRef("positions", makeCheckpointArrayRef<operation>(xGlobal_));
+    checkpointData->arrayRef("velocities", makeCheckpointArrayRef<operation>(vGlobal_));
+    checkpointData->tensor("box", box_);
+    checkpointData->scalar("ddpCount", &ddpCount_);
+    checkpointData->scalar("ddpCountCgGl", &ddpCountCgGl_);
+    checkpointData->arrayRef("cgGl", makeCheckpointArrayRef<operation>(cgGl_));
+}
+
+void StatePropagatorData::Element::saveCheckpointState(std::optional<WriteCheckpointData> checkpointData,
+                                                       const t_commrec*                   cr)
 {
-    ArrayRef<RVec> xGlobalRef;
-    ArrayRef<RVec> vGlobalRef;
     if (DOMAINDECOMP(cr))
     {
-        if (MASTER(cr))
-        {
-            xGlobalRef = statePropagatorData_->xGlobal_;
-            vGlobalRef = statePropagatorData_->vGlobal_;
-        }
-        if (operation == CheckpointDataOperation::Write)
-        {
-            dd_collect_vec(cr->dd,
-                           statePropagatorData_->ddpCount_,
-                           statePropagatorData_->ddpCountCgGl_,
-                           statePropagatorData_->cgGl_,
-                           statePropagatorData_->x_,
-                           xGlobalRef);
-            dd_collect_vec(cr->dd,
-                           statePropagatorData_->ddpCount_,
-                           statePropagatorData_->ddpCountCgGl_,
-                           statePropagatorData_->cgGl_,
-                           statePropagatorData_->v_,
-                           vGlobalRef);
-        }
+        // Collect state from all ranks into global vectors
+        dd_collect_vec(cr->dd,
+                       statePropagatorData_->ddpCount_,
+                       statePropagatorData_->ddpCountCgGl_,
+                       statePropagatorData_->cgGl_,
+                       statePropagatorData_->x_,
+                       statePropagatorData_->xGlobal_);
+        dd_collect_vec(cr->dd,
+                       statePropagatorData_->ddpCount_,
+                       statePropagatorData_->ddpCountCgGl_,
+                       statePropagatorData_->cgGl_,
+                       statePropagatorData_->v_,
+                       statePropagatorData_->vGlobal_);
     }
     else
     {
-        xGlobalRef = statePropagatorData_->x_;
-        vGlobalRef = statePropagatorData_->v_;
+        // Everything is local - copy local vectors into global ones
+        statePropagatorData_->xGlobal_.resizeWithPadding(statePropagatorData_->totalNumAtoms());
+        statePropagatorData_->vGlobal_.resizeWithPadding(statePropagatorData_->totalNumAtoms());
+        std::copy(statePropagatorData_->x_.begin(),
+                  statePropagatorData_->x_.end(),
+                  statePropagatorData_->xGlobal_.begin());
+        std::copy(statePropagatorData_->v_.begin(),
+                  statePropagatorData_->v_.end(),
+                  statePropagatorData_->vGlobal_.begin());
     }
     if (MASTER(cr))
     {
-        GMX_ASSERT(checkpointData, "Master needs a valid pointer to a CheckpointData object");
-        checkpointVersion(checkpointData, "StatePropagatorData version", c_currentVersion);
-
-        checkpointData->arrayRef("positions", makeCheckpointArrayRef<operation>(xGlobalRef));
-        checkpointData->arrayRef("velocities", makeCheckpointArrayRef<operation>(vGlobalRef));
-        checkpointData->tensor("box", statePropagatorData_->box_);
-        checkpointData->scalar("ddpCount", &statePropagatorData_->ddpCount_);
-        checkpointData->scalar("ddpCountCgGl", &statePropagatorData_->ddpCountCgGl_);
-        checkpointData->arrayRef("cgGl", makeCheckpointArrayRef<operation>(statePropagatorData_->cgGl_));
+        statePropagatorData_->doCheckpointData<CheckpointDataOperation::Write>(&checkpointData.value());
     }
 }
 
-void StatePropagatorData::Element::saveCheckpointState(std::optional<WriteCheckpointData> checkpointData,
-                                                       const t_commrec*                   cr)
-{
-    doCheckpointData<CheckpointDataOperation::Write>(
-            checkpointData ? &checkpointData.value() : nullptr, cr);
-}
-
 /*!
  * \brief Update the legacy global state
  *
@@ -568,7 +571,10 @@ static void updateGlobalState(t_state*                      globalState,
 void StatePropagatorData::Element::restoreCheckpointState(std::optional<ReadCheckpointData> checkpointData,
                                                           const t_commrec*                  cr)
 {
-    doCheckpointData<CheckpointDataOperation::Read>(checkpointData ? &checkpointData.value() : nullptr, cr);
+    if (MASTER(cr))
+    {
+        statePropagatorData_->doCheckpointData<CheckpointDataOperation::Read>(&checkpointData.value());
+    }
 
     // Copy data to global state to be distributed by DD at setup stage
     if (DOMAINDECOMP(cr) && MASTER(cr))
@@ -581,11 +587,23 @@ void StatePropagatorData::Element::restoreCheckpointState(std::optional<ReadChec
                           statePropagatorData_->ddpCountCgGl_,
                           statePropagatorData_->cgGl_);
     }
+    // Everything is local - copy global vectors to local ones
+    if (!DOMAINDECOMP(cr))
+    {
+        statePropagatorData_->x_.resizeWithPadding(statePropagatorData_->totalNumAtoms_);
+        statePropagatorData_->v_.resizeWithPadding(statePropagatorData_->totalNumAtoms_);
+        std::copy(statePropagatorData_->xGlobal_.begin(),
+                  statePropagatorData_->xGlobal_.end(),
+                  statePropagatorData_->x_.begin());
+        std::copy(statePropagatorData_->vGlobal_.begin(),
+                  statePropagatorData_->vGlobal_.end(),
+                  statePropagatorData_->v_.begin());
+    }
 }
 
 const std::string& StatePropagatorData::Element::clientID()
 {
-    return identifier_;
+    return StatePropagatorData::checkpointID();
 }
 
 void StatePropagatorData::Element::trajectoryWriterTeardown(gmx_mdoutf* gmx_unused outf)
@@ -705,4 +723,25 @@ ISimulatorElement* StatePropagatorData::Element::getElementPointerImpl(
     return statePropagatorData->element();
 }
 
+void StatePropagatorData::readCheckpointToTrxFrame(t_trxframe* trxFrame, ReadCheckpointData readCheckpointData)
+{
+    StatePropagatorData statePropagatorData;
+    statePropagatorData.doCheckpointData(&readCheckpointData);
+
+    trxFrame->natoms = statePropagatorData.totalNumAtoms_;
+    trxFrame->bX     = true;
+    trxFrame->x  = makeRvecArray(statePropagatorData.xGlobal_, statePropagatorData.totalNumAtoms_);
+    trxFrame->bV = true;
+    trxFrame->v  = makeRvecArray(statePropagatorData.vGlobal_, statePropagatorData.totalNumAtoms_);
+    trxFrame->bF = false;
+    trxFrame->bBox = true;
+    copy_mat(statePropagatorData.box_, trxFrame->box);
+}
+
+const std::string& StatePropagatorData::checkpointID()
+{
+    static const std::string identifier = "StatePropagatorData";
+    return identifier;
+}
+
 } // namespace gmx
index b3c1b050cac28d488b5d59dd2af5778968f20af7..fe277200617671a5cdbf863b6123a240db7869e7 100644 (file)
@@ -60,6 +60,7 @@ struct t_commrec;
 struct t_inputrec;
 class t_state;
 struct t_mdatoms;
+struct t_trxframe;
 
 namespace gmx
 {
@@ -148,6 +149,11 @@ public:
     //! Initial set up for the associated element
     void setup();
 
+    //! Read everything that can be stored in t_trxframe from a checkpoint file
+    static void readCheckpointToTrxFrame(t_trxframe* trxFrame, ReadCheckpointData readCheckpointData);
+    //! CheckpointHelper identifier
+    static const std::string& checkpointID();
+
     //! \cond
     // (doxygen doesn't like these)
     // Classes which need access to legacy state
@@ -155,6 +161,8 @@ public:
     //! \endcond
 
 private:
+    //! Default constructor - only used internally
+    StatePropagatorData() = default;
     //! The total number of atoms in the system
     int totalNumAtoms_;
     //! The local number of atoms
@@ -195,6 +203,10 @@ private:
     //! OMP helper to move x_ to previousX_
     void copyPosition(int start, int end);
 
+    //! Helper function to read from / write to CheckpointData
+    template<CheckpointDataOperation operation>
+    void doCheckpointData(CheckpointData<operation>* checkpointData);
+
     // Access to legacy state
     //! Get a deep copy of the current state in legacy format
     std::unique_ptr<t_state> localState();
@@ -347,12 +359,6 @@ private:
     //! ITrajectoryWriterClient implementation
     std::optional<ITrajectoryWriterCallback> registerTrajectoryWriterCallback(TrajectoryEvent event) override;
 
-    //! CheckpointHelper identifier
-    const std::string identifier_ = "StatePropagatorData";
-    //! Helper function to read from / write to CheckpointData
-    template<CheckpointDataOperation operation>
-    void doCheckpointData(CheckpointData<operation>* checkpointData, const t_commrec* cr);
-
     //! ILastStepSignallerClient implementation (used for final output only)
     std::optional<SignallerCallback> registerLastStepCallback() override;
 
index 6f0be163caa5a452ae44aa504d6ecd321b742734..896ac888ab167be290e8ba1639e7ef52b69905cf 100644 (file)
@@ -165,7 +165,7 @@ static interaction_const_t setupInteractionConst(const KernelBenchOptions& optio
         GMX_RELEASE_ASSERT(options.ewaldcoeff_q > 0, "Ewald coefficient should be > 0");
         ic.ewaldcoeff_q       = options.ewaldcoeff_q;
         ic.coulombEwaldTables = std::make_unique<EwaldCorrectionTables>();
-        init_interaction_const_tables(nullptr, &ic, 0);
+        init_interaction_const_tables(nullptr, &ic, 0, 0);
     }
 
     return ic;
index 9819cfaca91c9fdeae7df8c4d41c11d5b221c8a5..94877a83c8533c00977ca734176e2aa2efec159a 100644 (file)
 #    define EL_EWALD_ANY
 #endif
 
+#if defined LJ_EWALD_COMB_GEOM || defined LJ_EWALD_COMB_LB
+/* Note: convenience macro, needs to be undef-ed at the end of the file. */
+#    define LJ_EWALD
+#endif
+
 #if defined EL_EWALD_ANY || defined EL_RF || defined LJ_EWALD \
         || (defined EL_CUTOFF && defined CALC_ENERGIES)
 /* Macro to control the calculation of exclusion forces in the kernel
 #    define EXCLUSION_FORCES
 #endif
 
-#if defined LJ_EWALD_COMB_GEOM || defined LJ_EWALD_COMB_LB
-/* Note: convenience macro, needs to be undef-ed at the end of the file. */
-#    define LJ_EWALD
-#endif
-
 #if defined LJ_COMB_GEOM || defined LJ_COMB_LB
 #    define LJ_COMB
 #endif
index 68e5b854cbf13b359bea30f1ccda216428d172b6..e5adb03aa694a88602e638debe2065442597b8ec 100644 (file)
 #    define EL_EWALD_ANY
 #endif
 
+#if defined LJ_EWALD_COMB_GEOM || defined LJ_EWALD_COMB_LB
+/* Note: convenience macro, needs to be undef-ed at the end of the file. */
+#    define LJ_EWALD
+#endif
+
 #if defined EL_EWALD_ANY || defined EL_RF || defined LJ_EWALD \
         || (defined EL_CUTOFF && defined CALC_ENERGIES)
 /* Macro to control the calculation of exclusion forces in the kernel
 #    define EXCLUSION_FORCES
 #endif
 
-#if defined LJ_EWALD_COMB_GEOM || defined LJ_EWALD_COMB_LB
-/* Note: convenience macro, needs to be undef-ed at the end of the file. */
-#    define LJ_EWALD
-#endif
-
 #if defined LJ_COMB_GEOM || defined LJ_COMB_LB
 /* Note: convenience macro, needs to be undef-ed at the end of the file. */
 #    define LJ_COMB
index 888a4df3fd52fcbcaaf415d822761c09a12c4881..6dc9184afb86aaccdf7b611274bef69431c93ea8 100644 (file)
@@ -352,12 +352,22 @@ static inline SimdFloat gmx_simdcall frexp(SimdFloat value, SimdFInt32* exponent
     const float32x4_t half = vdupq_n_f32(0.5F);
     int32x4_t         iExponent;
 
-    iExponent               = vandq_s32(vreinterpretq_s32_f32(value.simdInternal_), exponentMask);
-    iExponent               = vsubq_s32(vshrq_n_s32(iExponent, 23), exponentBias);
-    exponent->simdInternal_ = iExponent;
+    iExponent = vandq_s32(vreinterpretq_s32_f32(value.simdInternal_), exponentMask);
+    iExponent = vsubq_s32(vshrq_n_s32(iExponent, 23), exponentBias);
+
+    float32x4_t result = vreinterpretq_f32_s32(
+            vorrq_s32(vandq_s32(vreinterpretq_s32_f32(value.simdInternal_), mantissaMask),
+                      vreinterpretq_s32_f32(half)));
 
-    return { vreinterpretq_f32_s32(vorrq_s32(vandq_s32(vreinterpretq_s32_f32(value.simdInternal_), mantissaMask),
-                                             vreinterpretq_s32_f32(half))) };
+    if (opt == MathOptimization::Safe)
+    {
+        uint32x4_t valueIsZero = vceqq_f32(value.simdInternal_, vdupq_n_f32(0.0F));
+        iExponent              = vbicq_s32(iExponent, vreinterpretq_s32_u32(valueIsZero));
+        result                 = vbslq_f32(valueIsZero, value.simdInternal_, result);
+    }
+
+    exponent->simdInternal_ = iExponent;
+    return { result };
 }
 
 template<MathOptimization opt = MathOptimization::Safe>
index ee263238be20bcff5fe20b037e75de2168417544..f42243a7d2e8192a52763809e04a196d0351f839 100644 (file)
@@ -317,12 +317,22 @@ static inline SimdDouble frexp(SimdDouble value, SimdDInt32* exponent)
     const float64x2_t half = vdupq_n_f64(0.5);
     int64x2_t         iExponent;
 
-    iExponent               = vandq_s64(int64x2_t(value.simdInternal_), int64x2_t(exponentMask));
-    iExponent               = vsubq_s64(vshrq_n_s64(iExponent, 52), exponentBias);
+    iExponent = vandq_s64(int64x2_t(value.simdInternal_), int64x2_t(exponentMask));
+    iExponent = vsubq_s64(vshrq_n_s64(iExponent, 52), exponentBias);
+
+    float64x2_t result = float64x2_t(vorrq_s64(
+            vandq_s64(int64x2_t(value.simdInternal_), int64x2_t(mantissaMask)), int64x2_t(half)));
+
+    if (opt == MathOptimization::Safe)
+    {
+        uint64x2_t valueIsZero = vceqq_f64(value.simdInternal_, vdupq_n_f64(0.0));
+        iExponent              = vbicq_s64(iExponent, int64x2_t(valueIsZero));
+        result                 = vbslq_f64(valueIsZero, value.simdInternal_, result);
+    }
+
     exponent->simdInternal_ = vmovn_s64(iExponent);
 
-    return { float64x2_t(vorrq_s64(
-            vandq_s64(int64x2_t(value.simdInternal_), int64x2_t(mantissaMask)), int64x2_t(half))) };
+    return { result };
 }
 
 template<MathOptimization opt = MathOptimization::Safe>
index 542d642f498759a6a1e5f9961913b45609c4a3b6..2e5e15850d7aa8c2c8f2ca1eccefa4ddbfc4246e 100644 (file)
@@ -385,16 +385,24 @@ static inline SimdDouble gmx_simdcall frexp(SimdDouble value, SimdDInt32* expone
     svint64_t         iExponent;
 
     iExponent = svand_s64_x(pg, svreinterpret_s64_f64(value.simdInternal_), exponentMask);
-    // iExponent               = svsub_s64_x(pg, svlsr_n_s64_x(pg, iExponent, 52), exponentBias);
     iExponent = svsub_s64_x(
             pg, svreinterpret_s64_u64(svlsr_n_u64_x(pg, svreinterpret_u64_s64(iExponent), 52)), exponentBias);
 
-    exponent->simdInternal_ = iExponent;
 
-    return { svreinterpret_f64_s64(
+    svfloat64_t result = svreinterpret_f64_s64(
             svorr_s64_x(pg,
                         svand_s64_x(pg, svreinterpret_s64_f64(value.simdInternal_), mantissaMask),
-                        svreinterpret_s64_f64(half))) };
+                        svreinterpret_s64_f64(half)));
+
+    if (opt == MathOptimization::Safe)
+    {
+        svbool_t valueIsZero = svcmpeq_n_f64(pg, value.simdInternal_, 0.0);
+        iExponent            = svsel_s64(valueIsZero, svdup_s64(0), iExponent);
+        result               = svsel_f64(valueIsZero, value.simdInternal_, result);
+    }
+
+    exponent->simdInternal_ = iExponent;
+    return { result };
 }
 
 template<MathOptimization opt = MathOptimization::Safe>
index a7f2737c27c5f65e9428f139c49989311fd3bce8..2945ea66a03df0b95445dfc3bdd2ad37a8da11a5 100644 (file)
@@ -392,12 +392,21 @@ static inline SimdFloat gmx_simdcall frexp(SimdFloat value, SimdFInt32* exponent
     iExponent = svand_s32_x(pg, svreinterpret_s32_f32(value.simdInternal_), exponentMask);
     iExponent = svsub_s32_x(
             pg, svreinterpret_s32_u32(svlsr_n_u32_x(pg, svreinterpret_u32_s32(iExponent), 23)), exponentBias);
-    exponent->simdInternal_ = iExponent;
 
-    return { svreinterpret_f32_s32(
+    svfloat32_t result = svreinterpret_f32_s32(
             svorr_s32_x(pg,
                         svand_s32_x(pg, svreinterpret_s32_f32(value.simdInternal_), mantissaMask),
-                        svreinterpret_s32_f32(half))) };
+                        svreinterpret_s32_f32(half)));
+
+    if (opt == MathOptimization::Safe)
+    {
+        svbool_t valueIsZero = svcmpeq_n_f32(pg, value.simdInternal_, 0.0F);
+        iExponent            = svsel_s32(valueIsZero, svdup_s32(0), iExponent);
+        result               = svsel_f32(valueIsZero, value.simdInternal_, result);
+    }
+
+    exponent->simdInternal_ = iExponent;
+    return { result };
 }
 
 template<MathOptimization opt = MathOptimization::Safe>
index 30637ade0c622e6a7a2b40d3e90d5568cff457c9..878dcc937ddf6f76e837e840b1d8c3e620e05c04 100644 (file)
@@ -79,7 +79,7 @@ double gmx_cycles_calibrate(double sampletime)
     GMX_UNUSED_VALUE(sampletime);
 #else
 #    if ((defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__PATHSCALE__) || defined(__PGIC__)) \
-         && defined(__x86_64__) && !defined(_CRAYC))
+         && defined(__x86_64__) && !defined(__ILP32__) && !defined(_CRAYC))
     long gmx_unused tmp;
     int             cpuid1;
     int gmx_unused cpuid2;
index 77f70a7863e5e6cdf6c0a96b3a5d6cde2ad76816..c7e36f603d5c2193a9d21e95001e6a7dc26e841d 100644 (file)
@@ -112,8 +112,9 @@ public:
      *
      * \throws std::bad_alloc if out of memory.
      */
-    template<typename T, typename = std::enable_if_t<!std::is_same_v<T, Any>>>
-    explicit Any(T&& value) : content_(new Content<std::decay_t<T>>(std::forward<T>(value)))
+    template<typename T, typename = std::enable_if_t<!std::is_same<T, Any>::value>>
+    explicit Any(T&& value) :
+        content_(new Content<typename std::decay<T>::type>(std::forward<T>(value)))
     {
     }
     /*! \brief
index f0638775db17202074b9d22d28a7412c008ae4c7..ec06ccd4ab88fe576f91f7c694096afbb34aff48 100644 (file)
@@ -97,6 +97,7 @@ const char* getGpuImplementationString()
         else
         {
             GMX_RELEASE_ASSERT(false, "Unknown GPU configuration");
+            return "impossible";
         }
     }
     else
index ab7a55ea54fa761b89338628c86affd7166197ac..24fa2b3fd4845e5323f91a667bfc352da10c5ac0 100644 (file)
@@ -113,6 +113,22 @@ void dumpKeyValueTree(TextWriter* writer, const KeyValueTreeObject& tree)
             dumpKeyValueTree(writer, value.asObject());
             writer->wrapperSettings().setIndent(oldIndent);
         }
+        else if (value.isArray()
+                 && std::all_of(value.asArray().values().begin(),
+                                value.asArray().values().end(),
+                                [](const auto& elem) { return elem.isObject(); }))
+        {
+            // Array containing only objects
+            writer->writeString(prop.key());
+            writer->writeLine(":");
+            int oldIndent = writer->wrapperSettings().indent();
+            writer->wrapperSettings().setIndent(oldIndent + 2);
+            for (const auto& elem : value.asArray().values())
+            {
+                dumpKeyValueTree(writer, elem.asObject());
+            }
+            writer->wrapperSettings().setIndent(oldIndent);
+        }
         else
         {
             int indent = writer->wrapperSettings().indent();
@@ -123,8 +139,10 @@ void dumpKeyValueTree(TextWriter* writer, const KeyValueTreeObject& tree)
                 writer->writeString("[");
                 for (const auto& elem : value.asArray().values())
                 {
-                    GMX_RELEASE_ASSERT(!elem.isObject() && !elem.isArray(),
-                                       "Arrays of objects not currently implemented");
+                    GMX_RELEASE_ASSERT(
+                            !elem.isObject() && !elem.isArray(),
+                            "Only arrays of simple types and array of objects are implemented. "
+                            "Arrays of arrays and mixed arrays are not supported.");
                     writer->writeString(" ");
                     writer->writeString(simpleValueToString(elem));
                 }
index 56a21bd394fa2b85aab7faa9a50b08c1acfebe90..63c595a630cf9dc0701ccd358694f6c64de9f485 100644 (file)
@@ -53,6 +53,7 @@ if(GMX_FAHCORE)
     add_library(fahcore $<TARGET_OBJECTS:mdrun_objlib>)
     target_link_libraries(fahcore PRIVATE ${GMX_COMMON_LIBRARIES} legacy_api)
 elseif(GMX_BUILD_MDRUN_ONLY)
+    message(STATUS "The mdrun-only build is deprecated")
     add_executable(mdrun-only $<TARGET_OBJECTS:mdrun_objlib> mdrun_main.cpp)
     gmx_target_compile_options(mdrun-only)
     target_include_directories(mdrun-only SYSTEM BEFORE PRIVATE ${PROJECT_SOURCE_DIR}/src/external/thread_mpi/include)
index 4a7774237f16fb8d09fbae753fc90c7beb4b1dd9..357882bb4843d9ed2b35854e8cdc0c725cbf6ff1 100644 (file)
@@ -86,6 +86,7 @@ set(exename "mdrun-io-test")
 
 gmx_add_gtest_executable(${exename}
     CPP_SOURCE_FILES
+        checkpoint.cpp
         exactcontinuation.cpp
         grompp.cpp
         initialconstraints.cpp
@@ -107,7 +108,6 @@ gmx_add_gtest_executable(${exename}
         ewaldsurfaceterm.cpp
         multiple_time_stepping.cpp
         orires.cpp
-        simulator.cpp
         swapcoords.cpp
         tabulated_bonded_interactions.cpp
         # pseudo-library for code for mdrun
@@ -234,3 +234,17 @@ target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure)
 # TODO: Link specific modules: topology
 target_link_libraries(${exename} PRIVATE legacy_modules)
 gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
+
+# End-to-end tests comparing different simulator code paths
+set(testname "MdrunSimulatorComparison")
+set(exename "mdrun-simulator-comparison-test")
+
+gmx_add_gtest_executable(${exename}
+        CPP_SOURCE_FILES
+        # files with code for tests
+        simulator.cpp
+        # pseudo-library for code for mdrun
+        $<TARGET_OBJECTS:mdrun_objlib>
+        )
+target_link_libraries(${exename} PRIVATE mdrun_test_infrastructure)
+gmx_register_gtest_test(${testname} ${exename} OPENMP_THREADS 2 INTEGRATION_TEST IGNORE_LEAKS)
diff --git a/src/programs/mdrun/tests/checkpoint.cpp b/src/programs/mdrun/tests/checkpoint.cpp
new file mode 100644 (file)
index 0000000..2ddd809
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2020, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+
+/*! \internal \file
+ * \brief Tests for checkpoint writing sanity checks
+ *
+ * Checks that final checkpoint is equal to final trajectory output.
+ *
+ * \author Pascal Merz <pascal.merz@me.com>
+ * \ingroup module_mdrun_integration_tests
+ */
+#include "gmxpre.h"
+
+#include "config.h"
+
+#include "gromacs/utility/strconvert.h"
+#include "gromacs/utility/stringutil.h"
+
+#include "testutils/simulationdatabase.h"
+
+#include "moduletest.h"
+#include "simulatorcomparison.h"
+#include "trajectoryreader.h"
+
+namespace gmx::test
+{
+namespace
+{
+
+class CheckpointCoordinatesSanityChecks :
+    public MdrunTestFixture,
+    public ::testing::WithParamInterface<std::tuple<std::string, std::string, std::string, std::string>>
+{
+public:
+    void runSimulation(MdpFieldValues     mdpFieldValues,
+                       int                numSteps,
+                       const std::string& trrFileName,
+                       const std::string& cptFileName)
+    {
+        mdpFieldValues["nsteps"] = toString(numSteps);
+        // Trajectories have the initial and the last frame
+        mdpFieldValues["nstxout"] = toString(numSteps);
+        mdpFieldValues["nstvout"] = toString(numSteps);
+        mdpFieldValues["nstfout"] = toString(0);
+
+        // Run grompp
+        runner_.useStringAsMdpFile(prepareMdpFileContents(mdpFieldValues));
+        runGrompp(&runner_);
+
+        // Do first mdrun
+        runner_.fullPrecisionTrajectoryFileName_ = trrFileName;
+        runMdrun(&runner_, { { "-cpo", cptFileName } });
+    }
+
+    static void compareCptAndTrr(const std::string&          trrFileName,
+                                 const std::string&          cptFileName,
+                                 const TrajectoryComparison& trajectoryComparison)
+    {
+        TrajectoryFrameReader trrReader(trrFileName);
+        TrajectoryFrameReader cptReader(cptFileName);
+        // Checkpoint has at least one frame
+        EXPECT_TRUE(cptReader.readNextFrame());
+        // Trajectory has at least two frames
+        EXPECT_TRUE(trrReader.readNextFrame());
+        EXPECT_NO_THROW(trrReader.frame());
+        EXPECT_TRUE(trrReader.readNextFrame());
+
+        // Now compare frames
+        trajectoryComparison(cptReader.frame(), trrReader.frame());
+
+        // Files had exactly 1 / 2 frames
+        EXPECT_FALSE(cptReader.readNextFrame());
+        EXPECT_FALSE(trrReader.readNextFrame());
+    }
+};
+
+TEST_P(CheckpointCoordinatesSanityChecks, WithinTolerances)
+{
+    const auto& params              = GetParam();
+    const auto& simulationName      = std::get<0>(params);
+    const auto& integrator          = std::get<1>(params);
+    const auto& temperatureCoupling = std::get<2>(params);
+    const auto& pressureCoupling    = std::get<3>(params);
+
+    // Specify how trajectory frame matching must work.
+    TrajectoryFrameMatchSettings trajectoryMatchSettings{ true,
+                                                          true,
+                                                          true,
+                                                          ComparisonConditions::MustCompare,
+                                                          ComparisonConditions::MustCompare,
+                                                          ComparisonConditions::NoComparison,
+                                                          MaxNumFrames::compareAllFrames() };
+    if (integrator == "md-vv")
+    {
+        // When using md-vv and modular simulator, the velocities are expected to be off by
+        // 1/2 dt between checkpoint (top of the loop) and trajectory (full time step state)
+        trajectoryMatchSettings.velocitiesComparison = ComparisonConditions::NoComparison;
+    }
+    const TrajectoryTolerances trajectoryTolerances{
+        defaultRealTolerance(), defaultRealTolerance(), defaultRealTolerance(), defaultRealTolerance()
+    };
+
+    const auto mdpFieldValues =
+            prepareMdpFieldValues(simulationName, integrator, temperatureCoupling, pressureCoupling);
+    runner_.useTopGroAndNdxFromDatabase(simulationName);
+    // Set file names
+    const auto cptFileName = fileManager_.getTemporaryFilePath(".cpt");
+    const auto trrFileName = fileManager_.getTemporaryFilePath(".trr");
+
+    SCOPED_TRACE(formatString(
+            "Checking the sanity of the checkpointed coordinates using system '%s' "
+            "with integrator '%s', '%s' temperature coupling, and '%s' pressure coupling ",
+            simulationName.c_str(),
+            integrator.c_str(),
+            temperatureCoupling.c_str(),
+            pressureCoupling.c_str()));
+
+    SCOPED_TRACE("End of trajectory sanity");
+    // Running a few steps - we expect the checkpoint to be equal
+    // to the final configuration
+    runSimulation(mdpFieldValues, 16, trrFileName, cptFileName);
+    compareCptAndTrr(trrFileName, cptFileName, { trajectoryMatchSettings, trajectoryTolerances });
+}
+
+#if !GMX_GPU_OPENCL
+INSTANTIATE_TEST_CASE_P(CheckpointCoordinatesAreSane,
+                        CheckpointCoordinatesSanityChecks,
+                        ::testing::Combine(::testing::Values("spc2"),
+                                           ::testing::Values("md", "md-vv"),
+                                           ::testing::Values("no"),
+                                           ::testing::Values("no")));
+#else
+INSTANTIATE_TEST_CASE_P(DISABLED_CheckpointCoordinatesAreSane,
+                        CheckpointCoordinatesSanityChecks,
+                        ::testing::Combine(::testing::Values("spc2"),
+                                           ::testing::Values("md", "md-vv"),
+                                           ::testing::Values("no"),
+                                           ::testing::Values("no")));
+#endif
+
+} // namespace
+} // namespace gmx::test
index 8c922b8e6cc68cba1902ad687555b1ddb03e11b2..d23f3925fde55778d3223c3f5686a90ace35b8f0 100644 (file)
@@ -362,8 +362,11 @@ TEST_P(MdrunNoAppendContinuationIsExact, WithinTolerances)
     const bool isTCouplingCompatibleWithModularSimulator =
             (temperatureCoupling == "no" || temperatureCoupling == "v-rescale"
              || temperatureCoupling == "berendsen");
+    // GPU update is not compatible with modular simulator
+    const bool isGpuUpdateRequested = (getenv("GMX_FORCE_UPDATE_DEFAULT_GPU") != nullptr);
     if (integrator == "md-vv" && pressureCoupling == "parrinello-rahman"
-        && (isModularSimulatorExplicitlyDisabled || !isTCouplingCompatibleWithModularSimulator))
+        && (isModularSimulatorExplicitlyDisabled || !isTCouplingCompatibleWithModularSimulator
+            || isGpuUpdateRequested))
     {
         // Under md-vv, Parrinello-Rahman is only implemented for the modular simulator
         return;
index 6c39160bf3fb22b79c74e827069e69776a2a10ec..9072e7b98ec93a4f53564a93a08fb383bbfa5c13 100644 (file)
@@ -95,16 +95,30 @@ TEST_P(FreeEnergyReferenceTest, WithinTolerances)
     const auto  maxNumWarnings   = std::get<1>(GetParam());
     const auto& interactionsList = std::get<2>(GetParam());
 
-    // TODO In similar tests, we are checking if the tests
-    //      can be run with the number of MPI ranks available
+    // As these tests check reproducibility, we restrict the maximum number
+    // of ranks to allow us to keep the tolerances tight. See also #3741.
+    const int     numRanksAvailable = getNumberOfTestMpiRanks();
+    constexpr int maxNumRanks       = 8;
+    if (numRanksAvailable > maxNumRanks)
+    {
+        fprintf(stdout,
+                "The FEP tests cannot run with %d ranks.\n"
+                "The maximum number of ranks supported is %d.",
+                numRanksAvailable,
+                maxNumRanks);
+        return;
+    }
 
     SCOPED_TRACE(formatString("Comparing FEP simulation '%s' to reference", simulationName.c_str()));
 
-    // Tolerance set to pass with identical code version and a range of different test setups
+    // Tolerance set to pass with identical code version and a range of different test setups for most tests
     const auto defaultEnergyTolerance = relativeToleranceAsFloatingPoint(50.0, GMX_DOUBLE ? 1e-5 : 1e-4);
+    // Some simulations are significantly longer, so they need a larger tolerance
+    const auto longEnergyTolerance = relativeToleranceAsFloatingPoint(50.0, GMX_DOUBLE ? 1e-4 : 1e-3);
+    const bool isLongSimulation    = (simulationName == "expanded");
+    const auto energyTolerance = isLongSimulation ? longEnergyTolerance : defaultEnergyTolerance;
 
-    EnergyTermsToCompare energyTermsToCompare{ { interaction_function[F_EPOT].longname,
-                                                 defaultEnergyTolerance } };
+    EnergyTermsToCompare energyTermsToCompare{ { interaction_function[F_EPOT].longname, energyTolerance } };
     for (const auto& interaction : interactionsList)
     {
         energyTermsToCompare.emplace(interaction_function[interaction].longname, defaultEnergyTolerance);
@@ -118,6 +132,7 @@ TEST_P(FreeEnergyReferenceTest, WithinTolerances)
                                                           ComparisonConditions::NoComparison,
                                                           ComparisonConditions::MustCompare };
     TrajectoryTolerances trajectoryTolerances = TrajectoryComparison::s_defaultTrajectoryTolerances;
+    trajectoryTolerances.forces = relativeToleranceAsFloatingPoint(100.0, GMX_DOUBLE ? 5.0e-5 : 5.0e-4);
 
     // Build the functor that will compare reference and test
     // trajectory frames in the chosen way.
@@ -139,12 +154,17 @@ TEST_P(FreeEnergyReferenceTest, WithinTolerances)
     runner_.dhdlFileName_                    = simulationDhdlFileName;
     runMdrun(&runner_);
 
-    // Currently used tests write trajectory (x/v/f) frames every 20 steps.
-    // Testing more than the first force frame is only feasible in double precision
-    // using a single rank.
-    // Note that this only concerns trajectory frames, energy frames are checked
-    // in all cases.
-    const bool testAllTrajectoryFrames = (GMX_DOUBLE && (getNumberOfTestMpiRanks() == 1));
+    /* Currently used tests write trajectory (x/v/f) frames every 20 steps.
+     * Except for the expanded ensemble test, all tests run for 20 steps total.
+     * As the tolerances are relatively strict, we need to restrict the number of
+     * force frames we can expect to match.
+     * Testing more than the first force frame is only feasible in double precision
+     * using a single rank.
+     * Testing one force frame is only feasible in double precision.
+     * Note that this only concerns trajectory frames, energy frames are checked
+     * in all cases. */
+    const bool testTwoTrajectoryFrames = (GMX_DOUBLE && (getNumberOfTestMpiRanks() == 1));
+    const bool testOneTrajectoryFrame  = GMX_DOUBLE;
 
     // Compare simulation results
     TestReferenceData    refData;
@@ -152,15 +172,21 @@ TEST_P(FreeEnergyReferenceTest, WithinTolerances)
     // Check that the energies agree with the refdata within tolerance.
     checkEnergiesAgainstReferenceData(simulationEdrFileName, energyTermsToCompare, &rootChecker);
     // Check that the trajectories agree with the refdata within tolerance.
-    if (testAllTrajectoryFrames)
+    if (testTwoTrajectoryFrames)
     {
-        checkTrajectoryAgainstReferenceData(simulationTrajectoryFileName, trajectoryComparison, &rootChecker);
+        checkTrajectoryAgainstReferenceData(
+                simulationTrajectoryFileName, trajectoryComparison, &rootChecker, MaxNumFrames(2));
     }
-    else
+    else if (testOneTrajectoryFrame)
     {
         checkTrajectoryAgainstReferenceData(
                 simulationTrajectoryFileName, trajectoryComparison, &rootChecker, MaxNumFrames(1));
     }
+    else
+    {
+        checkTrajectoryAgainstReferenceData(
+                simulationTrajectoryFileName, trajectoryComparison, &rootChecker, MaxNumFrames(0));
+    }
     if (File::exists(simulationDhdlFileName, File::returnFalseOnError))
     {
         TextInputFile dhdlFile(simulationDhdlFileName);
index b8aec654a78a12053311487a1d886cd8c35283ca..65418e8c899d2245f58ac6c5bf867691e1d606c5 100644 (file)
@@ -110,6 +110,14 @@ TEST_P(SimulatorComparisonTest, WithinTolerances)
         return;
     }
 
+    const std::string envVariableModSimOn  = "GMX_USE_MODULAR_SIMULATOR";
+    const std::string envVariableModSimOff = "GMX_DISABLE_MODULAR_SIMULATOR";
+
+    GMX_RELEASE_ASSERT(
+            environmentVariable == envVariableModSimOn || environmentVariable == envVariableModSimOff,
+            ("Expected tested environment variable to be " + envVariableModSimOn + " or " + envVariableModSimOff)
+                    .c_str());
+
     const auto hasConservedField = !(tcoupling == "no" && pcoupling == "no");
 
     SCOPED_TRACE(formatString(
@@ -126,8 +134,8 @@ TEST_P(SimulatorComparisonTest, WithinTolerances)
             simulationName.c_str(), integrator.c_str(), tcoupling.c_str(), pcoupling.c_str());
 
     EnergyTermsToCompare energyTermsToCompare{ {
-            { interaction_function[F_EPOT].longname, relativeToleranceAsPrecisionDependentUlp(10.0, 100, 80) },
-            { interaction_function[F_EKIN].longname, relativeToleranceAsPrecisionDependentUlp(60.0, 100, 80) },
+            { interaction_function[F_EPOT].longname, relativeToleranceAsPrecisionDependentUlp(60.0, 200, 160) },
+            { interaction_function[F_EKIN].longname, relativeToleranceAsPrecisionDependentUlp(60.0, 200, 160) },
             { interaction_function[F_PRES].longname,
               relativeToleranceAsPrecisionDependentFloatingPoint(10.0, 0.01, 0.001) },
     } };
@@ -185,16 +193,18 @@ TEST_P(SimulatorComparisonTest, WithinTolerances)
     runner_.useStringAsMdpFile(prepareMdpFileContents(mdpFieldValues));
     runGrompp(&runner_);
 
-    // Backup current state of environment variable and unset it
-    const char* environmentVariableBackup = getenv(environmentVariable.c_str());
-    gmxUnsetenv(environmentVariable.c_str());
+    // Backup current state of both environment variables and unset them
+    const char* environmentVariableBackupOn  = getenv(envVariableModSimOn.c_str());
+    const char* environmentVariableBackupOff = getenv(envVariableModSimOff.c_str());
+    gmxUnsetenv(envVariableModSimOn.c_str());
+    gmxUnsetenv(envVariableModSimOff.c_str());
 
     // Do first mdrun
     runner_.fullPrecisionTrajectoryFileName_ = simulator1TrajectoryFileName;
     runner_.edrFileName_                     = simulator1EdrFileName;
     runMdrun(&runner_);
 
-    // Set environment variable
+    // Set tested environment variable
     const int overWriteEnvironmentVariable = 1;
     gmxSetenv(environmentVariable.c_str(), "ON", overWriteEnvironmentVariable);
 
@@ -203,16 +213,16 @@ TEST_P(SimulatorComparisonTest, WithinTolerances)
     runner_.edrFileName_                     = simulator2EdrFileName;
     runMdrun(&runner_);
 
-    // Reset or unset environment variable to leave further tests undisturbed
-    if (environmentVariableBackup != nullptr)
+    // Unset tested environment variable
+    gmxUnsetenv(environmentVariable.c_str());
+    // Reset both environment variables to leave further tests undisturbed
+    if (environmentVariableBackupOn != nullptr)
     {
-        // set environment variable
-        gmxSetenv(environmentVariable.c_str(), environmentVariableBackup, overWriteEnvironmentVariable);
+        gmxSetenv(environmentVariable.c_str(), environmentVariableBackupOn, overWriteEnvironmentVariable);
     }
-    else
+    if (environmentVariableBackupOff != nullptr)
     {
-        // unset environment variable
-        gmxUnsetenv(environmentVariable.c_str());
+        gmxSetenv(environmentVariable.c_str(), environmentVariableBackupOff, overWriteEnvironmentVariable);
     }
 
     // Compare simulation results