Fortran problems with IBM XLF
Testing the writeread-ftn example with IBM XLF on Summitdev has revealed a few problems.
First, we need to use -qextname compiler option to get the gfortran-style naming where you append an underscore to the C interface to make it visible to Fortran code. Without the option, it was calling our existing C interface and the arguments didn't match up, leading to weird behavior and failures. To remedy this, we should also consider using a different function name for the Fortran interface, such as unifycr_mount_ftn
Second, XLF errors out when you use 0 as the writeunit, which it reserves for stderr. I worked around that by adding 10 to the rank.
Third, the open fails with the following error message:
../../../../examples/src/writeread.f90", line 49: 1525-014 The I/O operation on unit 10 cannot be completed because an errno value of 5 (Input/output error) was received while opening the file. The program will stop.
It appears that it's successfully wrapping the open, but something is going wrong in Unify.
I was wrong, our open wrapper is not being called. Looking at the disassembly, seems it's really calling a custom xlfBeginIO function, and similarly uses custom functions for write and close.