Some answers inline. ----- Original Message -----
From: "Marc-Andre Hermanns" <[email protected]> To: [email protected] Sent: Tuesday, June 4, 2013 5:43:00 PM Subject: [Mpi3-tools] Fortran Wrappers in Fortran? Dear all,
with the Fortran wrappers discussion taking off tomorrow, I wanted to explicitly ask about something that has spooked around in my head for some time, and I am unsure whether this is viable or not.
It does not solve the name mangling is general, but maybe it is an easy approach in some cases, such as simple preinstrumented libraries.
The new Fortran interface comes only with Fortran 2008+ compilers, because older compilers don't know all the new magic that is necessary to make it work, right? This would mean that the compiler also has the C interface capabilities of Fortran 2003.
The new mpi_f08 module does not require Fortran 2008 + TS 29113. Preliminary implementations (with MPI_SUBARRAYS_SUPPORTED=.FALSE.) are possible with Fortran 2003. Same is valid for the new requirements on the mpi module (e.g., compile time arument checking).
Performance tools like Scalasca or Score-P, usually call straight-forward C routines in the wrappers to generate the measurement data and maybe do some simple computations in between. Usually, they just pass the initial parameters through.
As most of our wrapper code is generated anyway. Would it be a viable approach to 1) generate a C interface definition for the parts of the measurement system in question to call the measurement routines from Fortran, and 2) generate Fortran wrappers that directly call the measurement system through the generated interface and then call the Fortran version of "PMPI_Func"?
Would the Fortran compiler then take care of all the name mangling issues in this case?
Using Fortran wrappers calling the Fortran PMPI routines would also make handle conversion (to call the C MPI wrapper) unnecessary and could save overhead.
I'm not sure whether I understood your approach. For me, it looks like that you want to go a similar way as Bill Long who has Fortran-written wrappers that directly call the MPI C routines. For this, he defined a module with the Interfaces of the MPI C routines in Fortran 2003 syntax with BIND(C). He tries to get his Fortran MPI wrappers fully portable, though the tools intercept only at the C Interface. See also the Details in c20.comments.txt attached to a previous mail. Best regards Rolf
Cheers, Marc-Andre -- Marc-Andre Hermanns German Research School for Simulation Sciences GmbH c/o Laboratory for Parallel Programming 52062 Aachen | Germany
Tel +49 241 80 99753 Fax +49 241 80 6 99753 Web www.grs-sim.de
Members: Forschungszentrum Jülich GmbH | RWTH Aachen University Registered in the commercial register of the local court of Düren (Amtsgericht Düren) under registration number HRB 5268 Registered office: Jülich Executive board: Prof. Marek Behr, Ph.D | Prof. Dr. Sebastian M. Schmidt _______________________________________________ Mpi3-tools mailing list [email protected] http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-tools
-- Dr. Rolf Rabenseifner . . . . . . . . . .. email [email protected] High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530 University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832 Head of Dpmt Parallel Computing . . . www.hlrs.de/people/rabenseifner Nobelstr. 19, D-70550 Stuttgart, Germany . . . . (Office: Room 1.307)