Skip to content

Commit

Permalink
Adding ability to ignore SIGABRT
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSimpson committed Nov 8, 2015
1 parent 4ea8c69 commit 5cff296
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
17 changes: 16 additions & 1 deletion src/split.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,17 @@ static void SegvHandler(int sig) {
exit(EXIT_SUCCESS);
}

// Handle SIGABRT, to handle a call to abort() for instance
static void AbrtHandler(int sig) {
fprintf(stderr, "*********\n ERROR: Signal Received: %d\n*********\n", sig);

MPI_Finalize();

exit(EXIT_SUCCESS);
}

// For an exit code of 0, any process with non 0 exit will abort entire wraprun
// Works for exit() or return()
static void ExitHandler() {
int finalized = 0;
MPI_Finalized(&finalized);
Expand Down Expand Up @@ -187,13 +197,18 @@ static void SplitInit() {
fprintf(stderr, "ERROR REGISTERING SIGSEGV HANDLER!\n");
}

if (getenv("W_IGNORE_ABRT")) {
sighandler_t err_abrt = signal(SIGABRT, AbrtHandler);
if(err_abrt == SIG_ERR)
fprintf(stderr, "ERROR REGISTERING SIGARBT HANDLER!\n");
}

if (getenv("W_IGNORE_RETURN_CODE")) {
int err_code = atexit(ExitHandler);
if(err_code != 0)
fprintf(stderr, "ERROR REGISTERING ATEXIT HANDLER!\n");
}


SetSplitCommunicator(color);

SetWorkingDirectory(work_dir);
Expand Down
3 changes: 2 additions & 1 deletion wraprun_formula.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class WraprunFormula < Formula
homepage "https://github.com/olcf/wraprun"
url "https://github.com/olcf/wraprun/archive/v0.1.4.tar.gz"
url "https://github.com/olcf/wraprun/archive/v0.1.5.tar.gz"

concern for_version("dev") do
included do
Expand Down Expand Up @@ -93,6 +93,7 @@ module load dynamic-link
setenv W_UNSET_PRELOAD 1
setenv W_IGNORE_SEGV 1
setenv W_IGNORE_RETURN_CODE 1
setenv W_IGNORE_ABRT 1
<% if @builds.size > 1 %>
<%= module_build_list @package, @builds %>
Expand Down

0 comments on commit 5cff296

Please sign in to comment.