next up previous index
Next: Hello World Up: Message Passing Interface Previous: The Discussion

Fortran Interface

MPI was defined from the beginning with C and F77 interfaces. The latter can be used without any change in F90 programs. The basic difference between C and Fortran interfaces is that in Fortran all MPI calls are implemented as subroutines, not functions. The error code is then returned in the last parameter, with other parameters being the same as in C. Some names are changed, e.g., instead of MPI_CHAR we use MPI_CHARACTER in fortran.

The following simple examples illustrate how to use F90 interfaces on the SP.

The MPI wraper for Fortran-90 codes on the SP is called mpxlf90. It works much the same as mpcc. Instead of

#include "mpi.h"
in Fortran you must use
INCLUDE 'mpif.h'
INCLUDE isn't a dinkum Fortran keyword. There should really be a compiled interface, which could then be USEd.


Zdzislaw Meglicki