tar xf griddemo.tar(assuming you saved the file under the name griddemo.tar).
date.Cis a simple example of a C++ class. It represents one day, storing day, month, and year of a date. The class has a function which advances by one day. The main program computes the age of a person in number of days.
frac.Cis a C++ class, which represents fractional numbers, ie, numers of the form p/q. Operator overloading is used to implement arithmetic operations on the numbers. The main program solves a linear 3x3 system in exact arithmetic.
bcurve.Cdescribed on lecture 6, shows how inheritance can be used in C++, and gives some introduction to the first programming exercise. An example of throwing an exception is given. Exceptions are not required for the course, or for the programming exercise. Note: the code is syntactically correct, but can not be executed, since not all functions are defined.
vector.Cis an example which shows how to use operator overloading in C++. A second version
vectorT.Ctemplates are added for vectors of double or int, or any type.
Matrix.Cis the matrix example shown on Lecture 7. Some additional functions have been added. Try to understand what the program does. The variable
thisis a pointer to the object itself.
mpiversion.Cis the first MPI example program shown on Lecture 9.
sendsimple.Cis the simplest example of sending and receiving with MPI, shown on Lecture 9.
reduce.Cis a simple example of global communication with MPI, shown on Lecture 9.
mpiCC, the command to run on (for example) 3 processors is
mpirun -np 3 a.out. The instructions on page 11 in the handed out material by Christer Andersson works, but you might have to add a machine file according to the example:
mpirun -np 3 -machinefile machines a.outwhere
machinesis the name of file containing a list of computers, for example,
An additional problem is that you will need a kerberos ticket on
all machines listed in the machine file. A way around this, is to
put all files needed for running the program (in the simplest case
under your Public directory (~username/Public).
Kerberos tickes are then not needed.