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?<div>
<br></div><div>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().</div>