<div dir="ltr"><div dir="ltr">On Sun, Dec 18, 2022 at 9:44 AM 김성익 <<a href="mailto:ksi2443@gmail.com">ksi2443@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">For example, before using preallocaotor, I made A matrix. (A matrix has information about indices of global matrix)<div>And the code structures are as below.</div><div>for (int i=0; i<num; i++){</div><div>   MatGetRow(A,~~) // for getting indices info of global matrix.</div><div>   MatSetvalues(preallocator, value_from_A);</div><div>}</div><div>Current state, I got an error at 'MatGetRow' when I run this code in parallel.</div><div>That's why I want "all mpi ranks has information of A matrix".</div></div></blockquote><div><br></div><div>Just from your explanation, this does not sound like a scalable algorithm for this, and FEM should be scalable.</div><div>I would take a look at some parallel FEM codes before settling on this structure.</div><div><br></div><div>However, if you really wish to do this, you can create the original matrix and then call</div><div><br></div><div>  <a href="https://petsc.org/main/docs/manualpages/Mat/MatCreateSubMatrices/">https://petsc.org/main/docs/manualpages/Mat/MatCreateSubMatrices/</a></div><div><br></div><div>with every process giving all indices as the argument.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks,</div><div>Hyung Kim</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2022년 12월 18일 (일) 오후 11:36, Junchao Zhang <<a href="mailto:junchao.zhang@gmail.com" target="_blank">junchao.zhang@gmail.com</a>>님이 작성:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I am not clear on what you said "this information must be viewed in all mpi ranks."  Even with preallocator, each rank only needs to insert entries it knows (i.e., don't need to get all entries)</div><div><br></div><div>Maybe you could provide an example code for us to better understand what you mean?</div><div><br></div><div><div dir="ltr"><div dir="ltr">--Junchao Zhang</div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 18, 2022 at 8:25 AM 김성익 <<a href="mailto:ksi2443@gmail.com" target="_blank">ksi2443@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div><br></div><div>Is there a matrix version function of VecScatterCreateToAll?</div><div><br></div><div>I'm using preallocator for preallocation of global matrix.</div><div>Prior to using the preallocator, information related to allocation is stored in the specific matrix, and this information must be viewed in all mpi ranks.<br></div><div>For using preallocator, I need scattering the specific matrix info to all mpi ranks.</div><div><br></div><div>Thanks,</div><div>Hyung Kim</div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>