[petsc-users] Converting a Parallel(MPI) Matrix to a Sequential Matrix

Matthew Knepley knepley at gmail.com
Mon Sep 7 10:19:57 CDT 2020


On Mon, Sep 7, 2020 at 11:17 AM Anthony Dowling <dowlinah at clarkson.edu>
wrote:

> Thank you for your help, Matthew.
>
> With those methods, will I be able to copy the contents of the created
> serial matrices back to a parallel matrix if needed? If so, what is a good
> way to do that?
>

There is nothing that does that right now. We would have to write it.

  Thanks,

     Matt


> Thanks,
> Anthony Dowling
>
>
> On Mon, Sep 7, 2020 at 11:12 AM Matthew Knepley <knepley at gmail.com> wrote:
>
>> On Mon, Sep 7, 2020 at 11:00 AM Anthony Dowling <dowlinah at clarkson.edu>
>> wrote:
>>
>>> Hello all,
>>>
>>> Is there a method to convert a parallel(MPI) dense matrix to a
>>> sequential dense matrix? Also to do the same in reverse? The code I am
>>> using needs to be able to convert a float** matrix to a Petsc matrix, and
>>> then later convert that Petsc matrix between MPI dense and sequential
>>> dense. How might this be achieved? The code seems to be converting float**
>>> matrices to Petsc properly, but I am unable to find a method to convert
>>> between MPI and sequential matrices.
>>>
>>
>> If you want the serial matrix everywhere, this is easy:
>> https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateRedundantMatrix.html
>> If you want it just on 1 process, you can use:
>> https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateSubMatrices.html
>>
>>   Thanks,
>>
>>     Matt
>>
>>
>>> Thanks in advance,
>>> Anthony Dowling
>>>
>>
>>
>> --
>> 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/>
>>
>

-- 
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/20200907/c8b5483b/attachment-0001.html>


More information about the petsc-users mailing list