How do I use the NAG Parallel Library?

Please note: The FAQ pages at the HPCVL website are continuously being revised. Some pages might pertain to an older configuration of the system. Please let us know if you encounter problems or inaccuracies, and we will correct the entries.

The NAG parallel libraries require running ClusterTools 7 (OpenMPI) to run on Solaris clusters, which is currently not the production version on our machines. Nevertheless, ClusterTools 7 is accessible by issuing the

use ct7

command. The NAG Parallel Library is located in /opt/nag/fdso603dm and only available as a 64-bit version.


mpif77 -c -dalign -xO3 -v9 program.f

Linking (static):

mpif77 -o program.exe -dalign -xO3 -xlic_lib=sunperf program.o \
/opt/nag/fdso603dm/libnagmpi.a /opt/nag/fdso603dm/libnagmpi_spl.a

Linking (dynamic):

mpif77 -o program.exe -dalign -xO3 -xlic_lib=sunperf program.o \
-L /opt/nag/fdso603dm -R /opt/nag/fdso603dm -lnagmpi -lnagmpi_spl

Again we assume that you want to use the Sun Performance Libraries from within the NAG routines. Replacing the reference to _spl by one to _nag replaces the performance library routines by the generic NAG ones. The -xlic_lib=sunperf option may then be dropped.

The mpif77 command is an MPI specific macro that calls the proper compiler options needed to handle MPI programs, and Fortran 77 compatibility.

To run an MPI program on our system, you need to use the mpirun command and specify how many processes you want to start, e.g.:

mpirun -np 4 program.exe

For this command to work properly, the use ct7 must have been issued first.