Compile Fortran programs on Big Red II at IU

On this page:

Note:

Big Red II will be retired from service on December 15, 2019. After that date, you will no longer be able to log into Big Red II; however, the data in your Big Red II home directory will remain accessible from your home directory on any of the other IU research supercomputers. New software requests for Big Red II will no longer be accepted after the October 13, 2019, maintenance window.

Beginning October 14, 2019, IU graduate students, faculty, and staff will be able to create accounts on Big Red III. Undergraduate students and affiliates will be able to get accounts if they are sponsored by full-time IU faculty or staff members. Grand Challenges users who create Big Red III accounts will be able to request exclusive access to a portion of the system for running jobs.

For more, see Upcoming changes to research supercomputers at IU.


Overview

On Big Red II at Indiana University, Fortran code that will execute on the compute nodes should be compiled with the ftn command. The command will indirectly invoke the Cray, Portland Group (PGI), or GNU (GCC) Fortran compiler depending on the programming environment you have loaded.

Note:
You should not directly invoke the Cray (crayftn), PGI (pgf95), or GCC (gfortran) Fortran compiler on Big Red II if your code is going to execute on the compute nodes. You can use them only for programs that will run on the login or service nodes.

Programming environments on Big Red II are controlled using the Modules user environment package. The following programming environment modules are available on Big Red II; information about using ftn with each is provided below:

Programming environment Module
Cray PrgEnv-cray/4.1.40
PGI PrgEnv-pgi/4.1.40
GNU PrgEnv-gnu/4.1.40

The only compiler switch common to each programming environment is default64, which promotes all integers and real numbers to a 64-bit default, and is compatible with the 64-bit MPI libraries.

Cray

The ftn command will invoke the Cray Fortran compiler when the Cray programming environment module (PrgEnv-cray/4.1.40) is loaded. To load the module, on the command line, enter:

module load PrgEnv-cray/4.1.40
Note:
If a programming environment module is already loaded, you will need to unload it before you can load another.

To make permanent changes to your environment, edit your ~/.modules file. For more, see Use a .modules file in your home directory to save your user environment on an IU research supercomputer.

The Cray compiler switches are heavily treed. The top-level switches contain most legacy switches, such as -o (output file), -O (optimization; default is -O2), -l (library name), and -L (library directory). Other switches, such as -e (enable compiling options), -d (disable compiling options), and -h (arguments), have multiple sub-options.

For details about Cray Fortran compiler switches and options, see the crayftn manual page on Big Red II; on the command line, enter:

man crayftn 

Portland Group (PGI)

The ftn command will invoke the PGI Fortran compiler when the PrgEnv-pgi/4.1.40 programming environment module is loaded. To load the module, on the command line, enter:

module load PrgEnv-pgi/4.1.40
Note:
If a programming environment module is already loaded, you will need to unload it before you can load another.

Although you'll use ftn to indirectly invoke the PGI Fortran compiler, you'll use it with most of the normal pgf95 compiler switches (except the -Mprof=mpi, -Mmpi, and -Mscalapack switches, which are not supported on Cray XT systems).

For details about the available PGI Fortran compiler switches and options, see the pgf95 manual page on Big Red II; on the command line, enter:

man pgf95

GNU

The ftn command will invoke the GNU Compiler Collection (GCC) Fortran compiler when the PrgEnv-gnu/4.1.40 programming environment module is loaded. To load the module, on the command line, enter:

module load PrgEnv-gnu/4.1.40
Note:
If a programming environment module is already loaded, you will need to unload it before you can load another.

Although you'll use the ftn command to indirectly invoke the GCC Fortran compiler, you'll use it with the normal set of gfortran compiler switches.

For details about GCC Fortran compiler switches and options, see the gfortran manual page on Big Red II; on the command line, enter:

man gfortran

This is document bdnm in the Knowledge Base.
Last modified on 2019-08-01 13:02:10.

Contact us

For help or to comment, email the UITS Support Center.