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

Better Cython for `seismic.ttime2d` #62

merged 5 commits into from Sep 23, 2013


None yet
1 participant

leouieda commented Sep 22, 2013

Updated the Cython code of the straight ray travel-time calculation.
It now uses some memoryviews instead of lists and inlined cdef
functions instead of lambdas. The result: > 300x speed up!
And that is when comparing the old parallel code with a serial run
of the new code.

In short, Cython rocks.

leouieda added some commits Sep 22, 2013

Better Cython in seismic.tttime2d
Replaced lists for memoryviews of numpy arrays.
Replaced lambdas for an inlined cdef function.
General speed up of 300x. Yeah. My old code sucked.
Renamed _cttime2d.pyx to _ttime2d.pyx
Just to follow the new name convention for Cython modules.
Doesn't really make sense to have a python alternative to many modules
because they wouldn't run in a reasonable amount of time.
So modules that have no alternative _*.py module don't need the 'c' in
the beginning.
Removed parallel fwd modeling from srtomo recipes
Don't need it because of new speedups.
It's not longer a bottleneck as the serial version is 300x faster than
the old parallel version.
Updated changelog
Included entry on speedup of seismic.ttime2d
Fixed wrong link tag in seismic.ttime2d docs
It read fatiando_seismic_ttime. Missing the 2d

leouieda added a commit that referenced this pull request Sep 23, 2013

Merge pull request #62 from leouieda/traveltime
Better Cython for `seismic.ttime2d`

@leouieda leouieda merged commit f5b38dd into master Sep 23, 2013

1 check passed

default The Travis CI build passed

@leouieda leouieda deleted the traveltime branch Sep 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment