Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] MPI_STARTALL doesn't compile with mpif90 and a multi-dimensional request array
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2010-10-15 10:50:51

On Oct 15, 2010, at 12:17 AM, Gus Correa wrote:

> I am having trouble compiling code with MPI_STARTALL using
> OpenMPI 1.4.2 mpif90 built with gcc (4.1.2) and Intel ifort (10.1.017),
> when the array of requests is multi-dimensional.

Right-o -- it's the strict bindings checking in F90 that's biting you.

> It gives me this error message:
> **************************
> fortcom: Error: mpiwrap_mod.F90, line 478: There is no matching specific subroutine for this generic subroutine call. [MPI_STARTALL]
> call MPI_STARTALL(nreq,req,ierr)
> ---------^
> **************************
> However, if I replace MPI_STARTALL by a loop that calls
> MPI_START repeated times, the compilation succeeds.
> I wonder if the serialization imposed by the loop may
> have some performance impact,
> or if MPI_STARTALL just implements the same type of loop.

MPI_STARTALL does do the same type of loop -- you do gain a bit of performance (depending on how big your loop is) just because there's one less function call traversal.

> Another workaround is to declare my array of requests
> as a one-dimensional assumed-size array inside my subroutine.
> The problem seems to be that MPI_STARTALL doesn't handle multi-dimensional arrays of requests.
> I can live with either workaround above,
> but is this supposed to be so?

Based on my understanding of Fortran, yes.

> I poked around on the OpenMPI code in ompi/mpi/f90/scripts
> and I found out that several OpenMPI Fortran90 subroutines
> have code to handle arrays up to rank 7 (the Fortran90 maximum),
> mostly for the send and receive buffers.

Right. Those are different buffers, though -- those are the choice buffers for sending and receiving. OMPI just gets the starting pointer and iterates through memory according to the associated count and MPI datatype.

For requests, it's an array of structures (i.e., the fortran integers are converted to their C struct counterparts). And there's a defined shape/size/whatever-the-right-fortran-term-is for that.

> I guess it would be nice if all OpenMPI
> subroutines in the Fortran90 bindings would accept
> arrays of rank up to 7 on all of their array dummy arguments.
> Assuming this doesn't violate the MPI standard, of course.
> This would allow more flexibility when writing MPI programs
> in Fortran90.

>From my understanding of Fortran, that would violate the MPI spec.

You could, I think, use an array subsection when you call MPI_STARALL that would give you a 1D array of integers, right?

Jeff Squyres
For corporate legal information go to: