Skip to content
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

Add option to control whether pyimath uses the fp exception mechanism #538

Merged

Conversation

kdt3rd
Copy link
Contributor

@kdt3rd kdt3rd commented Aug 24, 2019

Signed-off-by: Kimball Thurston kdt3rd@gmail.com

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
@@ -10,6 +10,10 @@ include(GNUInstallDirs)
set(PYILMBASE_OVERRIDE_PYTHON2_INSTALL_DIR "" CACHE STRING "Override the install location for any python 2.x modules compiled")
set(PYILMBASE_OVERRIDE_PYTHON3_INSTALL_DIR "" CACHE STRING "Override the install location for any python 3.x modules compiled")

# Enables tracking of floating point exceptions and throwing them
# as the signals are received
option(PYIMATH_ENABLE_EXCEPTIONS "Enable runtime floating point exceptions" OFF)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I reading this correctly - the new option is off by default, is that the intention? Previous to this change, fp exceptions would be handled, but now they're only handled if you specify this option? Seems it would be better to leave the behavior as is, but provide an option to disable it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you are reading the change correctly. As near as I can tell, the fp exception mechanism only seems reliable for gcc under linux, so I am suggesting disabling it by default. We could leave it on for linux / gcc by default. Even with clang, it doesn't seeom work reliably under linux. But we're also doing an incredible amount of work for every single operation in pyimath (i.e. setting and clearing the exception handler), it seemed ridiculous. We can talk about it at the meeting this week? Maybe there's something I'm missing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'm fine with changing the default, consistency is better.

@cary-ilm cary-ilm merged commit cd1b068 into AcademySoftwareFoundation:master Aug 29, 2019
@cary-ilm cary-ilm added this to the v2.4.0 milestone Aug 29, 2019
@kdt3rd kdt3rd deleted the add_pyimath_exc_option branch February 12, 2022 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants