There are both GNU and Intel compilers on Darwin (in several versions depending on the currently loaded modules. The following table summarises the available compiler commands on the cluster:
|Recommended optimisation flag||-O3||-O3 -ipo -xHost|
For best performance, use of the Intel compilers is recommended. Please see the online documentation for the Intel compilers and the Math Kernel library. For more information about optimisation for GNU, please refer to the respective man and info pages (or here).
The commands referred to above should be used directly for single processor or OpenMP parallel applications. For MPI parallel applications it is preferable to use the MPI-specific wrappers which automatically locate the correct MPI header and library files. These wrappers are available in the default user environment and are:
These commands are wrappers around the Intel compilers (unless overridden, see below) and ensure that the correct MPI include and library files are used. Since they are wrappers, the same optimisation flags can be used as with the standard Intel compilers.
Typically, applications use a Makefile that has to be adapted for compilation. (Please refer to the application's documentation in order to adapt the Makefile for a Linux/x86_64 cluster.) Frequently, it is sufficient to choose a Makefile specifically for a Linux MPI environment and to adapt the CC & FC parameters in the Makefile, which should point to mpicc and mpif77 (or mpif90 in the case of Fortran90 code) respectively.
By default mpicc/mpif77 etc use the Intel compilers. To use another compiler, e.g. the GNU compiler, the following flags will override the default behaviour:
mpicc -cc=gcc mpif77 -fc=gfortran mpif90 -f90=gfortran mpicxx -cxx=g++