SAPAC logo The South Australian Partnership for Advanced Computing spacer
Information about Information for Search SAPAC Contact SAPAC

Compiling programs

High Performance Fortran programs can be compiled using the Portland Group PGHPF compiler (pghpf). You should use the -Mmpi flag and link in the object file /usr/pgi/src/mpi.o so the compiler can use Sun MPI for inter-processor communications. You will also need to use the flags -64 and -xarch=v9a to produce 64-bit executables, which is required in order to use the Myrinet.

Fortran programs can be compiled using Sun's Fortran 77 or Fortran 90/95 compilers (f77, f90, f95). The pghpf compiler can also be used to compile Fortran 90 programs programs using the -Mf90 flag.

C and C++ programs can be compiled using Sun's cc compiler. The GNU C/C++ compiler gcc is also available.

MPI programs can be compiled using mpf77 or mpcc. You will need to link the programs with the -lmpi flag to link in the MPI libraries and use -xarch=v9a to produce 64-bit executables, which is required in order to use the Myrinet.

The compilers will produce much faster code if you use compiler optimization flags. You can usually get good results by using the -fast compiler flag, which attempts to provide the best optimization settings. For the PGHPF compiler, use -fast -W0,-fast.

Note that you should NOT use these optimization 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 takes substantially longer to compile the program with -fast. Some programs or subroutines may take an extremely long time to compile at the highest optimization level. In some cases the compiler may not be able to complete the compilation at all, and may give up and try again at a lower optimization level.

With all compilers, there is a greater chance of finding a compiler bug at a higher optimization level. It is a good idea to check that the results of your programs compiled with -fast are the same as those with the default optimization level. Also, if you see a strange compilation error when using -fast (which corresponds to -O5 with Sun compilers), you should try compiling that routine or program again with a lower optimization level, e.g. -O4 or -O3, which may fix the problem.

Note: Programs should only be compiled on the front end.

 

Orion User's Guide

SAPAC SITE MAP