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
memcheck and CEED_STRIDES_BACKEND #1460
Comments
Really, the issue is that
That isn't the best explanation though. We should make it clearer (though people don't always read the documentation carefully to catch all implications of what's in there). Technically, the L-vector ordering is supposed to be consistent across backends when using Making the |
What I did is pull out the array as |
Woops, misremembered and mispoke above. The strides specify the L-vector ordering, so Taking an ordering from one backend and handing it off to a different backend is specifically a usage that I don't think taking the pointer out of the But, I think now that actually changing the meaning of |
I think we could forbid host access to such a vector (using an extra flag). Most vectors transparently mirror, but we could say it's invalid to do that on these L-vectors. We could possibly do something like that on the host too, but that would require that backend access use an internal interface to bypass that check. |
Ok, I at least have a way to make the problem seen, though it doesn't provide an explanation as to what is happening. It would be handy for #1454 to have some sort of internal API for bypassing some checks when accessing vector memory spaces. I haven't worked through exactly what I need, but some deeper replication of the dual memory spaces we have for device backends would have caught the small vector issues we had in the deal.II example when first testing on HIP. |
I’ve done a similar thing, but used |
CEED_STRIDES_BACKEND means that the backend picks the L-vector ordering. It doesn't guarantee that the L-vector is ordered identical to the E-vector. It's really intended for transferring data between CeedOperater of the same backend. The guaranteed approach under the API as written would be to apply the CeedElemRestriction and then go through the E-vector. We could also add a CeedElemRestrictionGetLLayout that would provide the actual backend L-vector layout. |
Ok, I think I like my PR better now. Summary of the changes
I think this helps the memcheck backend catch some cases of misuse and offers a new function to help users muck around with the contents of the L-vector themselves. |
Ok, I've merged fixes. |
From @knepley
A couple ideas to catch this sooner:
memcheck
use a weird permutation for its backend so you can at least detect this on the host.CEED_STRIDES_BACKEND
. I think this would require extra state. It should still be possible to compute permutation-invariant things like norms.The text was updated successfully, but these errors were encountered: