Skip to content
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

Switch from Cython to f2py #4

Open
rwest opened this issue Apr 25, 2012 · 3 comments
Open

Switch from Cython to f2py #4

rwest opened this issue Apr 25, 2012 · 3 comments

Comments

@rwest
Copy link
Contributor

rwest commented Apr 25, 2012

I notice you have a bunch of work on an f2py branch, that uses numpy's f2py instead of Cython, and was wondering what the status is? I note the last commit message 07ed119 mentions a possible speed penalty for cythonized residual functions?

@jwallen
Copy link
Owner

jwallen commented Apr 25, 2012

If I remember right, the problem was that DASSL makes many calls to the residual function per time step in order to determine the appropriate step size. The change from Cython to f2py caused this to become a slow Python call instead of a faster Cython call. Even if the residual function is Cythonized, the f2py version still needs to pass through the Python layer to get from Fortran to the Cythonized residual, which the Cython version avoids. This might not be an issue if the overhead of the Python call is small compared to the time spent evaluating the residual itself, but that was not the case for the simple test case I was using at the time. Presumably it would be more true in RMG-Py, but I don't think I ever got that far.

@rwest
Copy link
Contributor Author

rwest commented Apr 25, 2012

OK, so not worth pursuing (unless someone really wants to avoid installing Cython).
Good to know. Thanks.

@rwest
Copy link
Contributor Author

rwest commented Apr 25, 2012

I'll also note in this comment thread that if anyone does play around with this, be sure to clean out your python site_packages folder during and after your playing - the two different versions leave incompatible things lying around that could cause you a world of confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants