Add basic benchmarks facilities
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
"""
|
||||
Plots benchmark files produced from Benchmark_RAW_File.
|
||||
|
||||
Usage: python plot_benchmarks.py [benchmark file name].
|
||||
|
||||
Example: python plot_benchmarks.py LiebLin_Rho_Rho_c_4_L_64_N_64_64_0__iK_32.raw_bmk
|
||||
"""
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import sys
|
||||
|
||||
filename = str(sys.argv[1])
|
||||
|
||||
index, srcont = np.loadtxt(filename, usecols=(0,1), unpack=True)
|
||||
index_srt, srcont_srt = np.loadtxt(filename + '_srt', usecols=(0, 1), unpack=True)
|
||||
|
||||
plt.semilogy(index, srcont, '.', markersize=1, label='Realized order')
|
||||
plt.semilogy(index, srcont_srt, '.', markersize=1, label='Ideal order') # careful: index, not index_srt
|
||||
|
||||
plt.xlabel('Order')
|
||||
plt.ylabel('ln(ME)')
|
||||
plt.title('Comparison of realized and ideal order\n' + filename)
|
||||
plt.legend()
|
||||
|
||||
plt.savefig(filename.replace('.', '_') + '_plot.png')
|
||||
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user