Commits

Jed Brown committed 381acf3 Merge

Merge branch 'jed/mat-restore-zeros'

Bug fix for DMCreateMatrix_Composite_AIJ

* jed/mat-restore-zeros:
DMComposite: fix use of column count after MatRestoreRow

Comments (0)

Files changed (1)

src/dm/impls/composite/packm.c

     maxnc = 0;
     for (i=0; i<mA; i++) {
       ierr  = MatGetRow(Atmp,rstart+i,&nc,NULL,NULL);CHKERRQ(ierr);
-      ierr  = MatRestoreRow(Atmp,rstart+i,&nc,NULL,NULL);CHKERRQ(ierr);
       maxnc = PetscMax(nc,maxnc);
+      ierr  = MatRestoreRow(Atmp,rstart+i,&nc,NULL,NULL);CHKERRQ(ierr);
     }
     ierr = PetscMalloc(maxnc*sizeof(PetscInt),&ccols);CHKERRQ(ierr);
     for (i=0; i<mA; i++) {