BOUT-dev icon indicating copy to clipboard operation
BOUT-dev copied to clipboard

Erroneous unused options warning when using PETSc

Open mikekryjak opened this issue 6 months ago • 4 comments

When using PETSc, all of the command line arguments are passed to it indiscriminately. This includes -d, which obviously does nothing inside PETSc and is therefore unused. This triggers the unused variable warning when writing BOUT.settings:

Run finished at  : Mon Jun  9 15:41:11 2025
Run time : 5 s
Finalising PETSc
WARNING! There are options you set that were not used!
WARNING! could be spelling mistake, etc!
There is one unused database option. It is:
Option left: name:-d value: finish-selcoll/fscol1d-evpress_braginskii_afn source: command line
        Option datadir = finish-selcoll/fscol1d-evpress_braginskii_afn (Command line)
        Option settingsfile = BOUT.settings (default)
Writing options to file finish-selcoll/fscol1d-evpress_braginskii_afn/BOUT.settings
        Option time_report:show = 0 (default)

mikekryjak avatar Jun 09 '25 17:06 mikekryjak

Hmm, I thought we fixed this. Which BOUT++ version/commit are you using here?

ZedThree avatar Jun 09 '25 17:06 ZedThree

I'm on https://github.com/boutproject/BOUT-dev/tree/396f6a7618a6a8dcdc6f9d46e51acb9e38e84d19, which is the commit we're linked to in Hermes-3.

mikekryjak avatar Jun 10 '25 13:06 mikekryjak

I can't reproduce this issue. What version of PETSc are you using @mikekryjak?

tomc271 avatar Sep 24 '25 11:09 tomc271

Reproduced the issue with PETSc version 3.23.6.

From https://community.freefem.org/t/suppress-options-left-when-using-petsc/2702: "Previously, this was only displayed with debug builds, but now it also shows up in optimized builds. You can skip this specific message using the additional option -options_left no (or false, or 0)."

tomc271 avatar Sep 25 '25 10:09 tomc271