Newsgroups: comp.parallel.mpi
From: Reto Koradi <kor@mol.biol.ethz.ch>
Subject: Re: using MPI under Fortran 90 ?
Organization: Swiss Federal Institute of Technology (ETHZ)
Date: Fri, 07 Nov 1997 11:04:14 +0100
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <3462E79E.4881@mol.biol.ethz.ch>

Benedikt Oswald wrote:
> We are planning to start a parallel software project under
> MPI but would like to use Fortran 90 instead of Fortran 77.
> Can anybody tell me how to do this ? How should we midify
> the mpif.h include file etc ?

On some systems the mpif.h is already compatible with Fortran 90, on
others there are things like old style comments that prevent it from
being used with free source form. How to modify it is mostly obvious,
but using modified versions of system header files can create problems
(different OS versions, etc.). One simple trick is to have one module
that you compile with fixed source format:

      module MPI
        include 'mpif.h'
      end module MPI

Then you can write all other modules in free format, and just do
a 'use MPI' for getting the MPI definitions.

Apart from the header file format, using MPI from Fortran 90 does
not create big problems. There are some points to watch out for,
e. g. you should not pass array expressions to asynchronous calls.
You can find a useful publication on the subject at:

  http://www.uni-karlsruhe.de/~Michael.Hennecke/Publications/#MPI_F90

The biggest problem with using Fortran 90 has nothing to do with
MPI: the compilers tend to be very unreliable. From the ones I tried
so far, only the Cray one is usable. Others make you feel like
guinea pigs, which I find sort of surprising after Fortran 90 has
been defined for a few years.
-- 
Reto Koradi (kor@mol.biol.ethz.ch, http://www.mol.biol.ethz.ch/~kor)

