[petsc-users] Convert mat SEQAIJ to MPIAIJ

Matthew Knepley knepley at gmail.com
Tue Sep 4 09:46:41 CDT 2012


On Tue, Sep 4, 2012 at 9:42 AM, Thomas Witkowski <
thomas.witkowski at tu-dresden.de> wrote:

>  Am 04.09.2012 16:20, schrieb Hong Zhang:
>
> Thomas:
> Do you mean create a mpiaij matrix of order 2nx2n from two local nxn
> matrices?
>
> Yes.
>
> You might have to use MatSetValues() to do this.
>
> I think, it will be faster and more efficient to create a MatShell to wrap
> around the local matrices. If anybody has some other ideas, please let me
> know.
>

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MATNEST.html

   Matt


> Thomas
>
>
>
>  Hong
>
>>
>> Thomas :
>>
>>> In my FETI-DP code, each rank creates a SEQAIJ matrix that represents
>>> the discretization of the interior domain. Just for debugging, I would like
>>> to join these sequential matrices to one global MPIAIJ matrix. This matrix
>>> has no off diagonal nnzs and should be stored corresponding to the ranks
>>> unknowns, thus, first all rows of the first rank and so on. What's the most
>>> efficient way to do this? Is it possible to create this parallel matrix
>>> just as a view of the sequential ones, so without copying the data? Thanks
>>> for any advise.
>>
>>
>>
>> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateMPIAIJConcatenateSeqAIJ.html
>>
>>  Note: entries in seqaij matrices are copied into a mpiaij matrix without
>> inter-processor communication. Use petsc-3.3 for this function.
>>
>>
>>  The function does not do what I expect. For example, if we have two mpi
>> task and each contains one local square matrix with n rows, I want to
>> create a global square matrix with 2n rows. This function create a
>> non-square matrix of size 2n x n.
>>
>> Thomas
>>
>
>
>


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120904/0261f5f5/attachment.html>


More information about the petsc-users mailing list