Partitioning on a mpiaij matrix

Barry Smith bsmith at
Fri Feb 9 13:09:17 CST 2007

  MatConvert() checks for a variety of converts; from the code

    /* 3) See if a good general converter is registered for the desired class */
    conv = B->ops->convertfrom;
    ierr = MatDestroy(B);CHKERRQ(ierr);
    if (conv) goto foundconv;

now MATMPIADJ has a MatConvertFrom that SHOULD be listed in the function table
so it should not fall into the default MatConvert_Basic().

  What version of PETSc are you using? Maybe an older one that does not have
this converter? If you are using 2.3.2 or petsc-dev you can put a 
breakpoint in MatConvert() and try to see why it is not picking up the 
convertfrom function? It is possible some bug that we are not aware of
but I have difficulty seeing what could be going wrong.

   Good luck,


On Fri, 9 Feb 2007, LECAS Dimitri wrote:

> Hello,
> I thinks i find a "bug". I try to use parmetis for partitioning a matrix
>  created with MatCreateMPIAIJ. 
> Here the output :
> [0]PETSC ERROR: No support for this operation for this object type!
> [0]PETSC ERROR: Mat type mpiadj!
> [0]PETSC ERROR: MatSetValues() line 825 in src/mat/interface/matrix.c
> [0]PETSC ERROR: MatConvert_Basic() line 34 in src/mat/utils/convert.c
> [0]PETSC ERROR: MatConvert() line 3134 in src/mat/interface/matrix.c
> [0]PETSC ERROR: MatPartitioningApply_Parmetis() line 47 in
> src/mat/partition/impls/pmetis/pmetis.c
> [0]PETSC ERROR: MatPartitioningApply() line 238 in
> src/mat/partition/partition.c
> If i understand correctly, MatPartitioningApply_Parmetis try to convert
> the matrix in format MPIAdj and failed because we can't use MatSetValues
> on a MPIAdj.
> It's possible to easily avoid this bug ?
> Best regards

More information about the petsc-users mailing list