From 495ee50a31ec7fb1832ffa59f2ce15f22679f1c5 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Mon, 5 Apr 2021 12:28:18 +0200 Subject: [PATCH] print backtrace when we exit due to an MPI failure --- src/smpi/bindings/smpi_mpi.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/smpi/bindings/smpi_mpi.cpp b/src/smpi/bindings/smpi_mpi.cpp index 7125608cf1..85be4db1c9 100644 --- a/src/smpi/bindings/smpi_mpi.cpp +++ b/src/smpi/bindings/smpi_mpi.cpp @@ -48,9 +48,13 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi) MPI_Errhandler err = (errhan) ? (errhan)->errhandler() : MPI_ERRHANDLER_NULL; \ if (err == MPI_ERRHANDLER_NULL || err == MPI_ERRORS_RETURN) \ XBT_WARN("%s - returned %.*s instead of MPI_SUCCESS", __func__, error_size, error_string); \ - else if (err == MPI_ERRORS_ARE_FATAL) \ + else if (err == MPI_ERRORS_ARE_FATAL){ \ + if (xbt_log_no_loc) \ + XBT_INFO("The backtrace would be displayed here if --log=no_loc would not have been passed"); \ + else \ + xbt_backtrace_display_current(); \ xbt_die("%s - returned %.*s instead of MPI_SUCCESS", __func__, error_size, error_string); \ - else \ + } else \ err->call((errhan), ret); \ if (err != MPI_ERRHANDLER_NULL) \ simgrid::smpi::Errhandler::unref(err); \ -- 2.20.1