Newsgroups: comp.parallel.mpi From: kenneth@hal.ilo.dec.com (Kenneth Cameron) Subject: Re: MPI Fortran to MPI C Organization: Digital Equipment Corporation Date: 20 Nov 1997 10:58:29 GMT Message-ID: <65154l$o68$1@mrnews.mro.dec.com> In article <3472AAD2.F1B01840@parme.saclay.cea.fr>, Stephane REQUENA writes: |> David W Walker wrote: |> |> > I want to convert an MPI Fortran program to an MPI C program. I could |> > use f2c and then change |> > all the MPI calls from Fortran to C |> > |> > David Walker |> |> An other problem will be the correspondance between Fortran types and C |> types : |> In fortran a communicator is an integer, in C is a MPI_Comm, a datatype |> in fortran |> is an integer, in C a MPI_Datatype, ..... For a first pass, depending on the implementation this may not be a major problem. Some MPI implementations have MPI_Comm etc typedef'd as int, but is in no way portable. A related problem is that in FORTRAN all arguments are passed by ref but in the C bindings, some are by value, some by reference, so some will need an & and others won't. Also note that the C and FORTRAN have different MPI datatypes, e.g. MPI_Int and MPI_Integer. You'll probably get away without changing these, but only if the library sets up both even if there's no FORTRAN calls. After doing the f2c step, and before starting to fix all the MPI calls, you could try linking it as is with the usual FORTRAN options i.e. -lfmpi -lmpi. fmpi will contain the correct entry points for the MPI calls. Cheers, Kenneth. -- Kenneth Cameron Digital Equipment International Software Engineer Galway, Ireland