[petsc-users] using PETSc libraries in an OpenMP application

Barry Smith bsmith at mcs.anl.gov
Tue Mar 2 21:04:30 CST 2010


  Yes, see the manual page for PCOPENMP.

  Possibly you want to use the hypre BoomerAMG algebraic multigrid  
solver inside it.

   The command line argument would be mpiexec -n <p> programname - 
openmp_merge_size  <p>  -ksp_type preonly -pc_type openmp - 
openmp_pc_type hypre

    You need to start your program with the line PetscInitialize() end  
with PetscFinalize() have your usual OpenMP code in between and create  
a sequential AIJ matrix to hold the matrix and a sequential KSP object  
to hold the linear system.

   Barry

On Mar 2, 2010, at 8:42 PM, David L Rodriguez wrote:

> Hello.  I am new to PETSc so bare with me.  I have gone through the  
> archived questions but have not been able to find an answer to my  
> question.  So here it goes.
>
> I have a huge CFD application that is parallelized exclusively with  
> OpenMP.  There is no use of MPI anywhere.  I am making significant  
> enhancements to this code and one enhancement includes an additional  
> elliptic solver for that builds very sparse matrices.  The matrix is  
> huge and has significantly varying eigenvalues and therefore I need  
> a preconditioned iterative solver.  I would like to implement PETSc  
> in this code to solve this matrix, but it from what I can tell, I  
> can only run it in serial.  Is there a way to call the parallel  
> PETSc libraries from an application that is parallelized strictly  
> with OpenMP?
>
> Any ideas would be very much appreciated.  Thanks.
>
>
>
> ____________________
> David L Rodriguez, Ph.D.
> Desktop Aeronautics, Inc.
>
> PH: 650-323-3141
> dlr at desktopaero.com
> http://desktopaero.com
>
>
>
>



More information about the petsc-users mailing list