[petsc-dev] MatSetOption is logically collective even for MAT_ROW_ORIENTED.

Jed Brown jedbrown at mcs.anl.gov
Thu May 16 14:03:52 CDT 2013


Patrick Lacasse <patrick.m.lacasse at gmail.com> writes:

> Hi Barry,
>
>    is MatSetOption still logically collective?
> Shouldn't  this code :
>
>      if (op > 0) PetscValidLogicalCollectiveEnum(mat,op,2);
>      PetscValidLogicalCollectiveBool(mat,flg,3);
>
> be :
>
>      if (op > 0) {
>        PetscValidLogicalCollectiveEnum(mat,op,2);
>        PetscValidLogicalCollectiveBool(mat,flg,3);
>      }
>
> Could this be part of the next release patch?

Looks good to me, but I think this is a mistake:

              MAT_NO_OFF_PROC_ENTRIES = -5,

It can't be allowed as non-collective:

PetscErrorCode MatAssemblyBegin_MPIAIJ(Mat mat,MatAssemblyType mode)
{
  Mat_MPIAIJ     *aij = (Mat_MPIAIJ*)mat->data;
  PetscErrorCode ierr;
  PetscInt       nstash,reallocs;
  InsertMode     addv;

  PetscFunctionBegin;
  if (aij->donotstash || mat->nooffprocentries) PetscFunctionReturn(0);

  /* make sure all processors are either in INSERTMODE or ADDMODE */
  ierr = MPI_Allreduce((PetscEnum*)&mat->insertmode,(PetscEnum*)&addv,1,MPIU_ENUM,MPI_BOR,PetscObjectComm((PetscObject)mat));CHKERRQ(ierr);



More information about the petsc-dev mailing list