You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been running the following code snippet with two 4x4 matrices on two ranks. overlappingMat is distributed so that rows [0, 1, 2] are on rank 0 and rows [1, 2, 3] are on rank 1, while uniqueMat is distributed so that rows [0, 1] are on rank 0 and rows [2, 3] are on rank 1.
overlappingMat = rcp(new Tpetra::CrsMatrix<SC, LO, GO, NO>(overlappingMap, columnMap, 4));
for (int i = 0; i < 3; i++) {
overlappingMat->insertLocalValues(i, localColIdx, valOne);
}
overlappingMat->fillComplete();
uniqueMat = rcp(new Tpetra::CrsMatrix<SC, LO, GO, NO>(uniqueMap, columnMap, 4));
// What is the difference between ADD and INSERT?
uniqueMat->doExport(*overlappingMat, overlappingToUniqueExporter, Tpetra::INSERT);
uniqueMat->fillComplete();
uniqueMat->describe(*out, Teuchos::VERB_EXTREME);
Of all the combine modes, ADD and INSERT are the only ones that work in this setting. I could not observe a functional difference between ADD and INSERT. In both cases the entries from rows [1, 2] coming from ranks 0 and 1 are added together when an export is done from overlappingMat to uniqueMat.
Is there a difference between these modes? If so, when can it be observed? If not, why do I have to pass a mode at all?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Not all CombineMode options work with matrices, which is not documented on that link. That said, ADD and INSERT do the same thing for matrices that are not fillComplete. For matrices that are fillComplete, INSERT is not allowed.
cc: @csiefer2 @searhein
I have been running the following code snippet with two 4x4 matrices on two ranks.
overlappingMat
is distributed so that rows [0, 1, 2] are on rank 0 and rows [1, 2, 3] are on rank 1, whileuniqueMat
is distributed so that rows [0, 1] are on rank 0 and rows [2, 3] are on rank 1.Of all the combine modes, ADD and INSERT are the only ones that work in this setting. I could not observe a functional difference between ADD and INSERT. In both cases the entries from rows [1, 2] coming from ranks 0 and 1 are added together when an export is done from
overlappingMat
touniqueMat
.Is there a difference between these modes? If so, when can it be observed? If not, why do I have to pass a mode at all?
Thanks in advance!
The text was updated successfully, but these errors were encountered: