Changeset 784


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

reconfiguration/tsar_generic_iob: adding legend in plot with fault configs

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  
    1919    ffst_end = open(outpath, "w")
    2020    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))
    2124
    2225    # repeat while configurations is not empty
    2326    quit = 0
    2427    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)):
    2830            temp = "config_{0}c{1}f/".format(x*y, f)
    2931            confdir = os.path.join(confpath, temp)
     
    4446                    found = True
    4547                    value = int(partitions[2])
    46                     ffst_end.write("   {0}".format(value))
     48                    ffst_end.write(" {0:<8}".format(value))
    4749                    break
    4850
    49             if not found: ffst_end.write("   -1")
     51            if not found: ffst_end.write(" {0:<8}".format(-1))
    5052            # end for faultconfig
    5153
     
    5961    configs = []
    6062    configs.append([2 , 2 ])
     63    configs.append([4 , 2 ])
    6164    configs.append([4 , 4 ])
     65    configs.append([8 , 4 ])
    6266    configs.append([8 , 8 ])
     67    configs.append([16, 8 ])
    6368    configs.append([16, 16])
    6469
    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)')
    6776
    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])
    6980
    7081# vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab
  • 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()
  • branches/reconfiguration/platforms/tsar_generic_iob/scripts/run.py

    r782 r784  
    2929faultylist.append([(1,0,0), (1,0,2), (1,0,3),
    3030                   (1,1,1), (1,1,2), (1,1,3)])  # 2 faulty cluster
     31
     32faultynames = []
     33faultynames.append("0 faulty core")
     34faultynames.append("1 faulty core")
     35faultynames.append("2 faulty cores")
     36faultynames.append("1 faulty cluster")
     37faultynames.append("2 faulty clusters")
    3138
    3239# number of processors per cluster
     
    108115
    109116parse_ffstend(configs,
    110              len(faultylist),
     117             faultynames,
    111118             os.path.join(basedir, 'conf'),
    112119             os.path.join(statsdir, 'ffst_stats.dat'))
Note: See TracChangeset for help on using the changeset viewer.