Automatically Running Simulations using gen-scripts
The Multifacet project uses extensive scripting to automate simulations. Our scripts generate shell scripts to run simulations interactively and we generate files used by our grid computing system called [http://www.cs.wisc.edu/condor Condor]. We included several of these to serve as starting points for your environment (however Condor functionality has been removed). In the $GEMS/gen-scripts directory, you will find some files of interest:
gen-scripts.py
- This script is run to generate shell-scripts to automatically start a simulation with chosen parameters and benchmarks. Some choices specified in this file include the chosen protocol and the number of processors. It is heavily tied to workloads.py
workloads.py
- This file is used by gen-scripts.py to generate scripts for the specified workloads. Additional configuration options can also be set
mfacet.py
- We instruct Simics to use this script to automatically load Ruby and Opal, set runtime parameters, and instruct Simics to complete the simulation by running the workload for some number of transactions, specified in workloads.py, and to dump the output to files.
Example of gen-scripts
First build a protocol as described in QuickStart. For this example, it is assumed that the MOSI_SMP_bcast protocol has been built.
- Edit $GEMS/gen-scripts/gen-scripts.py and specify the protocol and the number of processors
modules_list.append("MOSI_SMP_bcast") processor_list.append(16)
- Edit $GEMS/gen-scripts/workloads.py to choose which checkpoints/workloads you wish to run. In this file, you will see several sets of workloads. For example, consider the following:
test_runs = [ ("jbb/jbb_warm", "jbb", 100, 1, 500, None), ("oltp/oltp_warm", "oltp", 2, 1, 500, None), ("apache/apache_warm", "apache", 8, 1, 500, None), ("zeus/zeus_warm", "zeus", 8, 1, 500, None), ]Four workloads are specified in this set. Each one corresponds to .check files in the $GEMS/simics/checkpoints-u3 directory. For example, "jbb/jbb_warm" corresponds to a $GEMS/simics/checkpoints-u3/jbb/jbb_warm-16p.check" file. These files do not exist in the release because we cannot distribute workloads due to licensing issues. To generate scripts to run this set of workloads, set the following variable in workloads.py:
workload_list += test_runs
Other runtime variables are also located in this file such as PROCS_PER_CHIP and NUM_L2_BANKS. There is a tight relationship between the specifications in gen-scripts.py and workloads.py, and we encourage you to examine the code to understand this and modify them to suit your needs.
- Generate shell-scripts by running gen-scripts.py
./gen-scripts.py
- Interactively run the simulation
cd ../results/scripts ./jbb_100_MOSI_SMP_bcast_default_16_10000.sh
- Look at the statistics dumped in the results directory
cd ../results/jbb_100 vi jbb_100-16p-default-MOSI_SMP_bcast-10000.statsThe .stats file is the output from Ruby. Some statistics of interest might be Ruby_cycles (the runtime of the simulation), L1D_cache_total_misses, and L2_cache_total_misses.