Skip to content
Browse files

Add plotting script samples

  • Loading branch information...
1 parent 14e3686 commit 1d07fa3c590f157b8e79204b4aedecb732bc0bc9 @gregs1104 committed Jan 9, 2011
Showing with 55 additions and 0 deletions.
  1. +46 −0 stream-graph.py
  2. +9 −0 stream-plot
View
46 stream-graph.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+
+"""
+stream-graph.py
+
+Stream has two types of lines that are interesting for a graph:
+
+Number of Threads requested = 1
+Triad: 4230.1227 0.7604 0.7593 0.7617
+Number of Threads requested = 2
+Triad: 8923.7072 0.3604 0.3599 0.3608
+
+Parse a file that contains those and produce something suitable
+for input to gnuplot:
+
+1 4230.1227
+2 8923.7072
+"""
+
+import sys, string
+
+current_threads=None
+
+print "# threads,triad MB/s"
+lines = sys.stdin.readlines()
+for line in lines:
+ line=line.rstrip()
+ pos=line.find("Number of Threads requested = ")
+ if (pos==0):
+ (junk,threads)=line.split("=",1)
+ threads=threads.strip()
+ if (threads.isdigit()):
+ try:
+ current_threads=int(threads)
+ except:
+ print "Confused by this line:"
+ print line
+ else:
+ pos=line.find("Triad:")
+ if (pos==0):
+ try:
+ (junk,triad,avg,min,max)=line.split()
+ print current_threads,triad
+ except:
+ print "Confused by this line:"
+ print line
View
9 stream-plot
@@ -0,0 +1,9 @@
+# gnuplot script to
+set autoscale x
+set autoscale y
+set xlabel "Threads"
+set ylabel "Triad MB/s"
+set key right bottom
+set terminal png
+set output "stream.png"
+plot "stream.txt" with lines title "STREAM Memory Scaling"

0 comments on commit 1d07fa3

Please sign in to comment.
Something went wrong with that request. Please try again.