[petsc-users] about MatTranspose

Likun Tan likunt at andrew.cmu.edu
Thu Sep 1 10:46:36 CDT 2011


Thank you for your reply~

I tried to use
PetscSplitOwnership(PETSC_COMM_WORLD,&n,&N);
MatCreateSeqDense(PETSC_COMM_SELF,M,n,PETSC_NULL,&B);

But it seems not working. This command is make B store in N/n processors
with n columns in each processor? I try to calculate the N/n parts in
parallel, but when i apply MatGetOwnershipRange(), i found the matrix will
be automatically partitioned by row.

That's why i go back to use MatCreate() to create a 200*27 matrix and try
to get the tranpose of it.I used
MatCreateSeqDense(PETSC_COMM_SELF, M, N, PETSC_NULL, &C)
to create C, there is no partition of C, i guess this is the reason of the
error.

How should i fix it?

Thanks,
Likun

On Thu, September 1, 2011 11:29 am, Jed Brown wrote:
> On Thu, Sep 1, 2011 at 10:24, Likun Tan <likunt at andrew.cmu.edu> wrote:
>
>
>> I used MatCreate() to create a non-square matrix B, and set values to
>> it in parallel. Now i want to get the tranpose of it to solve Ax=B',
>> where A is SeqDense.
>>
>> I define a SeqDense C=B' and use MatTranspose() to get it, then apply
>> MatMatSolve(fact,C,x), but i get the following error:
>>
>>
>> [0]PETSC ERROR: --------------------- Error Message
>> ------------------------------------
>> [0]PETSC ERROR: Nonconforming object sizes!
>> [0]PETSC ERROR: Mat A,Mat B: local dim 27 14!
>>
>>
>
> When you send error messages, please send the whole stack trace.
>
>
> It looks like C=B' is not being partitioned correctly.
> Did you take my earlier suggestions about how to partition this problem?
>
>






More information about the petsc-users mailing list