Fahad Alanezi

Fahad Alanezi

Project 1

Fahad Alanezi

California Lutheran University

CSC582: High Performance Computing

Dr. Nagi Mekhiel

Summer 2013

June 26, 2013

Abstraction:

Nowadays, computer deals with a massive amount of data which required a processor that can execute them in a short time. Therefore, now computers have multi-processors. Accouding to Insidehpc.com the High performance computing is “High Performance Computing most generally refers to the practice of aggregating computing power in a way that delivers much higher performance than one could get out of a typical desktop computer or workstation in order to solve large problems in science, engineering, or business”. High Performance Computing systems have the ability to deliver sustained performance through the concurrent use of computing resources.

Cygwin is a set of powerful tools assist developers to observe and modify the performance in migrating applications. It’s used Unix-like environment and command-line interface. In this report I will illustrate its installation steps and some other tools such Simplescalar and GCC cross that Cygwin needs to work properly. Then I will use a simple c program and do some modification in the performance and see who this modifications will change the performance.

To make the Cygwin works properly, make sure all tools (Cygwin, Simplescalar and GCC) are downloaded at the same disk (e.g.: disk C).

Just be aware we are going to download three tools respectively:

1.  Download Cygwin.

2.  Download Simplescalar.

3.  Download GCC.

First. Follow the next step to install Cygwin:

1.  Visit http://www.cygwin.com .

2.  Then in the left side under the Cygwin category, click on install Cygwin.

3.  Click on setup.exe, and save it.

4.  Open it, and click Run.

5.  Click next as shown in the following pic.

6.  Choose install from the Internet, and click next:

7.  By default, it will saved it in C disk, you can choose the location( keep in mind, other tools must be at the same location(disk))

8.  Choose the connection type( usually Direct Connection):

9.  Choose the server that close to your location. ( for California choose the following):

10.  If this is the first time you’ve installed Cygwin on your computer then Ignore this message.

11.  This is a very important step watch it carefully.

12.  Change the situation on Devel and to install. Then click next.

13.  Click next to start install the Cygwin.

14.  Estimated time to install Cygwin is 20 - 40 minutes.

15.  Sometimes, you get message tells the download is incomplete. Just click yes to try again.

16.  Click next, and then finish to run Cygwin.

17.  To make sure the Cygwin has successfully installed. Type “make “. Then enter.

If you got this message “make: *** No targets specified and no makefile found”. This means that you have successfully installed Cygwin.

Second. Download Simplescalar:

(Make sure that you download the file at the same location that Cygwin exist).

1.  Visit http://www.simplescalar.com .

2.  In the left side, under Download section, click on Tools, then choose simplesim-3v0e.tgz.

3.  Download the package directly into Cygwin’s root directory (c:\cygwin). (Very important).

4.  To make sure that you have downloaded the simplesim-3v0e.tgz at the same Cygwin’s root directory.

a)  Type “Cd / “then click enter to make sure you are at Cygwin root directory.

b)  Type “ls” then click enter.

5.  You will find the simplesim-3v0e.tgz in the list. Otherwise, move the file to Cygwin’s root directory.

6.  Type “tar –xzvf simplesim-3v0d.tgz” and press enter to untar and unzip the package to install Simplescalar.

7.  The next steps will create a subdirectory simplesim-3.0 with the source code for all simulators described above.

a)  Type “cd simplesim-3.0” then press enter.

b)  Type “make config-pisa” then press enter

8.  The next step will set up the files for building the PISA target. The other alternative is an Alpha target.

a)  Type “make”, then press enter.

9.  You should be able to see “My work is done here …”.

10.  Type “make sim-tests”, then press enter.

At the end of this step you have successfully installed the simulators.

Third. Download GCC:

1.  In order to be able to compile programs to run on the simulator, you need a port of cross-compiler and libraries for Cygwin.

2.  Visit this link to download the cross compiler and save it at the same Cygwin’s root directory: http://www.eecg.toronto.edu/~moshovos/ACA05/hw/ss-gcc.usrlocal.tar.bz

3.  Open the Cygwin terminal and make sure you are at Cygwin root directory by typing “cd /”, then press enter.

4.  Type “tar –xvf ss-gcc.usrlocal.tar.tar.bz”, and then press enter to untar the package to install cross compiler. (Note: this is just a tar file not a zip file. So the option should be only –xvf not -xzvf).

Now at the end of this step you have successfully installed all of the components to run and compile files for Simplescalar.

Test the cross compiler, do the following steps:

1.  Write a C program.

2.  Open the Cygwin terminal and make sure you are at Cygwin root directory by typing “cd /”.

3. To compile a c program, type “sslittle-na-sstrix-gcc the name of program.c”.

e.g. “sslittle-na-sstrix-gcc sortingNumbers.c”.

4. To run Simplescalar, go to simplesim-3.0 directory by typing “cd /simplesim-3.0”

Then type “./sim-safe.exe ../the name of compiled c program for example a.out”.

5.  To store the simplescalar out to a file do the following steps:

a)  Type “./sim-outorder.exe -redir:sim file name ../a.out”

Example: “./sim-outorder.exe -redir:sim exam1 ../a.out”.

b)  To create a config file for the C program that you have been used in the previous step. Type “./sim-outorder.exe -dumpconfig exam2”.

6.  To make some change on the parameters open the config file (under simplesim-3.0 folder) by an editor and change some of the parameters. For example, L1 data cache configdl1 il1:512:32:1: l which means size=128 kb, 32 byte block size, associativity equals 4, and cycle speed is 1. As you can see, since level 1 cache is 1 mb, the latency is 1 cycles. Then you can change these numbers and save it.

7.  After you changed the config file and save it, type in Cygwin terminal the following commands “./sim-outorder.exe -config exam2 -redir:sim exam3 ../a.out”

8.  Now you can open the two files (in this example: exam1 and exam2). And you can compare between their results.

My observation:

1.  I have used SrotingNumber.c which asked to enter five digit numbers, and then print out the largest and smallest numbers among these five numbers. I have stored the simplescalar out to a file called exam1. Then I have created a config file to make some changes of parameters.at the first time, I have only changed one parameter which is the size of the second level of the data cache config. It was 1024 to 2048 K.B. There was a slightly different happened after modifition. The next table shows the differences.

Factors / Exam1(before) / Exam3(after)
total simulation time in seconds / 24 / 33
simulation speed (in insts/sec) / 649.1667 / 472.1212

2.  Then I decided to change one more parameter “data cache hit latency” for the same level of cache that I have done, from 6 to 12 cycles.

Factors / Exam1(before) / Exam3(after)
cycles per instruction / 2.0364 / 1.7702

3.  I put everything back to the normal situation, and I changed the memory access bus width. It’s made a slightly changed.

Factors / Exam1(before) / Exam3(after)
cycles per instruction / 1.7702 / 1.4266

4.  I have noticed that for all of these changes the numbers of hits and misses at level two in cache memory were stable (fixed).

23