-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse_bcast.py
68 lines (55 loc) · 2.55 KB
/
parse_bcast.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
68
from charm_header import *
import numpy as np
num_nodes=1
max_nodes=32
ppn = ppnmap[key]
proc_per_node=proc_per_node_map[key]
#regular, bcast send reg, bcast post reg
def parseFromOutputFileNumpy(filename, basebuild, archopt_str):
header_skip_lines = skipHeaderLineMap[basebuild]
if(archopt_str == "smp"):
header_skip_lines += smpSkipLinesModifierMap[basebuild]
data = np.genfromtxt(filename, dtype=[int, int, float, float, float, float, float, float, float, float, float], skip_header=header_skip_lines, skip_footer=1, delimiter=",", usecols=(0, 2, 4, 6, 9))
return data
#Testing Data
#data = parseFromOutputFileNumpy('/pylon5/ac7k4vp/nbhat4/charmutils/results/bridges/bcast/reg_bcast_test_1_ofi_smp', 'ofi', 'smp')
#print data
myBaseBuild = "mpi"
myArchOpt = ""
smp_index=0
for archopt_str in archopts_str:
for basebuild in basebuilds[key]:
#if(myBaseBuild == basebuild and myArchOpt == archopt_str):
print "Basebuild:" + basebuild + " Archopt:" + archopt_str
num_nodes=1
database = []
while num_nodes <= max_nodes:
extraSuffix= ""
outputFile = getOutputFile(num_nodes, archopt_str, smp_index, basebuild, extraSuffix)
print outputFile
data = parseFromOutputFileNumpy(outputFile, basebuild, archopt_str)
database.append(data);
print "Num Nodes: " + str(num_nodes) + " done, and size is " + str(len(data))
num_nodes = num_nodes*2
print "All data elems added and size is " + str(len(database))
row_index = 0
row_max = 21
while(row_index <= row_max):
node_index = 0
#print "======================================================="
#print "===========" + basebuild +"-" + archopts[smp_index] + "=========="
for data in database:
num_nodes = 2**node_index;
myRow = data[row_index]
print basebuild + "," + archopts[smp_index] + "," + str(num_nodes) + "," + str((ppn * num_nodes)) + "," + str(myRow[0]) + "," + str(myRow[1]) + "," + str(myRow[2]) + "," + str(myRow[3]) + "," + str(myRow[4]) + "," + str(myRow[1]/myRow[2]) + "," + str(myRow[3]/myRow[4])
node_index += 1
#print "======================================================="
row_index += 1
smp_index = smp_index + 1;
#def printResultLine(int row_index)
#node_index = 0
#for data in database:
# num_nodes = 2**node_index;
# myRow = data[row_index]
# print str(num_nodes) + "," + str((ppn * num_nodes)) + "," + str(myRow[0]) + "," + str(myRow[1]) + "," + str(myRow[2]) + "," + str(myRow[3]) + "," + str(myRow[4])
# node_index += 1