<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=""><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div class="">PetscCall in C doesn’t actually “call” the function that is in its arguments, but rather “checks” the called function’s return </div></div></blockquote><div class=""><br class=""></div>The most logical form would have been `PetscCheck()` but we unfortunately we had just recently added it as a replacement for<div class=""><br class=""><div class=""><div class="">```</div><div class="">if (error) SETERRQ()</div><div class="">``` </div><div class=""><br class=""></div><div class="">So the idea instead was to have a `PetscSafeCall()` but with less typing. It also fit with the previous `PetscStackCall()` family. You can find the naming discussion here <a href="https://gitlab.com/petsc/petsc/-/merge_requests/4889#note_854556084" class="">https://gitlab.com/petsc/petsc/-/merge_requests/4889#note_854556084</a><div class=""><br class=""><div class="">
<meta charset="UTF-8" class=""><div>Best regards,<br class=""><br class="">Jacob Faibussowitsch<br class="">(Jacob Fai - booss - oh - vitch)</div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Apr 26, 2022, at 20:18, Boyce Griffith <<a href="mailto:boyceg@gmail.com" class="">boyceg@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Apr 26, 2022, at 8:12 PM, Barry Smith <<a href="mailto:bsmith@petsc.dev" class="">bsmith@petsc.dev</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span 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; float: none; display: inline !important;" class="">I didn't like PetscCall(ierr) in Fortran because it is strange, even freakish. PetscCall(AFunction(args)) makes sense in C but IMHO "call AFunction(args,ierr); PetscCall(ierr)" looks weird, what are you calling? Nothing. I'd like to keep CHKERRQ(ierr) in Fortran and not support PetscCall(ierr) in Fortran.<span class="Apple-converted-space"> </span></span></div></blockquote></div><br class=""><div class="">I have to admit that I don’t really understand the C usage either, since unless I am misreading the code, PetscCall in C doesn’t actually “call” the function that is in its arguments, but rather “checks” the called function’s return value.</div><div class=""><br class=""></div><div class="">— Boyce</div></div></div></blockquote></div><br class=""></div></div></div></div></body></html>