<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div><div class=""> I never liked, and never understood, the business of </div><div class=""><br class=""></div><div class="">PetscCall(PetscObjectComposeFunction((PetscObject)pc,"PCGAMGSetProcEqLim_C",NULL));</div><div class=""><br class=""></div><div class="">a large list of functions that match was composed in earlier when an object's type is destroyed. </div><div class=""><br class=""></div><div class="">And now I see this horrific <span style="font-family: Menlo; font-size: 14px;" class="">-checkfunctionlist</span> that got into the CI.</div><div class=""><br class=""></div><div class="">Side note: I think it is a mistake to add much of anything to the .gitlab-ci.yml file about options for tests. The net effect of them is that no one can (reasonably) run, at home, the same tests as the CI trivially. They have to hunt around and look for options in the .gitlab-ci.yml that they may want to add somewhere when they run the test harness. This type of thing I believe belongs in the test harness infrastructure so people running make test get the same tests as the CI does, not in the .gitlab-ci.yml file. I have removed some in the past and will continue to remove them when possible. Satish likes it because it is easy to do and he lets it happen, I'm too lazy to notice that someone is adding something there so it grows again.</div><div class=""><br class=""></div><div class="">Back to the main topic. Why don't we just destroy the obj->qlist always when the object's type is destroyed? Then one needs not worry about getting the exact list into each type destroy function.</div><div class=""><br class=""></div><div class="">Is it for fear that the user may have put other functions on the PetscObject, that are not related to the object's specific type and we don't want them destroyed? Or some other reason? </div><div class=""><br class=""></div><div class="">I think we should get rid of this horrible need to manually remove the function pointers. If needed, one way to do it would be to have two qlists for each object or to somehow mark the implementation functions in some way and only remove those? For example, note the naming convention ClassTypeXXX PCGAMGSetProc... when destroying a type we could remove all composed functions that start with ClassType. For example the block of code (that appears in many places)</div><div class=""><br class=""></div><div class=""><div class=""> /* Destroy the previous private PC context */</div><div class=""> if (pc->ops->destroy) {</div><div class=""> PetscCall((*pc->ops->destroy)(pc));</div><div class=""> pc->ops->destroy = NULL;</div><div class=""> pc->data = NULL;</div><div class=""> }</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">could be a function that cleans up the qlist and resets the destroy and data. Say </div><div class=""><br class=""></div><div class="">PetscObjectDestroyType(PetscObject obj)</div><div class="">if obj->hdr.destroytype {</div><div class=""> PetscFunctionListPurge(obj->list,objectname+typename)</div><div class=""> obj->hdr.destroytype = NULL</div><div class=""> obj->hdr.data = NULL</div><div class="">}</div><div class=""><br class=""></div><div class="">This would be a good thing to do anyways since almost all PETSc objects have a type destroy and type data already, best to get them in the unified base class, less code duplication for each new PETSc object.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>