Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osc-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpcdf
obs
osc-plugins
Commits
ea1ada16
There was a problem fetching the pipeline summary.
Commit
ea1ada16
authored
6 years ago
by
Lorenz Huedepohl
Browse files
Options
Downloads
Patches
Plain Diff
Support for new 'default_*' attributes
parent
e4626e29
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mpcdf_common.py
+72
-18
72 additions, 18 deletions
mpcdf_common.py
mpcdf_info.py
+8
-5
8 additions, 5 deletions
mpcdf_info.py
with
80 additions
and
23 deletions
mpcdf_common.py
+
72
−
18
View file @
ea1ada16
...
...
@@ -10,7 +10,27 @@ from xml.etree import ElementTree
def
valid_mpi
(
compiler
,
mpi
):
return
True
"""
It might be possible to use Intel MPI libararies and compilers from
different Parallel Studio packages, but I currently do not want to support
it.
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
"
),
}
if
compiler
.
startswith
(
"
intel
"
)
and
mpi
.
startswith
(
"
impi
"
):
return
(
compiler
,
mpi
)
in
valid_intel_impi
else
:
return
True
def
valid_cuda
(
cuda
,
compiler
):
...
...
@@ -117,6 +137,8 @@ def remove_attribute(api_url, project, package, attribute_name):
def
mpcdf_enable_repositories
(
api_url
,
project
,
package
,
verbose
=
False
):
from
itertools
import
product
root
=
ElementTree
.
fromstringlist
(
osc
.
core
.
show_package_meta
(
api_url
,
project
,
package
))
build
=
root
.
find
(
"
./build
"
)
if
build
is
None
:
...
...
@@ -130,6 +152,10 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False):
mpis
=
get_attribute_values
(
api_url
,
project
,
package
,
"
MPCDF:mpi_modules
"
,
with_project
=
True
)
cudas
=
get_attribute_values
(
api_url
,
project
,
package
,
"
MPCDF:cuda_modules
"
,
with_project
=
True
)
default_compilers
=
get_attribute_values
(
api_url
,
project
,
None
,
"
MPCDF:default_compiler
"
)
default_mpis
=
get_attribute_values
(
api_url
,
project
,
None
,
"
MPCDF:default_mpi
"
)
default_cudas
=
get_attribute_values
(
api_url
,
project
,
None
,
"
MPCDF:default_cuda
"
)
def
enable
(
name
):
node
=
ElementTree
.
Element
(
"
enable
"
)
node
.
set
(
"
repository
"
,
name
)
...
...
@@ -145,34 +171,62 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False):
print
(
"
Warning: Could not get attribute MPCDF:enable_repositories for package {0}
"
.
format
(
package
))
return
False
def
actual_compilers
():
for
compiler
in
compilers
:
if
compiler
==
"
intel
"
:
for
intel_compiler
in
filter
(
lambda
cc
:
cc
.
startswith
(
"
intel
"
),
compilers
):
yield
intel_compiler
elif
compiler
==
"
gcc
"
:
for
gcc_compiler
in
filter
(
lambda
cc
:
cc
.
startswith
(
"
gcc
"
),
compilers
):
yield
gcc_compiler
elif
compiler
==
"
default_compiler
"
:
for
default_compiler
in
default_compilers
:
yield
default_compiler
else
:
yield
compiler
def
actual_mpis
():
for
mpi
in
mpis
:
if
mpi
==
"
impi
"
:
for
impi
in
filter
(
lambda
cc
:
cc
.
startswith
(
"
impi
"
),
mpis
):
yield
impi
elif
mpi
==
"
default_mpi
"
:
for
default_mpi
in
default_mpis
:
yield
default_mpi
else
:
yield
mpi
def
actual_cudas
():
for
cuda
in
cudas
:
if
cuda
==
"
default_cuda
"
:
for
default_cuda
in
default_cudas
:
yield
default_cuda
else
:
yield
cuda
for
flag
in
enable_repos
:
if
flag
==
"
system
"
:
enable
(
"
System
"
)
if
flag
==
"
compilers
"
:
for
compiler
in
compilers
:
enable
(
compiler
)
for
compiler
in
actual_
compilers
()
:
enable
(
compiler
)
if
flag
==
"
mpi
"
:
for
compiler
in
compilers
:
for
mpi
in
mpis
:
if
valid_mpi
(
compiler
,
mpi
):
enable
(
mpi
+
"
_
"
+
compiler
)
for
mpi
,
compiler
in
product
(
actual_mpis
(),
actual_compilers
()):
if
valid_mpi
(
compiler
,
mpi
):
enable
(
mpi
+
"
_
"
+
compiler
)
if
flag
==
"
cuda
"
:
for
cuda
in
cudas
:
for
compiler
in
all_compilers
:
if
valid_cuda
(
cuda
,
compiler
):
enable
(
cuda
+
"
_
"
+
compiler
)
for
cuda
,
compiler
in
product
(
actual_cudas
(),
all_compilers
):
if
valid_cuda
(
cuda
,
compiler
):
enable
(
cuda
+
"
_
"
+
compiler
)
if
flag
==
"
cuda_mpi
"
:
for
cuda
in
cudas
:
for
compiler
in
all_compilers
:
if
valid_cuda
(
cuda
,
compiler
):
for
mpi
in
mpis
:
if
valid_mpi
(
compiler
,
mpi
):
enable
(
cuda
+
"
_
"
+
mpi
+
"
_
"
+
compiler
)
for
cuda
,
mpi
,
compiler
in
product
(
actual_cudas
(),
actual_mpis
(),
all_compilers
):
if
valid_cuda
(
cuda
,
compiler
)
and
valid_mpi
(
compiler
,
mpi
):
enable
(
cuda
+
"
_
"
+
mpi
+
"
_
"
+
compiler
)
if
len
(
build
.
getchildren
())
>
0
:
build
.
getchildren
()[
-
1
].
tail
=
"
\n
"
...
...
@@ -332,7 +386,7 @@ def mpcdf_setup_repositories(api_url, project, distribution=None, parent=None, p
# Update repositories
print
(
"
Updating prj meta
"
)
osc
.
core
.
edit_meta
(
"
prj
"
,
project
,
data
=
prj
)
osc
.
core
.
edit_meta
(
"
prj
"
,
project
,
data
=
prj
,
force
=
True
)
print
(
"
Updating prjconf meta
"
)
osc
.
core
.
edit_meta
(
"
prjconf
"
,
project
,
data
=
prjconf
)
...
...
This diff is collapsed.
Click to expand it.
mpcdf_info.py
+
8
−
5
View file @
ea1ada16
...
...
@@ -43,8 +43,11 @@ 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
"
)
unmanaged
=
[]
...
...
@@ -67,13 +70,13 @@ def do_mpcdf_info(self, subcmd, opts, *args):
def
subset
(
description
,
attribute
):
if
mpcdf_common
.
has_attribute
(
api_url
,
project
,
package
,
attribute
):
return
"
(
{0}
:
{1}
)
"
.
format
(
description
,
"
,
"
.
join
(
mpcdf_common
.
get_attribute_values
(
api_url
,
project
,
package
,
attribute
)))
return
"
{0}
=
{1}
"
.
format
(
description
,
"
,
"
.
join
(
mpcdf_common
.
get_attribute_values
(
api_url
,
project
,
package
,
attribute
)))
return
""
print
(
"
"
+
pkg_name_fmt
.
format
(
package
),
"
,
"
.
join
(
enabled_repos
),
subset
(
"
compiler
subset
"
,
"
MPCDF:compiler_modules
"
)
+
subset
(
"
MPI subset
"
,
"
MPCDF:mpi_modules
"
)
+
subset
(
"
CUDA subet
"
,
"
MPCDF:cuda_modules
"
))
print
(
"
"
+
pkg_name_fmt
.
format
(
package
),
"
--set=
"
+
(
"
,
"
.
join
(
enabled_repos
)
)
,
subset
(
"
--
compiler
-modules
"
,
"
MPCDF:compiler_modules
"
)
+
subset
(
"
--mpi-modules
"
,
"
MPCDF:mpi_modules
"
)
+
subset
(
"
--cuda-modules
"
,
"
MPCDF:cuda_modules
"
))
print
()
if
unmanaged
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment