[petsc-users] Loading only upper + MatSetOption(A,MAT_SYMMETRIC,PETSC_TRUE);

Matthew Knepley knepley at gmail.com
Mon Mar 4 07:45:03 CST 2019


On Mon, Mar 4, 2019 at 8:03 AM Klaus Burkart via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Hello,
>
> I want to solve many symmetric linear systems one after another in
> parallel using boomerAMG + KSPCG  and need to make the matrix transfer more
> efficient. Matrices are symmetric in structure and values. boomerAMG +
> KSPCG work fine.
>

Can you be more specific about where you want to save time? The best thing
would be to send the output of -log_view and show us.
I ask because loading a matrix from memory  should be much faster than
BAMG. Loading it from disk could possibly be slower, but
I do not think that BAMG handles a symmetric format, so you would load a
symmetric matrix and convert to AIJ.

  Thanks,

    Matt


>
>
So far I have been loading the entire matrices but I read in a paper, that
> it's sufficient to load the upper part only and tell petsc that the matrix
> is symmetric using MatSetOption(A,MAT_SYMMETRIC,PETSC_TRUE); Unfortunately
> all computations fail if I load only the upper values and use
> MatSetOption(A,MAT_SYMMETRIC,PETSC_TRUE);
>
> The idea is:
>
>     if (matrix_.symmetric())
>     {
>         MatSetOption(A,MAT_SYMMETRIC,PETSC_TRUE);
>        //load only upper part of the matrix MatSetValues(...)
>
>    }else //asymmetric matrix
>            {
>                //load the entire matrix MatSetValues(...)
>            }
>
> Is it possible at all?
>
> Klaus
>


-- 
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/20190304/6b66f025/attachment.html>


More information about the petsc-users mailing list