<div dir="ltr">The only logical result is for newcomm to have "use_shared_memory"="no", because that is state associated with comm, and what is duplicated is the state of comm.  That the user originally provided "use_shared_memory"="yes" is irrelevant to MPI_Comm_dup, because the implementation is not going to track such things, only the actual state that results from the failed attempt to set this key to "yes" during MPI_Comm_set_info, at which point, the communicator only knows "use_shared_memory"="no".<div><br></div><div>The way for the user to have any hope of achieving a "yes" result is to call "MPI_Comm_dup_with_info(comm, myinfo, &newcom);", which will attempt to set "use_shared_memory"="yes" without regards to the prior failed attempt.</div><div><br></div><div>Hammond<br><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 15, 2016 at 3:04 PM, Jeff Squyres (jsquyres) <span dir="ltr"><<a href="mailto:jsquyres@cisco.com" target="_blank">jsquyres@cisco.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On February 15, 2016 at 5:58:48 PM, Jeff Hammond (<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>) wrote:<br>
> Well, this program will not compile, since MPI_Comm_dup_with_info takes<br>
> three arguments. Furthermore, the info is NOT duplicated and instead the<br>
> second argument is the info the user provides for the new communicator.<br>
<br>
</span>Yeah, that was a typo -- it should be MPI_Comm_dup (i.e., use the info that was set on the communicator).  Here's the correct version:<br>
<span class=""><br>
-----<br>
MPI_Info_set(myinfo, "use_shared_memory", "yes");<br>
MPI_Comm_set_info(comm, myinfo);<br>
MPI_Comm_get_info(comm, myinfo_returned);<br>
// Assume here that there was not enough shared memory available to use shared-memory for<br>
// communication on this comm, so MPI_Info_get() tells us that use_shared_memory is "no".<br>
<br>
// ...time passes, and now assume there is more shared-memory available<br>
</span>MPI_Comm_dup(comm, &newcom);<br>
MPI_comm_get_info(newcom, myinfo_returned);<br>
-----<br>
<div class=""><div class="h5"><br>
--<br>
Jeff Squyres<br>
<a href="mailto:jsquyres@cisco.com">jsquyres@cisco.com</a><br>
For corporate legal information go to: <a href="http://www.cisco.com/web/about/doing_business/legal/cri/" rel="noreferrer" target="_blank">http://www.cisco.com/web/about/doing_business/legal/cri/</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div>
</div></div></div>