[petsc-users] about MatTranspose

Likun Tan likunt at andrew.cmu.edu
Wed Aug 31 10:02:36 CDT 2011


Thanks.

Where should i 'redundantly create A and B' ? Is this the correct procedure:

MatCreateSeqDense(PETSC_COMM_SELF, M, M, PESTC_NULL, &A)
MatCreateMPIDense(PETSC_COMM_WORLD, PETSC_DECIDE, PETSC_DECIDE, M, N,
PETSC_NULL, &B)
MatSetValues() //Set values to A and B
MatCholeskyFactor()// Factorization
MatMatSolve()

The 3D array is generated before setting values to A and B. It comes from
some known function evaluation, an i need the array in every process.



On Wed, August 31, 2011 10:50 am, Jed Brown wrote:
> On Wed, Aug 31, 2011 at 09:41, Likun Tan <likunt at andrew.cmu.edu> wrote:
>
>
>> so what I want to do is using MatMatSolve() to solve Ax=B, where A is a
>>  27*27 dense matrix, B is a 27*4000 dense matrix.
>>
>>
>> 1. For efficiency, i want to generate the matrix B in parallel. Since
>> it cannot be partitioned by row, i generated a 4000*27 matrix and try to
>> get the transpose of it. Should i use MatCreateTranspose()?
>>
>> 2. Does MatMatSolve() solve Ax=B in parallel?
>>
>>
>
> Depends whether A is parallel, but you don't want it to anyway.
>
>
>
>> If so, since A is not
>> partitioned, is A visible in every process? or other steps i should do?
>>
>
> You should redundantly create A and redundantly create parts of B. That
> is, every process will have
>
> A : 27x27 dense matrix on COMM_SELF.
> B : 27x(4000/np) dense matrix on COMM_SELF.
>
>
> np is the number of processes in COMM_WORLD
>
>
>> 3. I have a 3D array (with PETSC_COMM_SELF) that will be used to
>> generate all the elements of matrix B, how could I make it available in
>> every process?
>>
>
> Where did it come from? (How did you get this array in the first place?)
>
>






More information about the petsc-users mailing list