The following compilers are available on Tango. They are easily accessible once you have loaded the correct module (refer to earlier section for description of modules).

Contents

  1. GNU compilers
  2. MPI programs
  3. OpenMP programs
  4. General tips and information


1. GNU compilers

  • gcc (also aliased to cc) for C and C++ programs.
  • gfortran for Fortran 95 programs (and a certain compatibility level for Fortran 77 and Fortran 90).

Note: You may find that some programs will only compile, or will run faster, using certain compilers, so you may want to try them all.

Check the main pages for details on usage and options for each compiler.


2. MPI programs

MPI programs should be compiled using mpicc (for C programs), mpiCC (C++), mpif77 (Fortran 77) or mpif90 (Fortran 90). To enable these commands, you need to load the OpenMPI module:

This will use the underlying Compiler Suite that has been loaded earlier to select the appropriate OpenMPI package, i.e. you need to select your compiler suite before you load the OpenMPI module. 

module load openmpi/gnu

Use the which command to check you are getting the right version of the MPI compilers. For example, when using the Intel compiler Suite: 

which mpicc

should return something like: 

/opt/shared/openmpi/2.1.0/gnu-6.3.0/bin/mpicc

If you have Fortran code that makes use of temporary arrays, you may find that it exceeds the stack space available and will cause your job to fail. If this happens, try using the -heap-arrays option during the compile (Intel compiler specific).


3. OpenMP programs

OpenMP directives for shared memory parallel programming are supported. These programs will only be able to run on a single node of Tango (i.e. up to 28 processors).


4. General tips and information

All of the compilers will produce much faster code if you use compiler optimisation flags. Check the main pages of the compiler you are using to find the appropriate optimisation flags (normally -O1, -O2, etc.).

Note: You should NOT use these optimisation flags when developing and debugging programs. They should only be used once you have checked that the program works, and you want to make it run faster. This is because it may take substantially longer to compile the program at a higher optimisation level.

Also, there is a greater chance of finding compiler problems or bugs at higher optimisation levels. The compiler may not be able to compile the program, or the output of the program may be incorrect. It is a good idea to check that the results of your programs, when they have been compiled with a high optimisation level, are the same as those when they have been complied with the default optimisation. If you detect an error when using a high optimisation level, try compiling that routine or program again at a lower optimisation level.

Note: Programs should only be compiled on the front end (the head node) of the cluster.



Did you find this information useful? Share your feedback here.