Assignments

In the following pages I will call the C-compiler cc, the Fortran-compiler fc and the C++-compiler CC. The actual names may be different. Note also that filename suffixes are not standardized; you must read the documentation for your compiler. In the following pages I will assume that a Fortran90-program, in free format, has the suffix .f90 (so a filename could be my_prog.f90). For C I assume that the filename would be my_prog.c and for C++ I will use my_prog.cc. When you compile you would usually use a few options (flags) e.g. for optimization. I have left out all flags in my examples (the names are not standardized).

If you do not have a Chalmers/GU account, you need to contact the helpdesk to get a personal account.


Here is fsecond.c. (for use with Fortran). This is how you use it...

Here is csecond.c (for use with C). Don't forget to write a prototype.

C and large arrays

A few simple programs to get you started.

Information about the Fortran90-compilers.

More on mixing C and Fortran

Some students never draw any conclusions from the labs. They may write something like:

  "Program A is faster than program B."

and then nothing more, no analysis, no conclusions, not anything. When I get such lab-reports I will promptly return them with a comment saying things like:

  "Why is program A faster? Analyze your results, draw some conclusions."

Often the analysis is the interesting part. Writing some code and running may just be a routine task, and not particularly interesting in itself. So the lab may just have started once you have written the code and run it.


In some labs (POSIX threads, MPI and OpenMP) it is sufficient to hand in the programs so that I can run them. In the Matlab and Uniprocessor labs I want the code on paper together with your lap-reports.

I have set the dates very late, but start a lot earlier (or you will not finish in time).

AssignmentDue date
Matlab2010-04-20
Uniprocessor optimization2010-05-11
POSIX threads2010-05-20
MPI2010-05-20
OpenMP2010-05-20