<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div><div>Hi Jeff,</div><div><br></div><div>I agree – the fix is simple. I just wanted to point out that this can break existing codes, in particular if we only fix this for some routines. In this case, if we make the change consistently (incl. all type creation functions) it’s probably not an issue at all.</div><div><br></div><div>As for the removed functions – that code was written pre MPI 2.1. It’s true legacy code :) (that’s also why its not in the public repo and not usually tested), but the problem is still there with the new functions as well.</div><div><br></div><div>Martin</div><div><br></div><div><br></div><div><div style="font-family: Consolas; font-size: medium;">________________________________________________________________________</div><div style="font-family: Consolas; font-size: medium;">Martin Schulz, <a href="mailto:schulzm@llnl.gov">schulzm@llnl.gov</a>, <a href="http://scalability.llnl.gov/">http://scalability.llnl.gov/</a></div><div style="font-family: Consolas; font-size: medium;">CASC @ Lawrence Livermore National Laboratory, Livermore, USA</div><div><br></div></div></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> mpi-forum <<a href="mailto:mpi-forum-bounces@lists.mpi-forum.org">mpi-forum-bounces@lists.mpi-forum.org</a>> on behalf of Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>><br><span style="font-weight:bold">Reply-To: </span> Main mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a>><br><span style="font-weight:bold">Date: </span> Wednesday, January 13, 2016 at 1:27 PM<br><span style="font-weight:bold">To: </span> Main mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a>><br><span style="font-weight:bold">Subject: </span> Re: [Mpi-forum] MPI_DATATYPE_NULL when count=0<br></div><div><br></div><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div><div dir="ltr"><div class="" title="Page 831"><div class=""><div class=""><p><span class="" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; background-color: rgb(255, 255, 255);"></span></p><div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="background-color:rgb(255,255,255)">I'm just guessing, but it seems like a trivial change to not stuff nothing into the struct is sufficient:</div><div style="background-color:rgb(255,255,255)"><br></div><div style="background-color:rgb(255,255,255)">#define DT_GENERALALLOC(b,c,dt,pb,var) \</div><div style="background-color:rgb(255,255,255)">{ int err,lens[2]; MPI_Aint addr[2]; MPI_Datatype types[2]; \</div><div style="background-color:rgb(255,255,255)">  types[0]=MPI_CHAR; lens[0]=piggyback_size; err=MPI_Address((void*) pb, &(addr[0])); \</div><div style="background-color:rgb(255,255,255)">  if (err!=MPI_SUCCESS) { return err; } \</div><div><span style="background-color:rgb(0,255,0)">likely_if (c>0) {</span></div><div style="background-color:rgb(255,255,255)">  types[1]=dt; lens[1]=c; err=MPI_Address((void*) b, &(addr[1])); \</div><div style="background-color:rgb(255,255,255)">  if (err!=MPI_SUCCESS) { return err; } \</div><div style="background-color:rgb(255,255,255)">  err=MPI_Type_struct(2,lens,addr,types,&var); \</div><div style="background-color:rgb(255,255,255)">  if (err!=MPI_SUCCESS) { return err; } \</div><div><span style="background-color:rgb(0,255,0)">} else {</span></div><div><span style="background-color:rgb(0,255,0)">  var = types[0];</span></div><div><span style="background-color:rgb(0,255,0)">}</span></div><div style="background-color:rgb(255,255,255)">  err=MPI_Type_commit(&var); \</div><div style="background-color:rgb(255,255,255)">  if (err!=MPI_SUCCESS) { return err; } \</div><div style="background-color:rgb(255,255,255)">}          </div><div style="background-color:rgb(255,255,255)"><br></div><div style="background-color:rgb(255,255,255)">However, I'm not sure it is prudent to discuss this code in this context, since it is not compliant with MPI 3.0 ;-)           </div></div><p><span style="font-size:12pt;font-family:CMSS12">B.2.2 Changes in MPI-3.0 </span></p><ol><li style="font-size:11pt;font-family:CMR10"><p><span style="font-size:11pt">Section </span><span style="font-size:11pt;color:rgb(0,0,255)">2.6.1
</span><span style="font-size:11pt">on page </span><span style="font-size:11pt;color:rgb(0,0,255)">17</span><span style="font-size:11pt">, Section
</span><span style="font-size:11pt;color:rgb(0,0,255)">16.2 </span><span style="font-size:11pt">on page
</span><span style="font-size:11pt;color:rgb(0,0,255)">604 </span><span style="font-size:11pt">and all other chapters.<br>
The C++ bindings were removed from the standard. See errata in Section </span><span style="font-size:11pt;color:rgb(0,0,255)">B.2.1
</span><span style="font-size:11pt">on page </span><span style="font-size:11pt;color:rgb(0,0,255)">798
</span><span style="font-size:11pt">for the latest changes to the </span><span style="font-size:11pt;font-family:CMSS10">MPI
</span><span style="font-size:11pt">C++ binding defined in </span><span style="font-size:11pt;font-family:CMSS10">MPI-2.2</span><span style="font-size:11pt">.<br>
This change may affect backward compatibility. </span></p></li><li style="font-size:11pt;font-family:CMR10"><p><span style="font-size:11pt">Section </span><span style="font-size:11pt;color:rgb(0,0,255)">2.6.1
</span><span style="font-size:11pt">on page </span><span style="font-size:11pt;color:rgb(0,0,255)">17</span><span style="font-size:11pt">, Section
</span><span style="font-size:11pt;color:rgb(0,0,255)">15.1 </span><span style="font-size:11pt">on page
</span><span style="font-size:11pt;color:rgb(0,0,255)">599 </span><span style="font-size:11pt">and Section
</span><span style="font-size:11pt;color:rgb(0,0,255)">16.1 </span><span style="font-size:11pt">on page
</span><span style="font-size:11pt;color:rgb(0,0,255)">603</span><span style="font-size:11pt">.
<span style="background-color:rgb(255,255,0)">The deprecated functions</span> </span><span style="font-size:11pt;font-family:CMSS10">MPI</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">TYPE</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">HVECTOR</span><span style="font-size:11pt">,
</span><span style="font-size:11pt;font-family:CMSS10">MPI</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">TYPE</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">HINDEXED</span><span style="font-size:11pt">,
</span><span style="background-color:rgb(255,255,0)"><span style="font-size:11pt;font-family:CMSS10">MPI</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">TYPE</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">STRUCT</span></span><span style="font-size:11pt">,
</span><span style="background-color:rgb(255,255,0)"><span style="font-size:11pt;font-family:CMSS10">MPI</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">ADDRESS</span></span><span style="font-size:11pt">,
</span><span style="font-size:11pt;font-family:CMSS10">MPI</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">TYPE</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">EXTENT</span><span style="font-size:11pt">,
</span><span style="font-size:11pt;font-family:CMSS10">MPI</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">TYPE</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">LB</span><span style="font-size:11pt">,
</span><span style="font-size:11pt;font-family:CMSS10">MPI</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">TYPE</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">UB</span><span style="font-size:11pt">,
</span><span style="font-size:11pt;font-family:CMSS10">MPI</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">ERRHANDLER</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">CREATE
</span><span style="font-size:11pt">(and its callback function prototype </span><span style="font-size:10pt;font-family:CMSS10">MPI</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">Handler</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">function</span><span style="font-size:11pt">),
</span><span style="font-size:11pt;font-family:CMSS10">MPI</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">ERRHANDLER</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">SET</span><span style="font-size:11pt">,
</span><span style="font-size:11pt;font-family:CMSS10">MPI</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">ERRHANDLER</span><span style="font-size:11pt;font-family:CMTT10">_</span><span style="font-size:11pt;font-family:CMSS10">GET</span><span style="font-size:11pt">,
 the deprecated special datatype handles </span><span style="font-size:10pt;font-family:CMSS10">MPI</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">LB</span><span style="font-size:11pt">,
