-
Notifications
You must be signed in to change notification settings - Fork 68
Enable optional floating point exception (FPE) trapping in rootlogon.C #768
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds optional floating point exception (FPE) trapping functionality to the ROOT logon script. The implementation checks environment variables to determine whether FPE trapping should be enabled, with automatic activation for development versions.
Key changes:
- Adds conditional FPE trapping based on STAR_VERSION and STARFPE environment variables
- Provides console feedback on FPE status
- Uses a namespace to organize the FPE-related variables
StRoot/macros/rootlogon.C
Outdated
| { | ||
| // set FloatPointException trap | ||
| namespace rootlogon { | ||
| int fpe=0;const char *env=0; |
Copilot
AI
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple variable declarations on a single line reduce readability. Each variable should be declared on its own line for better maintainability.
| int fpe=0;const char *env=0; | |
| int fpe = 0; | |
| const char *env = 0; |
StRoot/macros/rootlogon.C
Outdated
| gSystem->SetFPEMask(kInvalid | kDivByZero | kOverflow ); | ||
| printf("*** Float Point Exception is ON ***\n"); | ||
| } else { | ||
| printf("*** Float Point Exception is OFF ***\n"); |
Copilot
AI
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term 'Float Point Exception' should be 'Floating Point Exception' to use the correct spelling.
|
@plexoos , are you intending to re-commit each change introduced into rootlogon.C documented by the CVS commits from 1998-2016 that aren't already in the version re-introduced in 2021? The CVS commit comments do already provide some minimal documentation of the added lines. https://www.star.bnl.gov/cgi-bin/protected/viewvc.cgi/cvsroot/StRoot/macros/rootlogon.C?hideattic=0&view=log |
No, only the ones we discussed: fpe and xrootd |
genevb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4bfc15c to
7ba1d45
Compare
Co-authored-by: Copilot <[email protected]>
klendathu2k
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The lines come directly form /afs/rhic.bnl.gov/star/ROOT/5.34.38/root/etc/rootlogon.C