[petsc-users] MATAIJ solvers

Barry Smith bsmith at mcs.anl.gov
Thu Nov 11 14:09:46 CST 2010


On Nov 11, 2010, at 2:01 PM, Chris Bording wrote:

> Hi I am new to petsc and am attempting to parallelize ex13.c (Poisson example) in the ksp tutorials.  I have been able to write some simple test codes and get them to work correctly and learn some of the mechanics of what petsc is doing, with respect to creating mpi vectors and matrices and in using the DA functions.   
> I attempting to test the different solvers I am having some trouble...
> 
> When I try to run with the same solver it fails with a message about 
> Matrix format for mpiaij does not have a built-in PETSc direct solver.  
> Which solvers are available for mpiaij formats?

  Running with -help (and having called KSPSetFromOptions() in your code) will print all solvers possible.

   Generally you don't want to use a direct solver for variable Poisson but if you like you can ./configure PETSc with --download-superlu_dist or --download-mumps --download-blacs --download-scalapack and then run the code with -pc_type lu -pc_factor_mat_solver_package superlu_dist or mumps


    A good solver for this problem is hypre's BoomerAMG which you can get with ./configure --download-hypre and then run with -pc_type hyre

     Running with -ksp_view is a good way of seeing exactly what solver it is using.


> 
> Also I created the Matrix and Vectors using the 
> DACreate2d(dA,PETSC_COMM_WORLD,.....
> 
> DAGetMatrix(dA,MATMPIAIJ,&A)
> 
> DACreateGlobalVector(dA,&x)
> DACreateGlobalVector(dA,&b)
> 
> ....
> 
> is this dictating the types of solvers available? 

  No

  For structured grids like with DA you can also use geometric multigrid, see for example ex22.c and some others in that directory.

   Barry

> 
> 
> Is there another example of the variable Poisson in Parallel? 
> or creating in a variable RHS and the rho variable in ex13 that maps from local to global indices?
> 
> Thanks
> Chris Bording



More information about the petsc-users mailing list