UK National HPC Service

Computer Services for Academic Research Logo
Home | Helpdesk | Machine Status | Search | Apply
 

Porting Codes 2

Use of Compilers

The main tool in porting applications is the compiler, as this is the means of converting your raw source code into an executable. When moving between compilers on different machines it is necessary to look at the behaviour of one compiler compared to another, and to assess what changes may need to be made to Makefiles and compile lines in order to get optimal performance combined with the required accuracy.

When compiling a working code for use on a supercomputer, it is necessary to use a high optimisation level to increase throughput. By default the optimisation level on both Origin and Altix machines is set to be -O2 although the exact definition of the optimisations carried out at this level may vary from compiler to compiler. For most codes setting the optimisation level to -O3 produces even better speedups but with the potential to modify results in the minor decimal places. At the -O3 level, compilers will carry out aggressive optimisations to improve performance, but it will only be a small number of these which affect accuracy. On the Origin machines the set of compiler flags -O3 -OPT:IEEE_arithmetic=1:roundoff=0 will produce the highest level of optimisations which do not impact on numerical accuracy. On the Altix the compiler flags -O3 -mp will attempt to perform aggressive optimisations where they do not affect precision, but anecdotal evidence has suggested that the -mp flag has a detrimental effect on performance.

Page maintained by This page last updated: Tuesday, 17-Aug-2004 15:32:53 BST