Enable optional floating point exception (FPE) trapping in rootlogon.C#768
Enable optional floating point exception (FPE) trapping in rootlogon.C#768
Conversation
There was a problem hiding this comment.
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
| { | ||
| // set FloatPointException trap | ||
| namespace rootlogon { | ||
| int fpe=0;const char *env=0; |
There was a problem hiding this comment.
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; |
| gSystem->SetFPEMask(kInvalid | kDivByZero | kOverflow ); | ||
| printf("*** Float Point Exception is ON ***\n"); | ||
| } else { | ||
| printf("*** Float Point Exception is OFF ***\n"); |
There was a problem hiding this comment.
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 |
4bfc15c to
7ba1d45
Compare
The lines come directly form /afs/rhic.bnl.gov/star/ROOT/5.34.38/root/etc/rootlogon.C