<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div> You can scatter from a global vector to a local vector; numerous PETSc examples demonstrate this. So hanging here is surprising. Please display the entire code so we can see the context of the VecScatterCreate() usage. Perhaps not all the MPI process that are in the global_vec communicator are involved in the call to VecScatterCreate(). <div><br></div><div> To determine where the hang occurs you can run with -start_in_debugger use c for continue in each debugger window and then after a long time of hanging do control d in the hanging windows and then type bt to see where the code is hanging.</div><div><br></div><div> Barry</div><div> <br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Dec 7, 2024, at 9:47 PM, Qiyue Lu <qiyuelu1@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr">Hello,<br><div>I am trying to fetch 12 entries from a distributed vector global_vec and put them into a local vector on each process. </div><div><br></div><div><div style="background-color:rgb(31,31,31);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;line-height:19px;white-space:pre"><div style="color:rgb(204,204,204)"><span style="color:rgb(78,201,176)"> IS</span> <span style="color:rgb(156,220,254)">is_source</span>, <span style="color:rgb(156,220,254)">is_dest</span>;</div><div style=""><font color="#cccccc"> </font><span style="color:rgb(220,220,170)">ISCreateGeneral</span><font color="#cccccc">(</font><span style="color:rgb(86,156,214)">PETSC_COMM_SELF</span><font color="#cccccc">, </font><font color="#9cdcfe">12</font><font color="#cccccc">, </font><span style="color:rgb(156,220,254)">idx_global</span><font color="#cccccc">, </font><span style="color:rgb(79,193,255)">PETSC_COPY_VALUES</span><font color="#cccccc">, </font><span style="color:rgb(212,212,212)">&</span><span style="color:rgb(156,220,254)">is_source</span><font color="#cccccc">);</font></div><div style=""><span style="color:rgb(204,204,204)"> <span style="color:rgb(220,220,170)">ISCreateGeneral</span>(<span style="color:rgb(86,156,214)">PETSC_COMM_SELF</span>, </span><font color="#9cdcfe">12</font><font color="#cccccc">, </font><span style="color:rgb(156,220,254)">idx_local</span><font color="#cccccc">, </font><span style="color:rgb(79,193,255)">PETSC_COPY_VALUES</span><font color="#cccccc">, </font><span style="color:rgb(212,212,212)">&</span><span style="color:rgb(156,220,254)">is_dest</span><font color="#cccccc">);</font></div><div style="color:rgb(204,204,204)"> <span style="color:rgb(78,201,176)">Vec</span> <span style="color:rgb(156,220,254)">local_vec</span>;</div><div style="color:rgb(204,204,204)"> <span style="color:rgb(220,220,170)">VecCreate</span>(<span style="color:rgb(86,156,214)">PETSC_COMM_SELF</span>, <span style="color:rgb(212,212,212)">&</span><span style="color:rgb(156,220,254)">local_vec</span>);</div><div style=""><span style="color:rgb(204,204,204)"> <span style="color:rgb(220,220,170)">VecSetSizes</span>(<span style="color:rgb(156,220,254)">local_vec</span>, <span style="color:rgb(86,156,214)">PETSC_DECIDE</span>, </span><font color="#9cdcfe">12</font><font color="#cccccc">); </font></div><div style="color:rgb(204,204,204)"> <span style="color:rgb(220,220,170)">VecSetType</span>(<span style="color:rgb(156,220,254)">local_vec</span>, <span style="color:rgb(86,156,214)">VECSEQ</span>);</div><div style="color:rgb(204,204,204)"> <span style="color:rgb(78,201,176)">VecScatter</span> <span style="color:rgb(156,220,254)">scat</span>;</div><div style="color:rgb(204,204,204)"> <span style="color:rgb(220,220,170)">VecScatterCreate</span>(<span style="color:rgb(156,220,254)">global_vec</span>, <span style="color:rgb(156,220,254)">is_source</span>, <span style="color:rgb(156,220,254)">local_vec</span>, <span style="color:rgb(156,220,254)">is_dest</span>, <span style="color:rgb(212,212,212)">&</span><span style="color:rgb(156,220,254)">scat</span>);</div></div></div><div><br></div><div><br></div><div>I create the local vector as sequential. However, the last two lines which create a scatter object, will cause more than half processes to hang and no error pops out. </div><div><br></div><div>Does the scatter have to be VECMPI to VECMPI and cannot VECMPI to VECSEQ?</div><div><br></div><div>Thanks,</div><div>Qiyue Lu</div></div>
</div></blockquote></div><br></div></body></html>