-
Notifications
You must be signed in to change notification settings - Fork 579
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
Tpetra: how to copy a matrix with a different range/domain map without invalidating the original #9391
Comments
Not sure about this, but what happens if you use the |
Look at you with all the answers :) |
Wait @cgcgcg you're not so smart as of yet, when I run in parallel I get failures in the fill complete call
looking into why |
Hm. There is also a |
Here is the code I replaced it with
|
Another attempt: Construct a new |
Yeah, i thought about all that crap, i can't use a local graph but will look into some other way to rebuild the matrix. Hoping for a good idea from someone hoping not to have to do all that crap |
@trilinos/tpetra should look at this case. Either tpetra should correctly handle the use-case or it should deprecate that constructor. We had to do some workaround for FECrsMatrix; let us take a look. |
@trilinos/tpetra any comment on the comment by @kddevin ??? I can make a copy of the graph and fill in the values and do all the stuff to recreate the matrix. It is in a test so it isn't a big deal that we duplicate the entire matrix but if this has a real application we will need a better path forward |
@cgcgcg or anyone else, is there an easy way to copy one matrix values to another matrix with the same graph Was hoping for a getValues and a deep copy of some sort. If I was to use an importer, do I just create an importer with the row maps? |
getLocalMatrixDevice() returns the KokkosSparse::CrsMatrix. The matrix values in this object are stored in a Kokkos::View. I don't see an accessor to get the entire view (there are row view accessors), so you may need to add a new method for that. Since the object is snapshotted into trilinos you would have to get the changes into kokkos kernels first. |
I think the |
@cgcgcg is correct. The class members are public. Just grab the "values" member. |
This is what I've done to replace that simple single line
|
We decided to add methods to replace the Domain and Range map. (Epetra has these functions, but Tpetra does not.) Then one would use the shallow copy constructor followed by the methods for replacing the Domain and Range map. See #9451 |
Graph will need those as well maybe.
Just saying they don't have that function either.
…On Mon, Jul 19, 2021 at 12:37 PM K Devine ***@***.***> wrote:
We decided to add methods to replace the Domain and Range map. (Epetra has
these functions, but Tpetra does not.) Then one would use the shallow copy
constructor followed by the methods for replacing the Domain and Range map.
See #9451 <#9451>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#9391 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADR4GIA7FNLBQE3BN5QO7WDTYRIGBANCNFSM475JCI3A>
.
|
In branch tpetra_9391, there is a test that attempts to copy a matrix four different ways. Two work -- repeating all the inserts to build the new matrix from scratch
Two do not work: building the new matrix from the original's local device matrix gets the counts wrong so that one cannot take a host view
|
Question
@trilinos/tpetra
@jhux2 @cgcgcg @kddevin
So, I;m removing UVM from zoltan2 and I ran into a use case in Z2 that is problematic for UVM removal, They have two matrices
JBlock and JCyclic where the only difference is the rance and domain maps. They construct the JCyclic via the call below
This does a shallow copy of the device matrix and then sets the use counts for the graph and values to 8 for the device side and only 4 for the host side.
I tried the following, make a deep copy of the matrix since this is just in a test and who cares about memory
and the 3rd getLocalMatrixHost fails cuz the graph has a mismatched use count. So, the graph is always a shallow copy it looks like
The auto fff = ... is there just for use count checking, just FYI
So, there has to be a way to do what I want, I looked there is no setRangeMap and only getters or I would just copy the matrix raising the counts to 8 but evenly.
Thanks
The text was updated successfully, but these errors were encountered: