[petsc-dev] MPI_Init_thread

Barry Smith bsmith at mcs.anl.gov
Sun May 6 12:22:44 CDT 2012


On May 6, 2012, at 12:19 PM, Jed Brown wrote:

> On Sun, May 6, 2012 at 11:07 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>   Is your specific questions is: should we replace all MPI_Init() calls in PETSc with MPI_Init_thread(...,MPI_THREAD_FUNNELED,...)?
> 
> Can't do this because of MPI-1 compatibility, but yeah, I'm thinking of always using MPI_THREAD_FUNNELED if configure picks it up.
>  
> 
>  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?
> 
> Sounds like there is not likely to be a performance hit because the standard system routines are thread safe.
> 
> http://lists.mcs.anl.gov/pipermail/mpich-discuss/2012-May/012380.html
> 
> MPICH2 does not use POSIX functions like getchar_unlocked() or non-POSIX stuff like fwrite_unlocked(), so it seems like the library will be doing exactly the same thing in both cases.

  I could care less about MPICH2. What happens on the Cray if one switches, sudden 50% drop in performance?

   Barry





More information about the petsc-dev mailing list