Programming
Quick Start for Hopper Users
You should be able to compile codes the same way you do on Hopper unless your code in some way relies on the PGI compilers. The default programming environment on Edison uses the Intel compiler suite. Cray and GNU compilers are also available. PGI and Pathscale compilers are not installed.
Overview
Cray provides a convenient set of wrapper commands that should be used in almost all cases for compiling and linking parallel programs. Invoking the wrappers will automatically link codes with MPI libraries and other Cray system software. All MPI and Cray system include directories are also transparently imported. In addition the wrappers append the compiler's target processor arguments for the Edison compute node processors.
NOTE: The intention is that programs be compiled on the login nodes and executed on the compute nodes. Because the compute nodes and login nodes have different operating systems, binaries created for compute nodes may not run on the login node. The wrappers mentioned above guarantee that codes compiled using the wrappers are prepared for running on the compute nodes.
Basic Example
For Fortran source code use ftn
% ftn -fast -o example.x example.f90
For C source code use cc
% cc -fast -o example.x example.c
For C++ source code use CC
% CC -fast -o example.x example.C
All compilers on Edison -- Intel, Cray and GNU -- are provided via three programming environments that are accessed via the module utility. Each programming environment contains the full set of compatible compilers and libraries. To change from one compiler to the other you change the programming environment via the 'module swap' command, e.g., module swap PrgEnv-intel PrgEnv-cray.
Using MKL
The Intel Math Kernel Library (MKL) is available on Edison, providing routines and functions that perform a wide variety of operations on vectors and matrices including sparse matrices. The library also includes fast Fourier transform (FFT) functions, vector mathematical and vector statistical functions with Fortran and C interfaces, and ScaLAPACK.
To use MKL on Edison you should link your code in either of the following two ways:
ftn -o mycode.exe *.o -mkl
ftn -o mycode.exe *.o -mkl=cluster
Note that the -mkl option NEEDS TO APPEAR AT THE END OF THE LINE, i.e., ftn -mkl *.o will not work. Also,
ftn -o mycode.x *.o -L/path/to/libs -llib works, whereas
ftn -o mycode.x -L/path/to/libs -llib *.o does not.
For more details please check the Intel compiler man page.
Help NERSC Configure the Programming Environment
Edison is a pre-production system and the default Intel programming environment is still being configured. Currently, many of the math libraries included in the Cray LIBSCI suite are available to the Intel compilers only through the Intel MKL library.
If you encounter other missing programming libraries or anything else that prohibits you from building your code, please report these to the NERSC consultants at consult@nersc.gov.
CoArray Fortran
You can use CoArrays with the Cray Programming Environment. This feature does not work within the Intel Programming Environment on Edison.


