Commit 69200527 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Prefer the matching MKL to the used Parallel Studio

This avoids having to install two separate intel_parallel_studio
packages. It is probably also not a good idea anyway to inter-link two
of them at the same time.
parent 732b0b5e
......@@ -8,6 +8,22 @@ import osc.oscerr
from functools import partial
from xml.etree import ElementTree
intel_parallel_studio = {
"mpcdf_intel_parallel_studio_2017_7": {"compiler": "intel_17_0_7", "impi": "impi_2017_4", "mkl": "mkl_2017_4-module", },
"mpcdf_intel_parallel_studio_2018_1": {"compiler": "intel_18_0_1", "impi": "impi_2018_1", "mkl": "mkl_2018_1-module", },
"mpcdf_intel_parallel_studio_2018_2": {"compiler": "intel_18_0_2", "impi": "impi_2018_2", "mkl": "mkl_2018_2-module", },
"mpcdf_intel_parallel_studio_2018_3": {"compiler": "intel_18_0_3", "impi": "impi_2018_3", "mkl": "mkl_2018_3-module", },
"mpcdf_intel_parallel_studio_2018_4": {"compiler": "intel_18_0_5", "impi": "impi_2018_4", "mkl": "mkl_2018_4-module", },
"mpcdf_intel_parallel_studio_2019_0": {"compiler": "intel_19_0_0", "impi": "impi_2019_0", "mkl": "mkl_2019_0-module", },
"mpcdf_intel_parallel_studio_2019_1": {"compiler": "intel_19_0_1", "impi": "impi_2019_1", "mkl": "mkl_2019_1-module", },
}
all_mkls = {ic["mkl"] for ic in intel_parallel_studio.values()}
# Some rotations
mpi_parallel_studio = {value["impi"]: dict({"ps": key}, **value) for key, value in intel_parallel_studio.items()}
compiler_parallel_studio = {value["compiler"]: dict({"ps": key}, **value) for key, value in intel_parallel_studio.items()}
def valid_mpi(compiler, mpi):
"""
......@@ -18,23 +34,29 @@ def valid_mpi(compiler, mpi):
Take care to keep this in sync with the file 'macros.obs_cluster' of
the package software:dist / mpcdf_cluster_macros
"""
valid_intel_impi = {
("intel_17_0_4", "impi_2017_3"),
("intel_17_0_7", "impi_2017_4"),
("intel_18_0_1", "impi_2018_1"),
("intel_18_0_2", "impi_2018_2"),
("intel_18_0_3", "impi_2018_3"),
("intel_19_0_0", "impi_2019_0"),
("intel_19_0_1", "impi_2019_1"),
}
if compiler.startswith("intel") and mpi.startswith("impi"):
return (compiler, mpi) in valid_intel_impi
return mpi == compiler_parallel_studio[compiler]["impi"]
else:
return True
def prefers(reponame):
prefer_ps = None
if reponame in compiler_parallel_studio:
prefer_ps = compiler_parallel_studio[reponame]["ps"]
else:
for mpi in mpi_parallel_studio:
if reponame.startswith(mpi):
prefer_ps = mpi_parallel_studio[mpi]["ps"]
if prefer_ps:
preferred_mkl = intel_parallel_studio[prefer_ps]["mkl"]
unprefer_other_mkls = ("!" + mkl for mkl in all_mkls if mkl != preferred_mkl)
return (prefer_ps,) + tuple(unprefer_other_mkls) + (preferred_mkl,)
else:
return ()
def valid_cuda(cuda, compiler):
"""
The CUDA distribution only works with certain gcc versions,
......@@ -338,6 +360,8 @@ def mpcdf_setup_repositories(api_url, project, distribution=None, parent=None, p
r.tail = "\n "
prjconf.append("%if %_repository == {0}".format(name))
for prefer in prefers(name):
prjconf.append("Prefer: " + prefer)
prjconf.append("Macros:")
prjconf.append("%is_compiler_repository {0}".format(1 if is_compiler else 0))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment