-
Notifications
You must be signed in to change notification settings - Fork 4
/
combine_UVM_MGG_8GPU.py
executable file
·39 lines (31 loc) · 1.29 KB
/
combine_UVM_MGG_8GPU.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
import csv
import os
# Read the first CSV file and get a column
# with open('UVM_GCN_8GPU.csv', 'r') as file1:
# reader = csv.reader(file1)
# col0 = [row[0] for row in reader]
with open('UVM_GCN_8GPU.csv', 'r') as file1:
reader = csv.reader(file1)
col1 = [float(row[1]) for row in reader]
# print(col0)
# print(col1)
# Read the second CSV file and get a column
with open('MGG_GCN_8GPU.csv', 'r') as file2:
reader = csv.reader(file2)
col2 = [float(row[1]) for row in reader]
with open('MGG_GCN_8GPU.csv', 'r') as file1:
reader = csv.reader(file1)
col0 = [row[0] for row in reader]
# print(col2)
# Compute the ratio of the values in the two columns
ratio = [col1[i] / col2[i] for i in range(len(col1))]
# Write the result, along with the original two columns, to a third CSV file
with open('Fig_8_UVM_MGG_8GPU_GCN.csv', 'w', newline='') as result_file:
writer = csv.writer(result_file)
writer.writerow(['Dataset', 'UVM-8GPU(ms)', 'MGG-8GPU(ms)', 'Speedup (x)'])
for i in range(len(col1)):
writer.writerow([col0[i].rstrip("_beg_pos.bin"), col1[i], col2[i], "{:.3f}".format(ratio[i])])
print("\n\nPlease check the [Fig_8_UVM_MGG_8GPU_GCN.csv] file!\n\n")
# os.system("mv UVM_8GPU.csv csvs/")
# os.system("mv MGG_8GPU.csv csvs/")
os.system("mv *.err logs/")