-
Notifications
You must be signed in to change notification settings - Fork 44
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
dash::Matrix local column and row access and copy #3
Comments
Created branch bug-3-mat-row-copy |
I have played around with the test and it seems that the number of elements to be copied is incorrectly determine. dash::copy reports that 381 will be copied:
The number of elements in a row should be 20 and I have verified that the target vector is large enough to hold 20 elements. However, I am not sure where the number of 381 comes from... |
Thank you, probably a bug in |
The defect could be easily reproduced and has been added as test case |
@devreal Please close this issue after review. |
My test case for copying a row succeeds now. However, trying to copy a column the same way still does not wok. Consider the following example (similar to the example above):
Here is the log and the valgrind message:
The size of the column should be 20, not 181. Sorry for not making the column example explicit in my first post. |
Yaaah, I'm kinda not surprised that this fails, there are commits missing. Hold on ... |
Ah, no, it's a packing / strided copy issue. Will add more info later today. |
So, it's trickier than that.
So, good news is that it's supposed to fail, but an error message would be more polite than, say, a core dump. But I think there are some members in our team at LMU that can hardly wait to prove their grit and EDIT: Ah, actually this is a feature in the stencil / halo functions. @dhinf, wanna dance? |
Closing this bug issue, missing feature requested in issue #116 |
I am trying to run a simple test using
dash::Matrix local row()
andcol()
views to copy a subset of a 2D matrix into astd::vector
. I am making the following observations:I can copy the whole local part of the Matrix into the local vector using dash::copy.
I can get a row using
matrix.local.row(0)
and correctly print its content on unit 0. However it fails with astd::out_out_range exception
on unit 1. I later realized that when using theoperator[]
instead ofoperator()
it works as expected. There seems to be a problem with theoperator()
.I am trying to copy a local row into a local
std::vector
like this:This code causes memory to be corrupted, e.g., on unit 0:
Valgrind says:
Since I am new to DASH, I cannot rule out that the code itself is incorrect. However, looking at the API it looks plausible to me.
I ran all my tests using
I am attaching my test case. Please let me know if you think that the test case is malformed, I am happy to correct it. Please also let me know if you need additional information.
The text was updated successfully, but these errors were encountered: