Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
i4
manycore
emper-io-eval
Commits
1ea41422
Commit
1ea41422
authored
Jan 21, 2022
by
Florian Fischer
Browse files
make open encoding explicit
parent
d87426c8
Pipeline
#76028
failed with stage
in 15 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bench/client.py
View file @
1ea41422
...
...
@@ -186,8 +186,8 @@ class Client(subprocess.Popen):
'err'
:
err_file
,
'host'
:
host
}))
self
.
fout
=
open
(
out_file
,
'w'
)
self
.
ferr
=
open
(
err_file
,
'w'
)
self
.
fout
=
open
(
out_file
,
'w'
,
encoding
=
'utf-8'
)
self
.
ferr
=
open
(
err_file
,
'w'
,
encoding
=
'utf-8'
)
super
().
__init__
(
cmd
.
split
(),
stdout
=
self
.
fout
,
...
...
bench/coordinator.py
View file @
1ea41422
...
...
@@ -16,15 +16,13 @@ class Coordinator(subprocess.Popen):
self
.
fout
=
subprocess
.
DEVNULL
self
.
ferr
=
subprocess
.
DEVNULL
if
out_file
:
self
.
fout
=
open
(
out_file
,
'w'
)
self
.
fout
=
open
(
out_file
,
'w'
,
encoding
=
'utf-8'
)
if
err_file
:
self
.
ferr
=
open
(
err_file
,
'w'
)
self
.
ferr
=
open
(
err_file
,
'w'
,
encoding
=
'utf-8'
)
cmd
=
f
'
{
COORDINATOR_EXE
}
{
nclients
}
'
log
.
debug
(
'Creating coordinator object with cmd: %s'
,
cmd
)
super
().
__init__
(
cmd
.
split
(),
stdout
=
self
.
fout
,
stderr
=
self
.
ferr
)
super
().
__init__
(
cmd
.
split
(),
stdout
=
self
.
fout
,
stderr
=
self
.
ferr
)
def
__enter__
(
self
):
log
.
debug
(
'Start coordinator'
)
...
...
bench/emper.py
View file @
1ea41422
...
...
@@ -389,7 +389,7 @@ def prepare_client(data_dir: Path):
"""Prepare and build the special emper variant for the client"""
client_checkout
=
get_commit_id
(
REPO
,
CLIENT_CHECKOUT
)
with
open
(
data_dir
/
'desc.yml'
,
'a'
)
as
desc_file
:
with
open
(
data_dir
/
'desc.yml'
,
'a'
,
encoding
=
'utf-8'
)
as
desc_file
:
print
(
f
'client_commit:
{
client_checkout
}
'
,
file
=
desc_file
)
# print(f'client_cmd: {CLIENT_CMD}', file=desc_file)
...
...
@@ -493,7 +493,8 @@ def prepare_flavors(data_dir: Path,
commit_ish
=
desc
.
get
(
'checkout'
,
DEFAULT_CHECKOUT
))
meson_options
=
desc
.
get
(
"meson_options"
,
""
)
with
open
(
flavor_dir
/
'desc.yml'
,
'w'
)
as
flavor_desc_file
:
with
open
(
flavor_dir
/
'desc.yml'
,
'w'
,
encoding
=
'utf-8'
)
as
flavor_desc_file
:
print
(
f
'cmd:
{
server_cmd
}
'
,
file
=
flavor_desc_file
)
print
(
f
'commit:
{
checkout
}
'
,
file
=
flavor_desc_file
)
print
(
f
'meson_options:
{
meson_options
}
'
,
file
=
flavor_desc_file
)
...
...
bench/server.py
View file @
1ea41422
...
...
@@ -56,8 +56,8 @@ class Server(subprocess.Popen):
'host'
:
host
or
'localhost'
}))
self
.
fout
=
open
(
out_file
,
'w'
)
self
.
ferr
=
open
(
err_file
,
'w'
)
self
.
fout
=
open
(
out_file
,
'w'
,
encoding
=
'utf-8'
)
self
.
ferr
=
open
(
err_file
,
'w'
,
encoding
=
'utf-8'
)
server_env
=
prepare_env
(
env
or
{})
...
...
eval.py
View file @
1ea41422
...
...
@@ -45,7 +45,7 @@ CLIENT_SEPARATION_TIME = 10
def
write_desc
(
data_dir
):
"""Write a YAML description of the evaluation into result_dir"""
desc_file_path
=
data_dir
/
'desc.yml'
with
open
(
desc_file_path
,
'w'
)
as
desc_file
:
with
open
(
desc_file_path
,
'w'
,
encoding
=
'utf-8'
)
as
desc_file
:
print
(
f
'start:
{
start_time
.
isoformat
()
}
'
,
file
=
desc_file
)
print
(
f
'args:
{
ARGS
}
'
,
file
=
desc_file
)
print
(
f
'host:
{
HOST
}
'
,
file
=
desc_file
)
...
...
@@ -92,7 +92,7 @@ def summarize(results: Mapping[str, Sequence[Sequence[BenchResult]]]):
summary
+=
f
'
{
result
.
name
}
:
{
amount
}
\n
'
print
(
summary
)
with
open
(
DATA_DIR
/
'summary.txt'
,
'w'
)
as
summary_file
:
with
open
(
DATA_DIR
/
'summary.txt'
,
'w'
,
encoding
=
'utf-8'
)
as
summary_file
:
print
(
summary
,
file
=
summary_file
)
...
...
plot.py
View file @
1ea41422
...
...
@@ -177,7 +177,7 @@ $table};
tikz
+=
tail
.
substitute
(
y_label
=
y_label
,
title
=
result_dir
.
replace
(
'_'
,
'
\\
_'
))
with
open
(
output_path
,
'w'
)
as
output_file
:
with
open
(
output_path
,
'w'
,
encoding
=
'utf-8'
)
as
output_file
:
print
(
tikz
,
file
=
output_file
)
...
...
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