Commits

Matt Knepley committed e22710e

Mat: Remove PETSC_COMM_WORLD from MatChop()

Comments (3)

  1. Jed Brown

    It's a good idea to compile before pushing.

    src/mat/utils/axpy.c: In function MatChop:
    src/mat/utils/axpy.c:437:3: warning: passing argument 1 of PetscObjectComm from incompatible pointer type [enabled by default]
       ierr    = MPI_Allreduce(&numRows, &maxRows, 1, MPIU_INT, MPI_MAX, PetscObjectComm(A));CHKERRQ(ierr);
       ^
    In file included from /home/jed/petsc/include/petscis.h:7:0,
                     from /home/jed/petsc/include/petscvec.h:9,
                     from /home/jed/petsc/include/petscmat.h:6,
                     from /home/jed/petsc/include/petsc-private/matimpl.h:5,
                     from src/mat/utils/axpy.c:2:
    /home/jed/petsc/include/petscsys.h:2280:23: note: expected ‘PetscObject’ but argument is of type ‘Mat’
     PETSC_EXTERN MPI_Comm PetscObjectComm(PetscObject);
                           ^
    

Files changed (1)

src/mat/utils/axpy.c

     ierr   = MatRestoreRow(A, r, &ncols, NULL, NULL);CHKERRQ(ierr);
   }
   numRows = rEnd - rStart;
-  ierr    = MPI_Allreduce(&numRows, &maxRows, 1, MPIU_INT, MPI_MAX, PETSC_COMM_WORLD);CHKERRQ(ierr);
+  ierr    = MPI_Allreduce(&numRows, &maxRows, 1, MPIU_INT, MPI_MAX, PetscObjectComm(A));CHKERRQ(ierr);
   ierr    = PetscMalloc2(colMax,PetscInt,&newCols,colMax,PetscScalar,&newVals);CHKERRQ(ierr);
   for (r = rStart; r < rStart+maxRows; ++r) {
     const PetscScalar *vals;