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
Commits
d6efc8f4
Commit
d6efc8f4
authored
5 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
SW-824
: processed review comments, better way of input checking.
parent
dde44d0a
No related branches found
No related tags found
2 merge requests
!74
Lofar release 4 0
,
!73
SW-824: Resolve SW-824
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LCS/PyCommon/cep4_utils.py
+4
-5
4 additions, 5 deletions
LCS/PyCommon/cep4_utils.py
with
4 additions
and
5 deletions
LCS/PyCommon/cep4_utils.py
+
4
−
5
View file @
d6efc8f4
...
...
@@ -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:
...
...
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