Archer:SESC

From Grid-Appliance Wiki

Jump to: navigation, search

Contents

Introduction

HOW-TO author: Girish Venkatasubramanian Girish
Overview: SESC is a cycle accurate architectural simulator. It models a very wide set of architectures: single processors, CMPs, PIMs, and thread level speculation. More about SESC can be found at the SESC project Web site

Installation pre-requisites

This how-to assumes you have a Grid appliance up and running.

Downloading and compiling SESC requires a few prerequisites. Most of them should already be present on the grid appliance - but it is better to ensure that all are present before proceeding. The required prerequisites are bison, flex, m4 and zlib1g-dev. CVS is also required to check out the SESC code. Since the grid appliance runs Debian, the APT package manager can be used to easily install the prerequisites using the following commands:

sudo iptables --flush
sudo apt-get update
sudo apt-get install m4 bison flex zlib1g-dev cvs
# in zlib1g-dev, note that the character before "g" is 1 (number one), not l (letter l)

Downloading SESC

SESC's CVS repository can be checked out through anonymous (pserver) CVS with the following instruction. (When prompted for a password, simply hit Enter). About 38MB is needed for the SESC files.

cd /home/griduser/
cvs -d:pserver:anonymous@sesc.cvs.sourceforge.net:/cvsroot/sesc login
cvs -z3 -d:pserver:anonymous@sesc.cvs.sourceforge.net:/cvsroot/sesc co -P sesc

The files are downloaded to "/home/griduser/sesc". Henceforth this directory will be referred to simply as the sesc directory in this document.

Compiling SESC

For performance reasons, many SESC configuration options are chosen at compile-time rather than run-time. For the most part, quantifiable options, such as processor speed or cache size, are specified at run-time in a configuration file. Qualitative options, such as whether cache-coherence is enabled, are usually specified at compile-time. It is recommended that SESC be built in separate directories, every time the compile options are changed.

The procedure to compile SESC is as follows.

First, go inside the sesc directory:

cd /home/griduser/sesc

Create a build directory inside the sesc directory. It is useful to give a descriptive name for the build directory. For instance, if SESC is to be compiled with SMP options, the directory may be named build_smp. For the remainder of this document, /home/griduser/sesc/build_smp will be referred to as the build directory. Create and go inside the build directory:

mkdir build_smp
cd build_smp

To see a list of all available compile time configure options, the configure script can be invoked with "--help" option. The configure script is present in the sesc directory.

../configure --help

In this document, we are going to compile SESC for SMP simulations, using the options enable-smp and enable-smpdebug.

../configure --enable-smp --enable-smpdebug

Note that compiler options like CFLAGS and CC can be specified following the SESC options, for example ../configure --enable-smp --enable-smpdebug CC=/path/to/compiler

The configure script will generate the make files with the correct options. This can be verified by examining Make.defs. SESC can then be compiled by running “make”, followed by “make sesc”. If any of the dependencies (like bison, flex, m4, zlib etc) are missing the make will fail. Install these dependencies and continue.

make
make sesc

The compiled SESC executable is called sesc.smp. This name can be changed (before running make), by editing the Makefile and Make.defs.

The next step is to test whether the compiled SESC works OK. The following command runs the crafty benchmark:

./sesc.smp -c../confs/smp.conf ../tests/crafty < ../tests/tt.in

-cconf_file_name specifies the runtime configurations. If this option is not specified, SESC will use the default configuration file specified by the environment variable SESCCONF. If this variable is also not specified, SESC will fail. crafty and tt.in are the benchmark and the input file. Once the benchmark finishes executing a report is generated in the build directory.

More options can be specified while running the sesc.smp binary. To see a complete list of these options, just run sesc.smp with no arguments.

Note that there is not space between the options switch (ex: "-c") and the option (ex: "conf_file_name").

Submitting SESC jobs using Condor

In order to submit jobs to the condor queue, the command condor_submit <submit_script>. The submit script has to specify, among other things, the executable, the input files and the command line arguments (see the sample submit script).

Create a directory called "run" and prepare the files which will be used for this test run:

cd ~/sesc
mkdir run
cd run
cp ../confs/smp.conf .
cp ../tests/crafty .
cp ../tests/tt.in .
cp ../build_smp/sesc.smp .

create and save the following condor submit script as a file named submit_script:

executable = sesc.smp
universe = vanilla
output = sesc.$(cluster).$(process).out
log = sesc.$(cluster).$(process).log
error = sesc.$(cluster).$(process).err
input = tt.in 
should_transfer_files = YES
when_to_transfer_output = ON_EXIT
transfer_input_files = crafty, tt.in, smp.conf
arguments = -csmp.conf crafty
queue

Here is the same script with comments:

##############################################################
# Sample Submit script for sesc.smp

#Specify the executable
executable = sesc.smp

# Universe is the environment in which the job runs
#Vanilla means Condor runs unmodified binaries
universe = vanilla

#input, output, error and log can be redirected to files
output = sesc.$(cluster).$(process).out
log = sesc.$(cluster).$(process).log
error = sesc.$(cluster).$(process).err
input = tt.in 

#Specify when and what files to transfer along with the executable
# files needed by sesc: benchmark and input
#no need to specify binary
should_transfer_files = YES
when_to_transfer_output = ON_EXIT
transfer_input_files = crafty, tt.in, smp.conf

#command line arguments
#./sesc.smp -csmp.conf crafty < tt.in
#tt.in is specified using the "input = " option above
arguments = -csmp.conf crafty
#queue submits the job to the queue
queue

#sometimes the input file need not be redirected, but should be specified as argument
#for example ./sesc.mem -cmem.conf mcf mcf.in - then arguments will be
#arguments = -cmem.conf mcf mcf.in
#another example ./sesc.mips -cmips.conf -icrafty.input crafty.mipseb - then arguments will be
#arguments = -cmips.conf -icrafty.input crafty.mipseb


#multiple runs can be specified in the same submit_script - for example
# another job
#arguments = <arguments for another job>
#queue

#other submit script options can be obtained from the condor manual
###################################################################

Once the submit script has been created, the job can be submitted by the following command:

condor_submit submit_script

Monitoring the progress of the job can be done by watching the condor queue. The condor queue specifies the number of jobs waiting and currently running.

watch -interval 2 condor_q

Once the job has completed, the output files along with the logs and error and out files can be found in the same directory where the job was submitted.

Linking SESC with Condor libraries

When there is the option to link with Condor libraries to created "standard universe" binaries, it is an alternative you should consider. Condor libraries allow an application to checkpoint periodically for improved reliability - a feature which is not available in the "vanilla" universe described above. SESC links with Condor by simply changing the way you call the configure script:

cd ~/sesc/build_smp
../configure --enable-smp --enable-smpdebug --enable-condor
make
make sesc

This creates a Condor-linked binary sesc.smp.condor

To submit a job using this binary, you will need a configuration file that is similar to the one used for the vanilla universe. The main differences are that the universe is now called "standard" and that there is no need to explicitly identify file transfers:

cd ~/sesc/run
cp ../build_tmp/sesc.smp.condor .

Create a file submit_condor_standard in the run directory:

executable = sesc.smp.condor
universe = standard
output = sescstd.$(cluster).$(process).out
log = sescstd.$(cluster).$(process).log
error = sescstd.$(cluster).$(process).err
arguments = -csmp.conf crafty
queue

The submit it with:

condor_submit submit_condor_standard
Personal tools