<div dir="ltr">Is it the right solution?<br><div><br>diff --git a/src/sys/objects/subcomm.c b/src/sys/objects/subcomm.c<br>index 752550d..17ef49b 100644<br>--- a/src/sys/objects/subcomm.c<br>+++ b/src/sys/objects/subcomm.c<br>
@@ -186,7 +186,7 @@ PetscErrorCode PetscSubcommSetTypeGeneral(PetscSubcomm psubcomm,PetscMPIInt colo<br> ierr = MPI_Allgather(sendbuf,2,MPI_INT,recvbuf,2,MPI_INT,comm);CHKERRQ(ierr);<br> <br> ierr = PetscMalloc(nsubcomm*sizeof(PetscMPIInt),&subsize);CHKERRQ(ierr);<br>
- for (i=0; i<2*size; i++) {<br>+ for (i=0; i<2*size; i+=2) {<br> subsize[recvbuf[i]] = recvbuf[i+1];<br> }<br> ierr = PetscFree(recvbuf);CHKERRQ(ierr);<br><br></div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">2013/10/2 Stefano Zampini <span dir="ltr"><<a href="mailto:s.zampini@cineca.it" target="_blank">s.zampini@cineca.it</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div>Hong,<br><br></div>currently in master there's an error in PetscSubcommSetTypeGeneral, namely in the loop starting at line 188<br><br><pre><span>for</span> <span>(</span><span>i</span><span>=</span><span>0</span><span>;</span> <span>i</span><span><</span><span>2</span><span>*</span><span>size</span><span>;</span> <span>i</span><span>++</span><span>)</span> <span>{</span>
<a name="14179d01a4ed1f94_cl-189"></a> <span>subsize</span><span>[</span><span>recvbuf</span><span>[</span><span>i</span><span>]]</span> <span>=</span> <span>recvbuf</span><span>[</span><span>i</span><span>+</span><span>1</span><span>];</span>
<a name="14179d01a4ed1f94_cl-190"></a><span>}</span></pre>recvbuf is allocated at line 178 as 2*size*sizeof(PetscMPIInt), and the loop tries to read at location 2*size<br><br></div>Could you please fix it?<span class="HOEnZb"><font color="#888888"><br>
<br><br clear="all">
<div><div><div><div><br>-- <br><div dir="ltr"><pre cols="72"><font><span style="font-family:garamond,serif"><span style="font-family:garamond,serif"></span>Ph. D. Stefano Zampini<br>CINECA
SuperComputing Applications and Innovations Department - SCAI
Via dei Tizii, 6 00185 Roma - ITALY
------------------------------------------------------------------------------------------------------------------------
Email: <a href="mailto:s.zampini@cineca.it" target="_blank"><span>s.zampini@cineca.it</span></a>
SkypeID: stefano.zampini
GoogleTalk: <a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</a>
Tel: <a value="+390644486720">+39 06.44486.707<br></a></span></font><a value="+390644486720"><font><span style="font-family:garamond,serif">------------------------------------------------------------------------------------------------------------------------
</span></font><br></a></pre></div>
</div></div></div></div></font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><pre cols="72"><font><span style="font-family:garamond,serif"><span style="font-family:garamond,serif"></span>Ph. D. Stefano Zampini<br>CINECA
SuperComputing Applications and Innovations Department - SCAI
Via dei Tizii, 6 00185 Roma - ITALY
------------------------------------------------------------------------------------------------------------------------
Email: <a href="mailto:s.zampini@cineca.it" target="_blank"><span>s.zampini@cineca.it</span></a>
SkypeID: stefano.zampini
GoogleTalk: <a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</a>
Tel: <a value="+390644486720">+39 06.44486.707<br></a></span></font><a value="+390644486720"><font><span style="font-family:garamond,serif">------------------------------------------------------------------------------------------------------------------------
</span></font><br></a></pre></div>
</div>