Using Modules

CCS continually updates applications, compilers, system libraries, etc. To facilitate this task and to provide a uniform mechanism for accessing different revisions of software, CCS uses the modules utility. At login, modules commands set up a basic environment for the default compilers, tools, and libraries. For example: the $PATH, $MANPATH, $LD_LIBRARY_PATH environment variables. Therefore, there is no need for you to set them or update them when updates are made to system and application software. The table below lists commonly used modules commands.

Command Purpose
module avail lists all available modules
module load package loads a module e.g., the ifort package
module list list modules currently loaded
module switch old new module switch switch intel gcc replace old module with new
module purge restores original setting by unloading all modules

You may request new software for Pegasus using our Software Request form.

Application Development

Compiling Code

The following sections present the compiler invocation for serial and MPI executions. All compiler commands can be used for just compiling with the -c option (create just the “.o” object files) or compiling and linking (to create executables). To use a different (non-default) compiler you first unload intel, swap the compiler environment, and then reload the MPI environment if necessary.

Compiling Serial Code

Pegasus has intel and gcc compilers

Vendor Compiler Module Command Example
intel icc (default) module load intel icc -o foo.exe foo.c
intel ifor (default) module load intel ifort -o foo.exe foo.f90
gnu gcc module load gcc gcc -o foo.exe foo.c
gnu gcc module load gcc gfortran -o foo.exe foo.f90

Compiling Programs with MPI

Pegasus supports Intel MPI and OpenMPI and mvapich2 for the intel and gcc compilers.

Compiler MPI Module Command Example
intel Intel MPI module load intel impi mpif90 -o foo.exe foo.f90
intel Intel MPI module load intel impi mpicc -o foo.exe foo.c
intel OpenMPI module load intel openmpi mpif90 -o foo.exe foo.f90
intel OpenMPI module load intel openmpi mpicc -o foo.exe foo.c
gcc OpenMPI module load openmpi-gcc mpif90 -o foo.exe foo.f90
gcc OpenMPI module load openmpi-gcc mpicc -o foo.exe foo.c