Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
bc75fa1d
Commit
bc75fa1d
authored
Nov 04, 2020
by
Antoine Kaufmann
Browse files
experiments: better runtime log messages
parent
3745dcb4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
experiments/modes/runtime.py
experiments/modes/runtime.py
+7
-3
experiments/run.py
experiments/run.py
+1
-1
No files found.
experiments/modes/runtime.py
View file @
bc75fa1d
...
...
@@ -3,12 +3,16 @@ import asyncio
import
modes.experiments
as
exp
class
Run
(
object
):
def
__init__
(
self
,
experiment
,
env
,
outpath
):
def
__init__
(
self
,
experiment
,
index
,
env
,
outpath
):
self
.
experiment
=
experiment
self
.
index
=
index
self
.
env
=
env
self
.
outpath
=
outpath
self
.
output
=
None
def
name
(
self
):
return
self
.
experiment
.
name
+
'['
+
str
(
self
.
index
)
+
']'
class
Runtime
(
object
):
def
add_run
(
self
,
run
):
pass
...
...
@@ -56,11 +60,11 @@ class LocalParallelRuntime(Runtime):
async
def
do_run
(
self
,
run
):
''' actually starts a run '''
await
run
.
experiment
.
prepare
(
run
.
env
,
verbose
=
self
.
verbose
)
print
(
'starting run '
,
run
)
print
(
'starting run '
,
run
.
name
()
)
run
.
output
=
await
run
.
experiment
.
run
(
run
.
env
,
verbose
=
self
.
verbose
)
with
open
(
run
.
outpath
,
'w'
)
as
f
:
f
.
write
(
run
.
output
.
dumps
())
print
(
'finished run '
,
run
)
print
(
'finished run '
,
run
.
name
()
)
return
run
async
def
wait_completion
(
self
):
...
...
experiments/run.py
View file @
bc75fa1d
...
...
@@ -76,6 +76,6 @@ for e in experiments:
mkdir_if_not_exists
(
workdir
)
env
=
exp
.
ExpEnv
(
args
.
repo
,
workdir
)
rt
.
add_run
(
runtime
.
Run
(
e
,
env
,
outpath
))
rt
.
add_run
(
runtime
.
Run
(
e
,
run
,
env
,
outpath
))
rt
.
start
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment