HP-MPI Version 2.0 for Windows Release Note
11 Fortran Command-Line Basics
The utility "%MPI_ROOT%\bin\mpif90" is included to aid in command line compilation. To
compile with this utility, set MPI_F90 to the path of the command line compiler you want to
use. Specify -mpi32 or -mpi64 to indicate if you are compiling a 32- or 64-bit application. Specify
the command line options that you normally pass to the compiler on the mpif90 command line.
The mpif90 utility adds additional command line options for HP-MPI include directories and
libraries. The -show option can be specified to mpif90 to display the command generated
without executing the compilation command. See the manpage mpif90(1) for more information.
To construct the desired compilation command, the mpif90 utility needs to know what command
line compiler is to be used, the bitness of the executable that compiler will produce, and the
syntax accepted by the compiler. These can be controlled by environment variables or from the
command line.
Table 11-1 mpif90 Utility
Command LineValueEnvironment Variable
-mpif90 <value>desired compiler (default ifort)MPI_F90
-mpi32 or -mpi6432 or 64 (no default)MPI_BITNESS
-mpisyntax <value>windows or unix (default windows)MPI_WRAPPER_SYNTAX
For example, to compile compute_pi.f using a 64-bit 'ifort' contained in your PATH could be
done with the following command since 'ifort' and the 'Windows' syntax are defaults:
C:\> "%MPI_ROOT%\bin\mpif90" -mpi64 compute_pi.f /link /out:compute_pi_ifort.exe
Or, use the following example to compile using the PGI compiler which uses a more UNIX-like
syntax:
C:\> "%MPI_ROOT%\bin\mpif90" -mpif90 pgf90 -mpisyntax unix -mpi32 compute_pi.f -o compute_pi_pgi32.exe
To compile compute_pi.f using Intel Fortran without utilizing the mpif90 tool (from a
command prompt that has the appropriate environment settings loaded for your Fortran
compiler):
C:\> ifort compute_pi.f /I"%MPI_ROOT%\include\64" /link /out:compute_pi.exe /libpath:"%MPI_ROOT%\lib"
/subsystem:console libhpmpi64.lib
NOTE: Intel compilers often link against the Intel run-time libraries. When running an MPI
application built with the Intel Fortran or C/C++ compilers, you might need to install the Intel
run-time libraries on every node of your cluster. We recommend that you install the version of
the Intel run-time libraries that correspond to the version of the compiler used on the MPI
application.
11.1 Autodouble (Automatic Promotion)
HP-MPI supports automatic promotion of Fortran datatypes using any of the following arguments
(some of which are not supported on all Fortran compilers).
/integer_size:64
/4I8
-i8
/real_size:64
/4R8
/Qautodouble
-r8
If these flags are given to the mpif90.bat script at link time, then the application will be linked
enabling HP-MPI to interpret the datatype MPI_REAL as 8 bytes (etc. as appropriate) at runtime.
11.1 Autodouble (Automatic Promotion) 47