Discussion:
[OMPI users] more migrating to MPI_F08
Tom Rosmond
2017-03-23 17:06:20 UTC
Permalink
Hello,

Attached is a simple MPI program demonstrating a problem I have
encountered with 'MPI_Type_create_hindexed' when compiling with the
'mpi_f08' module. There are 2 blocks of code that are only different
in how the length and displacement arrays are declared. I get

indx.f90(50): error #6285: There is no matching specific subroutine for
this generic subroutine call. [MPI_TYPE_CREATE_HINDEXED]
call mpi_type_create_hindexed(lenidx,ijlena_2d,ijdispl_2d, &

for a case where the length and displacement arrays are 2-dimensional.
As far as I can find, there is nothing in the MPI-3.1 standard that
requires that these arrays be 1-dimensional. Am I missing something, or
is this a OPEN-MPI bug? I have been running successful programs with
multi-dimensional versions of these arrays for years when compiling with
'mpif.h'.

T. Rosmond
Jeff Squyres (jsquyres)
2017-03-23 17:50:33 UTC
Permalink
Actually, MPI-3.1 p90:37-45 explicitly says that the array_of_blocklengths and array_of_displacements arrays must be both 1D and of length count.

If my Fortran memory serves me correctly, I think you can pass in an array subsection if your blocklengths/displacements are part of a larger array (the compiler should be smart enough to do that without forcing a copy, when possible).

FWIW: one of the design goals of the mpi_f08 module was to bring to light previous practices that people used in their applications with mpif.h that, although they worked, probably were not really correct Fortran / worked kinda by accident. Recall that F08 is very, very strongly typed (even more so than C++). Meaning: being picky about 1D-and-a-specific-legnth is a *feature*! (yeah, it's kind of a PITA, but it really does help prevent bugs)
Post by Tom Rosmond
Hello,
Attached is a simple MPI program demonstrating a problem I have encountered with 'MPI_Type_create_hindexed' when compiling with the 'mpi_f08' module. There are 2 blocks of code that are only different in how the length and displacement arrays are declared. I get
indx.f90(50): error #6285: There is no matching specific subroutine for this generic subroutine call. [MPI_TYPE_CREATE_HINDEXED]
call mpi_type_create_hindexed(lenidx,ijlena_2d,ijdispl_2d, &
for a case where the length and displacement arrays are 2-dimensional. As far as I can find, there is nothing in the MPI-3.1 standard that requires that these arrays be 1-dimensional. Am I missing something, or is this a OPEN-MPI bug? I have been running successful programs with multi-dimensional versions of these arrays for years when compiling with 'mpif.h'.
T. Rosmond
<indx.f90>_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
--
Jeff Squyres
***@cisco.com
Tom Rosmond
2017-03-23 19:20:18 UTC
Permalink
Thanks, Jeff,

I had stared at those lines many times and it didn't register that
(count) was explicitly specifying only 1-D is allowed. Pretty cryptic.
I wonder how many other fortran programmers will be bit by this?

T. Rosmond
Post by Jeff Squyres (jsquyres)
Actually, MPI-3.1 p90:37-45 explicitly says that the array_of_blocklengths and array_of_displacements arrays must be both 1D and of length count.
If my Fortran memory serves me correctly, I think you can pass in an array subsection if your blocklengths/displacements are part of a larger array (the compiler should be smart enough to do that without forcing a copy, when possible).
FWIW: one of the design goals of the mpi_f08 module was to bring to light previous practices that people used in their applications with mpif.h that, although they worked, probably were not really correct Fortran / worked kinda by accident. Recall that F08 is very, very strongly typed (even more so than C++). Meaning: being picky about 1D-and-a-specific-legnth is a *feature*! (yeah, it's kind of a PITA, but it really does help prevent bugs)
Post by Tom Rosmond
Hello,
Attached is a simple MPI program demonstrating a problem I have encountered with 'MPI_Type_create_hindexed' when compiling with the 'mpi_f08' module. There are 2 blocks of code that are only different in how the length and displacement arrays are declared. I get
indx.f90(50): error #6285: There is no matching specific subroutine for this generic subroutine call. [MPI_TYPE_CREATE_HINDEXED]
call mpi_type_create_hindexed(lenidx,ijlena_2d,ijdispl_2d, &
for a case where the length and displacement arrays are 2-dimensional. As far as I can find, there is nothing in the MPI-3.1 standard that requires that these arrays be 1-dimensional. Am I missing something, or is this a OPEN-MPI bug? I have been running successful programs with multi-dimensional versions of these arrays for years when compiling with 'mpif.h'.
T. Rosmond
<indx.f90>_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
Jeff Squyres (jsquyres)
2017-03-23 19:33:14 UTC
Permalink
I had stared at those lines many times and it didn't register that (count) was explicitly specifying only 1-D is allowed. Pretty cryptic. I wonder how many other fortran programmers will be bit by this?
My understanding is that that is standard Fortran notation (e.g., it's how we declare them in the mpi_f08 module in Open MPI).

Yes, it might be a bit cryptic for the uninitiated, but -- for better or for worse -- that's how the language is defined.
--
Jeff Squyres
***@cisco.com
Loading...