<div dir="ltr"><div dir="ltr"><div class="gmail_default">[This is a branch-off from thread "Pt2pt messaging with MPI_PROC_NULL (and MPI_TAG_NULL,MPI_ADDRESS_NULL)" ]</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default" style="font-size:small">It turns out that MPI_COMM_NULL opens some questions that I am sure can be resolved by people on the list.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It is enlightening that you see my suggested MPI_COMM_NULL as a set and not an item. I did not think about that, but it is of course the more natural approach and MPI_COMM_NULL can then be seen as problematic. I do indeed have the view that the MPI_xxxx_NULL items are to be compared to NaN in that they are items in themselves. In particular they are items that are not members of any set of similar items. Thus, MPI_COMM_NULL is a process communicator that is not a member of any set of (valid) process communicators and it is not MPI_COMM_EMPTY.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I am not sure that there is a need for an explicit MPI_COMM_EMPTY, but if there was it is allowed and can be created as a sub-communicator to any communicator by MPI_Comm_create, eg for MPI_COMM_WORLD:</div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">MPI_Comm_create(MPI_COMM_WORLD,MPI_GROUP_EMPTY,&mpi_comm_empty)</blockquote></div></blockquote><div class="gmail_default"><div class="gmail_default" style="font-size:small">but its usefulness I find debatable. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The set operations in MPI are, I believe, restricted to the MPI_GROUP_xxx set of items and do not directly involve communicators, but I am on thin ice here. This is for the intra-communicator people, MPMD and multi-physics scientists to have opinions on. In my view, the group members of MPI_COMM_NULL should be MPI_GROUP_NONE (not MPI_GROUP_EMPTY) if it should return any members at all. My suggestion would rather be that MPI_COMM_NULL is an illegal communicator argument in any call to MPI_Group_*() or MPI_Comm_*() that takes a communicator as an argument, eg MPI_Comm_dup(), MPI_Comm_free(), MPI_Comm_group().</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">So, I think that you and I are arguing for the same definition of MPI_COMM_NULL .<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">/Nils</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 21, 2021 at 7:14 PM Dan Holmes <danholmes@chi.scot> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Hi Nils,<div><br></div><div>In general, I like the idea of having default/invalid values for these MPI-related user variables.</div><div>[...]</div><div>IMHO, there would need to be a statement that, “when the comm argument is MPI_COMM_NULL, the only acceptable value for the source/dest argument is MPI_PROC_NULL” because asking for the 3rd item from an empty set (for example) is clearly an error. Your proposal tries to treat MPI_COMM_NULL as if it is a valid MPI intra-communicator that has size zero, or a valid inter-communicator that has a remote group of size zero. I think I would prefer to create MPI_COMM_EMPTY for that purpose, and continue to use MPI_COMM_NULL for situations that call for an invalid communicator, i.e. something that can never be used as a communicator without causing an error condition.</div><div><br></div><div>The phrase used elsewhere in the MPI Standard is “XYZ parameter is significant only <when condition>”</div><div><div><div dir="auto" style="color:rgb(0,0,0)"><br class="gmail-Apple-interchange-newline"></div></div></div></div></blockquote></div></div></div></div></div>