[petsc-users] Matrix Partitioning using PARMETIS

Eda Oktay eda.oktay at metu.edu.tr
Tue Mar 12 03:03:54 CDT 2019


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190312/01072d86/attachment.html>


More information about the petsc-users mailing list