"vscode:/vscode.git/clone" did not exist on "dfb016fe0f40f3a36851775316956b674df096d9"
dist_memcache.py 2.17 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright 2022 Max Planck Institute for Software Systems, and
# National University of Singapore
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Jonas Kaufmann's avatar
Jonas Kaufmann committed
22
23
24
25
26
27
"""
Generates data file for dist_memcache scalability graph.

First column is the number of hosts, second column the qemu timing simulation
time in hours, and the third column is the gem5 simulation time.
"""
28

29
import json
Jonas Kaufmann's avatar
Jonas Kaufmann committed
30
import sys
Jonas Kaufmann's avatar
Jonas Kaufmann committed
31
from os.path import exists
32

33
34
35
36
37
38
39
40
41
42
if len(sys.argv) != 2:
    print('Usage: dist_memcache.py OUTDIR')
    sys.exit(1)

basedir = sys.argv[1] + '/'
n_hosts_per_rack = 40
racks = [1, 5, 10, 15, 25]
host_types = ['qt', 'gem5']

for n_racks in racks:
Jonas Kaufmann's avatar
Jonas Kaufmann committed
43
44
    l = str(n_racks * n_hosts_per_rack)
    for host_type in host_types:
Jonas Kaufmann's avatar
Jonas Kaufmann committed
45
46
47
        log_path = (
            f'{basedir}dist_memcache-{host_type}-{n_racks}-{n_hosts_per_rack}'
            '-1.json'
Jonas Kaufmann's avatar
Jonas Kaufmann committed
48
        )
Jonas Kaufmann's avatar
Jonas Kaufmann committed
49
50
51
52
53
54
        if exists(log):
            with open(log_path, 'r', encoding='utf-8') as log:
                exp_log = json.load(log)
                start_time = exp_log['start_time']
                end_time = exp_log['end_time']
                diff_time = float(end_time - start_time) / 60 / 60
Jonas Kaufmann's avatar
Jonas Kaufmann committed
55
        else:
Jonas Kaufmann's avatar
Jonas Kaufmann committed
56
            diff_time = ''
Jonas Kaufmann's avatar
Jonas Kaufmann committed
57
58
59
60

        l += '\t' + str(diff_time)

    print(l)