Skip to content

Commit

Permalink
Merge pull request #5314 from raffenet/abort-cvar
Browse files Browse the repository at this point in the history
Add cvar to dump a corefile on abort

Approved-by: Hui Zhou <[email protected]>
  • Loading branch information
raffenet authored Jun 7, 2021
2 parents 6618ddb + c44ced2 commit 5c99b94
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/mpi/init/init_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
scope : MPI_T_SCOPE_ALL_EQ
description : Disable printing of abort error message.
- name : MPIR_CVAR_COREDUMP_ON_ABORT
category : ERROR_HANDLING
type : boolean
default : false
class : none
verbosity : MPI_T_VERBOSITY_USER_BASIC
scope : MPI_T_SCOPE_ALL_EQ
description : Call libc abort() to generate a corefile
=== END_MPI_T_CVAR_INFO_BLOCK ===
*/

Expand Down
4 changes: 4 additions & 0 deletions src/mpid/ch3/src/mpid_abort.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ int MPID_Abort(MPIR_Comm * comm, int mpi_errno, int exit_code,
MPL_error_printf("%s\n", error_msg);
fflush(stderr);

if (MPIR_CVAR_COREDUMP_ON_ABORT) {
abort();
}

/* FIXME: What is the scope for PMI_Abort? Shouldn't it be one or more
process groups? Shouldn't abort of a communicator abort either the
process groups of the communicator or only the current process?
Expand Down
5 changes: 5 additions & 0 deletions src/mpid/ch4/src/ch4_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ int MPID_Abort(MPIR_Comm * comm, int mpi_errno, int exit_code, const char *error
MPIR_FUNC_VERBOSE_EXIT(MPID_STATE_MPID_ABORT);
fflush(stderr);
fflush(stdout);

if (MPIR_CVAR_COREDUMP_ON_ABORT) {
abort();
}

if (NULL == comm || (MPIR_Comm_size(comm) == 1 && comm->comm_kind == MPIR_COMM_KIND__INTRACOMM))
MPL_exit(exit_code);

Expand Down

0 comments on commit 5c99b94

Please sign in to comment.