Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oar
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Jeremy Auguste
oar
Commits
260b6626
Commit
260b6626
authored
6 years ago
by
Jeremy Auguste
Browse files
Options
Downloads
Patches
Plain Diff
Added way to specify multiple hosts (and ignore hosts)
parent
5bb2a115
No related branches found
No related tags found
No related merge requests found
Pipeline
#998
failed
6 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
batchoar.py
+6
-3
6 additions, 3 deletions
batchoar.py
oargen.py
+12
-5
12 additions, 5 deletions
oargen.py
with
18 additions
and
8 deletions
batchoar.py
+
6
−
3
View file @
260b6626
...
...
@@ -23,8 +23,10 @@ def argparser():
help
=
"
If True, reserves only cores with GPUs
"
)
parser
.
add_argument
(
'
-c
'
,
'
--core
'
,
default
=
1
,
type
=
int
,
help
=
"
Number of cores to reserve
"
)
parser
.
add_argument
(
'
-H
'
,
'
--host
'
,
help
=
"
Name of the host (SQL LIKE syntax accepted)
"
)
parser
.
add_argument
(
'
-H
'
,
'
--host
'
,
nargs
=
"
+
"
,
default
=
[],
help
=
"
Name of the hosts (SQL
'
LIKE
'
syntax accepted)
"
)
parser
.
add_argument
(
'
-I
'
,
'
--ignore-host
'
,
nargs
=
"
+
"
,
default
=
[],
help
=
"
Name of the hosts to ignore (SQL
'
NOT LIKE
'
syntax accepted)
"
)
parser
.
add_argument
(
'
-i
'
,
'
--interactive
'
,
action
=
"
store_true
"
,
help
=
"
Launch job in interactive mode
"
)
parser
.
add_argument
(
'
-C
'
,
'
--checkpoint
'
,
type
=
int
,
metavar
=
"
SECONDS
"
,
...
...
@@ -95,7 +97,7 @@ def load_jobs(yaml_in, args):
yaml_jobs
=
yaml
.
load
(
yaml_in
)
var_names
,
var_tuples
=
load_variables
(
yaml_jobs
[
"
variables
"
])
constants
=
yaml_jobs
[
"
constants
"
]
constants
=
yaml_jobs
[
"
constants
"
]
if
"
constants
"
in
yaml_jobs
else
{}
flags
=
load_flags
(
yaml_jobs
[
"
flags
"
],
args
)
try
:
precommand
=
yaml_jobs
[
"
environment
"
][
"
precommand
"
]
...
...
@@ -142,6 +144,7 @@ def main():
anterior
=
anteriors
.
pop
()
oar_command
=
oargen
.
prepare_oarsub
(
args
.
gpu
,
args
.
host
,
args
.
core
,
args
.
time
,
ignore_hosts
=
args
.
ignore_host
,
command
=
job
,
name
=
job_name
,
output_directory
=
args
.
directory
,
besteffort
=
args
.
besteffort
,
...
...
This diff is collapsed.
Click to expand it.
oargen.py
+
12
−
5
View file @
260b6626
...
...
@@ -27,8 +27,10 @@ def argparser():
help
=
"
If True, reserves only cores with GPUs
"
)
parser
.
add_argument
(
'
-c
'
,
'
--core
'
,
default
=
1
,
type
=
int
,
help
=
"
Number of cores to reserve
"
)
parser
.
add_argument
(
'
-H
'
,
'
--host
'
,
help
=
"
Name of the host (SQL LIKE syntax accepted)
"
)
parser
.
add_argument
(
'
-H
'
,
'
--host
'
,
nargs
=
"
+
"
,
default
=
[],
help
=
"
Name of the hosts (SQL
'
LIKE
'
syntax accepted)
"
)
parser
.
add_argument
(
'
-I
'
,
'
--ignore-host
'
,
nargs
=
"
+
"
,
default
=
[],
help
=
"
Name of the hosts to ignore (SQL
'
NOT LIKE
'
syntax accepted)
"
)
parser
.
add_argument
(
'
-i
'
,
'
--interactive
'
,
action
=
"
store_true
"
,
help
=
"
Launch job in interactive mode
"
)
parser
.
add_argument
(
'
-C
'
,
'
--checkpoint
'
,
type
=
int
,
metavar
=
"
SECONDS
"
,
...
...
@@ -42,7 +44,8 @@ def argparser():
return
args
def
prepare_oarsub
(
gpu
,
host
,
core
,
time
,
def
prepare_oarsub
(
gpu
,
hosts
,
core
,
time
,
ignore_hosts
=
[],
command
=
None
,
interactive
=
False
,
name
=
None
,
output_directory
=
None
,
...
...
@@ -55,8 +58,12 @@ def prepare_oarsub(gpu, host, core, time,
properties
+=
"
(gpu IS NOT NULL)
"
else
:
properties
+=
"
(gpu IS NULL)
"
if
host
is
not
None
:
if
hosts
:
for
host
in
hosts
:
properties
+=
"
AND host LIKE
'
{}
'"
.
format
(
host
)
if
ignore_hosts
:
for
host
in
ignore_hosts
:
properties
+=
"
AND host NOT LIKE
'
{}
'"
.
format
(
host
)
properties
+=
""
oar_cmd
.
append
(
properties
)
...
...
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