Python Task Force Home
bob, shaines, bill, daniel, lomask, nick, shan, paul
Next meeting: Wed, July 22, 10 AM
Robustness:
F2py tries to be smarter than it should and I did not find a way to switch that off. I.e., if you pass to it a vector V of length n, and the number "n" itself (F-77 style), it will recognize that n=len(V) and the resulting subroutine will only take as input V itself. And other such hacks, of which the author must be quite proud of. They work most of the time, but this being software written by a human being, from time to time it will fail. As a result, you will have 30-year old, 100% reliable f77 legacy code (lapack, etc), behaving unpredictably.
Current reliability:
F90/95 not fully implemented (i.e. does not recognize derived types). F2py is also under continuous development which means current and future bugs, which mean lost productivity on our side.
Long-term reliability:
F2py is also maintained by a single man - a Mechanical Engineering researcher at Tallin Technical University, Estonia. With python itself slowly evolving, I can see a day in which the f2py guy finds something else to do, f2py ceases to work and all our stuff becomes totally non-reproducible.
Cost:
To make things work reasonably well, it requires interfaces to be auto generated and hand modified for existing f90 code, or for f2py directives to be embedded in the fortran code. It won't be as simple as only calling a f90 subroutine from a python driver and have an automatic command generate the interface. Given the large amount of old report code that we have, this means thousands of cummulated man-hours.
While Python itself has other capabilities worth exploring, F2py does not seem to match the current needs of SEP. The cause is not the concept behind f2py itself, but the implementation. For coarse-grained parallelization I would highly recommend replacing MPI with a python "makefile" calling Fortran-compiled ".x" executables, but not writing a python driver with fortran subroutines.
|
Department of Geophysics Stanford University |
|