[MPI3 Fortran] [Mpi-comments] MPI 3.0:Fortran 2008 interface - issue with the LOGICAL kind

Tobias Burnus burnus at net-b.de
Fri Mar 15 14:09:49 CDT 2013


Am 15.03.2013 19:45, schrieb N.M. Maclaren:
> On Mar 15 2013, Hubert Ritzdorf wrote:
>>
>> I'm still developing MPI and I'm also implementing the mpi_f08 module.
>> My concern in connection with BIND(C) are the routines which use
>> character strings (for example MPI_Error_string()).. My Intel 
>> compiler aborts the compilation for these functions with
>>
>> A character dummy argument with length other than 1 is not interoperable
> Ugh.  That needs looking into.  They can be mapped to lengths of 1
> using sequence association, of course.

My understanding is:
a) Fortran 2003 allows character(len=1,kind=c_char) with Bind(C), which 
interoperates with "char *". (And sequence association can be used.)
b) Fortran 2008 allows character(len=<const-expr>)
c) TS 29113 also allows character(len=*) and character(len=:) - however, 
in that case, the TS 29113 array descriptor is used - instead of passing 
the data directly.

To (a): See 15.2.1.
To (b): See 15.3.5.
To (c): See TS 29113, 8.7 (6)(b) and the paragraph after (6)(d).

Thus, Intel's error message is in line with Fortran 2003. However, 
MPI_F08 requires Fortran 2008 plus TS 29113. In case of 
MPI_ERROR_STRING, the F2008+TS29113 interface uses 
CHARACTER(LEN=MPI_MAX_ERROR_STRING), hence, Fortran 2008's support is 
sufficient and no TS 29113 feature is required.

>> What's about future developments in C and Fortran ? May they generate 
>> new problems for BIND(C) or less problems (i.e. is there a 
>> coordinated standardization effort between Fortran and C in order to 
>> reduce the interoperability problems) ?
>
> They have already generated massive new problems for interoperability,
> not merely between Fortran and C, but between C++ and C. 

Do you suggest to add BIND(C++extern-C) to Fortran? That is 
compatibility with C++'s 'extern "C" {'?

Tobias



More information about the mpiwg-fortran mailing list