[petsc-users] about ksp

Barry Smith bsmith at mcs.anl.gov
Tue Aug 30 12:12:18 CDT 2011


On Aug 30, 2011, at 12:08 PM, Likun Tan wrote:

> Dear all,
> 
> I am using MatCreateSeqDense() to create the matrix A, if i set np=2, i
> got the error 'Comm must be of size 1'. As you suggested, i should put the
> same dense matrix on every process, but how should i do it?
> 
> And also, should the right hand side matrix B be partitioned by column?

   The comm argument to PETSc create functions determines what processes share the object. A seqdense matrix cannot be shared, it must live on a single process hence using PETSC_COMM_SELF is appropriate; if this is called on several processes then each process will hold the entire matrix.

   Barry

> 
> Thanks,
> Likun
> 
> 
> On Mon, August 29, 2011 6:01 pm, Jed Brown wrote:
>> On Mon, Aug 29, 2011 at 16:49, Likun Tan <likunt at andrew.cmu.edu> wrote:
>> 
>> 
>>> It is 27*27 with 343 non-zeros, i use LU for all the linear equations.
>>> 
>> 
>> 
>> This is just too small and not sparse enough for sparse linear algebra to
>> pay off. Create the same serial dense matrix redundantly on every
>> process, factor it, put all your right hand sides for that process in a
>> matrix B, and call MatMatSolve().
>> 
> 
> 
> 
> 



More information about the petsc-users mailing list