Programming Environment

The Intel compilers are available on the Campus Cluster.

module load intel/18.0

Older versions of the Intel compiler are also available. See the output from the command module avail intel for the specific modules.

The GNU compiler collection (GCC) version 4.4.7 is in the default user environment. Version 7.2.0 is also available — load this version with the command:

module load gcc/7.2.0

Compiler Commands

Serial

To build (compile and link) a serial program in Fortran, C, or C++, use the commands in the table below.

Serial program build commands

GCC

Intel Compiler

Fortran

gfortran myprog .f

ifort myprog .f

C

gcc myprog .c

icc myprog .c

C++

g++ myprog .cc

icpc myprog .cc

MPI

To build (compile and link) an MPI program in Fortran, C, and C++, use the commands in the table below.

MPI program build commands

MPI Implementation

Module Files for MPI/Compiler

Build Commands

MVAPICH2

mvapich2/2.3-intel-18.0

mvapich2/2.3-gcc-7.2.0

Fortran 77: mpif77 myprog.f

Fortran 90: mpif90 myprog.f90

C: mpicc myprog.c

C++: mpicxx myprog.cc

Open MPI

openmpi/3.1.1-intel-18.0

openmpi/3.1.1-gcc-7.2.0

Intel MPI

Intel MPI Home Page / Documentation

intel/18.0

GCC:

  • Fortran 77: mpif77 myprog.f

  • Fortran 90: mpif90 myprog.f90

  • C: mpicc myprog.c

  • C++: mpicxx myprog.cc

Intel Compiler:

  • Fortran 77: mpiifort myprog.f

  • Fortran 90: mpiifort myprog.f90

  • C: mpiicc myprog.c

  • C++: mpiicpc myprog.cc

For example, use the following command to load MVAPICH2 v2.3 built with the Intel 18.0 compiler:

module load mvapich2/2.3-intel-18.0

OpenMP

To build an OpenMP program, use the -fopenmp / -qopenmp option.

OpenMP program build commands

GCC

Intel Compiler

Fortran 77

gfortran -fopenmp myprog .f

ifort -qopenmp myprog .f

Fortran 90

gfortran -fopenmp myprog .f90

ifort -qopenmp myprog .f90

C

gcc -fopenmp myprog .c

icc -qopenmp myprog .c

C++

g++ -fopenmp myprog .cc

icpc -qopenmp myprog .cc

Hybrid MPI/OpenMP

To build an MPI/OpenMP hybrid program, use the -fopenmp / -qopenmp option with the MPI compiling commands.

MPI/OpenMP hybrid program GCC build commands

MVAPICH2, OpenMPI, and Intel MPI

Fortran 77

mpif77 -fopenmp myprog.f

Fortran 90

mpif90 -fopenmp myprog.f90

C

mpicc -fopenmp myprog.c

C++

mpicxx -fopenmp myprog.cc

MPI/OpenMPI hybrod program Intel compiler build commands

MVAPICH2 and OpenMPI

Intel MPI

Fortran 77

mpif77 -fopenmp myprog.f

mpiifort -qopenmp myprog.f

Fortran 90

mpif90 -fopenmp myprog.f90

mpiifort -qopenmp myporg.f90

C

mpicc -fopenmp myprog.c

mpiicc -qopenmp myprog.c

C++

mpicxx -fopenmp myprog.cc

mpiicpc -qopenmp myprog.cc

CUDA

NVIDIA GPUs are available as a purchase option of the Campus Cluster. CUDA is a parallel computing platform and programming model from NVIDIA for use on their GPUs. These GPUs support CUDA compute capability 2.0.

Load the CUDA Toolkit into your environment using the module load cuda command.

Libraries

The Intel Math Kernel Library (MKL) contains the complete set of functions from the basic linear algebra subprograms (BLAS), the extended BLAS (sparse), and the complete set of LAPACK routines. In addition, there is a set of fast Fourier transforms (FFT) in single- and double-precision, real and complex data types with both Fortran and C interfaces. The library also includes the cblas interfaces, which allow the C programmer to access all the functionality of the BLAS without considering C-Fortran issues. ScaLAPACK, BLACS and the PARDISO solver are also provided by Intel MKL. MKL provides FFTW interfaces to enable applications using FFTW to gain performance with Intel MKL and without changing the program source code. Both FFTW2 and FFTW3 interfaces are provided as source code wrappers to Intel MKL functions.

Load the Intel compiler module to access MKL.

Use the following -mkl flag options when linking with MKL using the Intel compilers:

  • Sequential libraries: -mkl=sequential

  • Threads libraries: -mkl=parallel

To use MKL with GCC, consult the Intel MKL link advisor for the link flags to include.

OpenBLAS, an optimized BLAS library based on GotoBLAS2 is also available. Load the library (version 0.3.12, built with gcc 7.2.0 ) module with the following command:

module load openblas/0.3.12_sandybridge

Link with the OpenBLAS library using:

-L /usr/local/src/openblas/0.3.12/gcc/Sandy.Bridge/lib -lopenblas