interface
subroutine mpi_wait( req, status, ierror )
optional :: status
integer req, ierror
integer status(4)
end subroutine
end interface
The following test program also works
--- start example
subroutine mpi_wait( req, status, ierror )
OPTIONAL:: status
Integer req, status(4), ierror
if (present(status)) then
print *, 'status present'
else
print *, 'no status'
endif
req = 0
ierror = 0
return
end
program main
integer a, ierr
integer status(4)
interface
subroutine mpi_wait( req, status, ierror )
optional :: status
integer req, ierror
integer status(4)
end subroutine
end interface
call mpi_wait( a, status, ierr )
call mpi_wait( a, ierror=ierr )
end
--- end example
Note that if we make ierror optional as well, you can do "call mpi_wait(a)".
I suggest that we eliminate MPI_STATUS_IGNORE and MPI_STATUS_IGNORE from the
Fortran bindings, and make use of the languages "optional" feature. This
works most easily only for the last argument in the argument list (except for
ierror). Note that we could even eliminate MPI_BOTTOM if we forced user to
use the argument keyword approach for this case.
We could even eliminate MPI_STATUS_IGNORE from C by forcing a varargs
binding...
Bill