Tutorial
Tutorial
This file provides a simple tutorial on how to run Sniper simulator and run our
cache replacement algorithms under Sniper simulator using PDS lab machines. If you
need more information about how to use Sniper simulator, you can refer to Sniper
manual in this link: http://snipersim.org/w/Manual or contact us.
To run Sniper for the first time in PDS lab machine, do the following:
1- Copy Sniper folder from the local directory (/usr/local) to your home directory.
2- In your terminal, specify Sniper directory using:
cd sniper-6.1
3- Build Sniper using:
make
To download and run the integrated benchmarks for the first time under
Sniper simulator, do the following:
1- wget http://snipersim.org/packages/sniper-benchmarks.tbz
2- tar xjf sniper-benchmarks.tbz
3- cd benchmarks
4- export SNIPER_ROOT=/path/to/sniper
/path/to/sniper is the path to Snipers copy on your home directory
5- export BENCHMARKS_ROOT=$(pwd)
6- make -j 2
Notes:
The 6 steps above needed to be done once (just first time), and then you can
run the benchmarks.
The make -j 2 takes long time to finish.
To run two workloads FFT from Splash2 benchmark and Dedup from
Parsec benchmark using Gainestown configuration and giving each
workload 2 cores with ewlru replacement policy, this is the used
command:
./run-sniper -c gainestown --benchmarks=splash2-fft-small-2,parsec-
dedup-simsmall-2 -g --perf_model/l3_cache/replacement_policy=ewlru -d
~/parallel/splash2-fft-parsec-dedup-on-gainestown-ewlru-2-2
Notes:
If the input size for the benchmark is not specified correctly, the default input
size (test) will be used.
All resulted files for single run will be saved in the run-results path like ~/run-
results/ewlru/parsec-bodytrack-on-gainstown-ewlru in your home directory.
All resulted files for multiple run will be saved in the parallel path like
~/parallel/ewlru/splash2-fft-parsec-dedup-on-gainestown-ewlru-2-2 in your
home directory.
As we mentioned above, we are using a fixed way of naming the folders. We
were using the name of the benchmark for naming the folder that has the
resulted files. However, we have changed 4 workloads' names from Splash2
benchmark for simplicity. These changes appear in the table:
If you did not specify the replacement policy using -g option, lru will be used
as a default replacement policy.
Some syntax errors when setting (-g) option such as using - rather than _ do
not show any error, but do not apply the needed changes.
To check that all configuration changes has been applied, refer to Sim.cfg file.
In all our tests, simsmall input size was used for Parsec benchmark while
small was used in Splash2 benchmark.
As for Hydra configuration, please run it using 8 cores (this is due to Sniper
limitations).
When running multiple benchmarks at the same time, be sure that the total
number of assigned cores dont exceeds the default number of cores for the
configuration (4 for Gainestown and 8 for Hydra), otherwise, it will overwrite it.
In order to be able to read the data and analyze them, we developed an ipython
notebook files to read and analyze data in sim.out files. We have developed two scripts:
1- collect_single_run.ipynb: to analyze the data for running single benchmark
(one at a time).
2- collect_multiple_runs.ipynb: to analyze the data for benchmarks that run in
parallel.
These files calculate the average miss rate since we use another way of
calculating average miss rate based on our key paper. Also, they were used to plot the
execution time and average miss rates for 11 workloads using three replacement
policies: ewlru, ewsrrip, and mrut compared to lru. Also, they plots the speedup of all
three replacement policies over lru.
After typing jupyter notebook, a web page in your web browser will open which
allows you to open one file.
2- After opening the file, you can directly examine the results and plot what we
generated, or you can re-run the code. If you chose to run the .ipynb file, change
the directory (rootdir) in the first cell of the code to the directory where your
Sniper generated files are or where our files were downloaded (the run-results
folder).
3- Check the names of the folders that is in the same format we mentioned
earlier since any change in the names will cause an error and the script will not
generate any result.
4- Run the script (all cells) if you change or add any files in the root directory.
After run the script, plots will appear after each cell.