space allocation for a parallel matrix

Yixun Liu enjoywm at
Tue Feb 3 09:47:26 CST 2009

Matthew Knepley wrote:
> On Tue, Feb 3, 2009 at 9:25 AM, Yixun Liu <enjoywm at> 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?

More information about the petsc-users mailing list