Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Merge requests
!73
SW-824
: Resolve
SW-824
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
SW-824
: Resolve
SW-824
SW-824
into
LOFAR-Release-4_0
Overview
4
Commits
5
Pipelines
0
Changes
1
Merged
Jorrit Schaap
requested to merge
SW-824
into
LOFAR-Release-4_0
5 years ago
Overview
4
Commits
5
Pipelines
0
Changes
1
Expand
Closes
SW-824
0
0
Merge request reports
Viewing commit
d6efc8f4
Prev
Next
Show latest version
1 file
+
4
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
d6efc8f4
SW-824
: processed review comments, better way of input checking.
· d6efc8f4
Jorrit Schaap
authored
5 years ago
LCS/PyCommon/cep4_utils.py
+
4
−
5
Options
@@ -123,23 +123,22 @@ def get_cep4_slurm_nodes(states, partition: str) -> []:
try
:
# filter out unknown states
_states
=
[
s
for
s
in
states
if
s
in
SLURM_STATES
]
if
not
_states
:
if
any
(
s
for
s
in
states
if
s
not
in
SLURM_STATES
):
raise
ValueError
(
"
the given states:%s are not valid slurm states:%s
"
%
(
states
,
SLURM_STATES
))
if
partition
not
in
SLURM_PARTITIONS
:
raise
ValueError
(
"
the given partition:%s is not one of the valid cep4 slurm partition:%s
"
%
(
partition
,
SLURM_PARTITIONS
))
logger
.
debug
(
'
determining available cep4 nodes states:%s, partition:%s
'
,
_
states
,
partition
)
logger
.
debug
(
'
determining available cep4 nodes states:%s, partition:%s
'
,
states
,
partition
)
# find out which nodes are available
cmd
=
[
'
sinfo -p %s -t %s
'
%
(
partition
,
'
,
'
.
join
(
_
states
))]
cmd
=
[
'
sinfo -p %s -t %s
'
%
(
partition
,
'
,
'
.
join
(
states
))]
cmd
=
wrap_command_in_cep4_head_node_ssh_call
(
cmd
)
logger
.
debug
(
'
executing command: %s
'
,
'
'
.
join
(
cmd
))
out
=
check_output_returning_strings
(
cmd
)
lines
=
out
.
split
(
'
\n
'
)
for
state
in
_
states
:
for
state
in
states
:
try
:
line
=
next
(
l
for
l
in
lines
if
state
in
l
).
strip
()
# get nodes string part of line:
Loading