Ignore:
Timestamp:
Aug 29, 2014, 12:05:16 PM (10 years ago)
Author:
cfuguet
Message:

reconfiguration/tsar_generic_iob: adding legend in plot with fault configs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/reconfiguration/platforms/tsar_generic_iob/scripts/plot_ffstend.py

    r782 r784  
    1515# parse the ffst stats file
    1616with 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 != "":
    1837        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
    2541
    2642        clusters.append(int(partitions[0]))
    27         for i in xrange(len(partitions)-1):
     43        for i in xrange(nfaultconfigs):
    2844            if int(partitions[i+1]) == -1:
    2945                cycles[i].append(None)
     
    3147                cycles[i].append(int(partitions[i+1]))
    3248
     49        line = filedat.readline()
     50
    3351# plot the different configurations
    3452for 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')
    3654
    3755# x axis parameters
     
    4664
    4765# show figure with legend and grid
     66pyplot.title('Number of Cycles per Mesh Dimensions and Faulty Cores')
    4867pyplot.legend(loc = 'lower right')
    4968pyplot.grid()
Note: See TracChangeset for help on using the changeset viewer.