</span><span style="font-size:10pt;font-family:CMSS10">MPI</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">UB</span><span style="font-size:11pt">, and the constants
</span><span style="font-size:10pt;font-family:CMSS10">MPI</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">COMBINER</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">HINDEXED</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">INTEGER</span><span style="font-size:11pt">,
</span><span style="font-size:10pt;font-family:CMSS10">MPI</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">COMBINER</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">HVECTOR</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">INTEGER</span><span style="font-size:11pt">,
</span><span style="font-size:10pt;font-family:CMSS10">MPI</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">COMBINER</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">STRUCT</span><span style="font-size:10pt;font-family:CMTT10">_</span><span style="font-size:10pt;font-family:CMSS10">INTEGER
</span><span style="font-size:11pt"><span style="background-color:rgb(255,255,0)">were removed from the standard</span>.
</span></p><p><span style="font-size:11pt;background-color:rgb(255,255,0)">This change may affect backward compatibility. </span></p></li></ol></div></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">Best,</div><div class="gmail_extra"><br>
Jeff</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 13, 2016 at 12:54 PM, Schulz Martin <span dir="ltr">
<<a href="mailto:schulzm@llnl.gov" target="_blank">schulzm@llnl.gov</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"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div><div>Hi Jeff,</div><div><br></div><div>Unfortunately, I don’t have the code on a public repo (it is part of our internal PnMPI branch), but the critical macro is below. Nothing too surprising – it basically takes the existing datatype and adds one field, creates a new datatype and then commits
 it. The following communication then uses this datatype together with MPI_BOTTOM.</div><div><br></div><div>I agree, this code could be optimized for such special cases and adding an if statement to check for zero counts is doable. However, my point was that the proposed change does change the standard so that existing code breaks. </div><div><br></div><div>Also, it would seem strange that you then could use MPI_TYPE_NULL for some operations with count zero and not for others. For this particular code, if we would define what it means to have MPI_TYPE_NULL for MPI_Type_struct with a zero count (it should
 probably just be ignored, although we would have to think through if there are any consequences for the extent calculations), the code would work just fine. I am not sure, if this would cover all cases, though (it might, if we are carefully defining this for
 all routines that take datatypes as arguments).</div><div><br></div><div>Martin</div><div><br></div><div><br></div><div><div>#define DT_GENERALALLOC(b,c,dt,pb,var) \</div><div>{ int err,lens[2]; MPI_Aint addr[2]; MPI_Datatype types[2]; \</div><div>  types[0]=MPI_CHAR; lens[0]=piggyback_size; err=MPI_Address((void*) pb, &(addr[0])); \</div><div>  if (err!=MPI_SUCCESS) { return err; } \</div><div>  types[1]=dt; lens[1]=c; err=MPI_Address((void*) b, &(addr[1])); \</div><div>  if (err!=MPI_SUCCESS) { return err; } \</div><div>  err=MPI_Type_struct(2,lens,addr,types,&var); \</div><div>  if (err!=MPI_SUCCESS) { return err; } \</div><div>  err=MPI_Type_commit(&var); \</div><div>  if (err!=MPI_SUCCESS) { return err; } \</div><div>}                     </div></div><span class=""><div><br></div><div><br></div><div><br></div><div><br></div><div><div style="font-family:Consolas;font-size:medium">________________________________________________________________________</div><div style="font-family:Consolas;font-size:medium">Martin Schulz, <a href="mailto:schulzm@llnl.gov" target="_blank">schulzm@llnl.gov</a>, <a href="http://scalability.llnl.gov/" target="_blank">http://scalability.llnl.gov/</a></div><div style="font-family:Consolas;font-size:medium">CASC @ Lawrence Livermore National Laboratory, Livermore, USA</div><div><br></div></div></span></div><div><br></div><span><div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;border-width:1pt medium medium;border-style:solid none none;padding:3pt 0in 0in;border-top-color:rgb(181,196,223)"><span class=""><span style="font-weight:bold">From: </span>mpi-forum <<a href="mailto:mpi-forum-bounces@lists.mpi-forum.org" target="_blank">mpi-forum-bounces@lists.mpi-forum.org</a>> on behalf of Jeff Hammond <<a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a>><br><span style="font-weight:bold">Reply-To: </span>Main mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a>><br></span><span style="font-weight:bold">Date: </span>Wednesday, January 13, 2016 at 12:09 PM
