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

Investigate NaN error catching in compiler #374

Closed
permcody opened this issue Feb 14, 2014 · 4 comments
Closed

Investigate NaN error catching in compiler #374

permcody opened this issue Feb 14, 2014 · 4 comments
Assignees
Labels
C: Framework P: minor A defect that does not affect the accuracy of results. T: task An enhancement to the software.

Comments

@permcody
Copy link
Member

None

@ghost ghost assigned andrsd Feb 14, 2014
@permcody
Copy link
Member Author

There doesn't seem to be a portable way to do this. On the Mac, one can use the Intel intrinsics to set the FP control register to throw an exception when a NaN is used in a calculation but despite my best attempts, I've not been able to recreate a good stack after catching the signal.

For now we are using an explicit check in debug mode for catching nans.

@permcody
Copy link
Member Author

Explore the PETSC -fp_trap option to see if we can get a stack trace from it.

@permcody
Copy link
Member Author

David is working on a solution similar to the one I was working on but has disabled the Petsc error handler as well allowing for a stack trace to be caught at least on Mac/GCC.

@andrsd
Copy link
Contributor

andrsd commented Feb 14, 2014

This is implemented. It works only in debug mode - where we get the full stack trace. It does not work in opt mode, since the compiler optimizes out stuff and we were getting false alarms.

Thus, closing this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework P: minor A defect that does not affect the accuracy of results. T: task An enhancement to the software.
Projects
None yet
Development

No branches or pull requests

2 participants