[mpiwg-tools] Fwd: [mpi-forum/mpi-issues] MPI RMA integer interfaces for AINT arguments (Issue #528)
Joachim Protze
protze at itc.rwth-aachen.de
Mon Nov 29 03:13:52 CST 2021
Hi tools folks,
We should have an eye on this issue. Has this the potential to break
PMPI Wrappers?
Best
Joachim
-------- Weitergeleitete Nachricht --------
Problem
RMA absolutely did the right thing with |MPI_Aint| size and displacement
arguments.
In C, it is no problem to pass 32b integers to these arguments when AINT
is 64b, because C type promotion rules just work.
In Fortran, I cannot do this, because an integer literal is not
compatible with an AINT argument. I find it tedious to have to declare a
variable just for this, or to explicitly cast with
|integer(100,MPI_ADDRESS_KIND)|.
Fortran
! USE mpi_f08
! MPI_Win_allocate(size, disp_unit, info, comm, baseptr, win, ierror)
! USE,INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR
!INTEGER(KIND=MPI_ADDRESS_KIND),INTENT(IN):: size
!INTEGER,INTENT(IN):: disp_unit
! TYPE(MPI_Info),INTENT(IN):: info
! TYPE(MPI_Comm),INTENT(IN):: comm
! TYPE(C_PTR),INTENT(OUT):: baseptr
! TYPE(MPI_Win),INTENT(OUT):: win
!INTEGER, OPTIONAL,INTENT(OUT):: ierror
program main
use iso_fortran_env
use mpi_f08
implicit none
integer(kind=MPI_ADDRESS_KIND):: as= 100
type(c_ptr):: XA
type(MPI_Win):: WA
TYPE(MPI_Comm):: comm= MPI_COMM_WORLD
call MPI_Win_allocate(as,1, MPI_INFO_NULL, comm, XA, WA)
call MPI_Win_allocate(100,1, MPI_INFO_NULL, comm, XA, WA)
end program main
% mpifort y.F90
y.F90:20:60:
20| call MPI_Win_allocate(100, 1, MPI_INFO_NULL, comm, XA, WA)
| 1
Error: There is no specific subroutinefor the generic'mpi_win_allocate'
at (1)
C
#include <mpi.h>
int main(void)
{
MPI_Aint as =100;
int * XA;
MPI_Win WA;
MPI_Win_allocate(as,1, MPI_INFO_NULL, MPI_COMM_WORLD, XA, &WA);
MPI_Win_allocate(100,1, MPI_INFO_NULL, MPI_COMM_WORLD, XA, &WA);
}
% mpicc y.c&& echo SUCCESS
SUCCESS
Proposal
Use Fortran does polymorphism and add subroutine declarations for
default integer arguments.
This proposal applies not to just MPI_Win_allocate but any RMA function
that uses AINT scalar arguments.
Changes to the Text
Impact on Implementations
Impact on Users
References and Pull Requests
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<https://github.com/mpi-forum/mpi-issues/issues/528>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSKPBS5QCGKWGJ5VIPAAUDUOM5VPANCNFSM5I6R7SWQ>.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5327 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-tools/attachments/20211129/2bebd42b/attachment.p7s>
More information about the mpiwg-tools
mailing list