From: lederman@breeze.cs.wisc.edu (Steve Huss-Lederman)
Newsgroups: comp.parallel.mpi
Subject: Re: C and FORTRAN
Date: 13 Oct 1998 13:07:54 GMT
Organization: U of Wisconsin CS Dept
Message-Id: <6vvjbb$do5@spool.cs.wisc.edu>
References: <361E42C2.4DB1EE55@ifd.mavt.ethz.ch>


>Now, my concern is the following: where should I initialize the MPI
>environment? There are 3 possibilities:
>
>1) call MPI_Init from the C part only
>2) call MPI_INIT from the FORTRAN part only
>3) initialize MPI from both the parts of the code

When MPI-2 was being developed this was recognized as a problem.  You
should look at section 4.12 of the MPI-2 standard.  It goes through a
lot of details about interlanguage usage of MPI.  You can communicate
between routines in different languages and the methods are discussed.
For initialization, MPI-1 was not clear on what would happen.  In
MPI-2, you can call MPI_INIT from any language and then use MPI in any
other language.  What language you use to initialize MPI has no
effect.  Note that MPI-1 had argc and argv as arguments to MPI_Init in
the C version.  To make sure that you can initialize in any language,
these arguments may not have any effect in MPI-2 implementations.

Steve

P.S. - (Warning: slight ad to follow by one of the authors of these
books.)  You can also get this information in Section 2.2 of volume 2
of the new two volume set on MPI from MIT Press.  These two books
replace the original book "MPI: The Complete Reference."  They present
the MPI-2 standard along with the MPI-1 standard.  In many cases the
books are easier to read than the standards since the MPI-1 & MPI-2
material that is related has been integrated together and presented in
one place.  For more information see volume 1 at
http://mitpress.mit.edu/book-home.tcl?isbn=0262692155 and volume 2 at
http://mitpress.mit.edu/book-home.tcl?isbn=0262571234.

