-
Notifications
You must be signed in to change notification settings - Fork 246
Optimized time_substitution method #62
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
Conversation
devito/propagator.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please use SymPy's built-in generator traversals sympy.preorder_traversal instead of actually recursing? That should make things even faster.
|
Yes, this looks convincing. Can we get an indication of how much faster this is? I would like @navjotk to have a second look at this, but otherwise I'm happy. |
|
On my machine @mloubout example (https://github.com/opesci/devito/blob/Zhang_tti/examples/tti_example2D.py) is ~6 times faster with this change |
|
looks reasonable to me |
|
The change looks good on visual inspection. However, this bit of the code is not currently being tested (I believe). I think now is as good a time as any to add a test for this. Here's my suggestion for the test: Run a forward propagation with |
cca351f to
1d25b64
Compare
1d25b64 to
2d99698
Compare
2d99698 to
ca2612a
Compare
|
Yes. Now that we have the test in place, we are good to go on this. Merging. |
Changed the time_substitutions method to build a dictionary of changes to be made by Sympy.subs before calling it instead of calling subs every time as suggested by @mlange05