When threading is used, PETSc should be calling MPI_Init_thread() instead of MPI_Init(). For our current use case, MPI_THREAD_FUNNELED is the natural mode to request. As opposed to MPI_THREAD_SINGLE, this causes the MPI implementation to manage locking around unsafe system calls. Should we just always ask for FUNNELED?
Do we envision a future time in which we want more threading (e.g. MPI_THREAD_MULTIPLE)? If so, we would definitely want a way to determine the desired mode before calling MPI_Init_thread(). -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120506/1bbfb89e/attachment.html>