<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 21 May 2021, at 7:49 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div dir="ltr" class="">On Fri, May 21, 2021 at 12:33 PM Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" class="">stefano.zampini@gmail.com</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="overflow-wrap: break-word;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 21 May 2021, at 7:17 PM, Pierre Jolivet <<a href="mailto:pierre@joliv.et" target="_blank" class="">pierre@joliv.et</a>> wrote:</div><br class=""><div class=""><div style="overflow-wrap: break-word;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 21 May 2021, at 6:03 PM, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" target="_blank" class="">stefano.zampini@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Emmanuel<div class=""><br class=""></div><div class="">thanks for reporting this.</div><div class="">I believe we have a regression in MatChop from <a href="https://gitlab.com/petsc/petsc/-/commit/038df967165af8ac6c3de46a36f650566a7db07c" target="_blank" class="">https://gitlab.com/petsc/petsc/-/commit/038df967165af8ac6c3de46a36f650566a7db07c</a><span class="Apple-converted-space"> </span>(cc'ing Pierre)<div class="">We call MatAssemblyBegin/End within the row loop. Also. I don't understand why we need to check for  r < rend herre <a href="https://gitlab.com/petsc/petsc/-/blob/038df967165af8ac6c3de46a36f650566a7db07c/src/mat/utils/axpy.c#L513" target="_blank" class="">https://gitlab.com/petsc/petsc/-/blob/038df967165af8ac6c3de46a36f650566a7db07c/src/mat/utils/axpy.c#L513</a>. nor why we need to allocate newCols (can use cols)</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">That part is from the initial 8-year old implementation from Matt (<a href="https://gitlab.com/petsc/petsc/-/commit/4325cce7191c5c61f4f090c59eaf6773fdee7b48#9d78409dea8190bffda8b68fee5aef233dc1c677" target="_blank" class="">https://gitlab.com/petsc/petsc/-/commit/4325cce7191c5c61f4f090c59eaf6773fdee7b48#9d78409dea8190bffda8b68fee5aef233dc1c677</a>).</div><div class="">You need the check otherwise this error is raised: <a href="https://www.mcs.anl.gov/petsc/petsc-current/src/mat/interface/matrix.c.html#line566" target="_blank" class="">https://www.mcs.anl.gov/petsc/petsc-current/src/mat/interface/matrix.c.html#line566</a>.</div></div></div></div></blockquote><div class=""><br class=""></div>I see, anyway you do not need the check if the loop range [rStart,rEnd). So now I don’t understand why the loop must be [rStart,rStart+maxRows], Matt?</div></div></blockquote><div class=""><br class=""></div><div class="">It is terrible, but I could not see a way around it. We want to use MatGetRow() for each row, but that requires an assembled matrix.</div></div></div></div></blockquote><div><br class=""></div><div>What is the use case for calling MatChop on an unassembled matrix ?</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="gmail_quote"><div class="">We want to use</div><div class="">MatSetValues() to changes things, but that unassembles the matrix, so we need an assembly at each iteration, but assembly is collective, so everyone has</div><div class="">to take the same number of iterations. Thus, maxRows.</div></div></div></div></blockquote><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="gmail_quote"><div class=""><br class=""></div><div class="">   Matt <br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="overflow-wrap: break-word;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div style="overflow-wrap: break-word;" class=""><div class=""><div class="">Thanks,</div><div class="">Pierre</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">Pierre, can you take a look?</div></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 21 mag 2021 alle ore 18:49 Emmanuel Ayala <<a href="mailto:juaneah@gmail.com" target="_blank" class="">juaneah@gmail.com</a>> ha scritto:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr" class=""><div class="">Hi everybody,</div><div class=""><br class=""></div><div class="">I just updated petsc from version 13 to 15. Before the update everything works well, then my code give me an error:</div><div class=""><br class=""></div><div class="">[9]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br class="">[9]PETSC ERROR: Invalid argument<br class="">[9]PETSC ERROR: Setting off process row 53484 even though MatSetOption(,MAT_NO_OFF_PROC_ENTRIES,PETSC_TRUE) was set<br class="">[9]PETSC ERROR: See<span class="Apple-converted-space"> </span><a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank" class="">https://www.mcs.anl.gov/petsc/documentation/faq.html</a><span class="Apple-converted-space"> </span>for trouble shooting.<br class="">[9]PETSC ERROR: Petsc Release Version 3.15.0, Mar 30, 2021<span class="Apple-converted-space"> </span><br class="">[9]PETSC ERROR: ./comp on a arch-linux-c-opt-O2-superlud_mumps_hyp named eayala by ayala Fri May 21 10:40:36 2021<br class="">[9]PETSC ERROR: Configure options --with-debugging=0 COPTFLAGS="-O2 -march=native -mtune=native" CXXOPTFLAGS="-O2 -march=native -mtune=native" FOPTFLAGS="-O2 -march=native -mtune=native" --download-mpich --download-hypre --download-mumps --download-scalapack --download-parmetis --download-metis --download-superlu_dist --download-cmake --download-fblaslapack=1 --with-cxx-dialect=C++11</div><div class=""><br class=""></div><div class="">The error appears after a matrix assembly, the matrix was created with DMCreateMatrix and updated with MatSetValuesLocal.</div><div class=""><br class=""></div><div class="">A Little work around I found the solution, avoid using MatChop on this matrix, but I still need to use MatChop. There is any reason to have this problem?</div><div class=""><br class=""></div><div class="">Thanks in advance.<br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div></blockquote></div><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class="">Stefano</div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></blockquote></div><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></div></blockquote></div><br class=""></body></html>