Newsgroups: comp.parallel.mpi
From: eddemain@neumann.uwaterloo.ca (Erik Demaine)
Subject: Re: How to write MPI program in Fortran90 ?
Organization: University of Waterloo
Date: Sun, 23 Jun 1996 13:08:07 GMT
Message-ID: <DtGF5J.p1A@undergrad.math.uwaterloo.ca>

Woo Chat Ming (cmwoo@hkusu8.hku.hk) wrote:
:   I have written a serial program in Fortran 90 in IBM SP2. Now, I want to
: parallelize it using MPI library. 
:   However, the header file "mpif.h" is written in Fortran 77. After I 
: "include" it into my program, my compiler(xlf90) generates a lot of errors.

The problem is likely the comments are in fixed-form in mpif.h (i.e., C or
* on the first column).  Try the following:

   1. Create a file `mpi90.f' with the following contents:

        module mpi90
           include "mpif.h"
        end module mpi90

      Note: Ensure that there are at least 6 spaces in front of each line!

   2. Compile it using:  xlf90 -qfixed mpi90.f

   3. Replace `include "mpif.h"' with `use mpi90'

When MPI-2 comes out, there should be a "real" F90 module for MPI.

Good luck,
Erik
--
Erik Demaine                 \/  e-mail: eddemain@neumann.uwaterloo.ca
Dept. of Computer Science    /\  URL   : http://barrow.uwaterloo.ca/~eddemain/
University of Waterloo       \/  Most jugglers do poorly while drunk, especially
Waterloo, ON Canada N2L 3G1  /\  in a large wavelength gravity field.

