From: "B. Lee" <bslee@pvmcube4.snu.ac.kr>
Newsgroups: comp.parallel.mpi
Subject: Re: C and FORTRAN
Date: Sat, 10 Oct 1998 09:53:18 +0900
Organization: ETRI/Super Computer Center
Message-Id: <361EAFFE.DEE@pvmcube4.snu.ac.kr>
References: <361E42C2.4DB1EE55@ifd.mavt.ethz.ch>
Reply-To: bslee@pvmcube4.snu.ac.kr
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Michele Milano wrote:
> 
> Hi all,
> 
> I'm using MPI to parallelize a code that is written part in C and part
> in FORTRAN.
> 
> The main program is in C, then from the C program a FORTRAN subroutine
> is called; this FORTRAN subroutine itself calls a C function.
> 
> Anyway, there is no "cross communication" between parts of code written
> in different languages, i.e. FORTRAN written routines communicate only
> with FORTRAN written routines, and the same for the C part of the code.
> I know that "cross communication" between codes written in different
> languages is a problem, because of typing differences, so I avoided to
> do that.
> 
> 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
> 
> I would like to have an opinion/advice...
> 
Another option is using PVM.
In PVM, cross communication is possible. If your parallelization is now
beginning, I advice you to use PVM as cross communication. Especially
master program is developed with C, and sub-programs are already
developed with Fortran.
Or another choice is using MPI and PVM both. If cross communication is
needed, use PVM elsewhere use MPI. This has no problem.

++++++++++++++++++++++++++++++++++++++++++++++++
Lee, Bo-sung
ETRI/Super Computer Center, S. Korea
mailto:bslee@pvmcube4.snu.ac.kr
mailto:bslee@linuxsvr.seri.re.kr
++++++++++++++++++++++++++++++++++++++++++++++++

