Hi,

I have a C++ program where I would like to call some of PETSc's KSP methods 
(KSPCreate, KSPSolve, etc.) from inside a for loop that has a "#pragma omp 
parallel for" in front of it.  Without this OpenMP pragma, my code runs fine.  
But when I add in this parallelism, my program segfaults with PETSc reporting 
some memory corruption errors.

I've read online in a few places that PETSc is not thread-safe, but before I 
give up hope, I thought I would ask to see if anyone has had success working 
with KSP routines when they are being called simultaneously from multiple 
threads (or whether such a feat is definitely not possible with PETSc).  Thanks 
very much for your advice!

Best,

David

Reply via email to