space allocation for a parallel matrix
Matthew Knepley
knepley at gmail.com
Tue Feb 3 09:50:16 CST 2009
On Tue, Feb 3, 2009 at 9:47 AM, Yixun Liu <enjoywm at cs.wm.edu> wrote:
> Matthew Knepley wrote:
>> On Tue, Feb 3, 2009 at 9:25 AM, Yixun Liu <enjoywm at cs.wm.edu> wrote:
>>
>>> Hi,
>>> I am confusing to the allocation for a parallel matrix in PETSC manual,
>>>
>>> "If PETSC DECIDE is not used for the arguments m and n, then the user
>>> must ensure that they are chosen
>>> to be compatible with the vectors. To do this, one first considers the
>>> matrix-vector product y = Ax. The m
>>> that is used in the matrix creation routine MatCreateMPIAIJ() must match
>>> the local size used in the vector
>>> creation routine VecCreateMPI() for y. Likewise, the n used must match
>>> that used as the local size in
>>> VecCreateMPI() for x."
>>>
>>> Since the process holds all the columns, why does it only hold part of
>>> vector x? Is it convenient for the matrix vector multiplication?
>>>
>>
>> I am not sure I understand your question. However, Mat objects do hold
>> all columns of a row. The local column size 'n' is used to match against
>> a Vec, not for storage.
>>
>> Matt
>>
>>
>>> Thanks.
>>>
>>> Yixun
>>>
> What I mean is that the process holds all the column, but only part of
> the vector, how to do the multiplication? It needs communicate with
> other processes. Right?
Yes. This is explained fairly well in Yousef Saad's book "Iterative Methods
for Sparse Linear Systems".
Matt
--
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
More information about the petsc-users
mailing list