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:
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.
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). 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 plots the speedup of all
three replacement policies over lru.
How to use the Python scripts:
- This should be done on your personal computer and not on the PDA lab
machine.
- To run our .ipynb files you need to have the following:
1- Jupyter Notebook :
If you dont already have it, please refer to
http://jupyter.readthedocs.io/en/latest/install.html for information
about the installation.
2- Python 3.3 or greater or Python 2.7.
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.