diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd58a9b844..100d9933ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,7 +30,7 @@ include: - .variables-template - .tags-template -.regressiontests-extends-template: +.regressiontests-prepare-extends-template: extends: - .no-cache-template - .variables-template @@ -45,7 +45,7 @@ stages: - configure-build # Build GROMACS in multiple configurations - build - # Test each configuration, perhaps in multiple ways + # Unit test each configuration, perhaps in multiple ways - test # Generate documentation files - documentation @@ -179,12 +179,12 @@ stages: # Runs during pre-build prepare-regressiontests: extends: - - .regressiontests-extends-template + - .regressiontests-prepare-extends-template - .regressiontests-template prepare-release-version: extends: - - .regressiontests-extends-template + - .regressiontests-prepare-extends-template - .release-version-template # Initial build that always needs to pass before follow-up stages run @@ -388,6 +388,7 @@ configure-docs-gmxapi: configure-archive-nightly: stage: nightly-configure only: + - web - triggers - schedules needs: @@ -564,6 +565,7 @@ test-gcc-7: - job: simple-build artifacts: false - job: build-gcc-7 + - job: prepare-regressiontests except: variables: - $GROMACS_RELEASE @@ -577,6 +579,7 @@ test-gcc-7-gmxapi: - job: simple-build artifacts: false - job: build-gcc-7-gmxapi + - job: prepare-regressiontests except: variables: - $GROMACS_RELEASE @@ -585,10 +588,13 @@ test-gcc-7-double: extends: - .test-gcc - .gcc7-template + variables: + REGRESSIONTEST_DOUBLE: "-double" needs: - job: simple-build artifacts: false - job: build-gcc-7-double + - job: prepare-regressiontests except: variables: - $GROMACS_RELEASE @@ -601,6 +607,7 @@ test-gcc-8: - job: simple-build artifacts: false - job: build-gcc-8 + - job: prepare-regressiontests except: variables: - $GROMACS_RELEASE @@ -612,10 +619,15 @@ test-gcc-8-cuda-10.2: extends: - .test-gcc-cuda - .gcc-8-cuda-10.2-template + variables: + REGRESSIONTEST_PME_RANK_NUMBER: 0 + REGRESSIONTEST_TOTAL_RANK_NUMBER: 2 + REGRESSIONTEST_OMP_RANK_NUMBER: 1 needs: - job: simple-build artifacts: false - job: build-gcc-8-cuda-10.2 + - job: prepare-regressiontests except: variables: - $GROMACS_RELEASE @@ -628,6 +640,7 @@ test-gcc-7-simd-sse41: - job: simple-build artifacts: false - job: build-gcc-7-simd-sse41 + - job: prepare-regressiontests except: variables: - $GROMACS_RELEASE @@ -640,6 +653,7 @@ test-clang-7: - job: simple-build artifacts: false - job: build-clang-7 + - job: prepare-regressiontests except: variables: - $GROMACS_RELEASE @@ -653,6 +667,7 @@ test-clang-7-gmxapi: - job: simple-build artifacts: false - job: build-clang-7-gmxapi + - job: prepare-regressiontests except: variables: - $GROMACS_RELEASE @@ -665,6 +680,7 @@ test-clang-8: - job: simple-build artifacts: false - job: build-clang-8 + - job: prepare-regressiontests except: variables: - $GROMACS_RELEASE @@ -672,11 +688,14 @@ test-clang-8: test-clang-6: extends: - .test-clang - - .clang6-template + - .clang6-template + variables: + REGRESSIONTEST_OMP_RANK_NUMBER: 0 needs: - job: simple-build artifacts: false - job: build-clang-6 + - job: prepare-regressiontests except: variables: - $GROMACS_RELEASE @@ -890,10 +909,10 @@ linkchecker: dependencies: - webpage-gmxapi only: + - web - schedules - triggers - merge_requests - - external_pull_requests except: variables: - $GROMACS_RELEASE @@ -921,6 +940,7 @@ build-archive-nightly: - job: configure-archive-nightly artifacts: true only: + - web - triggers - schedules except: @@ -935,6 +955,7 @@ webpage-nightly: - .configure-gmxapi-template stage: nightly-deploy only: + - web - triggers - schedules except: @@ -958,7 +979,7 @@ webpage-nightly: package-regressiontests-release: extends: - - .regressiontests-extends-template + - .regressiontests-prepare-extends-template - .regressiontests-release-template needs: - job: prepare-release-version @@ -992,7 +1013,7 @@ package-archive-release: release-verify: extends: - - .regressiontests-extends-template + - .regressiontests-prepare-extends-template - .release-verify-template only: diff --git a/admin/ci-templates/.build-docs-template.yml b/admin/ci-templates/.build-docs-template.yml index 6f257f969a..7312348354 100644 --- a/admin/ci-templates/.build-docs-template.yml +++ b/admin/ci-templates/.build-docs-template.yml @@ -1,8 +1,14 @@ .configure-docs-template: - # Built by admin/dockerfiles/ci-docs + # Built by admin/dockerfiles/ci-docs-clang # TODO this should be organized more like the current documentation.py script - image: gromacs/continuous-integration:ci-docs + image: gromacs/ci-docs-clang:2020 stage: configure-build + only: + refs: + - web + - pushes + - schedules + - merge_requests variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 @@ -62,9 +68,15 @@ - $BUILD_DIR .build-docs-binary-template: - # Built by admin/dockerfiles/ci-docs + # Built by admin/dockerfiles/ci-docs-clang # TODO this should be organized more like the current documentation.py script - image: gromacs/continuous-integration:ci-docs + image: gromacs/ci-docs-clang:2020 + only: + refs: + - web + - pushes + - schedules + - merge_requests script: - cd $BUILD_DIR - cmake --build . --target gmx -- -j8 @@ -77,9 +89,15 @@ - $BUILD_DIR .build-docs-webpage-template: - # Built by admin/dockerfiles/ci-docs + # Built by admin/dockerfiles/ci-docs-clang # TODO this should be organized more like the current documentation.py script - image: gromacs/continuous-integration:ci-docs + image: gromacs/ci-docs-clang:2020 + only: + refs: + - web + - pushes + - schedules + - merge_requests variables: KUBERNETES_CPU_LIMIT: 4 KUBERNETES_CPU_REQUEST: 2 @@ -111,9 +129,9 @@ - $BUILD_DIR/docs/sphinx-html.log .configure-docs-release-template: - # Built by admin/dockerfiles/ci-docs + # Built by admin/dockerfiles/ci-docs-clang # TODO this should be organized more like the current documentation.py script - image: gromacs/continuous-integration:ci-docs + image: gromacs/ci-docs-clang:2020 stage: release-configure variables: KUBERNETES_CPU_LIMIT: 1 diff --git a/admin/ci-templates/.build-template.yml b/admin/ci-templates/.build-template.yml index 256123fcf7..d05a83dce6 100644 --- a/admin/ci-templates/.build-template.yml +++ b/admin/ci-templates/.build-template.yml @@ -2,7 +2,12 @@ # Dockerfiles are from dockerhub, user eriklindahl # image in admin/dockerimages/ci-docs-py27 stage: configure-build - image: biophysics/gcc-gromacs + only: + refs: + - web + - pushes + - schedules + - merge_requests variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 @@ -56,7 +61,6 @@ # Dockerfiles are from dockerhub, user eriklindahl # image in admin/dockerimages/ci-docs-py27 stage: release-configure - image: biophysics/gcc-gromacs variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 @@ -148,9 +152,12 @@ # Dockerfiles are from dockerhub, user eriklindahl # image in admin/dockerimages/ci-docs-py27 stage: build - image: biophysics/gcc-gromacs - variables: - + only: + refs: + - web + - pushes + - schedules + - merge_requests script: - cd $BUILD_DIR - cmake --build . -- -j8 2>&1 | tee buildLogFile.log @@ -175,8 +182,13 @@ # Redmine #3361 .archive-build-template: # Dockerfiles are from dockerhub, user eriklindahl - image: gromacs/continuous-integration:ci-docs - variables: + image: gromacs/ci-docs-clang:2020 + only: + refs: + - web + - pushes + - schedules + - merge_requests variables: KUBERNETES_CPU_LIMIT: 4 KUBERNETES_CPU_REQUEST: 2 @@ -222,7 +234,6 @@ .simple-build-template: # Docker images are from dockerhub, user eriklindahl stage: pre-build - image: biophysics/gcc-gromacs variables: KUBERNETES_CPU_LIMIT: 8 KUBERNETES_CPU_REQUEST: 4 @@ -235,6 +246,12 @@ CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug" CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF" CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF" + only: + refs: + - web + - pushes + - schedules + - merge_requests script: - echo $CMAKE_COMPILER_SCRIPT diff --git a/admin/ci-templates/.image-templates.yml b/admin/ci-templates/.image-templates.yml index a7196734a5..311b45c46c 100644 --- a/admin/ci-templates/.image-templates.yml +++ b/admin/ci-templates/.image-templates.yml @@ -1,47 +1,47 @@ .gcc5-template: - image: gromacs/continuous-integration:ci-gcc-5 + image: gromacs/ci-gcc-5:2020 .gcc6-template: - image: gromacs/continuous-integration:ci-gcc-6 + image: gromacs/ci-gcc-6:2020 .gcc7-template: - image: gromacs/continuous-integration:ci-gcc-7 + image: gromacs/ci-gcc-7:2020 .gcc8-template: - image: gromacs/continuous-integration:ci-gcc-8 + image: gromacs/ci-gcc-8:2020 .clang6-template: - image: gromacs/continuous-integration:ci-clang-6 + image: gromacs/ci-clang-6:2020 .clang7-template: - image: gromacs/continuous-integration:ci-clang-7 + image: gromacs/ci-clang-7:2020 .clang8-template: - image: gromacs/continuous-integration:ci-clang-8 + image: gromacs/ci-clang-8:2020 .gcc5-gmxapi-template: - image: gromacs/continuous-integration:ci-gcc-5-gmxapi + image: gromacs/ci-gcc-5-gmxapi:2020 .gcc6-gmxapi-template: - image: gromacs/continuous-integration:ci-gcc-6-gmxapi + image: gromacs/ci-gcc-6-gmxapi:2020 .gcc7-gmxapi-template: - image: gromacs/continuous-integration:ci-gcc-7-gmxapi + image: gromacs/ci-gcc-7-gmxapi:2020 .gcc8-gmxapi-template: - image: gromacs/continuous-integration:ci-gcc-8-gmxapi + image: gromacs/ci-gcc-8-gmxapi:2020 .clang6-gmxapi-template: - image: gromacs/continuous-integration:ci-clang-6-gmxapi + image: gromacs/ci-clang-6-gmxapi:2020 .clang7-gmxapi-template: - image: gromacs/continuous-integration:ci-clang-7-gmxapi + image: gromacs/ci-clang-7-gmxapi:2020 .clang8-gmxapi-template: - image: gromacs/continuous-integration:ci-clang-8-gmxapi + image: gromacs/ci-clang-8-gmxapi:2020 .gcc-8-cuda-10.2-template: - image: gromacs/continuous-integration:ci-gcc-8-cuda-10.2 + image: gromacs/ci-gcc-8-cuda-10.2:2020 variables: CUDA_BASE_VERSION: "10.2" COMPILER_MAJOR_VERSION: 8 diff --git a/admin/ci-templates/.regressiontest-template.yml b/admin/ci-templates/.regressiontest-template.yml index e3289afe8f..ad9c052e34 100644 --- a/admin/ci-templates/.regressiontest-template.yml +++ b/admin/ci-templates/.regressiontest-template.yml @@ -9,34 +9,31 @@ KUBERNETES_MEMORY_LIMIT: 2Gi only: refs: + - web + - pushes - merge_requests - schedules - - web except: variables: - $GROMACS_RELEASE # Always clone the default version for this branch, release-2020 in this case script: - export REGTESTBRANCH=release-2020 - - if [ ! -z $CI_MERGE_REQUEST_TARGET_BRANCH_NAME ] ; then - if [[ ! -d regressiontests ]] ; then - mkdir regressiontests ; - cd regressiontests ; - git init ; - cd .. ; - fi ; + - if [[ ! -d regressiontests ]] ; then + mkdir regressiontests ; cd regressiontests ; - git fetch https://gitlab.com/gromacs/gromacs-regressiontests.git $REGTESTBRANCH ; - git checkout -qf FETCH_HEAD ; - git clean -ffdxq ; - git gc ; - git archive -o gmx-regressiontests.tar.gz --prefix regressiontests/ -9 HEAD; - echo "Build regressiontests for branch $CI_MERGE_REQUEST_TARGET_BRANCH_NAME"; - cd ..; - else - touch regressiontests; - tar czf gmx-regressiontests.tar.gz regressiontests ; - fi; + git init ; + cd .. ; + fi + - cd regressiontests + - git fetch https://gitlab.com/gromacs/gromacs-regressiontests.git $REGTESTBRANCH + - git checkout -qf FETCH_HEAD + - git clean -ffdxq + - git gc + - git archive -o gmx-regressiontests.tar.gz --prefix regressiontests/ -9 HEAD + - echo "Build regressiontests for branch $REGTESTBRANCH" + - mv gmx-regressiontests.tar.gz .. + - cd .. artifacts: paths: - gmx-regressiontests.tar.gz @@ -51,8 +48,8 @@ KUBERNETES_MEMORY_LIMIT: 2Gi only: refs: - - schedules - web + - schedules - triggers variables: - $GROMACS_RELEASE diff --git a/admin/ci-templates/.test-runner-template.yml b/admin/ci-templates/.test-runner-template.yml index c98a2bca8e..d5dec907f7 100644 --- a/admin/ci-templates/.test-runner-template.yml +++ b/admin/ci-templates/.test-runner-template.yml @@ -1,6 +1,11 @@ .test-base-template: variables: - BUILD_DIR: build + BUILD_DIR: build + REGRESSIONTEST_TOTAL_RANK_NUMBER: 4 + REGRESSIONTEST_OMP_RANK_NUMBER: 2 + REGRESSIONTEST_PME_RANK_NUMBER: 1 + REGRESSIONTEST_MPI_RUN_COMMAND: "" + REGRESSIONTEST_DOUBLE: "" image: biophysics/gcc-gromacs stage: test retry: diff --git a/admin/ci-templates/.test-script-template.yml b/admin/ci-templates/.test-script-template.yml index 000cf2c4bf..fd056aadaa 100644 --- a/admin/ci-templates/.test-script-template.yml +++ b/admin/ci-templates/.test-script-template.yml @@ -1,4 +1,11 @@ .test-script-template: + only: + refs: + - web + - pushes + - schedules + - merge_requests + script: - cd $BUILD_DIR - ctest -D ExperimentalTest --output-on-failure | tee ctestLog.log || true @@ -10,29 +17,18 @@ exit 1; fi - cd .. + - tar xzf gmx-regressiontests.tar.gz + - source $INSTALL_DIR/bin/GMXRC + - cd regressiontests + - echo "perl gmxtest.pl -nt $REGRESSIONTEST_TOTAL_RANK_NUMBER -ntomp $REGRESSIONTEST_OMP_RANK_NUMBER -npme $REGRESSIONTEST_PME_RANK_NUMBER $REGRESSIONTEST_DOUBLE $REGRESSIONTEST_MPI_RUN_COMMAND" + - perl gmxtest.pl -nt $REGRESSIONTEST_TOTAL_RANK_NUMBER -ntomp $REGRESSIONTEST_OMP_RANK_NUMBER + -npme $REGRESSIONTEST_PME_RANK_NUMBER $REGRESSIONTEST_DOUBLE $REGRESSIONTEST_MPI_RUN_COMMAND -xml all artifacts: reports: junit: $BUILD_DIR/JUnitTestResults.xml paths: - $BUILD_DIR/Testing - $BUILD_DIR/tests + - regressiontests when: always expire_in: 1 week - -.test-regressiontests-template: - variables: - - TOTAL_RANK_NUMBER: 2 - - MPI_RANK_NUMBER: 2 - - PME_RANK_NUMBER: 0 - - MPI_RUN_COMMAND: "" - - DOUBLE: "" - only: - - refs - - schedules - - merge_requests - script: - - tar xzf gmx-regressiontests.tar.gz - - source $INSTALL_DIR/bin/GMXRC - - cd regressiontests - - perl gmxtest.pl -np $TOTAL_RANK_NUMBER -nt $MPI_RANK_NUMBER -npme $PME_RANK_NUMBER - $DOUBLE $MPI_RUN_COMMAND diff --git a/admin/containers/scripted_gmx_docker_builds.py b/admin/containers/scripted_gmx_docker_builds.py new file mode 100644 index 0000000000..45d72e7b9c --- /dev/null +++ b/admin/containers/scripted_gmx_docker_builds.py @@ -0,0 +1,231 @@ +#!/usr/bin/env python +# +# 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. + +""" +Generates a set of docker images used for running GROMACS CI on Gitlab. +The images are prepared according to a selection of build configuration targets +that hope to cover a broad enough scope of different possible systems, +allowing us to check compiler types and versions, as well as libraries used +for accelerators and parallel communication systems. Each combinations is +described as an entry in the build_configs dictionary, with the script +analysing the logic and adding build stages as needed. + +Based on the example script provided by the NVidia HPCCM repository. + +Authors: + * Paul Bauer + * Eric Irrgang + * Joe Jordan + +Usage:: + + $ python3 scripted_gmx_docker_builds.py --help + $ python3 scripted_gmx_docker_builds.py --format docker > Dockerfile && docker build . + $ python3 scripted_gmx_docker_builds.py | docker build - + +""" + +import argparse + +import hpccm +import hpccm.config + +try: + import utility +except ImportError: + raise RuntimeError( + 'This module assumes availability of supporting modules in the same directory. Add the directory to ' + 'PYTHONPATH or invoke Python from within the module directory so module location can be resolved.') + + +# Parse command line arguments +parser = argparse.ArgumentParser(description='GROMACS CI image creation script', parents=[utility.parser]) + +parser.add_argument('--format', type=str, default='docker', + choices=['docker', 'singularity'], + help='Container specification format (default: docker)') + +def main(args) -> hpccm.Stage: + # Create Stage + Stage0 = hpccm.Stage() + + # Create string for base image tag + base_image_tag = str() + + # Check if we use CUDA images or plain linux images + if (args.cuda is not None): + cuda_version_tag = 'nvidia/cuda:' + args.cuda + '-devel' + if (args.centos is not None): + cuda_version_tag += '-centos' + args.centos + elif (args.ubuntu is not None): + if ((args.cuda == '9.0') and (args.ubuntu == '18.04')): + raise RuntimeError('Can not combine CUDA 9.0 and Ubuntu 18.04') + cuda_version_tag += '-ubuntu' + args.ubuntu + else: + raise RuntimeError('Logic error: no Linux distribution selected.') + + base_image_tag = cuda_version_tag + else: + if (args.centos is not None): + base_image_tag = 'centos:centos' + args.centos + elif (args.ubuntu is not None): + base_image_tag = 'ubuntu:' + args.ubuntu + else: + raise RuntimeError('Logic error: no Linux distribution selected.') + + Stage0 += hpccm.primitives.baseimage(image=base_image_tag) + + # Install the GROMACS packages we always will need for our builds. + Stage0 += hpccm.building_blocks.packages(ospackages=['build-essential', + 'ccache', + 'git', + 'libfftw3-dev', + 'libhwloc-dev', + 'liblapack-dev', + 'libx11-dev', + 'moreutils', + 'ninja-build', + 'rsync', + 'valgrind', + 'wget', + 'xsltproc']) + + # Add CMake to image + Stage0 += hpccm.building_blocks.cmake(eula=True, version=args.cmake) + + # We always add Python3 and Pip + Stage0 += hpccm.building_blocks.python(python3=True, python2=False) + Stage0 += hpccm.building_blocks.pip(upgrade=True, pip='pip3', + packages=['pytest', 'networkx', 'numpy']) + + # Compiler + if (args.icc is not None): + raise RuntimeError('Intel compiler toolchain recipe not implemented yet') + + if (args.llvm is not None): + # Build the default compiler if we don't need special support + if (args.tsan is None): + if (args.llvm == 3): + if ((args.ubuntu is not None) and (args.ubuntu == '18.04')): + raise RuntimeError('LLVM 3 and Ubuntu 18.04 can cause issues when used together') + args.llvm = 3.6 + compiler = hpccm.building_blocks.llvm(extra_repository=True, version=args.llvm) + # Build our own version instead to get TSAN + OMP + else: + compiler_branch = 'release_'+str(args.llvm)+'0' + compiler = hpccm.building_blocks.generic_cmake(repository='https://git.llvm.org/git/llvm.git', + prefix='/usr/local', recursive=True, branch=compiler_branch, + cmake_opts=['-D CMAKE_BUILD_TYPE=Release', '-D LLVM_ENABLE_PROJECTS="clang;openmp"', '-D LIBOMP_TSAN_SUPPORT=on'], + preconfigure=['export branch='+compiler_branch, + '(cd projects; git clone https://git.llvm.org/git/libcxx.git; cd libcxx; git checkout $branch)', + '(cd projects; git clone https://git.llvm.org/git/libcxxabi.git; cd libcxxabi; git checkout $branch)', + '(cd projects; git clone https://git.llvm.org/git/compiler-rt.git; cd compiler-rt; git checkout $branch)', + '(cd ..; git clone https://git.llvm.org/git/openmp.git; cd openmp; git checkout $branch)', + '(cd ..; git clone https://git.llvm.org/git/clang.git; cd clang; git checkout $branch)', + '(cd ../clang/tools; git clone https://git.llvm.org/git/clang-tools-extra.git extra; cd extra; git checkout $branch)'], + postinstall=['ln -s /usr/local/bin/clang++ /usr/local/bin/clang++-'+str(args.llvm), + 'ln -s /usr/local/bin/clang-format /usr/local/bin/clang-format-'+str(args.llvm), + 'ln -s /usr/local/bin/clang-tidy /usr/local/bin/clang-tidy-'+str(args.llvm)]) + + + elif (args.gnu is not None): + compiler = hpccm.building_blocks.gnu(extra_repository=True, + version=args.gnu, + fortran=False) + else: + raise RuntimeError('Logic error: no compiler toolchain selected.') + + + Stage0 += compiler + # If we use the package version of LLVM, we need to install extra packages for it. + if (args.llvm is not None) and (args.tsan is None): + Stage0 += hpccm.building_blocks.packages(ospackages=['libomp-dev', + 'clang-format-'+str(args.llvm), + 'clang-tidy-'+str(args.llvm)]) + + # If needed, add MPI to the image + if (args.mpi is not None): + if args.mpi == 'openmpi': + use_cuda = False + if (args.cuda is not None): + use_cuda = True + + Stage0 += hpccm.building_blocks.openmpi(toolchain=compiler.toolchain, cuda=use_cuda, infiniband=False) + elif args.mpi == 'impi': + raise RuntimeError('Intel MPI recipe not implemented yet.') + + # Add OpenCL environment if needed + if (args.opencl is not None): + if args.opencl == 'nvidia': + if (args.cuda is None): + raise RuntimeError('Need Nvidia environment for Nvidia OpenCL image') + + Stage0 += hpccm.building_blocks.packages(ospackages=['nvidia-opencl-dev']) + + elif args.opencl == 'intel': + Stage0 += hpccm.building_blocks.packages(ospackages=['ocl-icd-opencl-dev', 'opencl-headers', 'beignet-opencl-icd']) + elif args.opencl == 'amd': + # Due to the wisdom of AMD, this needs to be done differently for the OS and version! Hurray! + # And they don't allow wget, so this branch is not taken for now! AMD, please allow me to use wget. + raise RuntimeError('AMD recipe can not be generated because they do not allow wget for getting the packages.') + # if args.ubuntu: + # if args.ubuntu is not '16.04': + # Stage0 += hpccm.building_blocks.generic_build(url='https://www2.ati.com/drivers/linux/ubuntu/'+args.ubuntu+'/amdgpu-pro-18.30-641594.tar.xz', + # install=['./amdgpu-install --opencl=legacy --headless -y']) + # elif: + # Stage0 += hpccm.building_blocks.generic_build(url='https://www2.ati.com/drivers/linux/ubuntu/amdgpu-pro-18.30-641594.tar.xz', + # install=['./amdgpu-install --opencl=legacy --headless -y']) + # elif args.centos: + # Stage0 += hpccm.building_blocks.generic_build(url='https://www2.ati.com/drivers/linux/rhel'+args.centos'/amdgpu-pro-18.30-641594.tar.xz', + # install=['./amdgpu-install --opencl=legacy --headless -y']) + + if (args.clfft is not None): + Stage0 += hpccm.building_blocks.generic_cmake(repository='https://github.com/clMathLibraries/clFFT.git', + prefix='/usr/local', recursive=True, branch=args.clfft, directory='clFFT/src') + + + return Stage0 + + +if __name__ == '__main__': + args = parser.parse_args() + + container_recipe = main(args) + + # Set container specification output format + hpccm.config.set_container_format(args.format) + + # Output container specification + print(container_recipe) diff --git a/admin/containers/utility.py b/admin/containers/utility.py new file mode 100644 index 0000000000..24403ffa2f --- /dev/null +++ b/admin/containers/utility.py @@ -0,0 +1,103 @@ +# 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. + +"""A `utility` module helps manage the matrix of configurations for CI testing and build containers. + +Provides importable argument parser. + +Authors: + * Paul Bauer + * Eric Irrgang + * Joe Jordan + +""" + +import argparse + + +parser = argparse.ArgumentParser(description='GROMACS CI image slug options.', add_help=False) +"""A parent parser for tools referencing image parameters. + +This argparse parser is defined for convenience and may be used to partially initialize +parsers for tools. + +.. warning:: Do not modify this parser. + + Instead, inherit from it with the *parents* argument to :py:class:`argparse.ArgumentParser` +""" + +# TODO: Try using distutils.version.StrictVersion. +parser.add_argument('--cmake', type=str, default='3.9.6', + choices=['3.9.6', '3.11.4', '3.15.7'], + help='Selection of CMake version to provide to base image') +compiler_group = parser.add_mutually_exclusive_group() +compiler_group.add_argument('--gnu', type=int, nargs='?', const=7, default=7, + choices=[5, 6, 7, 8, 9], + help='Select GNU compiler tool chain. (Default) ' + 'Some checking is implemented to avoid incompatible combinations') +compiler_group.add_argument('--llvm', type=int, nargs='?', const=7, default=None, + choices=[3, 6, 7, 8], + help='Select LLVM compiler tool chain. ' + 'Some checking is implemented to avoid incompatible combinations') +compiler_group.add_argument('--icc', type=int, nargs='?', const=19, default=None, + choices=[19], + help='Select Intel compiler tool chain. ' + 'Some checking is implemented to avoid incompatible combinations') + +linux_group = parser.add_mutually_exclusive_group() +linux_group.add_argument('--ubuntu', type=str, nargs='?', const='18.04', default='18.04', + choices=['16.04', '18.04'], + help='Select Ubuntu Linux base image. (default: ubuntu 18.04)') +linux_group.add_argument('--centos', type=str, nargs='?', const='7', default=None, + choices=['6', '7'], + help='Select Centos Linux base image.') + +parser.add_argument('--cuda', type=str, nargs='?', const='10.2', default=None, + choices=['9.0', '10.0', '10.1', '10.2'], + help='Select a CUDA version for a base Linux image from NVIDIA.') + +parser.add_argument('--mpi', type=str, nargs='?', const='openmpi', default=None, + choices=['openmpi', 'impi'], + help='Enable MPI (default disabled) and optionally select distribution (default: openmpi)') + +parser.add_argument('--tsan', type=str, nargs='?', const='llvm', default=None, + choices=['llvm'], + help='Build special compiler versions with TSAN OpenMP support') + +parser.add_argument('--opencl', type=str, nargs='?', const='nvidia', default=None, + choices=['nvidia', 'intel', 'amd'], + help='Provide environment for OpenCL builds') + +parser.add_argument('--clfft', type=str, nargs='?', const='master', default=None, + choices=['master', 'develop'], + help='Add external clFFT libraries to the build image') diff --git a/admin/dockerfiles/buildall.sh b/admin/dockerfiles/buildall.sh index 9b69b5545c..b713aa6a73 100644 --- a/admin/dockerfiles/buildall.sh +++ b/admin/dockerfiles/buildall.sh @@ -7,7 +7,7 @@ export SLUG="ci-$MATRIX" docker login -tags[0]=gromacs/base +tags[0]=gromacs/base:2020 docker pull ${tags[0]} || true docker build -t ${tags[0]} --cache-from ${tags[0]} base @@ -15,7 +15,7 @@ tool=clang for tool_version in 6 7 8; do MATRIX="$tool-$tool_version" SLUG="ci-$MATRIX" - tag=gromacs/continuous-integration:$SLUG + tag=gromacs/$SLUG:2020 tags[${#tags[@]}]=$tag docker build \ -t $tag \ @@ -27,7 +27,7 @@ tool=gcc for tool_version in 5 6 7 8; do MATRIX="$tool-$tool_version" SLUG="ci-$MATRIX" - tag=gromacs/continuous-integration:$SLUG + tag=gromacs/$SLUG:2020 tags[${#tags[@]}]=$tag docker build \ -t $tag \ @@ -35,12 +35,12 @@ for tool_version in 5 6 7 8; do ci-$tool done -tag=gromacs/continuous-integration:ci-docs-clang +tag=gromacs/ci-docs-clang:2020 tags[${#tags[@]}]=$tag docker build -t $tag \ ci-docs-clang -tag=gromacs/continuous-integration:ci-docs-gcc +tag=gromacs/ci-docs-gcc:2020 tags[${#tags[@]}]=$tag docker build -t $tag \ ci-docs-gcc diff --git a/admin/dockerfiles/ci-clang/Dockerfile b/admin/dockerfiles/ci-clang/Dockerfile index 54f6e3b913..3f9a7267fd 100644 --- a/admin/dockerfiles/ci-clang/Dockerfile +++ b/admin/dockerfiles/ci-clang/Dockerfile @@ -1,7 +1,7 @@ # Make an image that has the dependencies for building GROMACS with clang. # Note when specifying TOOL_VERSION that clang 6.0 packages use the minor version # in the name, while 7 and 8 do not. -FROM gromacs/base +FROM gromacs/base:2020 WORKDIR /tmp ARG TOOL_VERSION RUN \ diff --git a/admin/dockerfiles/ci-docs-clang/Dockerfile b/admin/dockerfiles/ci-docs-clang/Dockerfile index deaa2fb5c9..7488e7ab48 100644 --- a/admin/dockerfiles/ci-docs-clang/Dockerfile +++ b/admin/dockerfiles/ci-docs-clang/Dockerfile @@ -33,7 +33,7 @@ RUN \ # We also install it separatly because it pulls in some dependencies # that are needed for the documentation build. -FROM gromacs/continuous-integration:ci-clang-7 +FROM gromacs/ci-clang-7:2020 WORKDIR /tmp COPY --from=doxygen-builder /usr/local/bin/* /usr/local/bin/ RUN \ diff --git a/admin/dockerfiles/ci-docs-gcc/Dockerfile b/admin/dockerfiles/ci-docs-gcc/Dockerfile index b9c85a99ed..cc594c90cd 100644 --- a/admin/dockerfiles/ci-docs-gcc/Dockerfile +++ b/admin/dockerfiles/ci-docs-gcc/Dockerfile @@ -33,7 +33,7 @@ RUN \ # We also install it separatly because it pulls in some dependencies # that are needed for the documentation build. -FROM gromacs/continuous-integration:ci-gcc-7 +FROM gromacs/ci-gcc-7:2020 WORKDIR /tmp COPY --from=doxygen-builder /usr/local/bin/* /usr/local/bin/ RUN \ diff --git a/admin/dockerfiles/ci-gcc/Dockerfile b/admin/dockerfiles/ci-gcc/Dockerfile index a7ac7e7c36..6b92aa07bf 100644 --- a/admin/dockerfiles/ci-gcc/Dockerfile +++ b/admin/dockerfiles/ci-gcc/Dockerfile @@ -1,7 +1,7 @@ # Make an image that has the dependencies for building GROMACS with gcc. -FROM gromacs/base +FROM gromacs/base:2020 WORKDIR /tmp ARG TOOL_VERSION RUN \ diff --git a/docs/dev-manual/containers.rst b/docs/dev-manual/containers.rst new file mode 100644 index 0000000000..82b3c9faa1 --- /dev/null +++ b/docs/dev-manual/containers.rst @@ -0,0 +1,28 @@ +========== +Containers +========== + +|Gromacs| project infrastructure uses Docker containerization to +isolate automated tasks. +A number of images are maintained to provide a breadth of testing coverage. + +Scripts and configuration files for building images are stored in the repository +under :file:`admin/containers/` +Images are (re)built manually by |Gromacs| project staff and pushed to +repositories at https://hub.docker.com/u/gromacs + +Utilities +========= + +.. automodule:: utility + :members: + +HPC container maker +------------------- + +We use the `NVidia HPC Container Maker `__ +package for scripted Dockerfile generation. +See :file:`admin/containers/scripted_gmx_docker_builds.py`. + +.. todo:: :issue:`3272` Insert tool documentation. + E.g. ``.. automodule:: scripted_gmx_docker_builds`` diff --git a/docs/release-notes/2020/2020.2.rst b/docs/release-notes/2020/2020.2.rst index c793676497..9a8573f450 100644 --- a/docs/release-notes/2020/2020.2.rst +++ b/docs/release-notes/2020/2020.2.rst @@ -16,6 +16,16 @@ in the :ref:`release-notes`. Fixes where mdrun could behave incorrectly ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Ewald dipole correction incorrect without domain decomposition +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Ewald dipole correction (epsilon-surface != 0) is now disabled when not +using domain decomposition. With domain decomposition, it only works +when each molecule consists of a single update group (e.g. water). +This will be fixed in release-2021. + +:issue:`3441` + Fixes for ``gmx`` tools ^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,3 +35,8 @@ Fixes that affect portability Miscellaneous ^^^^^^^^^^^^^ +Fixed initial DLB state reporting +""""""""""""""""""""""""""""""""" + +The initial DLB state was reported incorrectly in the log file when +the either "on" or "auto" value was the chosen at mdrun startup. diff --git a/src/api/cpp/CMakeLists.txt b/src/api/cpp/CMakeLists.txt index f22edbbbe8..8c29e0db9b 100644 --- a/src/api/cpp/CMakeLists.txt +++ b/src/api/cpp/CMakeLists.txt @@ -104,6 +104,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") endif() set_target_properties(gmxapi PROPERTIES +<<<<<<< HEAD +======= + OUTPUT_NAME "gmxapi${GMX_LIBS_SUFFIX}" +>>>>>>> 844bfb6d0 (Change Line 105) SOVERSION ${GMXAPI_MAJOR} VERSION ${GMXAPI_RELEASE} ) diff --git a/src/gromacs/domdec/domdec.cpp b/src/gromacs/domdec/domdec.cpp index 78a1501a39..542275d916 100644 --- a/src/gromacs/domdec/domdec.cpp +++ b/src/gromacs/domdec/domdec.cpp @@ -119,7 +119,7 @@ using gmx::DdRankOrder; using gmx::DlbOption; using gmx::DomdecOptions; -static const char* edlbs_names[int(DlbState::nr)] = { "off", "auto", "locked", "on", "on" }; +static const char* edlbs_names[int(DlbState::nr)] = { "off", "off", "auto", "locked", "on", "on" }; /* The size per atom group of the cggl_flag buffer in gmx_domdec_comm_t */ #define DD_CGIBS 2 diff --git a/src/gromacs/mdlib/forcerec.cpp b/src/gromacs/mdlib/forcerec.cpp index cb2e49a4dd..3361623811 100644 --- a/src/gromacs/mdlib/forcerec.cpp +++ b/src/gromacs/mdlib/forcerec.cpp @@ -1151,6 +1151,14 @@ void init_forcerec(FILE* fp, "orientation restraints. " "This likely means that the global topology and the force constant " "data have gotten out of sync."); + if (useEwaldSurfaceCorrection) + { + gmx_fatal(FARGS, + "In GROMACS 2020, Ewald dipole correction is disabled when not " + "using domain decomposition. With domain decomposition, it only works " + "when each molecule consists of a single update group (e.g. water). " + "This will be fixed in GROMACS 2021."); + } } else {