next up previous
Next: Applications Up: User's Guide to the Previous: Libraries

Optimisation

The modern hardware of the HPCx system, and its sophisticated compilers mean that many time-honoured code `hand-crafting' optimisation techniques are irrelevant, and should not be necessary except in the pathological case.

The use of appropriate optimisation switches at compile time can lead to significant (sometimes dramatic) improvements in execution time

Use of the thread-safe re-entrant versions of compilers ([mp]xlf90_r, [mp]xlc_r, [mp]xlC_r, etc) is essential for any code which is required to be thread-safe. There is no performance hit when using these compilers for codes which are not required to be thread-safe, so we recommend their use for all programs.

Fortran and C compilers have a similar set of optimisation switches, some of these are described briefly here. Users should refer to the relevant compiler documentation for more detailed information.

A good mix of compiler switches to use when starting serious optimisation might be:

-qhot -qarch=pwr4 -O3 -q64

Please note that it is better to compile and debug your code first without optimisation. If your code is in some way non-standard, then optimising may break your code. Optimising your code in the above ways can alter the precise numerical results. If you do not want this to happen then try compiling with the -qstrict flag which will overcome this problem, but may result in some performance degradation.


next up previous
Next: Applications Up: User's Guide to the Previous: Libraries
Andrew Turner
2010-01-14