SyneRBI / SIRF

Main repository for the CCP SynerBI software
http://www.ccpsynerbi.ac.uk
Other
58 stars 29 forks source link

Gadgetron NUFFT producing a lot of output in stdout. #1175

Open johannesmayer opened 1 year ago

johannesmayer commented 1 year ago

The non-uniform Fourier transform using Gadgetron generates a lot of output during the gridding. The output is just timing how long the gridding took. In the past this has caused notebooks to crash without warning.

This output can be suppressed by adjusting the gadgetron logger-level setting an environmental variable export GADGETRON_LOG_MASK="LEVEL_INFO" (c.f. here).

This should be documented somewhere, but I don't know where would be best. Or maybe exporting the variable in the sirf environmental script could automatically suppress it, I don't know what would be best.

KrisThielemans commented 1 year ago

I think it would make sense to add it to the env scripts as a default value, and provide an equivalent to stir.set_verbosity() in SIRF that would set the env variable, assuming that changing the env variable while in python would change the log-level. @johannesmayer could you test that?

johannesmayer commented 1 year ago

I did some testing, but doing anything to the environmental variables from Python will not modify them in the parent shell (according to SO). Setting the verbosity level within Python seems not possible.

KrisThielemans commented 1 year ago

yes, you cannot modify anything in the parent shell, and certainly not anything for a running Gadgetron server. However, you are running this toolboxes directly from SIRF, so I didn't think the parent shell as we involved. I think if you change the env variables from Python, you would change them for the whole process, and therefore for anything that runs from Python. But I guess you tried that...

The alternative is to do a PR to Gadgetron to be able to switch this output off.