From: Jed B. <je...@je...> - 2017-11-07 23:48:01
|
Roy Stogner <roy...@ic...> writes: > On Tue, 7 Nov 2017, Jed Brown wrote: > >> If you have a list of options that you handle, you can use >> PetscOptionsHasName(NULL, NULL, "-your-option", NULL) so that PETSc >> knows it is used and won't warn about it. Might be simpler than munging >> the command line before passing it off. > > Much simpler, thanks! I didn't know that method existed. > >>> Do PETSc options ever include an =? >> >> No. > > That's two out of three categories down... except if I understand your > third response, it's a necessary category for us to bother with? Unfortunately. >>> We could have a method which strips out any argument with an = in >>> it... >>> >>> Oh, but we'd *also* need to handle application-specific >>> position-independent arguments which *aren't* just input file >>> overrides, like the options we grab via GetPot in >>> src/apps/calculator.C >> >> PETSc doesn't process or complain about these. > > And that's the third. I think I misinterpreted what you were referring to here. > But I don't yet understand: why not? Is it just because we use > double-dashes and the PETSc unused-option detection looks for > single-dashes? How about a slightly different solution. Before calling PetscFinalize, call PetscOptionsLeftGet and loop over the options, calling PetscOptionsHasName if you would have recognized it. So if it contains an = or leading --, you could ignore it. |