<div><div class="h5"><br><span style="font-weight:bold">To: </span>Main mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a>><br><span style="font-weight:bold">Subject: </span>Re: [Mpi-forum] MPI_DATATYPE_NULL when count=0<br></div></div></div><div><br></div><div><div><div dir="ltr"><div><div class="h5">Can you provide the specifics of a tool that does this today?  I'd like to read the source code to see what changes are actually required.
<div><br></div></div></div><div><div><div class="h5">How can you piggyback an MPI collective call by hacking the datatype if count=0?  You already have to check if count=0 and bump it to count=1 if you are going to send a piggy for a null transfer, so how hard is it to replace MPI_DATATYPE_NULL
 with MPI_BYTE?  If you are not sending a piggy for a null transfer, then the issue is moot.
<div><br></div></div></div><div><div><div class="h5">If nothing else, the overhead of implementing the trivial branch that solves this issue will be negligible compared to firing up the datatype engine.
</div></div><div><div><br></div><div>Jeff<br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Jan 13, 2016 at 11:41 AM, Schulz Martin <span dir="ltr"><<a href="mailto:schulzm@llnl.gov" target="_blank">schulzm@llnl.gov</a>></span> wrote:<br></div></div><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"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div><div class="h5"><div><div><div><div>In general, I agree that allowing any argument for datatype if the count is zero makes sense. However, such a change (even if it is just allowing more) can cause backwards compatibility problems: e.g., any PMPI tool or other kind of internal wrapper library
 can currently have the assumption that it is only passed valid datatypes and hence can use the datatype without having to check. We, for example, use this to implement piggybacking (by creating a new struct datatype that contains the original one and adds
 a piggyback field). If we allowed arbitrary datatypes, we would brake such codes, unless we then also allowed it for datatype creation.</div><div><br></div><div>If we wanted to change this, we probably need to be very careful and make sure we are consistent across the standard and touch all routines that take datatype arguments. Just adding the exception for P2P, or even for all communication routines, seems insufficient.</div><div><br></div><div>Martin</div><div><br></div><div> </div><div><div style="font-size:medium;font-family:Consolas">________________________________________________________________________</div></div></div><div><br></div><div><div style="font-family:Consolas;font-size:medium">________________________________________________________________________</div><div style="font-family:Consolas;font-size:medium">Martin Schulz, <a href="mailto:schulzm@llnl.gov" target="_blank">schulzm@llnl.gov</a>, <a href="http://scalability.llnl.gov/" target="_blank">http://scalability.llnl.gov/</a></div><div style="font-family:Consolas;font-size:medium">CASC @ Lawrence Livermore National Laboratory, Livermore, USA</div><div><br></div></div></div></div><div><br></div></div></div><span><div><div class="h5"><div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;border-width:1pt medium medium;border-style:solid none none;padding:3pt 0in 0in;border-top-color:rgb(181,196,223)"><span style="font-weight:bold">From: </span>mpi-forum <<a href="mailto:mpi-forum-bounces@lists.mpi-forum.org" target="_blank">mpi-forum-bounces@lists.mpi-forum.org</a>> on behalf of Jeff Hammond <<a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a>><br><span style="font-weight:bold">Reply-To: </span>Main mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a>><br><span style="font-weight:bold">Date: </span>Wednesday, January 13, 2016 at 6:24 AM<br><span style="font-weight:bold">To: </span>Main mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a>>
