Exercise 3: Test Compilers on IEEE floating point arithmetic

In this exercise you will test the compilers you installed in the previous exercise on a bunch of codes provided by the workshop.

All the examples/codes provided here are dealing with Floating Point weird behavior (discussed in the lecture) and are designed to show the types of problems one can encounter with either badly written software or too aggressively “optimized” executables.

Some of these examples are taken and in some cases modified from many different sources on the internet: the full list of web reference is at the end of the exercise.

EXERCISE GUIDE

Task 1: Download and Install the Codes

This is a trivial task: just download the the codes from svn server:

$ svn checkout --username anonsvn https://www.qe-forge.it/svn/hpc-2008/trunk/week1/exercise3/ 

Certificate information:
 - Hostname: centos5
 - Valid: from Sep 29 13:33:51 2007 GMT until Sep 28 13:33:51 2008 GMT
 - Issuer: SomeOrganizationalUnit, SomeOrganization, SomeCity, SomeState, --
 - Fingerprint: 67:af:bd:e1:b9:3e:7d:4f:6e:50:e0:33:d1:ee:bb:3b:4d:20:bb:09
(R)eject, accept (t)emporarily or accept (p)ermanently? p
Authentication realm: <https://www.qe-forge.it:443> Document repository
Password for 'anonsvn': 

the password is: anonsvn

$ cd exercise3 
$ ls -lrt
total 16
drwxrwxr-x 3 maryam maryam 4096 Oct 27 17:58 inverse
drwxrwxr-x 3 maryam maryam 4096 Oct 28 11:14 sum_numbers
drwxrwxr-x 3 maryam maryam 4096 Oct 28 11:24 exe_ieee
drwxrwxr-x 3 maryam maryam 4096 Oct 28 11:29 paranoia

The codes are also available in the following address:

$ wget http://nexus/hpc/exercises/week1/exercise3.tgz
$ tar -xvzf exercise3.tgz 
$ cd exercise3 

You are now ready to play with the four proposed exercises: each for any directory. Please note: even if the order is not important we strongly suggests you to follow the order proposed.

Task 2: Play with the inverse program

Task 3: Compare the performance and effectiveness of the obtained executables ?

Task 4: Compile the Paranoia.c code with gnu compiler and test the correctness of the Floating Point arithmetic

Task 5: Play with the sum_numbers program


Some additional references:

  1. Pitfalls of verifying floating point computations
  2. IEEE 754 floating-point test software
  3. What Every Computer Scientist Should Know About Floating-Point Arithmetic
  4. The perils of the floating point