[petsc-users] Matrix Partitioning using PARMETIS

Smith, Barry F. bsmith at mcs.anl.gov
Tue Mar 12 12:41:04 CDT 2019


   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 <petsc-users at mcs.anl.gov> 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



More information about the petsc-users mailing list