History of High Performance Computing in Cambridge

Cambridge-Cranfield HPCF  > Information for Users  > Programming and Compilation  > Hodgkin

Compiling and tuning programs

There are uncounted different facilities in this area, not all of which are supported by SGI or will work on hodgkin. If you are using Insight (just type 'insight') to read the documentation, look for the MPSPro and APO manuals in the Developer section. Please do not use ANY fancy facility without checking that it is intended to be available and supported.

The default for the compilers is 64-bit working (the -64 ABI option), but MPI does NOT support 64-bit integers, so be careful when using C (e.g. don't use size_t) or specify -n32 explicitly. To enable OpenMP (or use the older SGI shared-memory parallelisation directives), specify -mp, but do NOT do this for MPI jobs. The best general-purpose optimisation option is -O3 and NOT -Ofast or -Ofast=ip27, despite SGI's documentation and tuning notes, because the latter are incompatible with -mp and do other strange things.

To get SGI's extended function library, specify -lffio (don't ask.) To get SGI's shared memory routines, specify -lsma, but be careful to use the right ones. To get the SGI/Cray Scientific Library, specify -lscs or -scs-mp, but NAG will generally be better when we have installed it. But please avoid all of these if you can use standard facilities, for all of the usual reasons. New code should use either MPI or OpenMP, and be written in portable Fortran or C as far as is possible.

Most experience is that the automatic parallelisation facilities are useful only in the simplest cases, but some of the diagnostic options in the compilers are useful. There is an incredibly complex facility for tuning called SpeedShop, but we have little experience with it, except for the perfex command (which is painful to use but provides a lot of information.)