From ab84f0b7937e1d8589d364fdb3141c41d19dc848 Mon Sep 17 00:00:00 2001 From: Jonas Schwab Date: Fri, 16 Apr 2021 15:21:39 +0200 Subject: [PATCH 1/9] update pipeline images --- .gitlab-ci.yml | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d12e8f7..ca62f10 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,7 @@ variables: - py_alf.py script: - apt-get update && apt-get install -y pylint3 python3-numpy git + - if [ "$MACHINE" = "INTEL" ]; then . /opt/intel/oneapi/setvars.sh; fi - if [ $(command -v pylint3) ]; then linter='pylint3'; else linter='pylint'; fi - $linter -E Run.py default_variables.py py_alf.py - git clone https://git.physik.uni-wuerzburg.de/ALF/ALF.git @@ -36,18 +37,25 @@ variables: script: - apt-get update && apt-get install -y python3-numpy git - export PYTHONPATH="$PWD:$PYTHONPATH" + - if [ "$MACHINE" = "INTEL" ]; then . /opt/intel/oneapi/setvars.sh; fi - cd Scripts - ./test_branch.py --branch_R $BRANCH_R --branch_T $BRANCH_T --machine $MACHINE +Test_Stretch: + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:stretch-gfortran-blas-lapack-fftw-hdf5-scipy3 + variables: + MACHINE: "GNU" + <<: *test_definition + Test_Buster: - image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:buster-gfortran-blas-lapack-fftw-hdf5-scipy + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:buster-gfortran-blas-lapack-fftw-hdf5-scipy3 variables: MACHINE: "GNU" <<: *test_definition -Test_Stretch: - image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:stretch-gfortran-blas-lapack-fftw-hdf5-scipy +Test_Bullseye: + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:bullseye-gfortran-blas-lapack-fftw-hdf5-scipy3 variables: MACHINE: "GNU" <<: *test_definition @@ -58,20 +66,32 @@ Test-PGI: MACHINE: "PGI" <<: *test_definition +Test-Intel-21: + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:bullseye-intel-oneapi-ifort + variables: + MACHINE: "INTEL" + <<: *test_definition + Warn_Buster: - image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:buster-gfortran-blas-lapack-fftw-hdf5-scipy + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:buster-gfortran-blas-lapack-fftw-hdf5-scipy3 <<: *warn_definition +Test_branch_Stretch: + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:stretch-gfortran-blas-lapack-fftw-hdf5-scipy3 + variables: + MACHINE: "GNU" + <<: *test_branch_definition + Test_branch_Buster: - image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:buster-gfortran-blas-lapack-fftw-hdf5-scipy + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:buster-gfortran-blas-lapack-fftw-hdf5-scipy3 variables: MACHINE: "GNU" <<: *test_branch_definition -Test_branch_Stretch: - image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:stretch-gfortran-blas-lapack-fftw-hdf5-scipy +Test_branch_Bullseye: + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:bullseye-gfortran-blas-lapack-fftw-hdf5-scipy3 variables: MACHINE: "GNU" <<: *test_branch_definition @@ -81,3 +101,9 @@ Test_branch-PGI: variables: MACHINE: "PGI" <<: *test_branch_definition + +Test_branch-Intel-21: + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:bullseye-intel-oneapi-ifort + variables: + MACHINE: "INTEL" + <<: *test_branch_definition -- GitLab From 90ea4c10d0ad1d5d1aaff7eb490c6c1f8aaf9bf3 Mon Sep 17 00:00:00 2001 From: Jonas Schwab Date: Mon, 3 May 2021 19:50:18 +0200 Subject: [PATCH 2/9] Work on pipeline --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca62f10..993a63b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,7 @@ variables: - default_variables.py - py_alf.py script: - - apt-get update && apt-get install -y pylint3 python3-numpy git + - apt-get update && apt-get install -y pylint3 git - if [ "$MACHINE" = "INTEL" ]; then . /opt/intel/oneapi/setvars.sh; fi - if [ $(command -v pylint3) ]; then linter='pylint3'; else linter='pylint'; fi - $linter -E Run.py default_variables.py py_alf.py @@ -27,7 +27,7 @@ variables: - default_variables.py - py_alf.py script: - - apt-get update && apt-get install -y pylint3 python3-numpy + - apt-get update && apt-get install -y pylint3 - pylint3 Run.py default_variables.py py_alf.py .test_branch_template: &test_branch_definition @@ -35,7 +35,7 @@ variables: - if: '$BRANCH_T' when: always script: - - apt-get update && apt-get install -y python3-numpy git + - apt-get update && apt-get install -y git - export PYTHONPATH="$PWD:$PYTHONPATH" - if [ "$MACHINE" = "INTEL" ]; then . /opt/intel/oneapi/setvars.sh; fi - cd Scripts -- GitLab From 74ba22d2fae7543a70f56c7d067f39786ae30e11 Mon Sep 17 00:00:00 2001 From: Jonas Schwab Date: Mon, 3 May 2021 20:15:30 +0200 Subject: [PATCH 3/9] Work on pipeline --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 993a63b..02e9e2a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ variables: - Run.py - default_variables.py - py_alf.py + - .gitlab-ci.yml script: - apt-get update && apt-get install -y pylint3 git - if [ "$MACHINE" = "INTEL" ]; then . /opt/intel/oneapi/setvars.sh; fi @@ -26,6 +27,7 @@ variables: - Run.py - default_variables.py - py_alf.py + - .gitlab-ci.yml script: - apt-get update && apt-get install -y pylint3 - pylint3 Run.py default_variables.py py_alf.py @@ -67,7 +69,7 @@ Test-PGI: <<: *test_definition Test-Intel-21: - image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:bullseye-intel-oneapi-ifort + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:bullseye-intel-oneapi-ifort-python3 variables: MACHINE: "INTEL" <<: *test_definition @@ -103,7 +105,7 @@ Test_branch-PGI: <<: *test_branch_definition Test_branch-Intel-21: - image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:bullseye-intel-oneapi-ifort + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:bullseye-intel-oneapi-ifort-python3 variables: MACHINE: "INTEL" <<: *test_branch_definition -- GitLab From d0d6cae6e80abbee6e988f591b10b537db64e1d8 Mon Sep 17 00:00:00 2001 From: Jonas Schwab Date: Mon, 3 May 2021 20:20:59 +0200 Subject: [PATCH 4/9] Fix small linter warning --- default_variables.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/default_variables.py b/default_variables.py index a3b33ad..3787fad 100644 --- a/default_variables.py +++ b/default_variables.py @@ -8,7 +8,7 @@ PARAMS_GENERIC -- contains all generic parameters independent from the choice PARAMS_MODEL -- contains namelists dependant on hamiltonian IN_HAM -- defines which elements of PARAMS_MODEL are needed by a hamiltonian """ -# pylint: disable=bad-whitespace, line-too-long +# pylint: disable = line-too-long __author__ = "Fakher F. Assaad, and Jonas Schwab" __copyright__ = "Copyright 2020, The ALF Project" @@ -36,8 +36,8 @@ def params_list(ham_name, include_generic=False): for name in IN_HAM[ham_name]: p_list += list(PARAMS_MODEL[name]) if include_generic: - for nlist_name, nlist in PARAMS_GENERIC.items(): - p_list += list(nlist) + for nlist_name in PARAMS_GENERIC: + p_list += list(PARAMS_GENERIC[nlist_name]) return [i.upper() for i in p_list] -- GitLab From f07099cf6d099fce16c42e5419745702f4fff9f8 Mon Sep 17 00:00:00 2001 From: Jonas Schwab Date: Mon, 3 May 2021 20:34:16 +0200 Subject: [PATCH 5/9] Work on pipeline --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 02e9e2a..bd2e276 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ variables: - py_alf.py - .gitlab-ci.yml script: - - apt-get update && apt-get install -y pylint3 git + - apt-get update && apt-get install -y pylint3 python3-numpy git - if [ "$MACHINE" = "INTEL" ]; then . /opt/intel/oneapi/setvars.sh; fi - if [ $(command -v pylint3) ]; then linter='pylint3'; else linter='pylint'; fi - $linter -E Run.py default_variables.py py_alf.py @@ -29,7 +29,7 @@ variables: - py_alf.py - .gitlab-ci.yml script: - - apt-get update && apt-get install -y pylint3 + - apt-get update && apt-get install -y pylint3 python3-numpy - pylint3 Run.py default_variables.py py_alf.py .test_branch_template: &test_branch_definition @@ -37,7 +37,7 @@ variables: - if: '$BRANCH_T' when: always script: - - apt-get update && apt-get install -y git + - apt-get update && apt-get install -y python3-numpy git - export PYTHONPATH="$PWD:$PYTHONPATH" - if [ "$MACHINE" = "INTEL" ]; then . /opt/intel/oneapi/setvars.sh; fi - cd Scripts -- GitLab From 03b8ce129e03c35d12e7d729d0ad39804a28ba57 Mon Sep 17 00:00:00 2001 From: Jonas Schwab Date: Mon, 3 May 2021 20:35:05 +0200 Subject: [PATCH 6/9] Work on pipeline --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bd2e276..91393b6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,7 +45,7 @@ variables: Test_Stretch: - image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:stretch-gfortran-blas-lapack-fftw-hdf5-scipy3 + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:stretch-gfortran-blas-lapack-fftw-hdf5 variables: MACHINE: "GNU" <<: *test_definition @@ -81,7 +81,7 @@ Warn_Buster: Test_branch_Stretch: - image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:stretch-gfortran-blas-lapack-fftw-hdf5-scipy3 + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:stretch-gfortran-blas-lapack-fftw-hdf5 variables: MACHINE: "GNU" <<: *test_branch_definition -- GitLab From b5bae6538183459483e89233698d4e779f21bd02 Mon Sep 17 00:00:00 2001 From: Jonas Schwab Date: Mon, 3 May 2021 20:45:34 +0200 Subject: [PATCH 7/9] Work on pipeline --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91393b6..4a84009 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,8 +75,8 @@ Test-Intel-21: <<: *test_definition -Warn_Buster: - image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:buster-gfortran-blas-lapack-fftw-hdf5-scipy3 +Warn_Bullseye: + image: git.physik.uni-wuerzburg.de:25812/z03/pdi/debian:bullseye-gfortran-blas-lapack-fftw-hdf5-scipy3 <<: *warn_definition -- GitLab From e2230969560fda845647d7f21a7b43f036a699f0 Mon Sep 17 00:00:00 2001 From: Jonas Schwab Date: Mon, 3 May 2021 20:48:08 +0200 Subject: [PATCH 8/9] Work on pipeline --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a84009..ce808d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,7 +30,7 @@ variables: - .gitlab-ci.yml script: - apt-get update && apt-get install -y pylint3 python3-numpy - - pylint3 Run.py default_variables.py py_alf.py + - pylint Run.py default_variables.py py_alf.py .test_branch_template: &test_branch_definition rules: -- GitLab From d947909fab5317ce6dd92076d7ee635951fb6c0a Mon Sep 17 00:00:00 2001 From: Jonas Schwab Date: Mon, 3 May 2021 20:59:18 +0200 Subject: [PATCH 9/9] Fix some linter warnings --- py_alf.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/py_alf.py b/py_alf.py index 8ef8011..74695a4 100644 --- a/py_alf.py +++ b/py_alf.py @@ -148,12 +148,13 @@ class Simulation: else: command = executable subprocess.run(command, check=True, env=env) - except subprocess.CalledProcessError: + except subprocess.CalledProcessError as ALF_crash: print('Error while running {}.'.format(executable)) print('parameters:') with open('parameters') as f: print(f.read()) - raise Exception('Error while running {}.'.format(executable)) + raise Exception('Error while running {}.'.format(executable)) \ + from ALF_crash def analysis(self): """Performs default analysis on Monte Carlo data.""" @@ -308,16 +309,18 @@ def compile_alf(alf_dir='ALF', branch=None, config='GNU noMPI', .format(alf_dir, url)) try: subprocess.run(["git", "clone", url, alf_dir], check=True) - except subprocess.CalledProcessError: - raise Exception('Error while cloning repository') + except subprocess.CalledProcessError as git_clone_failed: + raise Exception('Error while cloning repository') \ + from git_clone_failed with cd(alf_dir): if branch is not None: print('Checking out branch {}'.format(branch)) try: subprocess.run(['git', 'checkout', branch], check=True) - except subprocess.CalledProcessError: - raise Exception('Error while checking out {}'.format(branch)) + except subprocess.CalledProcessError as git_checkout_failed: + raise Exception('Error while checking out {}'.format(branch)) \ + from git_checkout_failed env = getenv(config) print('Compiling ALF... ', end='') subprocess.run(['make', 'clean'], check=True, env=env) -- GitLab