Programming Environment

The Intel compilers are available on the Campus Cluster.

module load intel/umf intel/compiler-rt intel/tbb intel/compiler

See the output of the command module avail intel for the versions of the Intel compiler that are available.

The GNU compiler collection (GCC) version 11.4.1 is in the default user environment. Additional versions are availble; view available gcc versions with the command:

module avail gcc/

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

ifx myprog.f

C

gcc myprog .c

icx myprog.c

C++

g++ myprog .cc

icpx 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.7-gcc-13.3.0

Fortran 77: mpif77 myprog.f

Fortran 90: mpif90 myprog.f90

C: mpicc myprog.c

C++: mpicxx myprog.cc

Open MPI

openmpi/5.0.1-gcc-13.3.0

Intel MPI

Intel MPI Home Page / Documentation

module load intel/umf intel/compiler-rt intel/tbb intel/compiler intel/mpi

GCC:

  • Fortran 77: mpif77 myprog.f

  • Fortran 90: mpif90 myprog.f90

  • C: mpicc myprog.c

  • C++: mpicxx myprog.cc

Intel Compiler:

  • Fortran 77: mpiifx  myprog.f

  • Fortran 90: mpiifx myprog.f90

  • C: mpiicx myprog.c

  • C++: mpiicpx myprog.cc

For example, use the following command to load MVAPICH2 v2.3.7 built with the GCC 13.3 compiler:

module load mvapich2/2.3.7-gcc-13.3.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

ifx -qopenmp myprog.f

Fortran 90

gfortran -fopenmp myprog .f90

ifx -qopenmp myprog.f90

C

gcc -fopenmp myprog .c

icx -qopenmp myprog.c

C++

g++ -fopenmp myprog .cc

icpx -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

mpiifx -qopenmp myprog.f

Fortran 90

mpif90 -fopenmp myprog.f90

mpiix -qopenmp myporg.f90

C

mpicc -fopenmp myprog.c

mpiicx -qopenmp myprog.c

C++

mpicxx -fopenmp myprog.cc

mpiicpx -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.

Visual Studio Code

Remote SSH to the Cluster in VS Code

  1. Install the Remote - SSH extension into VS Code.

    Remote ssh extension in VS Code.
  2. Press Ctrl+Shift+P (Cmd+Shift+P) and select Remote-SSH: Connect to Host… from the menu.

  3. Enter username@hostname.

  4. At the password prompt, enter your NetID password.

  5. At the Duo prompt, enter 1 to send a push authentication to Duo on your mobile device.

  6. Once you are connected to the cluster, you can:

    • Open files remotely: VS Code will open the remote workspace. You can edit and run code on the cluster directly.

    • Use the integrated terminal: Press Ctrl+Backtick(`) to open the terminal in VS Code. From there you can execute commands on the cluster.