PETSc and OpenMP

Patrick Lechner mappol at
Mon Oct 9 11:12:01 CDT 2006

Dear all,

I basically use PETSc inside an existing OpenMP application. All PETSc
solves are done in serial in this application. I therefore do not need MPI
(at the moment...). The code solves finite element problems, where the
OpenMP environment is used to use various parameters for these systems. All
private variables are allocated on the stack, the OpenMP parallel loop makes
calls to PETSc.
Thanks for your replies,

On 10/9/06, Barry Smith <bsmith at> wrote:
>    Patrick,
>     Are you using "user level threads", that is your code stops
> and starts additional threads directly or are you using loop level
> threads, that is OpenMPI manages all the threads for you. If the
> later you are fine, if the former make sure only one thread
> makes PETSc calls.
>    Barry
> On Mon, 9 Oct 2006, Patrick Lechner wrote:
> > Dear all,
> > I am currently writing a code and try to combine PETSc and OpenMP (where
> > PETSc will be used inside a parallel environment).
> > My questions now are:
> >   1. Is it safe to combine these libraries?
> >   2. What will I have to consider to make my code work reliably?
> > Thanks a lot for your help.
> > Best wishes,
> > Patrick
> >


Patrick Lechner
Numerical Analysist / Numerical Modeller
Flat 1
159 Hardgate
Aberdeen, AB11 6XQ

Phone: 07815 927333
E-mail: patrick at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the petsc-users mailing list