Skip to content

Commit

Permalink
Feature #1730: set std::set_terminate for charm++ applications
Browse files Browse the repository at this point in the history
Gives a meaningful error message in case an application causes a C++
exception.

Change-Id: Id01f44f984158afe3c37df7b4b59a2aa1f8f4b7e
  • Loading branch information
matthiasdiener committed Feb 14, 2018
1 parent 7b2ec34 commit becc773
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ck-core/init.C
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ void _initCharm(int unused_argc, char **argv)
int inCommThread = (CmiMyRank() == CmiMyNodeSize());

DEBUGF(("[%d,%.6lf ] _initCharm started\n",CmiMyPe(),CmiWallTimer()));
std::set_terminate([](){ CkAbort("Unhandled C++ exception in user code.\n");});

CkpvInitialize(size_t *, _offsets);
CkpvAccess(_offsets) = new size_t[32];
Expand Down

0 comments on commit becc773

Please sign in to comment.