Yes, by default there is one subdomain per process so if you run on one process you will get all zero indices. Run on two processes and you should see a partitioning. See also MatPartitioningSetNParts()
Barry > On Mar 12, 2019, at 3:03 AM, Eda Oktay via petsc-users > <[email protected]> wrote: > > Hello, > > I have a Laplacian matrix PL of matrix A and I try to partition A using > PARMETIS. Since PL is sequential and not adjacency matrix, I converted PL to > AL, then write the following code: > > ierr = MatConvert(PL,MATMPIADJ,MAT_INITIAL_MATRIX,&AL);CHKERRQ(ierr); > > ierr = MatMeshToCellGraph(AL,2,&dual);CHKERRQ(ierr); > ierr = MatPartitioningCreate(MPI_COMM_WORLD,&part);CHKERRQ(ierr); > ierr = MatPartitioningSetAdjacency(part,dual);CHKERRQ(ierr); > ierr = MatPartitioningSetFromOptions(part);CHKERRQ(ierr); > ierr = MatPartitioningApply(part,&partitioning);CHKERRQ(ierr); > ierr = ISView(partitioning,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr); > ierr = ISDestroy(&partitioning);CHKERRQ(ierr); > ierr = MatPartitioningDestroy(&part);CHKERRQ(ierr); > > However, when I look at partitioning with ISView, the index set consists of > zeros only. Is that because I have only one processor and my codes are > written for only one processor, or is there another problem? I ran my code > with -mat_partitioning_type parmetis. > > Thanks, > > Eda
