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

Mac Arm64 Architecture fpe handling #3447

Merged
merged 6 commits into from
Jul 28, 2023

Conversation

johnson452
Copy link
Contributor

@johnson452 johnson452 commented Jul 25, 2023

Summary

Handles floating pointing exception when compiled on arch64 and Apple (for M1 and M2 chips). Only works for overflow currently, there is an apparent limitation to these architectures for catching division by zero.

Additional background

SIGILL instead of SIGFPE is needed to catch arch64 signals, see ref: https://developer.apple.com/forums/thread/689159

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

@WeiqunZhang
Copy link
Member

We need to restore the previous signal handler for SIGILL in amrex::Finalize(). We could also update BLBackTrace::handler to print out a message about the type of signal.

@WeiqunZhang WeiqunZhang requested a review from atmyers July 25, 2023 17:41
@atmyers
Copy link
Member

atmyers commented Jul 25, 2023

This worked for me on my M1 mac.

@atmyers atmyers enabled auto-merge (squash) July 27, 2023 21:09
auto-merge was automatically disabled July 27, 2023 21:13

Head branch was pushed to by a user without write access

Src/Base/AMReX.cpp Outdated Show resolved Hide resolved
@WeiqunZhang WeiqunZhang merged commit bba6d9c into AMReX-Codes:development Jul 28, 2023
64 of 66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants