[petsc-users] KSP ex2.c and Parallelization

Maahi Talukder maahi.buet at gmail.com
Fri Feb 15 13:22:53 CST 2019


Hello All,

I have some questions regarding ex2.c in /
*petsc/src/ksp/ksp/examples/tutorials/ex2.c. *

1.   The  local sizes of the matrix was decided by PETSc using *ierr =
MatSetSizes(A,PETSC_DECIDE,PETSC_DECIDE,m*n,m*n);CHKERRQ(ierr);*
But without knowing the local sizes, how was the following function used
which requires the knowledge of how the big matrix was split into smaller
chunks within PETSc?
  *ierr = MatMPIAIJSetPreallocation(A,5,NULL,5,NULL);CHKERRQ(ierr);*

2.  When using  *MatGetOwnershipRange(A,&Istart,&Iend);CHKERRQ(ierr),  *the
global index of  first and last row of which local chunk of the big matrix
is it returning ? I mean if the big matrix was split into three processes,
for example, fist and last global row of which process is it returning?

Your replies are highly appreciated

Thanks,
Maahi Talukder
Clarkson University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190215/11942dd0/attachment.html>


More information about the petsc-users mailing list