Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
macaon_data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Franck Dary
macaon_data
Commits
9071eb15
Commit
9071eb15
authored
4 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
launchBatches now detects nodes that are not alive
parent
7c0b8667
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
UD_any/launchBatches.py
+11
-2
11 additions, 2 deletions
UD_any/launchBatches.py
with
11 additions
and
2 deletions
UD_any/launchBatches.py
+
11
−
2
View file @
9071eb15
...
...
@@ -52,7 +52,7 @@ def launchTrainOar(mode, expName, arguments, nbHours) :
command
+=
"
-l walltime=%d:00:00
"
%
nbHours
command
+=
"
\'
"
+
"
./train.sh %s bin/%s %s --silent
"
%
(
mode
,
expName
,
arguments
)
+
"
\'
"
os
.
system
(
command
)
subprocess
.
Popen
(
command
,
shell
=
True
).
wait
(
)
###############################################################################
###############################################################################
...
...
@@ -85,7 +85,7 @@ def launchEvalOar(mode, expName, nbHours) :
command
+=
"
-l walltime=%d:00:00
"
%
nbHours
command
+=
"
\"
"
+
"
./evaluate.sh %s bin/%s --silent
"
%
(
mode
,
expName
)
+
"
\"
"
os
.
system
(
command
)
subprocess
.
Popen
(
command
,
shell
=
True
).
wait
(
)
###############################################################################
###############################################################################
...
...
@@ -123,14 +123,23 @@ def getOarNbUsedGpuPerNode() :
return
res
###############################################################################
###############################################################################
def
getOarNotAliveNodes
()
:
return
subprocess
.
Popen
(
"
oarnodes | grep -B 2
'
state : [^A]
'
| grep
'
network_address
'
| sort --unique | awk
'
{print $3}
'"
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
).
stdout
.
read
().
decode
(
"
utf8
"
).
split
(
'
\n
'
)
###############################################################################
###############################################################################
def
getOarNbFreeGpuPerNode
()
:
gpus
=
getOarNbGpuPerNode
()
notAlive
=
getOarNotAliveNodes
()
usedGpus
=
getOarNbUsedGpuPerNode
()
for
gpu
in
gpus
:
gpus
[
gpu
]
-=
usedGpus
[
gpu
]
if
gpu
in
usedGpus
else
0
for
host
in
notAlive
:
gpus
[
host
]
=
0
return
gpus
###############################################################################
...
...
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