From bf0427531bd136ae95b17ece7024afa79ac848f3 Mon Sep 17 00:00:00 2001 From: Daniel Ruprecht Date: Mon, 21 Sep 2015 13:51:32 +0100 Subject: [PATCH] energy plot function now correctly handles energy values in first line of RUR file --- plot_parareal_energy.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plot_parareal_energy.py b/plot_parareal_energy.py index 5d47afe..8fffeb5 100644 --- a/plot_parareal_energy.py +++ b/plot_parareal_energy.py @@ -16,7 +16,7 @@ def extract_energy(line): fs = 8 Nsamples = 50 -Nsamples = 1 +#Nsamples = 1 #Nprocs = numpy.array([2, 4, 6, 8, 12, 24]) Nprocs = numpy.array([24]) @@ -52,7 +52,10 @@ def extract_energy(line): f = open(filename,'r') line1 = f.readline() line2 = f.readline() - energy[tt,ii,jj] = extract_energy(line2) + if "energy_used" in line1: + energy[tt,ii,jj] = extract_energy(line1) + elif "energy_used" in line2: + energy[tt,ii,jj] = extract_energy(line2) f.close() # Compute averages for jj in range(0,Nsamples):