Modify gather script to include raw data and update results without prefetchers

Signed-off-by: Rafael Ravedutti <rafaelravedutti@gmail.com>
This commit is contained in:
Rafael Ravedutti 2021-06-30 16:09:34 +02:00
parent ecb5ccf6ff
commit 5534f1b195
2 changed files with 40 additions and 6 deletions

View File

@ -10,9 +10,7 @@ The configuration parameters are:
- **-ny <numbers>:** number of unit cells in the y dimension, the default is 4. - **-ny <numbers>:** number of unit cells in the y dimension, the default is 4.
- **-nz <numbers>:** number of unit cells in the z dimension, the default is 2. - **-nz <numbers>:** number of unit cells in the z dimension, the default is 2.
Notice that these parameters can also be specified as lists, which executes the stubbed force calculation several times varying the specific parameter to each element of the list. Notice that these parameters can also be specified as lists, which executes the stubbed force calculation several times varying the specific parameter to each element of the list, and hence all combinations of parameters will be executed. For example, the following command:
All combinations of parameters are executed!
For example, the following command:
```bash ```bash
bash run_stub.sh -a "8 16" -nx "4 8" -ny 8 -nz 4 bash run_stub.sh -a "8 16" -nx "4 8" -ny 8 -nz 4
@ -33,3 +31,7 @@ The following parameters are also available:
- **-r <runs>:** number of runs for each configuration (only the values for the best run are displayed), the default is 3. - **-r <runs>:** number of runs for each configuration (only the values for the best run are displayed), the default is 3.
**plot_run_stub_data.py:** Python script to plot the data generated by the *run_stub.sh* script. Just provide the name of the .txt file as a parameter and this script generates a corresponding PDF with the same file name. **plot_run_stub_data.py:** Python script to plot the data generated by the *run_stub.sh* script. Just provide the name of the .txt file as a parameter and this script generates a corresponding PDF with the same file name.
**plot_gather_data.py:** Python script to plot the data generated by the gather benchmark. Just provide the name of the .txt file containing the gather output as a parameter and this script generates a corresponding PDF with the same file name. Multiple outputs with different strides can be included in the text file by concatenating the outputs. The script handles output from both standard simple array case and MD variant.
**cache.py:** Python script to run the cache simulator with the data obtained from the memory tracer. Just run it with the tracer output file name as a parameter. The cache specifications can be directly adapted in the script to match those of the target processor of interest.

View File

@ -2,7 +2,8 @@ import matplotlib.pyplot as plt
import sys import sys
filename = sys.argv[1] filename = sys.argv[1]
output_file = filename.replace(".txt", ".pdf") plot_output_file = filename.replace(".txt", ".pdf")
raw_output_file = filename.replace(".txt", ".csv")
fig = plt.figure() fig = plt.figure()
ax = plt.axes() ax = plt.axes()
plot_data = {} plot_data = {}
@ -20,7 +21,7 @@ with open(filename, 'r') as fp:
for line in fp.readlines(): for line in fp.readlines():
line = line.strip() line = line.strip()
if len(line) <= 0: if len(line) <= 0 or "likwid-pin" in line:
continue continue
if line.startswith("Stride,"): if line.startswith("Stride,"):
@ -57,12 +58,43 @@ with open(filename, 'r') as fp:
plot_data[stride][size] = cycles if size not in plot_data[stride] \ plot_data[stride][size] = cycles if size not in plot_data[stride] \
else min(cycles, plot_data[stride][size]) else min(cycles, plot_data[stride][size])
all_sizes = set()
all_strides = set()
for stride in plot_data: for stride in plot_data:
sizes = list(plot_data[stride].keys()) sizes = list(plot_data[stride].keys())
sizes.sort() sizes.sort()
cycles = [plot_data[stride][size] for size in sizes] cycles = [plot_data[stride][size] for size in sizes]
ax.plot(sizes, cycles, marker='.', label=str(stride)) ax.plot(sizes, cycles, marker='.', label=str(stride))
for size in sizes:
all_sizes.add(size)
all_strides.add(stride)
all_sizes = list(all_sizes)
all_sizes.sort()
all_strides= list(all_strides)
all_strides.sort()
with open(raw_output_file, 'w') as wp:
wp.write(" size\stride")
for stride in all_strides:
wp.write(",{0:14}".format(stride))
wp.write("\n")
for size in all_sizes:
wp.write("{:14.6f}".format(size))
for stride in all_strides:
try:
cycles = plot_data[stride][size]
except:
cycles = ''
wp.write(",{:14.6f}".format(cycles))
wp.write("\n")
cy_label = "Cycles per iteration" if md_case else "Cycles per gather" cy_label = "Cycles per iteration" if md_case else "Cycles per gather"
ax.vlines([32, 1000], 0, 1, transform=ax.get_xaxis_transform(), linestyles='dashed', color=['#444444', '#777777']) ax.vlines([32, 1000], 0, 1, transform=ax.get_xaxis_transform(), linestyles='dashed', color=['#444444', '#777777'])
#ax.vlines([32, 1000, 28000], 0, 1, transform=ax.get_xaxis_transform(), linestyles='dashed', color=['#444444', '#777777', '#aaaaaa']) #ax.vlines([32, 1000, 28000], 0, 1, transform=ax.get_xaxis_transform(), linestyles='dashed', color=['#444444', '#777777', '#aaaaaa'])
@ -71,4 +103,4 @@ ax.set_xscale('log')
#ax.set_xticks([32, 1000, 28000]) #ax.set_xticks([32, 1000, 28000])
#ax.set_xlim(0, 200000) #ax.set_xlim(0, 200000)
plt.legend(title="Stride") plt.legend(title="Stride")
fig.savefig(output_file, bbox_inches = 'tight', pad_inches = 0) fig.savefig(plot_output_file, bbox_inches = 'tight', pad_inches = 0)