Re: [f2py] "natural" Fortran calling conventions?
Thomas Breuel <[email protected]>
| Newsgroups | gmane.comp.python.f2py.user |
|---|---|
| Message-ID | <[email protected]> |
I just wanted to explain that I realize that f2py is a volunteer effort, and I'm not asking for other people to implement this; I just wanted to be clear about what our needs are because I think if people think about it, they may realize that intent(natural) might be a useful feature for them as well. That is, although it's been an easy solution for calling code in Fortran, I've found it to be tricky tuning my code using f2py to be high performance and maintaining semantics for the above reasons: arrays always seem to end up in the wrong storage order either in Python or in Fortran. I guess one solution would be for me to start modifying f2py myself, but that looks tricky, and it's unclear to me whether any changes would be picked up anyway. As an alternative, I'm looking at using Python's clib for calling Fortran code with "natural" order (i.e., reversed indexes). That's a bit more work defining each function, but it's clear that there won't be any conversions. I'm also looking into creating GFortran array descriptors on the fly to allow calling with Fortran 95 arrays. There are pluses and minuses to such an approach. Tom