<div><div><br><span style="font-weight:bold">Subject: </span>Re: [Mpi-forum] MPI_DATATYPE_NULL when count=0<br></div></div></div></div></div><div><div><div><br></div><div><div><div dir="ltr"><div><div class="h5">That is precisely what I want: when count=0, the buffer and the datatype arguments are ignored.  There may be a good reason for MPI_DATATYPE_NULL to be invalid when it is actually relevant, but when count=0, the datatype argument is not relevant,
 because there are zero of them.<br><div><br></div><div>We already state explicitly that arguments are ignored for MPI_IN_PLACE and MPI_NO_OP:<br><br>
* The “in place” option for intracommunicators is specified by passing MPI_IN_PLACE as the value of recvbuf at the root. In such a case, recvcount and recvtype are ignored..." <br><br></div></div></div><div><div><div class="h5">* "When MPI_NO_OP is specified as the operation, the origin_addr, origin_count, and origin_datatype arguments are ignored."<br><br>
I see no reason why count=0 is different from these cases.<br><br>
Jeff<br><br>
On Wed, Jan 13, 2016 at 5:47 AM, William Gropp <<a href="mailto:wgropp@illinois.edu" target="_blank">wgropp@illinois.edu</a>> wrote:<br>
><br>
> True, MPI_BOTTOM need not be null, but it might be, so the standard doesn’t prohibit it.<br>
><br>
> A carefully worded exception to the general rule for NULL handles would be ok.  I would still make it narrow; for example, just for the use of MPI_DATATYPE_NULL in communication operations with a zero count.<br>
><br>
> Bill<br>
><br>
> William Gropp<br>
> Director, Parallel Computing Institute<br>
> Thomas M. Siebel Chair in Computer Science<br>
> Chief Scientist, NCSA<br>
> University of Illinois Urbana-Champaign<br>
><br>
><br>
><br>
><br>
><br>
> On Jan 12, 2016, at 11:22 PM, Fab Tillier <<a href="mailto:ftillier@microsoft.com" target="_blank">ftillier@microsoft.com</a>> wrote:<br>
><br>
> Don’t datatypes with absolute addresses rely on MPI_BOTTOM, and a portable program can’t assume that MPI_BOTTOM == NULL?<br>
>  <br>
> I think from an ease of use perspective, if I have a count of zero, having to pick an arbitrary committed datatype is non-intuitive.  If count is zero, there is no buffer or datatype, and there should be no requirement such non-existent datatype be committed.<br>
>  <br>
> Cheers,<br>
> -Fab<br>
>  <br>
> From: mpi-forum [mailto:<a href="mailto:mpi-forum-bounces@lists.mpi-forum.org" target="_blank">mpi-forum-bounces@lists.mpi-forum.org</a>] On Behalf Of William Gropp<br>
> Sent: Wednesday, 13 January 2016 4:52 p.m.<br>
> To: Main MPI Forum mailing list <<a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a>><br>
> Subject: Re: [Mpi-forum] MPI_DATATYPE_NULL when count=0<br>
>  <br>
> Yes, NULL buffers are valid - they aren’t an MPI object.  There is no prohibition about passing them; only if they are used to form an invalid address (note that a datatype with absolute addresses relies on NULL as the buffer address).<br>
>  <br>
> Bill<br>
>  <br>
><br>
> William Gropp<br>
> Director, Parallel Computing Institute<br>
> Thomas M. Siebel Chair in Computer Science<br>
> Chief Scientist, NCSA<br>
> University of Illinois Urbana-Champaign<br>
><br>
><br>
><br>
>  <br>
> On Jan 12, 2016, at 9:49 PM, Jeff Hammond <<a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a>> wrote:<br>
><br>
><br>
> Who wrote Example 4.23 of MPI 3.1?<br>
>  <br>
> I propose to add the exception rather than delete that example. I do not want to have to use real datatypes when sending nothing.<br>
>  <br>
> Is NULL a valid buffer handle? Can I pass null pointers when count=0?<br>
><br>
>  <br>
> Jeff<br>
><br>
><br>
> On Tuesday, January 12, 2016, William Gropp <<a href="mailto:wgropp@illinois.edu" target="_blank">wgropp@illinois.edu</a>> wrote:<br>
><br>
> The standard says that the null handles are invalid for input unless explicitly permitted.  There’s no exemption for a datatype argument where the associated count is zero.<br>
>  <br>
> Bill<br>
>  <br>
><br>
> William Gropp<br>
> Director, Parallel Computing Institute<br>
> Thomas M. Siebel Chair in Computer Science<br>
> Chief Scientist, NCSA<br>
> University of Illinois Urbana-Champaign<br>
><br>
><br>
><br>
>  <br>
> On Jan 12, 2016, at 9:26 PM, Jeff Hammond <<a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a>> wrote:<br>
><br>
><br>
> Is it allowed to communicate messages with (buffer=NULL,count=0,type=MPI_DATATYPE_NULL)?<br>
>  <br>
> George thinks MPI_DATATYPE_NULL cannot be used even when count=0, which I think is ridiculous, particularly when one makes the analogy to buffer=NULL.<br>
>  <br></div></div>
> See <a href="http://secure-web.cisco.com/1uIwjXiVB0UCnFFG4b2DNhy-WFSpBHoZVan-ksg1oo1XCSjcKasJCWljyye8xZYsJX2A72ZewdK6RzVNcE2jWKnCqVVFTmp9Oprj6gbb1orgQeDMDduaWKuVGKXKbRsPnX2cJZeGodMtDUQx5HPmA46Qmql4kBAvZDR2KnWoFOQKuotirK6FQIazgUFBlC9CPP8fkF0TFKw4OIzxQJ_Tp2Xe-mRb3swzYiungQAHNUVs53lxZSOLwP432qi3ovJ8cFw4G6XCXEkE37Xx2rGYhrsHiZQy03zUFRmYy13QckBzIrtfY1zG5piXPVIOCfIoFfvm4o-tUjgyZSzspCUye23lLO2G1ic7fjL5OsxTrokI/http%3A%2F%2Fwww.open-mpi.org%2Fcommunity%2Flists%2Fusers%2F2016%2F01%2F28255.php" target="_blank">
http://secure-web.cisco.com/1uIwjXiVB0UCnFFG4b2DNhy-WFSpBHoZVan-ksg1oo1XCSjcKasJCWljyye8xZYsJX2A72ZewdK6RzVNcE2jWKnCqVVFTmp9Oprj6gbb1orgQeDMDduaWKuVGKXKbRsPnX2cJZeGodMtDUQx5HPmA46Qmql4kBAvZDR2KnWoFOQKuotirK6FQIazgUFBlC9CPP8fkF0TFKw4OIzxQJ_Tp2Xe-mRb3swzYiungQAHNUVs53lxZSOLwP432qi3ovJ8cFw4G6XCXEkE37Xx2rGYhrsHiZQy03zUFRmYy13QckBzIrtfY1zG5piXPVIOCfIoFfvm4o-tUjgyZSzspCUye23lLO2G1ic7fjL5OsxTrokI/http%3A%2F%2Fwww.open-mpi.org%2Fcommunity%2Flists%2Fusers%2F2016%2F01%2F28255.php</a>
 for the thread in question.
