[petsc-users] PETSc and dense matrices

Barry Smith bsmith at mcs.anl.gov
Thu Jan 6 12:30:57 CST 2011


On Jan 6, 2011, at 11:46 AM, Hamid M. wrote:

> Hello,
> 
> In our research, we solve the diffusion equation PDE using Boundary
> Element Method (BEM).
> I am trying to parallelize the code we already have and I was
> wondering if PETSc is the right tool for us.
> 
> As you know, BEM produces a dense LHS matrix that needs to be solved.
> Also due to the size of our problems, populating the entities of the
> LHS matrix needs to be done on different processes as it won't fit on
> a single process of our cluster.
> 
> So I was wondering if you guys can answer my questions:
> 
> 1- Can I use PETSc to build/populate my LHS matrix on different nodes
> of a cluster (as opposed to constructing it on a single node and then
> distributing it) ?

  MatCreateMPIDense() then use MatGetArray() to access the raw array on each process or use MatSetValues() to put values into the matrix.
> 
> 2- Are there optimized parallel solvers for dense matrices in PETSc ?

  The Krylov solvers all work with parallel dense matrices so if your matrix is well conditioned (which it often is with BEM) you can just use GMRES or CG with diagonal scaling. -ksp_type gmres -pc_type jacobi 

   You can also use the direct solvers in PLAPACK with PETSc (configure PETSc with --download-plapack) but frankly if you need to use direct solvers you are in trouble in how large a problem you can run.

   Barry

> 
> 3- If the answer to question 1 is 'No', can I build my LHS matrix
> independent of PETSc and then direct PETSc to solve it for me ?
> 
> thanks in advance,
> 
> Hamid



More information about the petsc-users mailing list