Skip to content

Make chpl_library_finalize() not exit the Chapel program for CHPL_COMM=gasnet #22968

Open
@bradcray

Description

@bradcray

This issue is a follow-on to #22739 and #22913. Specifically, #22739 requested that chpl_library_finalize() not tear down the program such that a user of a library author could do other things after tearing down the Chapel library. And #22913 refactored the runtime to support this for CHPL_COMM=none (and potentially other comm layers).

However, in reviewing the PR, @ronawho noted that chpl_library_finalize() calls chpl_comm_exit() which calls gasnet_exit() which exits the program. This issue captures the desire to eventually extend the current behavior to have chpl_library_finalize() not exit the program for CHPL_COMM=gasnet.

If gasnet_exit() is not called explicitly, it will be called implicitly at the exit of a GASNet program, so my proposed path forward here would be to have chpl_comm_exit() not call gasnet_exit() explicitly, and to rely on this implicit behavior to call gasnet_exit() instead. Though we do additional teardown-related actions after chpl_comm_exit(), Elliot seemed to believe that none of them would be problematic if done before gasnet_exit(), suggesting that this should be OK. The GASNet team also seemed to believe that this approach was reasonable.

While here, we might consider renaming chpl_comm_exit() or chpl_foo_exit() more generally to chpl_comm_finalize() to better indicate "wrap things up for exiting" rather than "literally exit".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions