Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Missing F90 modules
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2008-07-30 16:34:13


"use mpi" basically gives you stronger type checking in Fortran 90
that you don't get with Fortran 77. So the error you're seeing is
basically a compiler error telling you that you have the wrong types
for MPI_CART_GET and that it doesn't match any of the functions
provided by Open MPI.

FWIW, the official declaration of the Fortran binding for MPI_CART_GET
is:

MPI_CART_GET(COMM, MAXDIMS, DIMS, PERIODS, COORDS, IERROR)
     INTEGER COMM, MAXDIMS, DIMS(*), COORDS(*), IERROR
     LOGICAL PERIODS(*)

The real problem is that it looks like we have a bug in our F90
bindings. :-( We have the "periods" argument typed as an integer
array, when it really should be a logical array. Doh!

The patch below fixes the problem in the v1.2 series; I'll get it
included in v1.2.7 and the upcoming v1.3 series.

Index: ompi/mpi/f90/scripts/mpi-f90-interfaces.h.sh
===================================================================
--- ompi/mpi/f90/scripts/mpi-f90-interfaces.h.sh (revision 19099)
+++ ompi/mpi/f90/scripts/mpi-f90-interfaces.h.sh (working copy)
@@ -1120,7 +1120,7 @@
    integer, intent(in) :: comm
    integer, intent(in) :: maxdims
    integer, dimension(*), intent(out) :: dims
- integer, dimension(*), intent(out) :: periods
+ logical, dimension(*), intent(out) :: periods
    integer, dimension(*), intent(out) :: coords
    integer, intent(out) :: ierr
  end subroutine ${procedure}

On Jul 30, 2008, at 4:15 PM, Scott Beardsley wrote:

> Brock Palen wrote:
>> On all MPI's I have always used there was only MPI
>> use mpi;
>
> Please excuse my admittedly gross ignorance of all things Fortran
> but why does "include 'mpif.h'" work but "use mpi" does not? When I
> try the "use mpi" method I get errors like:
>
> $ mpif90 -c cart.f
>
> call mpi_cart_get( igcomm,2,ivdimx,lvperx, mygrid, ierr)
> ^
> pathf95-389 pathf90: ERROR CART, File = cart.f, Line = 34, Column = 12
> No specific match can be found for the generic subprogram call
> "MPI_CART_GET"
>
> $ mpif90 -c cartfoo.f
> $ diff cart.f cartfoo.f
> 3,4c3,4
> < C include 'mpif.h'
> < use mpi;
> ---
> > include 'mpif.h'
> > C use mpi;
> $
>
> From the googling I've done it seems like "use mpi" is preferred[1].
> I've made sure that my $LD_LIBRARY_PATH has the directory that
> MPI.mod is in.
>
> Scott
> --------
> [1] http://www.mpi-forum.org/docs/mpi-20-html/node243.htm
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users

-- 
Jeff Squyres
Cisco Systems