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.
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 Implementation |
Module Files for MPI/Compiler |
Build Commands |
---|---|---|
MVAPICH2 |
mvapich2/2.3.7-gcc-13.3.0 |
Fortran 77: Fortran 90: C: C++: |
Open MPI |
openmpi/5.0.1-gcc-13.3.0 |
|
Intel MPI |
TBA |
GCC:
Intel Compiler:
|
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.
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.
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 |
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.
Visual Studio Code
Remote SSH to the Cluster in VS Code
Install the Remote - SSH extension into VS Code.
Press Ctrl+Shift+P (Cmd+Shift+P) and select Remote-SSH: Connect to Host… from the menu.
Enter username@hostname.
At the password prompt, enter your NetID password.
At the Duo prompt, enter 1 to send a push authentication to Duo on your mobile device.
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.