source: branches/reconfiguration/platforms/tsar_generic_iob/scripts/plot_ffstend.py @ 782

Last change on this file since 782 was 782, checked in by cfuguet, 8 years ago

reconfiguration/tsar_generic_iob: adding script for plotting

File size: 1.4 KB
Line 
1#!/usr/bin/python
2# @author Cesar Fuguet <cesar.fuguet-tortolero@lip6.fr>
3# @date   28 August, 2014
4
5import sys
6import matplotlib.pyplot as pyplot
7
8# get statistics file name
9assert len(sys.argv) > 1, "Introduce the stats file"
10filename = sys.argv[1]
11
12clusters = []
13cycles   = []
14
15# parse the ffst stats file
16with open(filename, 'r') as filedat:
17    for line in filedat:
18        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([]);
25
26        clusters.append(int(partitions[0]))
27        for i in xrange(len(partitions)-1):
28            if int(partitions[i+1]) == -1:
29                cycles[i].append(None)
30            else:
31                cycles[i].append(int(partitions[i+1]))
32
33# plot the different configurations
34for c in xrange(len(cycles)):
35    pyplot.plot(clusters, cycles[c], label = 'config{0}'.format(c), marker = 'o')
36
37# x axis parameters
38pyplot.xlabel('number of clusters')
39pyplot.xticks(clusters)
40pyplot.xlim(0, max(clusters))
41#pyplot.xticks(xrange(0, 257, 64)
42#pyplot.xscale('log', basex=2, subx=clusters)
43
44# y axis parameters
45pyplot.ylabel('number of cycles')
46
47# show figure with legend and grid
48pyplot.legend(loc = 'lower right')
49pyplot.grid()
50pyplot.show()
51
52# vim: tabstop=4 : softtabstop=4 : shiftwidth=4 : expandtab
Note: See TracBrowser for help on using the repository browser.