Bridges User Guide
Bridges User Guide: Programming Environment
C, C++ and Fortran
Intel, Gnu and PGI compilers for C, C++ and Fortan are available on Bridges. The compilers are:
C | C++ | Fortran | |
Intel | icc | icpc | ifort |
Gnu | gcc | g++ | gfortran |
PGI | pgcc | pgc++ | pgfortran |
The Intel and Gnu compilers are loaded for you automatically.
To run the PGI compilers you must first issue the command
module load pgi
There are man pages for each of the compilers. Load the pgi module first for access to the pgi man pages.
See also:
- PGI web site
- GNU compilers web site
- Module documentation for information on what modules are avail and how to use them.
OpenMP programming
To compile OpenMP programs you must add an option to your compile command:
Intel | -qopenmp for example: icc -qopenmp myprog.c |
Gnu | -fopenmp for example: gcc -fopenmp myprog.c |
PGI | -mp for example: pgcc -mp myprog.c |
See also:
MPI programming
Three types of MPI are supported on Bridges: MVAPICH2, OpenMPI and Intel MPI.
To compile an MPI program, you must do these things:
- Load the module for the MPI type you want to use, if you are using MVAPICH2 or OpenMPI. The Intel MPI module is loaded for you on login.
- Load the module for the compiler that you want to use.
- Issue the appropriate MPI wrapper command to compile your program.
The three MPI types may perform differently on different problems or in different programming environments. If you are having trouble with one type of MPI, please try using another type. Contact help@psc.edu for more help.
Note: When using Intel MPI, you must set the environment variable I_MPI_JOB_RESPECT_PROCESS_PLACEMENT to 0. Otherwise the mpirun task placement settings you give will be ignored.
Compiler commands for MPI programs
Intel compilers
To use the Intel compilers with | Load this module | Compile with this wrapper command | ||
---|---|---|---|---|
C | C++ | Fortran | ||
Intel MPI | none, this is loaded by default | mpiicc note the “ii” |
mpiicpc note the “ii” |
mpiifort note the “ii” |
OpenMPI | mpi/intel_openmpi | mpicc | mpicxx | mpifort |
MVAPICH2 | mpi/intel_mvapich | mpicc code.c -lifcore | mpicxx code.cpp -lifcore | mpifort code.f90 -lifcore |
BASH:
export I_MPI_JOB_RESPECT_PROCESS_PLACEMENT=0
CSH:
setenv I_MPI_JOB_RESPECT_PROCESS_PLACEMENT 0
Gnu compilers
To use the Gnu compilers with | Load this module | Compile with this command | ||
---|---|---|---|---|
C | C++ | Fortran | ||
Intel MPI | none, this is loaded by default | mpicc | mpicxx | mpifort |
OpenMPI | mpi/gcc_openmpi | |||
MVAPICH2 | mpi/gcc_mvapich |
PGI compilers
To use the PGI compilers with | Load this module | Compile with this command | ||
---|---|---|---|---|
C | C++ | Fortran | ||
OpenMPI | mpi/pgi_openmpi | mpicc | mpicxx | mpifort |
MVAPICH2 | mpi/pgi_mvapich |
See also:
- Intel MPI web site
- MVAPICH2 web site
- OpenMPI web site
- Module documentation for information on what modules are avail and how to use them.
Other languages
Other languages, including Java, Python, R, and MATLAB, are available. See the software page for information.
Debugging and performance analysis
DDT
DDT is a debugging tool for C, C++ and Fortran 90 threaded and parallel codes. It is client-server software. Install the client on your local machine and then you can access the GUI on Bridges to debug your code.
See the DDT and MAP page for more information.
MAP
MAP is a profiling tool for C, C++ and Fortran applications. It is client-server software. Install the client on your local machine and then you can access the GUI on Bridges to debug your code.
See the DDT and MAP page for more information.
VTune
VTune is a performance analysis tool from Intel for serial, multithreaded and MPI applications. Install the client on your local machine and then you can access the GUI on Bridges. See the VTune page for more information.