<div><div class="h5"><br>
>  <br>
> There is example code in MPI that uses this behavior.  George and I agree that example text is non-normative, but I cannot imagine how this example came to exist without the Forum believing it to be valid.<br>
><br>
> Jeff<br>
>  <br>
> --<br>
> 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><br>
> _______________________________________________<br>
> mpi-forum mailing list<br>
> <a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a><br>
> <a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum" target="_blank">
http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum</a><br>
><br>
>  <br>
><br>
><br>
><br>
> --<br>
> 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><br>
> _______________________________________________<br>
> mpi-forum mailing list<br>
> <a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a><br>
> <a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum" target="_blank">
http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum</a><br>
><br>
>  <br>
> _______________________________________________<br>
> mpi-forum mailing list<br>
> <a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a><br>
> <a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum" target="_blank">
http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> mpi-forum mailing list<br>
> <a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a><br>
> <a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum" target="_blank">
http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum</a><br><br><br><br><br>
--<br>
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></div></div></div></div></span></div><div><div class="h5"><br>
_______________________________________________<br>
mpi-forum mailing list<br><a href="mailto:mpi-forum@lists.mpi-forum.org" target="_blank">mpi-forum@lists.mpi-forum.org</a><br><a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum" rel="noreferrer" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum</a><br></div></div></blockquote></div><div><div class="h5"><br><br clear="all"><div><br></div>
-- <br><div>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></div></div></div></div></div></div></div></span></div><br>
_______________________________________________<br>
mpi-forum mailing list<br><a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a><br><a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum" rel="noreferrer" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-forum</a><br></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></div></span></body></html>