Tpetra: resumeFill+expertStaticFillComplete change triangular status
Created by: aprokop
@trilinos/tpetra @csiefer2
// construct A_crs_new
std::cout << "A_crs_new is lower triangular: " << A_crs_new->isLowerTriangular() << std::endl;
A_crs_new->resumeFill();
A_crs_new->expertStaticFillComplete(A_crs_->getDomainMap(), A_crs_->getRangeMap());
std::cout << "A_crs_new is lower triangular: " << A_crs_new->isLowerTriangular() << std::endl;
results in
A_crs_new is lower triangular: 1
A_crs_new is lower triangular: 0
I would have assumed that calling expertStaticFillComplete
would just modify the importers/exporters, and not touch the internal state of the graph/matrix. But this does not seem to be the case.
I think the problem is that resumeFill
resets lowerTriangular_
and upperTriangular_
, however it only calls computeGlobalConstants()
and not computeLocalConstants
where those variables are set.
Calling expertStaticFillComplete
with a parameter list that has "compute global constants" set to false does call computeLocalConstants
, however, it is shortcircuted by these lines in the function:
// Short circuit
if(haveGlobalConstants_) return;
...
if (! haveLocalConstants_) {
The only way I could make it work is by commenting the first one, and resetting haveLocalConstants_
in expertStaticFillComplete
.
This seems like a real bug.