<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">In src/mpi/comm/intercomm_create.c from lines 58, the calculation of maxi seems to be incorrect when maxlpid is a multiple of 32.</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">    /* Compute the max index and zero the pids array */</div><div style="font-family:arial,sans-serif;font-size:13px">    maxi = (maxlpid + 31) / 32;</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">    if (maxi >= MAX_LPID32_ARRAY) {</div><div style="font-family:arial,sans-serif;font-size:13px">
<span style="white-space:pre-wrap">     </span>MPIU_CHKLMEM_MALLOC(lpidmask,int32_t*,maxi*sizeof(int32_t),</div><div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap">                        </span>    mpi_errno,"lpidmask");</div>
<div style="font-family:arial,sans-serif;font-size:13px">    }</div><div style="font-family:arial,sans-serif;font-size:13px">    else {</div><div style="font-family:arial,sans-serif;font-size:13px"><span style="white-space:pre-wrap">   </span>lpidmask = lpidmaskPrealloc;</div>
<div style="font-family:arial,sans-serif;font-size:13px">    }</div><div style="font-family:arial,sans-serif;font-size:13px">    </div><div style="font-family:arial,sans-serif;font-size:13px">    for (i=0; i<maxi; i++) lpidmask[i] = 0;</div>
</div>