-
Notifications
You must be signed in to change notification settings - Fork 28
Unset DISPLAY to avoid importing ROOT when not showing plots #314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Do we want to rely on this implementation detail of ROOT? Or is this documented as an actual guarantee somewhere? |
Well it's more a Linux thing since |
Also that line has last changed (according to git) 25 years ago, when ROOT went from cvs to svn, so I would consider the behavior fairly stable for now ;). We should document that edit: One thing that might break with this is https://github.com/key4hep/k4MarlinWrapper/blob/main/k4MarlinWrapper/examples/event_display.py . I am not entirely sure since technically |
BTW: this issue in ROOT is probably relevant for the general issue: root-project/root#18744 |
I'm happy with this as it is. Once root-project/root#18744 is merged we can also use that but in the meanwhile this works as intended for me. |
Unfortunately this seems not to be so easy. Running the ported Conformal Tracking prints what seems to be harmless errors:
This doesn't happen when running other algorithms that create ROOT histograms and write them to a file. Also, it doesn't happen when running the CLD reconstruction. I'm not sure why it happens for Conformal Tracking, maybe something that is done related to ROOT from DDKaltest. |
BEGINRELEASENOTES
ENDRELEASENOTES
In my testing unsetting the environment variable
DISPLAY
seems to be enough to disable showing plots. The reason to do this is that importing ROOT is slow (on my desktop it is ~0.5 seconds) so it's better if we can avoid it.If DISPLAY is set, then batch mode is guaranteed not to be set: https://github.com/root-project/root/blob/ee9e36b3c7b9209a5ae1f1f4f7a8e4afba104c25/core/base/src/TROOT.cxx#L875
Can you please test it @Zehvogel (since you found this originally in #207)? You can copy and paste the k4run script in this PR without building anything.
I also thought about changing the option from
--interactive-root
to--interactive-graphics
since all graphics will be disabled (I think), but it's true that most likely it's ROOT graphics what someone wants to see.