<div dir="ltr">On Thu, Feb 14, 2013 at 1:16 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Do we really ALWAYS want to call this version even if we are not monkeying with threads at ALL?<br>
<br>
Thanks<br>
<br>
Barry<br>
<br>
ierr = MPI_Initialized(&flag);CHKERRQ(ierr);<br>
if (!flag) {<br>
if (PETSC_COMM_WORLD != MPI_COMM_NULL) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"You cannot set PETSC_COMM_WORLD if you have not initialized MPI first");<br>
#if defined(PETSC_HAVE_MPI_INIT_THREAD)<br>
{<br>
PetscMPIInt provided;<br>
ierr = MPI_Init_thread(argc,args,MPI_THREAD_FUNNELED,&provided);CHKERRQ(ierr);<br>
}<br>
#else<br>
ierr = MPI_Init(argc,args);CHKERRQ(ierr);<br></blockquote><div><br></div><div style>The implementation of MPI_Init just probes around the environment and calls MPI_Init_thread. There is no performance advantage of MPI_THREAD_SINGLE over MPI_THREAD_FUNNELED so I think the code here is fine.</div>
</div></div></div>