Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Fortran 2018 ISO_Fortran_binding.h #6

Open
rouson opened this issue Oct 20, 2017 · 11 comments
Open

Support Fortran 2018 ISO_Fortran_binding.h #6

rouson opened this issue Oct 20, 2017 · 11 comments
Assignees

Comments

@rouson
Copy link
Member

rouson commented Oct 20, 2017

The draft Fortran 2015 standard defines a new C header file described as follows in Subclause 18.5.1:

"The source file ISO_Fortran_binding.h shall contain the C structure definitions, typedef declarations, macro definitions, and function prototypes specified in subclauses 18.5.2 to 18.5.5. The definitions and declarations in ISO_Fortran_binding.h can be used by a C function to interpret and manipulate a C descriptor. These provide a means to specify a C prototype that interoperates with a Fortran interface that has a non-interoperable dummy variable (18.3.7)."

Gfortran developer Paul Richard Thomas recently suggested that this header can be implemented without touching other parts of the gfortran compiler, which is an intriguing possibility. Rather than changing the gfortran descriptors, for example, the header can make use of functions that take fortran's native descriptors as input and return the standard descriptors as output. This issue is being created for discussion by those interested in this feature and/or in contributing to this feature.

@rouson rouson self-assigned this Oct 20, 2017
@rouson
Copy link
Member Author

rouson commented Oct 20, 2017

@zbeekman this could also be a good project for someone interested in learning more C. ;) For now, I'm hoping to find some time to work on this myself and @sfilipone (not sure why tagging him doesn't work here) has offered to help at least with testing at a minimum.

@zbeekman
Copy link

zbeekman commented Oct 20, 2017

strange that @sfilippone doesn't work... did he change his account or something?

EDIT: oh, nm, it looks like @rouson had a typo.

@zbeekman zbeekman assigned zbeekman and rouson and unassigned rouson Oct 20, 2017
@rouson
Copy link
Member Author

rouson commented Oct 21, 2017

I just created an issue-#6-iso-fortran-binding-h branch with a start on iso_fortran_binding.h. It's incomplete and probably even incorrect in a few places, but it would be good to get some initial feedback from @jerryd regarding style, e.g., regarding the format and verbosity of the comments.

@sfilippone
Copy link

sfilippone commented Oct 21, 2017 via email

@jerryd
Copy link

jerryd commented Oct 21, 2017

Need s space between function names and first left paren. Tabbing should be two space indents, 8 spaces converted to tabs. (My editor just does that for me.) Lines should not exceed 80 characters and manually wrapped and indented appropriatly as needed. Comments end with a period followed by two spaces before the closing */

I will clone this down to my workstation and edit the file if you would like. Let me know.

@rouson
Copy link
Member Author

rouson commented Oct 21, 2017 via email

@rouson rouson changed the title Support Fortran 2015 iso_fortran_binding.h Support Fortran 2018 iso_fortran_binding.h Mar 30, 2018
@zbeekman
Copy link

Brief recap of pertinent notes from call on 03/30/2018:

It would be useful to have an example of using the mpi-f08 module @scrasmussen has agreed to kindly help us by providing simple examples with send and receives, or some form of communication.

@scrasmussen
Copy link

scrasmussen commented Mar 30, 2018

@rouson, in f08_mpi.tar.gz is the send receive example using mpi_f08. The mpi_f08 module doesn't change much, just a few types.

Earlier in the call I remembered a few things incorrectly, I believe Intel's compiler has ISO_Fortran_binding.h, and as you can see, GNU doesn't. OpenMPI has a mpi_f08 module. Though I see it in MPICH's codebase, the MPICH version I installed with OpenCoarray's install.sh didn't seem to have it. I'm looking further into this.

If you have any questions please ask! I've spent a fair deal of time looking at these issues since I was writing a source to source compiler to generate wrappers to deal with C and Fortran interoperability for MPI.

@rouson
Copy link
Member Author

rouson commented Apr 11, 2018

@soren Thanks for attaching the mpi_f08 example. One confusing thing is the reference to MPI_COMM_WORLD followed by the subsequent reference to the declared bu uninitialized comm. Let's talk about this example during Friday's call.

@soren
Copy link

soren commented Apr 11, 2018

Hey, @rouson, you wanted to ping @scrasmussen, not me ;-)

@rouson rouson changed the title Support Fortran 2018 iso_fortran_binding.h Support Fortran 2018 ISO_Fortran_binding.h Apr 11, 2018
@rouson
Copy link
Member Author

rouson commented Apr 13, 2018

@jerryd I just pushed a commit to the issue-#6-iso-fortran-binding-h branch of this fork putting the current versions of ISO_Fortran_binding.h and ISO_Fortran_binding.c in the libgfortran/runtime subdirectory as we discussed. If you have a moment to edit the GCC build system on the same branch or submit a pull request against the branch to incorporate the functions into libgfortran and install the header file, I would greatly appreciate it. That would make it easiest to start testing whether MPICH will find and recognize the file and therefore build the mpi_f08 module that the MPI standard describes. Currently, MPICH won't build mpi_f08 because it doesn't find ISO_Fortran_binding.h. Thanks for any assistance you can offer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants