Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fsl_sub_plugin_sge
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
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
FSL
fsl_sub_plugin_sge
Commits
6947c791
Commit
6947c791
authored
4 years ago
by
Duncan Mortimer
Browse files
Options
Downloads
Patches
Plain Diff
Prevent duplicate warnings
Output CommentedMap starting at queues:
parent
57dd598a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl_sub_plugin_sge/__init__.py
+21
-8
21 additions, 8 deletions
fsl_sub_plugin_sge/__init__.py
with
21 additions
and
8 deletions
fsl_sub_plugin_sge/__init__.py
+
21
−
8
View file @
6947c791
...
...
@@ -1105,6 +1105,11 @@ def _minutes_to_seconds(minutes):
return
minutes
*
60
def
_add_warning
(
warnings
,
warning
):
if
warning
not
in
warnings
:
warnings
.
append
(
warning
)
def
build_queue_defs
():
'''
Return YAML suitable for configuring queues
'''
logger
=
_get_logger
()
...
...
@@ -1116,7 +1121,9 @@ def build_queue_defs():
except
BadSubmission
as
e
:
logger
.
error
(
'
Unable to query Grid Engine:
'
+
str
(
e
))
return
(
''
,
[])
queues
=
CommentedMap
()
q_base
=
CommentedMap
()
q_base
[
'
queues
'
]
=
CommentedMap
()
queues
=
q_base
[
'
queues
'
]
for
q
in
queue_list
:
qinfo
=
_get_queue_info
(
q
)
if
'
BATCH
'
not
in
qinfo
[
'
qtype
'
]:
...
...
@@ -1128,7 +1135,8 @@ def build_queue_defs():
warnings
=
[]
for
coproc_m
in
(
'
gpu
'
,
'
cuda
'
,
'
phi
'
,
):
if
coproc_m
in
q
:
warnings
.
append
(
_add_warning
(
warnings
,
"
Quene name looks like it might be a queue supporting co-processors.
"
"
Cannot auto-configure.
"
)
...
...
@@ -1155,7 +1163,8 @@ def build_queue_defs():
qd
[
'
max_size
'
]
=
int
(
queue_ram_map
[
q
][
0
])
add_comment
(
"
Maximum RAM size of a job
"
,
'
max_size
'
,
column
=
0
)
if
queue_ram_map
[
q
][
1
]:
warnings
.
append
(
_add_warning
(
warnings
,
"
Queue has hosts of different total memory size, consider creating multiple queues
"
"
for the different host hardware in Grid Engine and then set the same
'
group
'
integer
"
"
to allow fsl_sub to maximise hardware your job can run on. Alternatively consider turning
"
...
...
@@ -1176,7 +1185,8 @@ def build_queue_defs():
unique_vmem
=
list
(
set
(
q_vmem
))
if
len
(
unique_vmem
)
>
0
:
warnings
.
append
(
_add_warning
(
warnings
,
"
Queue has hosts of different per-slot memory size, consider creating multiple
"
"
queues for the different host hardware in Grid Engine and then add these queues
"
"
to the configuration setting the same
'
group
'
integer in the configuration to
"
...
...
@@ -1189,7 +1199,8 @@ def build_queue_defs():
unique_rss
=
list
(
set
(
q_rss
))
if
len
(
unique_rss
)
>
0
:
if
not
warnings
:
warnings
.
append
(
_add_warning
(
warnings
,
"
Queue has hosts of different per-slot memory size, consider creating multiple
"
"
queues for the different host hardware in Grid Engine and then add these queues
"
"
to the configuration setting the same
'
group
'
integer in the configuration to
"
...
...
@@ -1200,11 +1211,13 @@ def build_queue_defs():
qd
[
'
slot_size
'
]
=
human_to_ram
(
unique_rss
[
0
],
output
=
ram_units
)
else
:
qd
[
'
slot_size
'
]
=
int
(
qd
[
'
max_size
'
])
//
queue_ram_map
[
q
][
2
]
warnings
.
append
(
_add_warning
(
warnings
,
"
Queue has no h_vmem or h_rss specified,
"
"
slot_size calculated with max_size divided by slots.
"
)
if
queue_ram_map
[
q
][
3
]:
warnings
.
append
(
_add_warning
(
warnings
,
"
Queue has multiple slot sizes
"
"
- this calculation will not be correct for all hosts.
"
)
...
...
@@ -1218,4 +1231,4 @@ def build_queue_defs():
for
w
in
warnings
:
queues
.
yaml_set_comment_before_after_key
(
qinfo
[
'
qname
'
],
after
=
w
)
return
q
ueues
return
q
_base
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