Tutorial
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:
To download and run the integrated benchmarks for the first time under
Sniper simulator, do the following: (You will not need to do this as the
benchmarks were uploaded with the file you downloaded)
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 the 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
~/multiple_run/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 single_run path like
~/single_run/ewlru/parsec-bodytrack-on-gainstown-ewlru
in your home directory.
All resulted files for multiple run will be saved in the multiple_run path like
~/multiple_run/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:
Workload name Used name
lu.cont lucont
lu.ncont luncont
water.nsq waterN
ocean.cont ocean
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 doesnt exceed the default number of cores for the
configuration (4 for Gainestown and 8 for Hydra), otherwise, it will overwrite it.
How to check the result of the simulation:
After running any benchmark under Sniper, four files will be generated:
Sim.cfg: It has all the details about the used configuration.
Sim.out: It has the output results of the simulation including runtime, idle time,
number of instruction, average miss rate for each cache level..etc.
Sim.info: Provides information about the run command that generated these
output files.
Sim.stats.sqlite3
In order to be able to read the data and analyze them, we developed 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 benchmarks
(one at a time). This file reads the single_run directory
2- collect_multiple_runs.ipynb: to analyze the data for benchmarks that run in
parallel. This file reads the multiple_run directory
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 plot 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 running the script, plots will appear below each cell.