-
Notifications
You must be signed in to change notification settings - Fork 0
/
osu_latency.py
executable file
·68 lines (46 loc) · 1.7 KB
/
osu_latency.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#! /usr/bin/env python
from test_commons import *
from test_parsing import *
def run_test_with_windowsize(config, hpx_command, windowsize):
hpx_command_with_winsize = hpx_command + " --window-size " + str(windowsize)
# Build the execution string
invocation_command = build_command(config, hpx_command_with_winsize)
# Run the test
out = run_command(invocation_command)
# Parse results
lines = get_lines(out)
lines = remove_meaningless_lines(lines)
lines = remove_startswith_lines(lines, "Total time:")
lines_split = split_lines_by_whitespace(lines)
results = []
for row in lines_split:
if len(row) != 2:
continue
value = float(row[1])
size = row[0]
arguments = { "size": size,
"window": windowsize }
results.append(build_test_result(config, arguments, value))
# Throw if no results read
if len(results) < 1:
error("Unable to read results!")
exit(1)
return results
if __name__ == "__main__":
# Get config
config = get_config("osu_latency")
if config["localities"] * config["nodes"] != 2:
send_result([])
exit(0)
# Get executable path
hpx_command = get_hpx_executable(config, "osu_latency")
# Statically set the max-size
hpx_command = hpx_command + " --max-size 4096"
hpx_command = hpx_command + " --loop 200"
results = []
# Dynamically set the window-size
for win_size in [1,10,20,100]:
current_results = run_test_with_windowsize(config, hpx_command, win_size)
results.extend(current_results)
# Send results via writing the json string to stdout
send_result(results)