# HG changeset patch # User Merten Sach # Date 1323717802 -3600 # Node ID 8323aae8c303d0a0692e6e6434d52f5fb0fc9399 # Parent c2e8c3b49545bace05077ffab7aa14cddcd4921c plot script rewritten in python and changed labeling diff -r c2e8c3b49545 -r 8323aae8c303 scripts/overhead.py --- a/scripts/overhead.py Fri Dec 09 15:09:34 2011 +0100 +++ b/scripts/overhead.py Mon Dec 12 20:23:22 2011 +0100 @@ -121,7 +121,7 @@ results.sort(lambda x,y: cmp(x["total_exe_cycles"],y["total_exe_cycles"])) total_workcycles = results[0]["total_workcycles"] total_exe_cycles = results[0]["total_exe_cycles"] - exeCycles_workCycles_ratio = results[0]["exeCycles_workCycles_ratio"] + #exeCycles_workCycles_ratio = results[0]["exeCycles_workCycles_ratio"] #Calculate numbers overhead = total_exe_cycles - total_workcycles @@ -130,6 +130,8 @@ cycles_of_task = float(total_workcycles) / float(TASKS_PER_THREAD * totalThreads) overhead_per_core = float(overhead) / NUM_CORES workcycles_per_core = total_workcycles / NUM_CORES + + exeCycles_workCycles_ratio = float(total_workcycles+float(overhead)/2)/float(total_workcycles) gnuplot_output.write("%20d\t%20d\t%20d\t%20f\t%20d\t%20d\t%20f\t%20f\n" % ( workload_iterations_in_task, diff -r c2e8c3b49545 -r 8323aae8c303 scripts/plot__exe_vs_task_size.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/plot__exe_vs_task_size.py Mon Dec 12 20:23:22 2011 +0100 @@ -0,0 +1,66 @@ +#! /usr/bin/python +# -*- coding: utf-8 -*- + +import sys +import re + +usage = """ +This generates a gnuplot script that plots the work cycles to exec cycles ratio +against the one task cycles. The scipt is printed to stdout. + %s [datafiles] +""" % sys.argv[0] + +# Gnupot skeleton that plots several curves in one diagram and a dotted line that marks the 2 on the y-axis. +gnuplot_cmd=""" +set terminal postscript enhanced color +set output "%(output_filename)s" +set title "INSERT MACHINE HERE" +set xlabel "Cycles in one Task" +set ylabel "Ratio of Total Execution to Total Work" +set multiplot + set origin 0,0 + set size 1,1 + set yrange [1:8] + line(x)=2 + set key box + plot line(x) notitle with line lc 0 lw 1 lt 2, %(plot_arguments)s + set notitle + #set xlabel "" + #set origin 0.40,0.40 + #set size 0.5,0.5 + #set xrange [0 : 2000] + #set yrange [1 : 8] + #set key box + #replot +set nomultiplot +exit""" + +# strip the script name from argument list +files = sys.argv[1:] + +# no arguments -> print usage +if len(files) == 0: + print usage + sys.exit(0) + +# generate Output file name - this removes the part til the first underscore +gnuplot_output_filename = files[0][files[0].find('_')+1:] + +# generate the plot arguments +curve_arguments = "'%(data_filename)s' using 4:8 title '%(number_of_threads)s Threads' with line lw 2" +list_of_thread_numbers = [] +plot_arguments = [] +for file in files: + # get number of threads from filename + try: + number_of_threads = re.search("(^[\d]*)",file).groups()[0] + list_of_thread_numbers.append(number_of_threads) + except: + print "Please provide a filename in the format that the number of threads is first the filename." + sys.exit(0) + plot_arguments.append(curve_arguments % {"data_filename" : file, "number_of_threads" : number_of_threads}) + +# Output script to stdout so it can be piped into a file +plot_arguments = ",".join(plot_arguments) +gnuplot_output_filename = "_".join(list_of_thread_numbers) + gnuplot_output_filename + ".eps" +print gnuplot_cmd % {"output_filename" :gnuplot_output_filename, "plot_arguments" : plot_arguments}