PROPOSAL FOR INTERLANGUAGE ACCESS TO HANDLES

Leslie Hart NOAA/FSL ( hart@nipmuc.fsl.noaa.gov)
Fri, 26 May 95 09:42:55 BST

PROPOSAL FOR INTERLANGUAGE ACCESS TO HANDLES
Leslie Hart
Tom Henderson
NOAA/Forecast Systems Laboratory

It is not uncommon for library developers to use one language to develop an
applications library to be used by applications developers using another
language. MPI currently supports both an ANSI C binding and a Fortran 77
binding. It should be possible for Fortran 77 to call C and vice versa that use
MPI in both languages. We do not propose to solve all of the interlanguage
problem but just make it possible to communicate handles to and from both
languages.

MPI_GET_<X>_HANDLE (FortranHandle, CHandle)
IN FortranHandle MPI Fortran handle <X>
OUT CHandle MPI C handle of type <X>

int MPI_Get_<X>_handle (FortranInteger FortranHandle, <C-handle-type> *CHandle)

NO FORTRAN BINDING.

This routine looks up the FortranHandle and fills the CHandle with the
appropriate information to make it useful in C.

MPI_MAKE_<X>_HANDLE (CHandle, FortranHandle)
IN CHandle MPI C handle of type <X>
OUT FortranHandle MPI Fortran handle <X>

int MPI_Make_<X>_handle (<C-handle-type> CHandle, FortranInteger *FortranHandle)

NO FORTRAN BINDING.

This routine makes a FortranHandle from the input CHandle so that it is useful
in Fortran.

Notes:

The MPI implementation should provide either a typedef or #define for the type
FortranInteger, but not necessarily any other types.

The above proposal includes a pair of routines for each handle type (this is
very MPI-like in that it introduces more routines :-). An alternative would
introduce a pair of routines, each with an additional parameter of handle type.
This would reduce the number of routines but would introduce some potentially
distasteful or complicated overloading of the usage of CHandle.