-
Notifications
You must be signed in to change notification settings - Fork 7
General Case #67
Comments
From @ggorman on March 10, 2016 22:25 Its not clear at this point what you mean by "this kind of analysis"
Yes - relocate.. |
Ok, I think completely switching to numpy arrays would invalidate any previous benchmarking results and possibly impact performance detrimentally, since one of our main tricks is that we own the allocation and enforce alignment. That being said I would very much like to be able to interface with native numpy data structures, since it would solve most of the points raised by @navjotk above. This is why I advocate for the introduction of some form of opaque data structures that can:
Another side to this is that the current code, since it completely absorbs any data handling by writing everything into a single .cpp file, is very limited in the way it interacts with the enclosing Python world. This is due to the previous requirement of having to generate standalone compilable propagator models, and I do believe this still holds (@ggorman does it?). Now that we want to interact with numpy directly we should clarify what the Python interface looks like, while maintaining the standalone option. |
I am not sure I got everything but here are a few things 1 . True velocity cannot be a function, it is usually a user provided array that will be updated and modify in the outer loop, so I think it has to be passed from python 2 . The same way as the velocity, it usually user provided as a file (for real data) 3 . The current boundary condition in my notebooks are really bad, It is just there to show it doesn't have to break the workflow (adjoint,gradient) if implemented correctly. The implementation I have in my own code is independent of the kernel (acoustic, elastic, anisotropic) it is just a bit trickier to write so I went for simple. So in practice it can be hard coded within the generated code without the need for a librairy of damping kernels. |
@mlange05 I haven't looked at your code, but could you not wrap the memory you allocate into a NumPy array the way PyOP2 does it and get the best of both worlds? |
@kynan Yes you are right, in the base case that is exactly what we would do. Our code is currently still an almost completely self-contained C model, but this can be done with only little modifications. My comments were more aimed at later potential optimisations, where we might change the underlying data layout to enforce vectorisation across multiple arrays, at which point we require meta data to be associated with the arrays. Essentially I'm advocating for an Opesci-specific class equivalent to |
From @navjotk on March 10, 2016 21:16
@ggorman @mlange05 I have some doubts about how the general case might look for running this sort of analysis using opesci.
Edit: After posting it I realise that this question is more related to the Opesci-fd repository than this one. Remove and repost?
Copied from original issue: devitocodes/notebooks#7
The text was updated successfully, but these errors were encountered: