Skip to main content

Application Development

RCDC offers hands-on training workshops and continuous support on HPC development for scientific and engineering applications. Please visit our training page for more information. Contact  RCDC Support with comments and questions.

Compiling

The first step for developing code is to enable the compilers associated with your code on Opuntia. To do this, load the module that corresponds to your code using the commands in the 2 nd column:

Program type Command
CPU, serial module load intel
CPU, parallel module load openmpi *
GPGPU, parallel module load cuda-toolkit
GPGPU, parallel module load pgi

*the module  openmpi is automatically loaded for you upon login in into Opuntia. These compilers work with code written in C, C++ and Fortran. Please visit our software page for more information on these modules.

C/C++ CPU serial code

Once you have loaded  intel (Compiling, above), you can invoke the C compiler with  icc on the command line using:

$ icc myprog.c -o myprog.exe

icc also works in makefiles. Similarly, you can invoke the C++ compiler with  icpc on the command line using:

$ icpc myprog.cpp -o myprog.exe

icc also works in makefiles. Note that when you invoke the compiler with icc it compiles C source files using C libraries and C include files. However if you use icc with a C++ source file instead, it is compiled as a C++ file. Conversely, when you invoke the compiler with icpc it compiles C++ source files using C++ libraries and C++ include files. But if you use icpc with a C source file, it is compiled as a C++ file.

Fortran CPU serial code

Once you have loaded  intel (Compiling, above), use the  ifort command either on the command line or in a makefile to invoke the Intel Fortran compiler:

$ ifort myprog.f90 -o myprog.exe

For more information on icc, icpc and ifort see  Intel ® C++ Compiler User and Reference Guide .

OpenMP parallel code

Once you have loaded intel (Compiling, above), use the compiler option  -openmp after the compiler command to build OpenMP parallel applications. That is, use one of the following commands, 2 nd column:

Language Command
C icc -openmp myprog.c -o myprog.exe
C++ icpc -openmp myprog.cpp -o myprog.exe
Fortran ifort -openmp myprog.f90 -o myprog.exe

Note that there are several other OpenMP compiler options associated with other compilers, for example GNU and PGI.

MPI parallel code

When  openmpi has been loaded (Table I), you can use one of the following commands, 2 nd column, to build MPI parallel applications:

Language Command
C mpicc myprog.c -o myprog.exe
C++ mpic++ myprog.cpp -o myprog.exe
Fortran 90, 95 mpif90 myprog.f90 -o myprog.exe
Fortran 77 mpif77 myprog.f77 -o myprog.exe

Note that  mpicc and  mpifort are compiler wrappers which OpenMPI recommends to use to compile parallel applications ( see their documentation).

CUDA GPGPU parallel code

Once you have loaded  cuda-toolkit (Compiling, above), you can use one of the following commands, 2 nd column, to build GPGPU parallel applications:

Language Command
CUDA code nvcc myprog.cu -o myprog.exe
C nvcc myprog.c -o myprog.exe
C++ nvcc myprog.cpp -o myprog.exe

For more information see  CUDA Toolkit’s Documentation.

CUDA Fortran parallel code

Once you have loaded  pgi (Compiling, above), you can use the following command to compile CUDA Fortran parallel code:

$ pgf90 -o myprog.exe myprog.cuf

For more information see  PGI’s CUDA Fortran documentation.

Scientific and Math Libraries

Please visit our Software page for information and details on many Scientific and Math libraries that are available on Opuntia.

Again, RCDC offers hands-on training workshops and continuous support on HPC development for scientific and engineering applications. Please visit our  training page for more information. Contact  RCDC Support with comments and questions.