[MPI3 Fortran] [Mpi-comments] MPI 3.0: Fortran 2008 interface - issue with the LOGICAL kind
Bill Long
longb at cray.com
Wed Mar 20 10:01:52 CDT 2013
On 3/20/13 8:26 AM, Jeff Squyres (jsquyres) wrote:
> On Mar 20, 2013, at 6:25 AM, Bill Long <longb at cray.com> wrote:
>
>> interface !--> MPI_Test
>>
>> ! int MPI_Test(MPI_Request *request, int *flag, MPI_Status *status);
>>
>> Function MPI_Test_C( request, flag, status) &
>> BIND(C, name="MPI_Test") RESULT (res)
>> import :: C_request, c_int, MPI_Status_C
>> integer(C_request) :: request
>
> This is not correct. You cannot assume that MPI handles are integers (they're pointers in Open MPI).
This is correct for mpich. OpenMPI would evidently have a different
version. But the concept is still the same - make a correct interface
to the C library routine, however it is defined by the implementation,
and then call that from a thin Fortran wrapper that takes care of the
issues related to LOGICAL, the use of default INTEGER, and OPTIONAL
arguments.
Cheers,
Bill
>
--
Bill Long longb at cray.com
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101
More information about the mpiwg-fortran
mailing list