<div dir="ltr">Even simpler than this, we could just forward all calls to the MPI_Count interface (see below). The int count argument should type convert to MPI_Count without issue. Note that it still needs to be a function-like macro so that function pointers work.<div><br></div><div>Don't give up yet! :D</div><div><br></div><div> ~Jim.</div><div><br></div>
<p class="gmail-p1" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(94,220,255);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">#include </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)"><stdio.h></span></p><p class="gmail-p2" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">typedef</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> MPI_Datatype;</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">typedef</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> MPI_Comm;</span></p><p class="gmail-p2" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> MPI_Send(</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">const</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">* buf, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> count, MPI_Datatype datatype, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> dest,</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> tag, MPI_Comm comm)</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">{</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>printf(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">"MPI_Send(count = </span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(254,212,213)">%d</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">)</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(254,212,213)">\n</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">"</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, count);</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(232,235,20)">return</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">;</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p><p class="gmail-p2" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> MPI_Send_x(</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">const</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">* buf, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">long</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">long</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> count, MPI_Datatype datatype, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> dest,</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> tag, MPI_Comm comm)</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">{</span></p><p class="gmail-p4" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(251,0,255);background-color:rgb(0,0,0)"><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(242,242,242)"><span class="gmail-Apple-converted-space"> </span>printf(</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"MPI_Send_x(count = </span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(254,212,213)">%lld</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">)</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures;color:rgb(254,212,213)">\n</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">"</span><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(242,242,242)">, count);</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(232,235,20)">return</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">;</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p><p class="gmail-p2" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p><p class="gmail-p1" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(94,220,255);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">#define MPI_Send(buf, count, datatype, dest, tag, comm) MPI_Send_x(buf, count, datatype, dest, tag, comm)</span></p><p class="gmail-p2" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0);min-height:16px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> main(</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> argc, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">char</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> *argv[]) {</span></p><p class="gmail-p5" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(44,238,235);background-color:rgb(0,0,0)"><span class="gmail-s6" style="font-variant-ligatures:no-common-ligatures;color:rgb(242,242,242)"><span class="gmail-Apple-converted-space"> </span></span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">/* 8589934592LL == 2^33 */</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">long</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">long</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> i = </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">8589934592LL</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> + </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">11</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">;</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> ret;</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> (*snd_ptr)(</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">const</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">void</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">*, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, MPI_Datatype, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(126,255,165)">int</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, MPI_Comm) = &MPI_Send;</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>ret = MPI_Send(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">NULL</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, i, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>ret = MPI_Send(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">NULL</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">5</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>ret = (*snd_ptr)(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">NULL</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, i, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>ret = (*snd_ptr)(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">NULL</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">5</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">, </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p><p class="gmail-p3" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span><span class="gmail-s5" style="font-variant-ligatures:no-common-ligatures;color:rgb(232,235,20)">return</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(251,0,255)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">;</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Menlo for Powerline";color:rgb(94,220,255);background-color:rgb(0,0,0)">
</p><p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">}</span></p> <div>
<p class="gmail-p1" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">MPI_Send_x(count = 8589934603)</span></p><p class="gmail-p1" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">MPI_Send_x(count = 5)</span></p><p class="gmail-p1" style="margin:0px;font:14px "Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">MPI_Send(count = 11)</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)">
</p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:14px;line-height:normal;font-family:"Menlo for Powerline";color:rgb(242,242,242);background-color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">MPI_Send(count = 5)</span></p></div></div>