-
Notifications
You must be signed in to change notification settings - Fork 8
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
Comments
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. |
OK, so not worth pursuing (unless someone really wants to avoid installing Cython). |
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. |
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?
The text was updated successfully, but these errors were encountered: