Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcdf
obs
osc-plugins
Commits
0267c7fc
Commit
0267c7fc
authored
Sep 23, 2021
by
Lorenz Hüdepohl
Browse files
Remove remaining usage of 'default_*' attributes
parent
25c54774
Pipeline
#110720
passed with stage
in 7 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mpcdf_common.py
View file @
0267c7fc
...
...
@@ -21,7 +21,6 @@ known_microarchs = {"sandybridge", "haswell", "skylake"}
package_attributes
=
[
"MPCDF:enable_repositories"
]
config_attributes
=
[
"MPCDF:compiler_modules"
,
"MPCDF:cuda_modules"
,
"MPCDF:mpi_modules"
,
"MPCDF:pgi_modules"
,
"MPCDF:openmpi_flavors"
]
default_attributes
=
[
"MPCDF:default_compiler"
,
"MPCDF:default_cuda"
,
"MPCDF:default_mpi"
]
intel_parallel_studio
=
{
"mpcdf_intel_parallel_studio_2017_7"
:
{
"compiler"
:
"intel_17_0_7"
,
"impi"
:
"impi_2017_4"
,
"mkl"
:
"mkl_2017_4-module"
,
},
...
...
@@ -476,10 +475,6 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, dry_run=
all_pgis
=
overloaded_project_attribute
(
api_url
,
project
,
"MPCDF:pgi_modules"
)
all_openmpi_flavors
=
overloaded_project_attribute
(
api_url
,
project
,
"MPCDF:openmpi_flavors"
)
default_compilers
=
overloaded_project_attribute
(
api_url
,
project
,
"MPCDF:default_compiler"
)
default_mpis
=
overloaded_project_attribute
(
api_url
,
project
,
"MPCDF:default_mpi"
)
default_cudas
=
overloaded_project_attribute
(
api_url
,
project
,
"MPCDF:default_cuda"
)
latest_intel
=
sorted
((
c
for
c
in
all_compilers
if
c
.
startswith
(
"intel"
)),
key
=
package_sort_key
)[
-
1
]
latest_gcc
=
sorted
((
c
for
c
in
all_compilers
if
c
.
startswith
(
"gcc"
)),
key
=
package_sort_key
)[
-
1
]
...
...
@@ -496,16 +491,13 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, dry_run=
print
(
"Enabling"
,
name
)
def
actual_compilers
():
for
compiler
in
(
c
for
c
in
compilers
if
c
in
all_compilers
+
[
"default_compiler"
,
"intel"
,
"gcc"
,
"latest_intel"
,
"latest_gcc"
]):
for
compiler
in
(
c
for
c
in
compilers
if
c
in
all_compilers
+
[
"intel"
,
"gcc"
,
"latest_intel"
,
"latest_gcc"
]):
if
compiler
==
"intel"
:
for
intel_compiler
in
[
cc
for
cc
in
all_compilers
if
cc
.
startswith
(
"intel"
)]:
yield
intel_compiler
elif
compiler
==
"gcc"
:
for
gcc_compiler
in
[
cc
for
cc
in
all_compilers
if
cc
.
startswith
(
"gcc"
)]:
yield
gcc_compiler
elif
compiler
==
"default_compiler"
:
for
default_compiler
in
default_compilers
:
yield
default_compiler
elif
compiler
==
"latest_intel"
:
yield
latest_intel
elif
compiler
==
"latest_gcc"
:
...
...
@@ -514,23 +506,16 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, dry_run=
yield
compiler
def
actual_mpis
():
for
mpi
in
(
m
for
m
in
mpis
if
m
in
all_mpis
+
[
"default_mpi"
,
"impi"
]):
for
mpi
in
(
m
for
m
in
mpis
if
m
in
all_mpis
+
[
"impi"
]):
if
mpi
==
"impi"
:
for
impi
in
[
mpi
for
mpi
in
all_mpis
if
mpi
.
startswith
(
"impi"
)]:
yield
impi
elif
mpi
==
"default_mpi"
:
for
default_mpi
in
default_mpis
:
yield
default_mpi
else
:
yield
mpi
def
actual_cudas
():
for
cuda
in
(
c
for
c
in
cudas
if
c
in
all_cudas
+
[
"default_cuda"
]):
if
cuda
==
"default_cuda"
:
for
default_cuda
in
default_cudas
:
yield
default_cuda
else
:
yield
cuda
for
cuda
in
(
c
for
c
in
cudas
if
c
in
all_cudas
):
yield
cuda
def
actual_pgis
():
for
pgi
in
(
p
for
p
in
pgis
if
p
in
all_pgis
):
...
...
@@ -629,7 +614,7 @@ def mpcdf_setup_subproject(api_url, project, distribution, microarchitecture,
parent
=
None
,
dry_run
=
False
,
diff
=
False
,
remove_old
=
False
,
all_possible
=
False
,
only_project
=
False
):
if
parent
and
not
dry_run
:
for
attribute
in
config_attributes
+
default_attributes
:
for
attribute
in
config_attributes
:
print
(
"Copying attribute '{0}' from parent project"
.
format
(
attribute
))
set_attribute_values
(
api_url
,
project
,
None
,
attribute
,
overloaded_project_attribute
(
api_url
,
parent
,
attribute
))
...
...
@@ -755,8 +740,6 @@ Macros:
def
actual_compiler
(
c
):
if
c
.
startswith
(
"latest"
):
return
False
if
c
==
"default_compiler"
:
return
False
if
c
==
"intel"
:
return
False
if
c
==
"gcc"
:
...
...
@@ -764,15 +747,11 @@ Macros:
return
True
def
actual_mpi
(
m
):
if
m
==
"default_mpi"
:
return
False
if
m
==
"impi"
:
return
False
return
True
def
actual_cuda
(
c
):
if
c
==
"default_cuda"
:
return
False
return
True
if
all_possible
:
...
...
mpcdf_info.py
View file @
0267c7fc
...
...
@@ -43,11 +43,8 @@ def do_mpcdf_info(self, subcmd, opts, *args):
print
()
print_attribute
(
"Compilers"
,
"MPCDF:compiler_modules"
)
print_attribute
(
"Default Compiler"
,
"MPCDF:default_compiler"
)
print_attribute
(
"MPI libraries"
,
"MPCDF:mpi_modules"
)
print_attribute
(
"Default MPI"
,
"MPCDF:default_mpi"
)
print_attribute
(
"CUDA versions"
,
"MPCDF:cuda_modules"
)
print_attribute
(
"Default CUDA"
,
"MPCDF:default_cuda"
)
print_attribute
(
"PGI compilers"
,
"MPCDF:pgi_modules"
)
unmanaged
=
[]
...
...
mpcdf_setup_clusters_project.py
View file @
0267c7fc
...
...
@@ -41,7 +41,7 @@ def do_mpcdf_setup_cluster_project(self, subcmd, opts, *args):
raise
Exception
(
"Internal error"
)
macros
[
target
]
=
[]
for
attribute
in
mpcdf_common
.
config_attributes
+
mpcdf_common
.
default_attributes
:
for
attribute
in
mpcdf_common
.
config_attributes
:
_
,
name
=
attribute
.
split
(
":"
)
values
=
mpcdf_common
.
overloaded_project_attribute
(
api_url
,
subproject
,
attribute
)
macros
[
target
].
append
(
"%available_{0} {1}"
.
format
(
name
,
","
.
join
(
sorted
(
values
))))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment