Skip to content

Handle AMReX Abort Across Dynamic Libs to Apps #76

Open
@ax3l

Description

@ax3l

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 BLAST-ImpactX/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.:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions