From: Mark Abraham Date: Thu, 17 Dec 2020 11:10:35 +0000 (+0000) Subject: Update CI image to OneAPI 2021.1.1, add ICC tests. X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=c1a0727c81b010ef83b8c878513b8d58299b236c;p=alexxy%2Fgromacs.git Update CI image to OneAPI 2021.1.1, add ICC tests. Also, backport a change from MR !796 that silences the false-positive ICC compiler warning. --- diff --git a/admin/containers/buildall.sh b/admin/containers/buildall.sh index f44058a43a..ba8759ee64 100644 --- a/admin/containers/buildall.sh +++ b/admin/containers/buildall.sh @@ -18,7 +18,7 @@ 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." diff --git a/admin/containers/scripted_gmx_docker_builds.py b/admin/containers/scripted_gmx_docker_builds.py index 1b820805bd..2e3bb6a1e2 100755 --- a/admin/containers/scripted_gmx_docker_builds.py +++ b/admin/containers/scripted_gmx_docker_builds.py @@ -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)] diff --git a/admin/containers/utility.py b/admin/containers/utility.py index 66d8af6fd3..046a898245 100644 --- a/admin/containers/utility.py +++ b/admin/containers/utility.py @@ -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() diff --git a/admin/gitlab-ci/global.gitlab-ci.yml b/admin/gitlab-ci/global.gitlab-ci.yml index d7eb86ac12..c90d795014 100644 --- a/admin/gitlab-ci/global.gitlab-ci.yml +++ b/admin/gitlab-ci/global.gitlab-ci.yml @@ -91,3 +91,18 @@ - 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 diff --git a/admin/gitlab-ci/gromacs.gitlab-ci.yml b/admin/gitlab-ci/gromacs.gitlab-ci.yml index 2850546af4..582be7e014 100644 --- a/admin/gitlab-ci/gromacs.gitlab-ci.yml +++ b/admin/gitlab-ci/gromacs.gitlab-ci.yml @@ -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 @@ -427,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 @@ -542,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 @@ -598,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: @@ -696,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 @@ -709,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 @@ -871,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 @@ -898,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: @@ -1088,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 @@ -1117,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: @@ -1205,19 +1250,19 @@ 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-9:release:regressiontest: extends: @@ -1273,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 @@ -1287,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 diff --git a/src/gromacs/fft/calcgrid.cpp b/src/gromacs/fft/calcgrid.cpp index 8d293464b7..de0bbb1b9a 100644 --- a/src/gromacs/fft/calcgrid.cpp +++ b/src/gromacs/fft/calcgrid.cpp @@ -51,14 +51,14 @@ */ /* Small grid size array */ -#define g_initNR 15 -const int grid_init[g_initNR] = { 6, 8, 10, 12, 14, 16, 20, 24, 25, 28, 32, 36, 40, 42, 44 }; +constexpr int g_initNR = 15; +constexpr int grid_init[g_initNR] = { 6, 8, 10, 12, 14, 16, 20, 24, 25, 28, 32, 36, 40, 42, 44 }; /* For larger grid sizes, a prefactor with any power of 2 can be added. * Only sizes divisible by 4 should be used, 90 is allowed, 140 not. */ -#define g_baseNR 14 -const int grid_base[g_baseNR] = { 45, 48, 50, 52, 54, 56, 60, 64, 70, 72, 75, 80, 81, 84 }; +constexpr int g_baseNR = 14; +constexpr int grid_base[g_baseNR] = { 45, 48, 50, 52, 54, 56, 60, 64, 70, 72, 75, 80, 81, 84 }; real calcFftGrid(FILE* fp, const matrix box, real gridSpacing, int minGridPointsPerDim, int* nx, int* ny, int* nz) { @@ -74,10 +74,8 @@ real calcFftGrid(FILE* fp, const matrix box, real gridSpacing, int minGridPoints gmx_fatal(FARGS, "invalid fourier grid spacing: %g", gridSpacing); } - if (grid_base[g_baseNR - 1] % 4 != 0) - { - gmx_incons("the last entry in grid_base is not a multiple of 4"); - } + static_assert(grid_base[g_baseNR - 1] % 4 == 0, + "the last entry in grid_base is not a multiple of 4"); /* New grid calculation setup: *