- Timestamp:
- Aug 29, 2014, 12:05:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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()
Note: See TracChangeset
for help on using the changeset viewer.