[MPI3 Fortran] Please tell me I'm wrong

Aleksandar Donev donev1 at llnl.gov
Wed Dec 17 13:24:29 CST 2008


Craig,

You should read last-week's WG5 messages concerning the Interop TR 
(especially mine :-). Reinhold Bader already identified this as a 
problem. The cause of it is the *generic* interface for MPI_Recv.

If you declared the non-generic interface:

subroutine MPI_Recv(buf, count, datatype, source, tag, comm,
   status, err) real, dimension(*), intent(out)  :: buf

then you could do

 real :: message(:,:)
  call MPI_Recv(message, 2, MPI_INTEGER, 1, 1, MPI_COMM_WORLD, 
MPI_STATUS_IGNORE)

and it would work as expected. If "message" is not contiguous a copy 
in/out would occur.

There is no way to have a generic interface and use "sequence 
association" argument passing, which is what you are trying to do. That 
does indeed require help from WG5.

Best,
Aleks




More information about the mpiwg-fortran mailing list