Compilers¶
Please use IBM compilers to create an optimized program from source code. The following compilers are available: - XL C/C++ (C/C++ compiler) version 13.1 - XLF Fortran version 15.1 GNU compilers are also available, but it is recommended to try XL compilers first.
Environment setup¶
IBM C/C++/fortran - compilers are available with standard settings
GNU C/C++/fortran - compilers are available with standard settings
64-bit addressing¶
Normally, compilers operate in 32 bit mode. You can compile your programs in 64 bit mode to achieve a higher performance as well as use more memory. You can do this by using the “-q64” flag. You can also set the variable OBJECT_MODE using this command:
export OBJECT_MODE=64
When using GNU compilers use “-maix64” flag.
Serial Code Compilation¶
Optimized code compilation examples:
C:xlc_r -q64 -qarch=pwr7 -qtune=pwr7 -O3 -qhot myprog.c
C++:xlC_r -q64 -qarch=pwr7 -qtune=pwr7 -O3 -qhot myprog.c
Fortran:xlf_r -q64 -qarch=pwr7 -qtune=pwr7 -O3 -qhot myprog.f
Fortran90:xlf90_r -q64 -qarch=pwr7 -qtune=pwr7 -O3 -qhot myprog.f90
You can find a more detailed description of IBM compilers using -qhelp
flag or here:
http://publib.boulder.ibm.com/infocenter/comphelp/v101v121/index.jsp
OpenMP Code Compilation¶
Optimized code compilation examples using Open Multi-Processing (OpenMP):
C:xlc_r -q64 -qsmp=omp -qarch=pwr7 -qtune=pwr7 -O3 -qhot myprog.c
C++:xlC_r -q64 -qsmp=omp -qarch=pwr7 -qtune=pwr7 -O3 -qhot myprog.c
Fortran:xlf_r -q64 -qsmp=omp -qarch=pwr7 -qtune=pwr7 -O3 -qhot myprog.f
Fortran90:xlf90_r -qsmp=omp -q64 -qarch=pwr7 -qtune=pwr7 -O3 -qhot myprog.f90
IBM Parallel Environment¶
Optimized code compilation examples using MPI on Aurel supercomputer:
C:mpcc -q64 -qarch=pwr7 -qtune=pwr7 -O3 -qhot myprog.c
C++:mpCC -q64 -qarch=pwr7 -qtune=pwr7 -O3 -qhot myprog.c
Fortran:mpxlf -q64 -qarch=pwr7 -qtune=pwr7 -O3 -qhot _myprog.f
Fortran90:mpxlf90 -q64 -qarch=pwr7 -qtune=pwr7 -O3 -qhot myprog.f90
MPICH2¶
You can load the necessary command through modules (module load mpi/mpich2
). The syntax is the same as for IBM PE, only the commands themselves are different:
C:mpicc
C++:mpic++
Fortran 77: mpif77
Fortran 90: mpif90