[petsc-users] Using MatCreateSBAIJ and MatZeroRowsColumns in parallel

Matthew Knepley knepley at gmail.com
Fri Dec 2 07:17:06 CST 2022


On Fri, Dec 2, 2022 at 7:48 AM Karthikeyan Chockalingam - STFC UKRI via
petsc-users <petsc-users at mcs.anl.gov> wrote:

> Hello,
>
>
>
> I have system matrix which is symmetric and thought I could make use of MatCreateSBAIJ.
> I don’t understand how to set the blocksize bs. I believe it has taken
> into account, when having multiple components/dofs per node.
>
>
>
> (i)          Currently, I have only one scalar field to solve so I set bs
> = 1 as below. Is it correct?
>
>
>
>       ierr = MatCreateSBAIJ(PETSC_COMM_WORLD, 1, PETSC_DECIDE,
> PETSC_DECIDE, N, N, d_nz, PETSC_NULL, o_nz, PETSC_NULL, &A); CHKERRQ
> (ierr);
>
>
>
>    ierr = MatCreateVecs(A, &right, &left);CHKERRQ(ierr);
>
>
>
>
>
> (ii)         If you multiple components/dofs per node, say 2, is the then
> block size = 2?
>
>
>
> (iii)        To apply homogenous Dirichlet boundary condition, I make use
> of MatZeroRowsColumns. It works in serial but while applying in parallel
> the following error is thrown,
>
>
>
> [0]PETSC ERROR: No method zerorowscolumns for Mat of type mpisbaij
>
>
>
>       How do I fix it?
>
>
>
> (iv)                           Is there performance again, when using MatCreateSBAIJ
> for large symmetric system matrix? I read there is more communication
> involved.
>
For block size 1, there is no improvement. Even for 2 I would say it is
small. The SBAIJ matrix will do the same number of flops
and use about the same bandwidth, but it will save on storage. Unless
storage is a big deal for you, I would use AIJ, get everything
working, and profile to see how important various operations are.

  Thanks,

     Matt


> Best,
>
> Karthik.
>
>
>
>
>
> This email and any attachments are intended solely for the use of the
> named recipients. If you are not the intended recipient you must not use,
> disclose, copy or distribute this email or any of its attachments and
> should notify the sender immediately and delete this email from your
> system. UK Research and Innovation (UKRI) has taken every reasonable
> precaution to minimise risk of this email or any attachments containing
> viruses or malware but the recipient should carry out its own virus and
> malware checks before opening the attachments. UKRI does not accept any
> liability for any losses or damages which the recipient may sustain due to
> presence of any viruses.
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221202/fb956e4f/attachment.html>


More information about the petsc-users mailing list