(j3.2006) MPI usage problems in Fortran
Craig Rasmussen
crasmussen
Wed Mar 19 11:27:04 EDT 2008
On Mar 18, 2008, at 4:17 PM, Aleksandar Donev wrote:
> On Tuesday 18 March 2008 15:04, Craig Rasmussen wrote:
>> Plus if I declare a dummy to have the target
>> attribute, the actual argument need not have the target attribute so
>> the user simply won't add it. I want these errors to be caught at
>> compiler time.
> That's exactly my "beef" with asynchronous. There are no rules or even
> specifics about the matching of the attribute across argument
> association.
> Why don't you write the code (including an explicit interface for
> MPI_Isend!)
> with ASYNCHRONOUS and then I can comment on what the standard (in
> my reading)
> actually says/guarantees about it.
>
Fair enough.
interface
function MPI_Isend(buf, count, datatype, &
dest, tag, comm, request) BIND(C,
name="MPI_Isend") result(err)
use, intrinsic :: ISO_C_BINDING
import :: MPI_HANDLE
implicit none
type(C_PTR), value, asynchronous, intent(in) :: buf ! LEAD
to compile error about volatile and C527
integer(C_INT), value, intent(in) :: count
type(MPI_HANDLE), value, intent(in) :: datatype
integer(C_INT), value, intent(in) :: dest
integer(C_INT), value, intent(in) :: tag
type(MPI_HANDLE), value, intent(in) :: comm
type(MPI_HANDLE), intent(out) :: request
integer(C_INT) :: err
end function MPI_Isend
end interface
use, intrinsic :: ISO_C_BINDING
use MPI3
type(MPI_HANDLE) :: request
integer, asynchronous :: buf(10)
integer(C_INT) :: err
err = MPI_Isend(C_LOC(buf), 10, MPI_INTEGER, 1, 1, MPI_COMM_WORLD,
request)
end
There are three problems with this as I see it:
1. VALUE and SYNCHRONOUS lead to a compile error (is this correct?)
2. buf doesn't have the TARGET attribute --- so change C_LOC to allow
ASYNCHRONOUS attributes as well
3. How long is buf tainted as Bill suggests? Let's say within the
scope of the variable and it is the users responsibility to add
ASYNCHRONOUS if tainted beyond the scope of the variable (argument
association).
Regards,
Craig
More information about the J3
mailing list