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

Handle AMReX Abort Across Dynamic Libs to Apps #76

Open
6 tasks
ax3l opened this issue Sep 28, 2022 · 1 comment
Open
6 tasks

Handle AMReX Abort Across Dynamic Libs to Apps #76

ax3l opened this issue Sep 28, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@ax3l
Copy link
Member

ax3l commented Sep 28, 2022

We want to make sure that calls to amrex::Abort() & general exceptions from, e.g., throw std::runtime_error(...)s, can be propagated across dynamic libraries of AMReX, ABLASTR, etc. up to app Python bindings. In other words: an amrex::Abort() called from routines that are compiled into the AMReX .so file, e.g. amrex::ParmParse::get(), should be able to be caught as a runtime error in WarpX/ImpactX.

See description in ECP-WarpX/impactx#265 for details.

  • set amrex.signal_handling = 0 and amrex.throw_exception = 1 in Python runs
  • proper amrex::Abort support: enable working, cross-dynamic-library throw std::runtime_error exceptions
    • macOS: e.g., RTTI flags on AppleClang ?
    • Linux: e.g., -shared-libgcc on Linux (or use g++ for linking)
    • since RTTI is the default with all modern compilers, this could also be related to symbol stripping in pybind11 release builds: https://stackoverflow.com/a/17923224/2719194 - which conda-forge seems to handle well (see links below)
  • make sure users can still trigger backtraces if they want to

Might also addressable via a custom system::error_handler:
https://github.com/AMReX-Codes/amrex/blob/b84d7c069cef7470f195b250926ca0e84ec46fb2/Src/Base/AMReX.cpp#L205-L206

Refs.:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant