[MPI3 Fortran] [Mpi3-tools] Comments/Questions on Fortran 08 Bindings
N.M. Maclaren
nmm1 at cam.ac.uk
Sat Jul 2 07:42:36 CDT 2011
On Jul 2 2011, Schulz, Martin wrote:
>On Jul 1, 2011, at 1:14 AM, Marc-Andre Hermanns wrote:
>>
>> However, some questions arose in the discussions that I have to admit
>> might stem from our limited knowledge of Fortran and Fortran 08 in
>> particular.
>>
>> 1) Are the Fortran handle types compatible/interchangeable with the C
>> handle types, or will c2f/f2c still have to be called?
A specification detail - i.e. it could be done, but it is not necessarily
the best solution. It's complicated.
>> 2) Just as John Mellor-Crummey commented: are there standardized
>> routines to handle the array descriptors in C and C++ which are the
>> primary languages to implement a measurement layer? If not, how to deal
>> with it? Can it be interpreted as a void*? How to compare against
>> MPI_BOTTOM?
As Steve Lionel commented in another thread, the forthcoming TR allows
the first two.
MPI_BOTTOM is a disaster on wheels, in all languages that MPI supports;
I wish that it had never been perpetrated :-(
It is so far into seriously undefined behaviour in all of Fortran, C and
C++ (i.e. undefined behaviour that CAN'T be defined without making the
language unimplementable on at least some mainstream systems) that the
best that can be done is to leave it to the implementation-specific
release notes. Sorry, but that's reality ....
>> 3) If the Fortran 08-C/C++ interface for the descriptors is not
>> available. Does it mean I have to implement the wrappers in Fortran?
>> Didn't we just agree that MPI_T does not need Fortran bindings? In this
>> case it would need them again, right?
>>
>> 4) How is the support for '_f' for just the MPI functions to be done in
>> the Fortran compiler? Won't it be mangled to '_f_' or '_f__' again? What
>> are the actual benefits of this '_f'?
These are specification details again, rather than being Fortran-specific.
>> 5) Why deviate from the existing MPI_STATUS_IGNORE in favor of inflating
>> the API? Is there a real need for it?
It's a lot cleaner and more user-friendly. That's all. Either works.
>> I can easily imagine users of the Fortran 08 interface, while fixing
>> some older MPI code written with the Fortran 77 interface, to get
>> confused about the (in 77) non-optional status parameter.
I teach a MPI course that covers Fortran, C and C++ simultaneously,
and will include both Fortran 77 and the new interface when it appears.
I don't see a major problem :-)
Seriously. There's no substitute for checking the exact specifications
when modifying code using a language or interface that you don't normally
use. It's always worth getting into the habit of not making assumptions
about similarity.
>> 7) Along the lines of Todd's comment on function overloading: It would
>> be great if the _f08 and _f09_nostatus could just be the same
>> measurement wrapper, to keep maintenance of measurement code to a
>> minimum.
Yes, agreed, and not just for that.
Regards,
Nick Maclaren.
More information about the mpiwg-fortran
mailing list