Changeset 784
- Timestamp:
- Aug 29, 2014, 12:05:16 PM (10 years ago)
- Location:
- branches/reconfiguration/platforms/tsar_generic_iob/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/reconfiguration/platforms/tsar_generic_iob/scripts/parse.py
r782 r784 19 19 ffst_end = open(outpath, "w") 20 20 ffst_end.write("# ffst end (cycles)\n") 21 ffst_end.write("{0}\n".format(len(faultconfigs))) 22 for config in faultconfigs: 23 ffst_end.write("{0}\n".format(config)) 21 24 22 25 # repeat while configurations is not empty 23 26 quit = 0 24 27 for x,y in configs: 25 ffst_end.write("\n") 26 ffst_end.write(str(x*y)) 27 for f in xrange(faultconfigs): 28 ffst_end.write("\n{0:<6}".format(str(x*y))) 29 for f in xrange(len(faultconfigs)): 28 30 temp = "config_{0}c{1}f/".format(x*y, f) 29 31 confdir = os.path.join(confpath, temp) … … 44 46 found = True 45 47 value = int(partitions[2]) 46 ffst_end.write(" {0}".format(value))48 ffst_end.write(" {0:<8}".format(value)) 47 49 break 48 50 49 if not found: ffst_end.write(" -1")51 if not found: ffst_end.write(" {0:<8}".format(-1)) 50 52 # end for faultconfig 51 53 … … 59 61 configs = [] 60 62 configs.append([2 , 2 ]) 63 configs.append([4 , 2 ]) 61 64 configs.append([4 , 4 ]) 65 configs.append([8 , 4 ]) 62 66 configs.append([8 , 8 ]) 67 configs.append([16, 8 ]) 63 68 configs.append([16, 16]) 64 69 65 assert len(sys.argv) > 3,\ 66 "Introduce number of faulty configs, config path and output path" 70 faultconfigs = [] 71 faultconfigs.append('0 faulty core') 72 faultconfigs.append('1 faulty core') 73 faultconfigs.append('2 faulty cores') 74 faultconfigs.append('1 faulty cluster (3 cores)') 75 faultconfigs.append('2 faulty clusters (6 cores)') 67 76 68 parse_ffstend(configs, int(sys.argv[1]), sys.argv[2], sys.argv[3]) 77 assert len(sys.argv) > 2, "Introduce config path and output path" 78 79 parse_ffstend(configs, faultconfigs, sys.argv[1], sys.argv[2]) 69 80 70 81 # vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab -
branches/reconfiguration/platforms/tsar_generic_iob/scripts/plot_ffstend.py
r782 r784 15 15 # parse the ffst stats file 16 16 with open(filename, 'r') as filedat: 17 for line in filedat: 17 # skip comment lines at the beginning of the file 18 line = filedat.readline() 19 while line[0] == '#': line = filedat.readline() 20 21 # get the number of faultconfigs and init cycles array 22 nfaultconfigs = int(line) 23 for i in xrange(nfaultconfigs): 24 cycles.append([]); 25 26 # get the name of configurations 27 faultconfigs = [] 28 for i in xrange(nfaultconfigs): 29 line = filedat.readline() 30 faultconfigs.append(line.rstrip('\n ')) 31 32 # read statistics 33 # first column is the number of clusters (X axis) 34 # other columns are number of cycles per fault configuration (Y axis) 35 line = filedat.readline() 36 while line != "": 18 37 partitions = line.split() 19 if len(partitions) == 0: continue 20 if partitions[0] == '#': continue 21 22 if len(cycles) == 0: 23 for i in xrange(len(partitions)-1): 24 cycles.append([]); 38 if len(partitions) == 0: 39 line = filedat.readline() 40 continue 25 41 26 42 clusters.append(int(partitions[0])) 27 for i in xrange( len(partitions)-1):43 for i in xrange(nfaultconfigs): 28 44 if int(partitions[i+1]) == -1: 29 45 cycles[i].append(None) … … 31 47 cycles[i].append(int(partitions[i+1])) 32 48 49 line = filedat.readline() 50 33 51 # plot the different configurations 34 52 for c in xrange(len(cycles)): 35 pyplot.plot(clusters, cycles[c], label = 'config{0}'.format(c), marker = 'o')53 pyplot.plot(clusters, cycles[c], label = faultconfigs[c], marker = 'o') 36 54 37 55 # x axis parameters … … 46 64 47 65 # show figure with legend and grid 66 pyplot.title('Number of Cycles per Mesh Dimensions and Faulty Cores') 48 67 pyplot.legend(loc = 'lower right') 49 68 pyplot.grid() -
branches/reconfiguration/platforms/tsar_generic_iob/scripts/run.py
r782 r784 29 29 faultylist.append([(1,0,0), (1,0,2), (1,0,3), 30 30 (1,1,1), (1,1,2), (1,1,3)]) # 2 faulty cluster 31 32 faultynames = [] 33 faultynames.append("0 faulty core") 34 faultynames.append("1 faulty core") 35 faultynames.append("2 faulty cores") 36 faultynames.append("1 faulty cluster") 37 faultynames.append("2 faulty clusters") 31 38 32 39 # number of processors per cluster … … 108 115 109 116 parse_ffstend(configs, 110 len(faultylist),117 faultynames, 111 118 os.path.join(basedir, 'conf'), 112 119 os.path.join(statsdir, 'ffst_stats.dat'))
Note: See TracChangeset
for help on using the changeset viewer.