Skip to content

Commit

Permalink
push results for comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
victoryang00 committed Mar 1, 2024
1 parent 9164a8c commit dd3d951
Show file tree
Hide file tree
Showing 5 changed files with 414 additions and 278 deletions.
157 changes: 79 additions & 78 deletions artifact/bench_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@
from multiprocessing import Pool
from matplotlib import pyplot as plt
import numpy as np
from collections import defaultdict

cmd = [
"linpack",
"llama",
"rgbd_tum",
"bc",
"bfs",
"cc",
"cc_sv",
"pr",
"pr_spmv",
"sssp",
"tc",
"bt",
"cg",
"ft",
Expand All @@ -29,14 +22,6 @@
"linpack",
"llama",
"ORB_SLAM2",
"gapbs",
"gapbs",
"gapbs",
"gapbs",
"gapbs",
"gapbs",
"gapbs",
"gapbs",
"nas",
"nas",
"nas",
Expand All @@ -50,14 +35,6 @@
[],
["stories110M.bin", "-z", "tokenizer.bin", "-t", "0.0"],
["./ORBvoc.txt,", "./TUM3.yaml", "./", "./associations/fr1_xyz.txt"],
["-g20", "-vn300"],
["-g20", "-vn300"],
["-g20", "-vn300"],
["-g20", "-vn300"],
["-g20", "-vn300"],
["-g20", "-vn300"],
["-g20", "-vn300"],
["-g20", "-n1"],
[],
[],
[],
Expand All @@ -77,18 +54,10 @@
"OMP_NUM_THREADS=4",
"OMP_NUM_THREADS=4",
"OMP_NUM_THREADS=4",
"OMP_NUM_THREADS=4",
"OMP_NUM_THREADS=4",
"OMP_NUM_THREADS=4",
"OMP_NUM_THREADS=4",
"OMP_NUM_THREADS=4",
"OMP_NUM_THREADS=4",
"OMP_NUM_THREADS=4",
"OMP_NUM_THREADS=4",
"a=b",
"a=b",
]
pool = Pool(processes=1)
pool = Pool(processes=20)

def run_mvvm():
results = []
Expand Down Expand Up @@ -128,17 +97,25 @@ def run_hcontainer():
lines = output.split("\n")
for line in lines:
if line.__contains__("elapsed"):
# Split the time string into minutes, seconds, and milliseconds
minutes, seconds = line.split(" ")[2].replace("elapsed", "").split(":")
seconds, milliseconds = seconds.split(".")

# Convert each part to seconds (note that milliseconds are converted and added as a fraction of a second)
total_seconds = (
int(minutes) * 60 + int(seconds) + int(milliseconds) / 1000
)

print(total_seconds)
exec_time = total_seconds
try:
minutes, seconds = line.split()[2].replace("elapsed", "").split(":")
seconds, milliseconds = seconds.split(".")

# Convert each part to seconds (note that milliseconds are converted and added as a fraction of a second)
total_seconds = (
int(minutes) * 60 + int(seconds) + int(milliseconds) / 1000
)

print(total_seconds)
exec_time = total_seconds
except:
try:
from datetime import datetime

time_object = datetime.strptime(line.split()[2].replace("elapsed", ""), "%H:%M:%S").time()
print(time_object)
except:
exec_time = float(line.split()[0].replace("user", ""))
results.append((exec, exec_time))
return results

Expand All @@ -162,17 +139,25 @@ def run_qemu_x86_64():
lines = output.split("\n")
for line in lines:
if line.__contains__("elapsed"):
# Split the time string into minutes, seconds, and milliseconds
minutes, seconds = line.split(" ")[2].replace("elapsed", "").split(":")
seconds, milliseconds = seconds.split(".")

# Convert each part to seconds (note that milliseconds are converted and added as a fraction of a second)
total_seconds = (
int(minutes) * 60 + int(seconds) + int(milliseconds) / 1000
)

print(total_seconds)
exec_time = total_seconds
try:
minutes, seconds = line.split()[2].replace("elapsed", "").split(":")
seconds, milliseconds = seconds.split(".")

# Convert each part to seconds (note that milliseconds are converted and added as a fraction of a second)
total_seconds = (
int(minutes) * 60 + int(seconds) + int(milliseconds) / 1000
)

print(total_seconds)
exec_time = total_seconds
except:
try:
from datetime import datetime

time_object = datetime.strptime(line.split()[2].replace("elapsed", ""), "%H:%M:%S").time()
print(time_object)
except:
exec_time = float(line.split()[0].replace("user", ""))
results.append((exec, exec_time))
return results

Expand All @@ -195,17 +180,25 @@ def run_qemu_aarch64():
lines = output.split("\n")
for line in lines:
if line.__contains__("elapsed"):
# Split the time string into minutes, seconds, and milliseconds
minutes, seconds = line.split(" ")[2].replace("elapsed", "").split(":")
seconds, milliseconds = seconds.split(".")

# Convert each part to seconds (note that milliseconds are converted and added as a fraction of a second)
total_seconds = (
int(minutes) * 60 + int(seconds) + int(milliseconds) / 1000
)

print(total_seconds)
exec_time = total_seconds
try:
minutes, seconds = line.split()[2].replace("elapsed", "").split(":")
seconds, milliseconds = seconds.split(".")

# Convert each part to seconds (note that milliseconds are converted and added as a fraction of a second)
total_seconds = (
int(minutes) * 60 + int(seconds) + int(milliseconds) / 1000
)

print(total_seconds)
exec_time = total_seconds
except:
try:
from datetime import datetime

time_object = datetime.strptime(line.split()[2].replace("elapsed", ""), "%H:%M:%S").time()
print(time_object)
except:
exec_time = float(line.split()[0].replace("user", ""))
results.append((exec, exec_time))
return results

Expand All @@ -228,17 +221,25 @@ def run_native():
lines = output.split("\n")
for line in lines:
if line.__contains__("elapsed"):
# Split the time string into minutes, seconds, and milliseconds
minutes, seconds = line.split(" ")[2].replace("elapsed", "").split(":")
seconds, milliseconds = seconds.split(".")

# Convert each part to seconds (note that milliseconds are converted and added as a fraction of a second)
total_seconds = (
int(minutes) * 60 + int(seconds) + int(milliseconds) / 1000
)

print(total_seconds)
exec_time = total_seconds
try:
minutes, seconds = line.split()[2].replace("elapsed", "").split(":")
seconds, milliseconds = seconds.split(".")

# Convert each part to seconds (note that milliseconds are converted and added as a fraction of a second)
total_seconds = (
int(minutes) * 60 + int(seconds) + int(milliseconds) / 1000
)

print(total_seconds)
exec_time = total_seconds
except:
try:
from datetime import datetime

time_object = datetime.strptime(line.split()[2].replace("elapsed", ""), "%H:%M:%S").time()
print(time_object)
except:
exec_time = float(line.split()[0].replace("user", ""))
results.append((exec, exec_time))
return results

Expand Down Expand Up @@ -279,7 +280,7 @@ def plot(results):

plt.rc('font', **font)
workloads = defaultdict(list)
for workload,hcontainer_values, mvvm_values, qemu_x86_64_values,qemu_aarch64_values,native_values in results:
for workload, mvvm_values,hcontainer_values, qemu_x86_64_values,qemu_aarch64_values,native_values in results:
workloads[
workload.replace("OMP_NUM_THREADS=", "")
.replace("-g20", "")
Expand Down
Loading

0 comments on commit dd3d951

Please sign in to comment.