next up previous
Next: Example: Up: Frequently Asked Questions Previous: Useful tip

How can I simulate many configurations easily?

Suppose you want to simulate cache sizes of 2k, 4k and 8k, and for each of them simulate block sizes of 16 and 32 bytes. This requires a total of 6 dinero simulations, which could be rather tedious to set going by hand. To help you out in this, I have provided you with a shell script called doDinero.sh. This takes parameters to specify the range of cache sizes and block sizes you wish to simulate, and also requires you to specify the settings for the write policy, the replacement strategy, the associativity and the write allocation policy. It creates a table of miss rates, and writes it to a file whose name is derived from the parameters. This allows you to automatically name your output files and get some idea of what they contain from their name. The synopsis for doDinero.sh is:-

 $SRCDIR/doDinero.sh <input> <sizes> <blocks> <assoc> <repl> <wp> <ap>

Where:-

<input>
is either tex, cc1 or spice
<sizes>
is a string containing a list of cache capacities, e.g. "1k 2k 4k"
<blocks>
is a string containing a list of block sizes, e.g. "16 32 64", specified in bytes.
<assoc>
is the degree of associativity to simulate, e.g. 1 specifies a direct-mapped cache.
<repl>
is the replacement policy. A value of l (``el'') specifies an LRU policy, a value of r specifies a random policy and a value of f specifies a FIFO policy.
<wp>
is the write policy. A value of c specifies a copy-back policy, whereas a value of w specifies a write-through policy.
<ap>
is the write allocation policy. A value of n indicates a ``no allocate on write miss'' policy, whereas a value of w indicates an ``allocate on write miss'' policy.
There are no default settings for these parameters, they must all be specified in the command line, and they must appear in the positions indicated above.

The doDinero.sh script you are given will read the trace file you specify from the central CS3 directory on each simulation, and uncompress it each time. If you have disk space available, you may wish to modify the script so that it uses an uncompressed copy which you can locate on a disk which is local to your processor, for example in the /tmp partition. However, please remember a couple of points:-

1.
Uncompressed trace files are large, and should not be stored permanently - they will rapidly use up disk quotas.
2.
Simulations do require a significant amount of CPU time, so if you are running on a server you MUST ``nice'' your simulation process. This reduces its priority, and ensures that the interactive response of the server is not crippled by your simulation. To do this you should precede the dinero (or doDinero.sh) command with the word nice. Running large simulations overnight is definitely a good idea.


 
next up previous
Next: Example: Up: Frequently Asked Questions Previous: Useful tip
Nigel Topham
6/25/1998