Skip to content

Commit

Permalink
Changing example files to accomodate Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
adanalis committed Feb 24, 2025
1 parent 2503cde commit 6c56608
Show file tree
Hide file tree
Showing 11 changed files with 347 additions and 818 deletions.
50 changes: 50 additions & 0 deletions src/counter_analysis_toolkit/scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Contents

The directory 'scripts' contains the files:

* README.txt
* process_dcache_output.sh
* default_gnp.inc
* single_plot.gnp
* multi_plot.gnp

and the directory 'sample_data'.


# Examples

Executing the following commands:
```
gnuplot single_plot.gnp
gnuplot multi_plot.gnp
```
will produce PDF files (single_plot.pdf and multi_plot.pdf)
with graphs showing the data in the directory 'sample_data'.


# Data Post-processing

To use these gnuplot programs with data generated by the cache benchmarks of
CAT (cat_collect -dcr, and cat_collect -dcw), the user must post-process the
output files of the benchmarks.
Executing the bash script 'process_dcache_output.sh' using as input a data file
generated by the data cache benchmarks will compute basic statistics
(min, avg, max) of the data gathered by each thread for each test size. The output
is automatically stored in a new file with the keyword '.stat' appended to its name.
These ".stat" files can be used as input for the gnuplot scripts.


# Modifying the Gnuplot scripts

The example scripts 'single_plot.gnp' and 'multi_plot.gnp' contain variables
(at the top of each script) that must be modified to fit the user's use case and
environment.

* The variables 'L1_per_core', 'L2_per_core', and 'L3_per_core' must be set to
indicate the sizes of the caches per core

* The variables 'SML_STRIDE', 'BIG_STRIDE', 'SML_PPB', and 'BIG_PPB' must be set
to the corresponding values reported in the benchmark output file.

* The directory 'DIR' where the user data resides, the name of the event 'EVENT' whose
data is being plotted, and the plot title 'PLOT_TITLE'.
33 changes: 0 additions & 33 deletions src/counter_analysis_toolkit/scripts/README.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ set key maxcolumns 0 maxrows 0
set key noopaque
unset label
unset arrow
set style increment default
unset style line
unset style arrow
set style histogram clustered gap 2 title textcolor lt -1
Expand Down
41 changes: 25 additions & 16 deletions src/counter_analysis_toolkit/scripts/multi_plot.gnp
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
L1_per_core=48*1024
L2_per_core=1280*1024
L3_per_core=36864*1024/4
L1_per_core=32768
L2_per_core=1048576
L3_per_core=4194304

SML_STRIDE=128
BIG_STRIDE=256
SML_PPB=16
BIG_PPB=512

DIR="sample_data/"
EVENT1="L2_RQSTS:DEMAND_DATA_RD_MISS"
EVENT2="L2_RQSTS:DEMAND_DATA_RD_HIT"
EVENT3="L2_RQSTS:ALL_DEMAND_REFERENCES"
PLOT_TITLE="L2_RQSTS (MISS/HIT/REF)"
EVENT1="PM_DATA_FROM_L2"
EVENT2="PM_DATA_FROM_L3"
EVENT3="PM_DATA_FROM_L3MISS"
PLOT_TITLE="L2 Reads / L3_reads / L3 Misses"

SUFFIX=".data.reads.stat"

Expand All @@ -18,7 +23,7 @@ set label 3 at L2_per_core+(L3_per_core-L2_per_core)/20, graph 1.020 "L3" font
set terminal pdfcairo noenhanced font "Sans,12"
set output "multi_plot.pdf"

load "default.gnp"
load "default_gnp.inc"

set xtics ("" L1_per_core, "" L2_per_core, "" L3_per_core)

Expand All @@ -31,15 +36,16 @@ unset key
set multiplot layout 1,6 title PLOT_TITLE."

set margin 0,0,1.5,2.5
set label 20 "Event Count" at screen 0.015,0.375 rotate by 90 # Y-label
set label 20 "Normalized Event Count" at screen 0.015,0.26 rotate by 90 # Y-label


OFFSET=0.09
GAP=0.015
WIDTH=(1.0-(OFFSET+5.0*GAP+GAP/4.0))/6.0


###
set label 21 "RND:64:256" at graph 0.1,-0.05 font ",10" # X-label
set label 21 sprintf("RND:%d:%d",SML_STRIDE,BIG_PPB) at graph 0.1,-0.05 font ",10" # X-label
set size 0.1475,1
set size WIDTH,1
set origin OFFSET,0.0
Expand All @@ -55,7 +61,7 @@ set ytics scale 0.1,0.5
unset label 20

###
set label 21 "RND:64:16" at graph 0.16,-0.05 font ",10" # X-label
set label 21 sprintf("RND:%d:%d",SML_STRIDE,SML_PPB) at graph 0.16,-0.05 font ",10" # X-label
set object 1 rectangle from graph 0,0 to graph 1,1 behind fillcolor rgb '#FFFAE8' fillstyle solid noborder
set size WIDTH,1
set origin OFFSET+(WIDTH+GAP)*1,0
Expand All @@ -66,7 +72,7 @@ plot \
unset object 1

###
set label 21 "RND:128:256" at graph 0.1,-0.05 font ",10" # X-label
set label 21 sprintf("RND:%d:%d",BIG_STRIDE,BIG_PPB) at graph 0.1,-0.05 font ",10" # X-label
set size WIDTH,1
set origin OFFSET+(WIDTH+GAP)*2,0
plot \
Expand All @@ -75,7 +81,7 @@ plot \
FILE3 every :::2::2 using 1:2 w lp ls 1

###
set label 21 "RND:128:16" at graph 0.1,-0.05 font ",10" # X-label
set label 21 sprintf("RND:%d:%d",BIG_STRIDE,SML_PPB) at graph 0.1,-0.05 font ",10" # X-label
set object rectangle from graph 0,0 to graph 1,1 behind fillcolor rgb '#FFFAE8' fillstyle solid noborder
set size WIDTH,1
set origin OFFSET+(WIDTH+GAP)*3,0
Expand All @@ -85,7 +91,7 @@ plot \
FILE3 every :::3::3 using 1:2 w lp ls 1

###
set label 21 "SEQ:64" at graph 0.25,-0.05 font ",10" # X-label
set label 21 sprintf("SEQ:%d",SML_STRIDE) at graph 0.25,-0.05 font ",10" # X-label
set object rectangle from graph 0,0 to graph 1,1 behind fillcolor rgb '#F0F6FF' fillstyle solid noborder
set size WIDTH,1
set origin OFFSET+(WIDTH+GAP)*4,0
Expand All @@ -95,8 +101,11 @@ plot \
FILE3 every :::4::4 using 1:2 w lp ls 1

###
set key top right font ",6"
set label 21 "SEQ:128" at graph 0.2,-0.05 font ",10" # X-label
set key at screen 0.997,0.997
set key font ",6"
set key opaque box samplen 4 width 2 height 1

set label 21 sprintf("SEQ:%d",BIG_STRIDE) at graph 0.2,-0.05 font ",10" # X-label
set object rectangle from graph 0,0 to graph 1,1 behind fillcolor rgb '#F0F6FF' fillstyle solid noborder
set size WIDTH,1
set origin OFFSET+(WIDTH+GAP)*5,0
Expand Down
Loading

0 comments on commit 6c56608

Please sign in to comment.