PETSc and OpenMP

Matthew Knepley knepley at
Mon Oct 9 10:30:28 CDT 2006

On 10/9/06, Patrick Lechner <mappol at> 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?

The main problem will be thread safety. We do not claim to be thread-safe,
as we occasionally
use static variables. However, we try to minimize this. I think most of the
uses are in output
routines. You will also need a thread safe MPI (or use MPIUNI). We have
tried this in the past,
and never really gotten any benefit from doing it. What is your target



Thanks a lot for your help.
> Best wishes,
> Patrick
"Failure has a thousand explanations. Success doesn't need one" -- Sir Alec
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the petsc-users mailing list