How does Python treat commons in fortran code?
Hello all This afternoon I introduced Python to my boss and the rest of my colleagues in the CFD laboratory (universidad politecnica de madrid, school of aeronautics). My boss wanted to know if it would be helpful to manage a quite complex parallel algorithm while keeping its performance. He has a long background in high performance computing, mainly in fortran. He asked me something i could not answer, in fact I just have no clue about it. We have some very tuned parallel subroutines to perform FFTs that are written in fortran 77; they have lots of _common_ structures that are used to manage large chunks of memory. Those subroutines have shown to be scalable to 2000 processors so it is very important that they perform as expected. Of course our intention is to use them and I had the idea of building a wrapper using f2py. His question was. ¿How does ctypes or f2py handle the _common_ structures present in fortran 77? ¿Are all they allocated at load? ¿Do they work exactly as they were called from a fortran executable and the main program is aware of all the _commons_ and allocates the storage when it is asked for? I told him that I see no difference between the python interpreter and any other executable but my knowledge of python is not that deep. I could not explain him successfully exactly what is stored in the interpreter stack and what is not neither. He has been programming for more than 40 years and I could not get him much into object oriented programing, however he found python+numpy+scipy a very promising tool. guillem
Guillem Borrell i Nogueras wrote: ¿How does ctypes or f2py handle the _common_ structures
present in fortran 77?
I think that's covered (for f2py) by this: http://cens.ioc.ee/projects/f2py2e/usersguide/#common-blocks ¿Are all they allocated at load? ¿Do they work
exactly as they were called from a fortran executable and the main program is aware of all the _commons_ and allocates the storage when it is asked for?
I'm pretty sure that's the case.
He has been programming for more than 40 years and I could not get him much into object oriented programing, however he found python+numpy+scipy a very promising tool.
Good news -- you could save a lot of time by using FORTRAN only for what it's good for: the number crunching. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov
participants (2)
-
Christopher Barker
-
Guillem Borrell i Nogueras