Skip to content

Commit

Permalink
precommit: Upgrade to Ubuntu 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed May 11, 2022
1 parent fd9656a commit 895ec07
Show file tree
Hide file tree
Showing 59 changed files with 116 additions and 235 deletions.
4 changes: 3 additions & 1 deletion src/arnoldi/PACKAGE
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"description": "Arnoldi iteration eigenvalue algorithm",
"archive": "libdbcsrarnoldi",
"requires": ["../mpiwrap", "../base", "../dbcsrx", "../common"],
"public": ["arnoldi_api.F",],
"public": [
"arnoldi_api.F",
],
}
5 changes: 4 additions & 1 deletion src/grid/hip/PACKAGE
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"description": "Optimized GPU backend (ROCM)",
"requires": ["../common", "../../offload",],
"requires": [
"../common",
"../../offload",
],
"archive": "libcp2kgridrocm",
}
4 changes: 3 additions & 1 deletion src/offload/PACKAGE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"description": "Common infrastructure for offloading to accelerator devices",
"requires": ["../base",],
"requires": [
"../base",
],
"public": [
"offload_api.F",
"offload_buffer.h",
Expand Down
40 changes: 21 additions & 19 deletions tools/docker/generate_dockerfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def main() -> None:
def regtest(version: str, arch: str = "local", testopts: str = "") -> str:
return (
install_cp2k(version=version, arch=arch)
+ fr"""
+ rf"""
# Run regression tests.
ARG TESTOPTS="{testopts}"
COPY ./tools/docker/scripts/test_regtest.sh ./
Expand All @@ -117,7 +117,7 @@ def regtest(version: str, arch: str = "local", testopts: str = "") -> str:
def regtest_postponed(version: str, arch: str = "local") -> str:
return (
install_cp2k(version=version, arch=arch)
+ fr"""
+ rf"""
# Postpone running the regression tests until the container is executed.
ARG TESTOPTS
COPY ./tools/docker/scripts/test_regtest.sh ./
Expand All @@ -133,7 +133,7 @@ def regtest_postponed(version: str, arch: str = "local") -> str:
def build(version: str, arch: str = "local") -> str:
return (
install_cp2k(version=version, arch=arch)
+ fr"""
+ rf"""
# Run build test.
COPY ./tools/docker/scripts/test_build.sh .
RUN ./test_build.sh "{arch}" "{version}" 2>&1 | tee report.log
Expand All @@ -146,7 +146,7 @@ def build(version: str, arch: str = "local") -> str:
def performance(arch: str = "local") -> str:
return (
install_cp2k(version="psmp", arch=arch)
+ fr"""
+ rf"""
# Run performance test for {arch}.
COPY ./benchmarks ./benchmarks
COPY ./tools/docker/scripts/test_performance.sh \
Expand All @@ -162,7 +162,7 @@ def performance(arch: str = "local") -> str:
def coverage(version: str) -> str:
return (
install_cp2k(version=version, arch="local_coverage")
+ fr"""
+ rf"""
# Run coverage test for {version}.
COPY ./tools/docker/scripts/test_coverage.sh .
RUN ./test_coverage.sh "{version}" 2>&1 | tee report.log
Expand All @@ -175,7 +175,7 @@ def coverage(version: str) -> str:
def conventions() -> str:
return (
install_cp2k(version="psmp", arch="local_warn")
+ fr"""
+ rf"""
# Run test for conventions.
COPY ./arch/Linux-x86-64-gfortran.dumpast ./arch/
COPY ./tools/conventions ./tools/conventions
Expand All @@ -192,7 +192,7 @@ def conventions() -> str:
def manual() -> str:
return (
install_cp2k(version="psmp", arch="local", revision=True)
+ fr"""
+ rf"""
# Generate manual.
COPY ./tools/manual ./tools/manual
COPY ./tools/input_editing ./tools/input_editing
Expand All @@ -206,7 +206,7 @@ def manual() -> str:
# ======================================================================================
def precommit() -> str:
return (
fr"""
rf"""
FROM ubuntu:22.04
# Install dependencies.
Expand All @@ -229,7 +229,7 @@ def precommit() -> str:
def test_3rd_party(name: str) -> str:
return (
install_cp2k(version="sdbg", arch="local")
+ fr"""
+ rf"""
# Run test for {name}.
COPY ./tools/docker/scripts/test_{name}.sh .
RUN ./test_{name}.sh 2>&1 | tee report.log
Expand All @@ -241,7 +241,7 @@ def test_3rd_party(name: str) -> str:
# ======================================================================================
def test_without_build(name: str) -> str:
return (
fr"""
rf"""
FROM ubuntu:22.04
# Install dependencies.
Expand Down Expand Up @@ -280,7 +280,7 @@ def print_cached_report() -> str:
def production(version: str, arch: str = "local") -> str:
return (
install_cp2k(version=version, arch=arch, revision=True, prod=True)
+ fr"""
+ rf"""
# Run regression tests.
ARG TESTOPTS
RUN /bin/bash -c " \
Expand Down Expand Up @@ -340,7 +340,7 @@ def install_cp2k(
input_block = "\n".join(input_lines)
run_block = " && \\\n ".join(run_lines)

return fr"""
return rf"""
# Install CP2K using {arch}.{version}.
WORKDIR /opt/cp2k
{input_block}
Expand All @@ -367,9 +367,11 @@ def toolchain_full(

# ======================================================================================
def toolchain_ubuntu_nompi(
base_image: str = "ubuntu:22.04", gcc_version: int = 10, libvori: bool = True,
base_image: str = "ubuntu:22.04",
gcc_version: int = 10,
libvori: bool = True,
) -> str:
return fr"""
return rf"""
FROM {base_image}
# Install Ubuntu packages.
Expand Down Expand Up @@ -409,7 +411,7 @@ def toolchain_ubuntu_nompi(
# ======================================================================================
def toolchain_intel() -> str:
# See https://github.com/cp2k/cp2k/issues/1936
return fr"""
return rf"""
FROM intel/oneapi-hpckit:2021.4-devel-ubuntu18.04
ENV PATH=/opt/intel/oneapi/compiler/2021.4.0/linux/bin/intel64:/opt/intel/oneapi/mpi/2021.4.0/bin:${{PATH}}
Expand All @@ -434,7 +436,7 @@ def toolchain_intel() -> str:

# ======================================================================================
def toolchain_cuda(gpu_ver: str) -> str:
return fr"""
return rf"""
FROM nvidia/cuda:11.3.1-devel-ubuntu20.04
# Setup CUDA environment.
Expand All @@ -455,7 +457,7 @@ def toolchain_cuda(gpu_ver: str) -> str:

# ======================================================================================
def toolchain_hip_cuda(gpu_ver: str) -> str:
return fr"""
return rf"""
FROM nvidia/cuda:11.3.1-devel-ubuntu20.04
# Setup CUDA environment.
Expand Down Expand Up @@ -558,7 +560,7 @@ def toolchain_hip_cuda(gpu_ver: str) -> str:

# ======================================================================================
def toolchain_hip_rocm(gpu_ver: str) -> str:
return fr"""
return rf"""
FROM rocm/dev-ubuntu-20.04:4.5.2-complete
# Install some Ubuntu packages.
Expand Down Expand Up @@ -592,7 +594,7 @@ def install_toolchain(base_image: str, **kwargs: Optional[str]) -> str:
install_args.append(f" --{k} \\")
install_args_str = "\n".join(install_args)

return fr"""
return rf"""
# Install requirements for the toolchain.
WORKDIR /opt/cp2k-toolchain
COPY ./tools/toolchain/install_requirements*.sh ./
Expand Down
2 changes: 1 addition & 1 deletion tools/doxify/doxify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ for file in "$@"; do
fi
done

exit ${nwarnings}
exit "${nwarnings}"
5 changes: 4 additions & 1 deletion tools/fix_unused_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ def parse_file(fn):
matches = re_use.findall(content)
for m in matches:
uses.append((m.strip(), ("*",)))
if m.strip() not in ("iso_c_binding", "f77_blas",):
if m.strip() not in (
"iso_c_binding",
"f77_blas",
):
print("missing ONLY-clause: ", fn, m)

matches = re_useonly.findall(content)
Expand Down
2 changes: 1 addition & 1 deletion tools/precommit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

# author: Ole Schuett

Expand Down
30 changes: 17 additions & 13 deletions tools/precommit/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
appdirs==1.4.4
attrs==20.1.0
black==19.10b0
click==7.1.2
attrs==21.4.0
black==22.3.0
click==8.1.3
cmake-format==0.6.13
cmakelang==0.6.13
Flask==1.1.2
gunicorn==20.0.4
itsdangerous==1.1.0
Jinja2==2.11.3
MarkupSafe==1.1.1
pathspec==0.8.0
regex==2020.7.14
Flask==2.1.2
gunicorn==20.1.0
gyp==0.1
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.1
mypy-extensions==0.4.3
pathspec==0.9.0
platformdirs==2.5.2
regex==2022.4.24
six==1.16.0
toml==0.10.1
typed-ast==1.4.1
Werkzeug==1.0.1
toml==0.10.2
tomli==2.0.1
typed-ast==1.5.3
Werkzeug==2.1.2
4 changes: 2 additions & 2 deletions tools/prettify/prettify_cp2k/normalizeFortranFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def __iter__(self):
return self

def __next__(self):
""" python 3 version"""
"""python 3 version"""
pos, char = next(self._it)
if not self._instring and char == "!":
raise StopIteration
Expand All @@ -168,7 +168,7 @@ def __next__(self):
return (pos, char)

def next(self):
""" python 2 version"""
"""python 2 version"""
pos, char = self._it.next()
if not self._instring and char == "!":
raise StopIteration
Expand Down
8 changes: 4 additions & 4 deletions tools/regtesting/do_regtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def launch_exe(

# ======================================================================================
class TestType:
""" Search pattern for result values, ie. a line in the TEST_TYPES file. """
"""Search pattern for result values, ie. a line in the TEST_TYPES file."""

def __init__(self, line: str):
parts = line.rsplit("!", 1)
Expand All @@ -285,7 +285,7 @@ def grep(self, output: str) -> Optional[str]:

# ======================================================================================
class Unittest:
""" A unit test, ie. a standalone binary that matches '*_unittest.{cfg.version}'."""
"""A unit test, ie. a standalone binary that matches '*_unittest.{cfg.version}'."""

def __init__(self, name: str, workdir: Path):
self.name = name
Expand All @@ -294,7 +294,7 @@ def __init__(self, name: str, workdir: Path):

# ======================================================================================
class Regtest:
""" A single input file to test, ie. a line in a TEST_FILES file. """
"""A single input file to test, ie. a line in a TEST_FILES file."""

def __init__(self, line: str, test_types: List[Optional[TestType]], workdir: Path):
parts = line.split()
Expand All @@ -311,7 +311,7 @@ def __init__(self, line: str, test_types: List[Optional[TestType]], workdir: Pat

# ======================================================================================
class Batch:
""" A directory of tests, ie. a line in the TEST_DIRS file. """
"""A directory of tests, ie. a line in the TEST_DIRS file."""

def __init__(self, line: str, cfg: Config):
parts = line.split()
Expand Down
2 changes: 1 addition & 1 deletion tools/regtesting/print_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [[ -d ".git" ]]; then
while IFS= read -r -d $'\0'; do
submodule_basedir="${REPLY%/*}"
submodule_hash=$(< "${submodule_basedir}/HEAD")
submodule_dir="${submodule_basedir#${modules_git_dir}}"
submodule_dir="${submodule_basedir#"${modules_git_dir}"}"
submodule_sha+=("${submodule_dir}:${submodule_hash}")
done < <(find "${modules_git_dir}" -name index -print0)
fi
Expand Down
3 changes: 3 additions & 0 deletions tools/toolchain-spack/install_cp2k_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# author: Tiziano Müller
# SPDX-License-Identifier: MIT

# TODO: Review and if possible fix shellcheck errors.
# shellcheck disable=all

set -o errexit
set -o nounset

Expand Down
5 changes: 1 addition & 4 deletions tools/toolchain/install_cp2k_toolchain.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash -e

# TODO: Review and if possible fix shellcheck errors.
# shellcheck disable=SC1003,SC1035,SC1083,SC1090
# shellcheck disable=SC2001,SC2002,SC2005,SC2016,SC2091,SC2034,SC2046,SC2086,SC2089,SC2090
# shellcheck disable=SC2124,SC2129,SC2144,SC2153,SC2154,SC2155,SC2163,SC2164,SC2166
# shellcheck disable=SC2235,SC2237
# shellcheck disable=all

[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)"
Expand Down
5 changes: 1 addition & 4 deletions tools/toolchain/scripts/common_vars.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Common variables used by the installation scripts

# TODO: Review and if possible fix shellcheck errors.
# shellcheck disable=SC1003,SC1035,SC1083,SC1090
# shellcheck disable=SC2001,SC2002,SC2005,SC2016,SC2091,SC2034,SC2046,SC2086,SC2089,SC2090
# shellcheck disable=SC2124,SC2129,SC2144,SC2153,SC2154,SC2155,SC2163,SC2164,SC2166
# shellcheck disable=SC2235,SC2237
# shellcheck disable=all
# shellcheck shell=bash

# directories and files used by the installer
Expand Down
5 changes: 1 addition & 4 deletions tools/toolchain/scripts/generate_arch_files.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash -e

# TODO: Review and if possible fix shellcheck errors.
# shellcheck disable=SC1003,SC1035,SC1083,SC1090
# shellcheck disable=SC2001,SC2002,SC2005,SC2016,SC2091,SC2034,SC2046,SC2086,SC2089,SC2090
# shellcheck disable=SC2124,SC2129,SC2144,SC2153,SC2154,SC2155,SC2163,SC2164,SC2166
# shellcheck disable=SC2235,SC2237
# shellcheck disable=all

[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)"
Expand Down
5 changes: 1 addition & 4 deletions tools/toolchain/scripts/get_openblas_arch.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash -e

# TODO: Review and if possible fix shellcheck errors.
# shellcheck disable=SC1003,SC1035,SC1083,SC1090
# shellcheck disable=SC2001,SC2002,SC2005,SC2016,SC2091,SC2034,SC2046,SC2086,SC2089,SC2090
# shellcheck disable=SC2124,SC2129,SC2144,SC2153,SC2154,SC2155,SC2163,SC2164,SC2166
# shellcheck disable=SC2235,SC2237
# shellcheck disable=all

[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)"
Expand Down

0 comments on commit 895ec07

Please sign in to comment.