Skip to content

Commit ceec793

Browse files
committed
Check for number of nz for switching to MatDense
1 parent 56fbbdb commit ceec793

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugin/mpi/PETSc-code.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ namespace PETSc {
868868
PetscInt* cnum = ptA->_num + dN->HPDDM_n;
869869
if (ptA->_petsc) {
870870
int rank, size, N;
871-
unsigned int flag = mN->nnz == mN->n * mN->m ? 1 : 0;
871+
unsigned int flag = mN->nnz && mN->nnz == mN->n * mN->m ? 1 : 0;
872872
MPI_Comm_size(PetscObjectComm((PetscObject)ptA->_petsc), &size);
873873
if (size > 1) {
874874
PetscBool dense;
@@ -4925,7 +4925,7 @@ namespace PETSc {
49254925
type = MATHERMITIANTRANSPOSEVIRTUAL;
49264926
}
49274927
} else MatGetSize(mat[i][j], &n, &m);
4928-
if(isType && m >= n) {
4928+
if(isType && m >= n && !(cast[i * N + j] && cast[i * N + j]->_num)) {
49294929
PetscMPIInt rank;
49304930
MPI_Comm_rank(PetscObjectComm((PetscObject)mat[i][j]), &rank);
49314931
if(rank == 0) {

0 commit comments

Comments
 (0)