[petsc-dev] MPI_Init_thread

Barry Smith bsmith at mcs.anl.gov
Sun May 6 12:07:53 CDT 2012


On May 6, 2012, at 11:09 AM, Jed Brown wrote:

> 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?
> 

   Is your specific questions is: should we replace all MPI_Init() calls in PETSc with MPI_Init_thread(...,MPI_THREAD_FUNNELED,...)?  

 Will there be a performance hit, when one is not using threads? Should we #if defined() do the replacement if the user has turned on OpenMP or Pthread or TBB only and not by default?


   Barry


> 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().




More information about the petsc-dev mailing list