Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Poulpe
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
octobus
Poulpe
Commits
371f64b0
Commit
371f64b0
authored
2 years ago
by
Pierre-Yves David
Browse files
Options
Downloads
Patches
Plain Diff
runner: split the `run_one` function
Let split the actual running from the more shell oriented part.
parent
e5db5ad5
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
python-libs/poulpe/runner.py
+18
-10
18 additions, 10 deletions
python-libs/poulpe/runner.py
with
18 additions
and
10 deletions
python-libs/poulpe/runner.py
+
18
−
10
View file @
371f64b0
...
...
@@ -12,7 +12,7 @@
RETURN_CODE_SETUP_ISSUE
=
64
def
run_one
(
bin_env_path
,
data_env_path
,
benchmark_path
,
result
):
def
run_one
_core
(
bin_env_path
,
data_env_path
,
benchmark_path
):
result_data
=
{}
result_data
[
'
run
'
]
=
{}
result_data
[
'
run
'
][
"
timestamp
"
]
=
time
.
time
()
...
...
@@ -37,6 +37,20 @@
try
:
bench_result
=
benchmark
.
run_one
(
bin_env_path
,
data_env_path
)
result_data
[
'
result
'
]
=
bench_result
finally
:
duration
=
time
.
time
()
-
result_data
[
'
run
'
][
"
timestamp
"
]
result_data
[
'
run
'
][
"
duration
"
]
=
duration
return
result_data
def
run_one
(
bin_env_path
,
data_env_path
,
benchmark_path
,
result
):
try
:
result_data
=
run_one_core
(
bin_env_path
,
data_env_path
,
benchmark_path
,
)
except
errors
.
MissingDataEnvInputVars
as
exc
:
err
=
poulpe
.
err
msg
=
(
...
...
@@ -45,7 +59,6 @@
)
err
(
msg
)
return
RETURN_CODE_SETUP_ISSUE
except
errors
.
BenchmarkRunFailure
as
exc
:
err
=
poulpe
.
err
err
(
"
ERROR: running benchmark failed:
"
)
...
...
@@ -69,11 +82,6 @@
for
line
in
exc
.
stderr
.
splitlines
():
err
(
f
"
ERROR:
{
line
.
decode
(
'
utf8
'
)
}
"
)
return
RETURN_CODE_EXEC_ISSUE
result_data
[
'
result
'
]
=
bench_result
duration
=
time
.
time
()
-
result_data
[
'
run
'
][
"
timestamp
"
]
result_data
[
'
run
'
][
"
duration
"
]
=
duration
poulpe
.
write_data
(
result
,
result_data
)
return
RETURN_CODE_SUCCESS
else
:
poulpe
.
write_data
(
result
,
result_data
)
return
RETURN_CODE_SUCCESS
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