Skip to content
Snippets Groups Projects
Commit a7f901a4 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Read the header to recover the CPU frequency

parent 63098d78
No related branches found
No related tags found
1 merge request!375Threadpool task plots
...@@ -99,6 +99,17 @@ colours = ["cyan", "lightgray", "darkblue", "yellow", "tan", "dodgerblue", ...@@ -99,6 +99,17 @@ colours = ["cyan", "lightgray", "darkblue", "yellow", "tan", "dodgerblue",
"magenta", "hotpink", "pink", "orange", "lightgreen"] "magenta", "hotpink", "pink", "orange", "lightgreen"]
maxcolours = len(colours) maxcolours = len(colours)
# Read header. First two lines.
with open(infile) as infid:
head = [next(infid) for x in xrange(2)]
header = head[1][2:].strip()
header = eval(header)
nthread = int(header['num_threads'])
CPU_CLOCK = float(header['cpufreq']) / 1000.0
print "Number of threads: ", nthread
if args.verbose:
print "CPU frequency:", CPU_CLOCK * 1000.0
# Read input. # Read input.
data = pl.genfromtxt(infile, dtype=None, delimiter=" ") data = pl.genfromtxt(infile, dtype=None, delimiter=" ")
...@@ -121,17 +132,12 @@ funcs = pl.array(funcs) ...@@ -121,17 +132,12 @@ funcs = pl.array(funcs)
threads = pl.array(threads) threads = pl.array(threads)
chunks = pl.array(chunks) chunks = pl.array(chunks)
nthread = int(max(threads)) + 1
print "Number of threads:", nthread
# Recover the start and end time # Recover the start and end time
tic_step = min(tics) tic_step = min(tics)
toc_step = max(tocs) toc_step = max(tocs)
# Not known. # Not known.
CPU_CLOCK = 2200067.0
if args.verbose:
print "CPU frequency:", CPU_CLOCK * 1000.0
# Calculate the time range, if not given. # Calculate the time range, if not given.
delta_t = delta_t * CPU_CLOCK delta_t = delta_t * CPU_CLOCK
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment