-
Notifications
You must be signed in to change notification settings - Fork 31
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
add fortran interface for mount and unmount #288
Conversation
@MichaelBrim , I dropped the MPI wrapper portion of this PR to just provide the Fortran interface. |
Example Fortran code (named test_write.F):
Build
Run
|
Last I tried, I could see that the fortran interface was successfully passing control from UNIFYCR_MOUNT() to unifycr_mount() and that the mount was returning with success. However, it then failed to intercept the Fortran open() call, which of course led to an I/O error. |
@MichaelBrim , would you mind taking a stab with this one? My hope is that we can use gotcha to still pick up Fortran as it calls down into the C I/O libraries so that we don't have to add a separate set I/O wrappers for the Fortran calls. |
@adammoody sure I'll take a stab. I already managed to figure out how to add fortran build support to our examples Makefile.am. Any objection to adding your simple test program as a real example? |
Great, thanks! Sure, go ahead and add this example. I don't know whether this is the real way Fortran programs do I/O, so I can't vouch for how legit it is. |
@adammoody On Summitdev, I see an error about failing to wrap stat(), but the rest of the I/O calls are successfully wrapped and executed. There's a segfault after unmount at the end of the program, but that's consistent across all examples using libunifycr_gotcha. |
4e9b9d6
to
27a0272
Compare
Also adds configure support for fortran, and a writeread example written in fortran. Note: checkpatch doesn't understand Fortran code TEST_CHECKPATCH_SKIP_FILES="client/src/unifycrf.h" TEST_CHECKPATCH_SKIP_FILES+=",client/src/unifycrf.c" TEST_CHECKPATCH_SKIP_FILES+=",examples/src/writeread.f90"
First, I found that I had a bug in Fortran example. I was not setting the writeunit to a valid value. Setting this to "mynod" works. After fixing that, with the Intel compiler, I get the following:
Good news is that I was able to see that this was in fact running through our I/O wrappers. The for_open was eventually calling into our open64 wrapper. It's possible that the Intel Fortran I/O library may not like the out-of-range file descriptor we are returning. |
Runs without error when using gfortran. The stack trace in open here goes: OPEN --> st_open --> new_unit --> open_external --> open wrapper Our open wrapper returns the same file descriptor value here. The gfortran example appears to work. |
Given that this works for gfortran, we could merge it since it will be useful to some people. I'll open an issue to track the Intel compiler problem. |
Issue to track Intel error: #300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch on the common headers too
New files unifycrf.{c,h} define Fortran wrappers to call unifycr_mount/unmount calls.
Description
I have some simple test cases not included in this current PR. I can see that UNIFYCR_MOUNT from Fortran calls unifycr_mount just fine. However, my Fortran call to open() is not intercepted by our open wrapper as I was hoping for. Will need to figure out what's going on there.
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist: