<div dir="ltr"><div dir="ltr">On Sun, Sep 4, 2022 at 5:50 PM Nicholas Arnold-Medabalimi <<a href="mailto:narnoldm@umich.edu">narnoldm@umich.edu</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">Thank you. I'm able to access the label functions. Can you clarify what the Begin and End functions are doing? <br><br>To clarify the behavior I am trying to achieve, I have identified the blue cell in the attached figure using metrics during the solve. I have already created a label across all the partitions I'm using to tag the identified and adjacent cells however I need the Root cell label to be updated to one when the initial identified cell is adjacent to its corresponding leaf. That doesn't seem to be happening with I use the propagate command, but I may be misusing them. I appreciate the assistance.<br></div></blockquote><div><br></div><div>I need to explain in more detail what is happening. Propagate ensures that all points involved in the PetscSF for points, meaning all shared points, have the same label values. In your diagram, it would appear that the 3 faces in red are shared, so label values on those faces would be made consistent across processes.</div><div><br></div><div>From your description, it would appear that you have at least 2 choices:</div><div><br></div><div> 1) Label faces as well, with the rule that face labels cause any cell in the support to be labeled, and labeling a cell also labels its faces<br><br> 2) Partition with a cell overlap</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"><img src="cid:ii_l7nv9qrr0" alt="image.png" width="506" height="253"><br><br><br>Sincerely <br>Nicholas<br><br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 2, 2022 at 7:27 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@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"><div dir="ltr">On Fri, Sep 2, 2022 at 12:53 AM Nicholas Arnold-Medabalimi <<a href="mailto:narnoldm@umich.edu" target="_blank">narnoldm@umich.edu</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">I've been trying to update from the snapshot to the main branch on the gitlab but I'm having one issue. This does not occur using the snapshot petsc mentioned previously. <br><br>I use a PetscViewer to read in a file. The appended function is used to fast-forward to the locations in the file. Looking at the error message, I thought maybe the file wasn't opening properly. However, I am able to read in and print the first line of the file using PetscViewerRead. As far as I can tell, the error is only due to the version change and I see something about the viewer in the compatibility notes, but I'm not sure how to resolve it. Any assistance would be appreciated since I can't use the gitlab version for the label functions without fixing this.<br></div></blockquote><div><br></div><div>You are missing "PetscFunctionBeginUser;" at the start of your function. This must be paired with all PetscFunctionReturn() calls since we keep</div><div>track of the stack. We added this check in the new version.</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"><br><div style="color:rgb(255,255,255);background-color:rgb(0,36,81);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre-wrap"><div><span style="color:rgb(255,238,173)">PetscErrorCode</span> <span style="color:rgb(187,218,255)">FileFastForward</span>(<span style="color:rgb(255,238,173)">PetscViewer</span> <span style="color:rgb(255,197,143)">viewer</span>, <span style="color:rgb(235,187,255)">char</span> <span style="color:rgb(255,197,143)">delim</span>, <span style="color:rgb(235,187,255)">bool</span> <span style="color:rgb(235,187,255)">&</span><span style="color:rgb(255,197,143)">eof</span>)</div><div>{</div><div> <span style="color:rgb(235,187,255)">int</span> <span style="color:rgb(255,157,164)">i</span> <span style="color:rgb(153,255,255)">=</span> <span style="color:rgb(255,197,143)">0</span>, <span style="color:rgb(255,157,164)">ret</span> <span style="color:rgb(153,255,255)">=</span> <span style="color:rgb(255,197,143)">0</span>;</div><div> <span style="color:rgb(235,187,255)">char</span> <span style="color:rgb(255,157,164)">buffer</span>;</div><div> <span style="color:rgb(235,187,255)">do</span></div><div> <span style="color:rgb(187,218,255)">PetscViewerRead</span>(<span style="color:rgb(255,197,143)">viewer</span>, <span style="color:rgb(153,255,255)">&</span>(<span style="color:rgb(255,157,164)">buffer</span>), <span style="color:rgb(255,197,143)">1</span>, <span style="color:rgb(153,255,255)">&</span><span style="color:rgb(255,157,164)">ret</span>, <span style="color:rgb(255,157,164)">PETSC_CHAR</span>);</div><div> <span style="color:rgb(235,187,255)">while</span> (<span style="color:rgb(255,157,164)">ret</span> <span style="color:rgb(153,255,255)">></span> <span style="color:rgb(255,197,143)">0</span> <span style="color:rgb(153,255,255)">&&</span> <span style="color:rgb(255,157,164)">buffer</span> <span style="color:rgb(153,255,255)">!=</span> <span style="color:rgb(255,197,143)">delim</span>);</div><div> <span style="color:rgb(235,187,255)">if</span> (<span style="color:rgb(255,157,164)">ret</span> <span style="color:rgb(153,255,255)">==</span> <span style="color:rgb(255,197,143)">0</span>)</div><div> {</div><div> <span style="color:rgb(187,218,255)">printf</span>(<span style="color:rgb(209,241,169)">"End of file reached before delimiter found</span><span style="color:rgb(255,197,143)">\n</span><span style="color:rgb(209,241,169)">"</span>);</div><div> <span style="color:rgb(255,197,143)">eof</span> <span style="color:rgb(153,255,255)">=</span> <span style="color:rgb(255,197,143)">false</span>;</div><div> }</div><div> <span style="color:rgb(235,187,255)">else</span></div><div> <span style="color:rgb(255,197,143)">eof</span> <span style="color:rgb(153,255,255)">=</span> <span style="color:rgb(255,197,143)">true</span>;</div><div> <span style="color:rgb(187,218,255)">PetscFunctionReturn</span>(<span style="color:rgb(255,197,143)">0</span>);</div><div>}</div></div>The viewer is opened using <br><div style="color:rgb(255,255,255);background-color:rgb(0,36,81);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre-wrap"><div> <span style="color:rgb(187,218,255)">PetscViewerCreate</span>(<span style="color:rgb(255,157,164)">PETSC_COMM_WORLD</span>, <span style="color:rgb(153,255,255)">&</span><span style="color:rgb(255,157,164)">viewer</span>);</div><div> <span style="color:rgb(187,218,255)">PetscViewerSetType</span>(<span style="color:rgb(255,157,164)">viewer</span>, <span style="color:rgb(187,218,255)">PETSCVIEWERASCII</span>);</div><div> <span style="color:rgb(187,218,255)">PetscViewerFileSetMode</span>(<span style="color:rgb(255,157,164)">viewer</span>, <span style="color:rgb(255,157,164)">FILE_MODE_READ</span>);</div><div> <span style="color:rgb(187,218,255)">PetscViewerFileSetName</span>(<span style="color:rgb(255,157,164)">viewer</span>, <span style="color:rgb(255,157,164)">meshfile</span>);</div></div>The error that is thrown is <br><br>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[0]PETSC ERROR: Petsc has generated inconsistent data<br>[0]PETSC ERROR: Invalid stack size 0, pop FileFastForward /home/narnoldm/code/solver-playground/version_upgrade/version_debug.cpp:35. (Note this line is the PetscFunctionReturn)<br><br>[0]PETSC ERROR: See <a href="https://petsc.org/release/faq/" target="_blank">https://petsc.org/release/faq/</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Development GIT revision: unknown GIT Date: unknown<br>[0]PETSC ERROR: /home/narnoldm/code/solver-playground/build/bin/version on a named Dragoon by narnoldm Fri Sep 2 00:34:02 2022<br>[0]PETSC ERROR: Configure options --prefix=/home/narnoldm/code/solver-playground/build/external/PETSc --with-hdf5-dir=/home/narnoldm/code/solver-playground/build/external/HDF5 --download-triangle --download-parmetis --download-metis --with-debugging=1<br>[0]PETSC ERROR: #1 FileFastForward() at /home/narnoldm/code/solver-playground/version_upgrade/version_debug.cpp:35<br>application called MPI_Abort(MPI_COMM_SELF, 77) - process 0<br>[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=77<br>:<br>system msg for write_line failure : Bad file descriptor<br><br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 1, 2022 at 5:32 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@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"><div dir="ltr">On Wed, Aug 31, 2022 at 9:30 PM Nicholas Arnold-Medabalimi <<a href="mailto:narnoldm@umich.edu" target="_blank">narnoldm@umich.edu</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">Hi <br><br>Thanks, this looks like what I need, but I don't seem to have it in my release (3.17.4 from <a href="https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.17.4.tar.gz" target="_blank">https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.17.4.tar.gz</a>). I see it in the current repository, though. Is the 3.17.4 tarball just missing it, or will it be added in the next release? <br></div></blockquote><div><br></div><div>Yes, it is in main (<a href="https://petsc.org/main/docs/changes/dev/" target="_blank">https://petsc.org/main/docs/changes/dev/</a>) since it was an interface change. Our main branch is quite stable, and I would recommend</div><div>it for development work.</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">Thanks<br>Nicholas</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 31, 2022 at 7:45 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@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"><div dir="ltr">On Tue, Aug 30, 2022 at 6:37 PM Nicholas Arnold-Medabalimi <<a href="mailto:narnoldm@umich.edu" target="_blank">narnoldm@umich.edu</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">Hi<br><br>Thanks for all the help. I'm looking to tag several cells based on metrics occurring at run time. In addition to the metric-defined cells I also want to label the surrounding cells. This is no problem as I can traverse the DMPlex chart to get the neighboring cells. The issue only arises if an identified cell is on a partition boundary. this leads to the neighbor cell in the overlap halo being tagged. However, the root cell on the adjacent partition is not tagged. Is there a built-in way to synchronize the labels from the leafs to the roots? <br><br>Right now, I iterate through the root and leaf cells of each processor, but it is somewhat wasteful as I don't see a way for the root cell partition to know if a corresponding leaf cell label value without communicating it first. <br></div></blockquote><div><br></div><div>What I think you want is this:</div><div><br></div><div> <a href="https://petsc.org/main/docs/manualpages/DMLabel/DMLabelPropagateBegin/" target="_blank">https://petsc.org/main/docs/manualpages/DMLabel/DMLabelPropagateBegin/</a></div><div><br></div><div>I use this to do the same kind of labeling I think. It is setup to allow multiple rounds,</div><div>so that you can use the communicated labeling to continue on the new rank.</div><div><br></div><div>Will this work?</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> <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">Thanks<br>Nicholas<br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div style="font-family:arial;font-size:small"><font color="#000000">Nicholas Arnold-Medabalimi<br><br></font><span style="font-family:sans-serif;font-size:14px">Ph.D. Candidate</span><font color="#000000"><br>Computational Aeroscience Lab<br>University of Michigan</font></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><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>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div style="font-family:arial;font-size:small"><font color="#000000">Nicholas Arnold-Medabalimi<br><br></font><span style="font-family:sans-serif;font-size:14px">Ph.D. Candidate</span><font color="#000000"><br>Computational Aeroscience Lab<br>University of Michigan</font></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><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>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div style="font-family:arial;font-size:small"><font color="#000000">Nicholas Arnold-Medabalimi<br><br></font><span style="font-family:sans-serif;font-size:14px">Ph.D. Candidate</span><font color="#000000"><br>Computational Aeroscience Lab<br>University of Michigan</font></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><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>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div style="font-family:arial;font-size:small"><font color="#000000">Nicholas Arnold-Medabalimi<br><br></font><span style="font-family:sans-serif;font-size:14px">Ph.D. Candidate</span><font color="#000000"><br>Computational Aeroscience Lab<br>University of Michigan</font></div></div></div></div></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>