Ignore:
Timestamp:
Apr 13, 2013, 1:19:18 PM (13 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
1e45786
Parents:
e5d779b
Message:

Added more info to MPI exception.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/comm/mpi/error_handler.cpp

    re5d779b r8bec32  
    4242#endif
    4343
     44#include <sstream>
     45
    4446#include "comm/mpi/error_handler.hpp"
    4547
    4648void VMG::MPI::ConvertToException(MPI_Comm* comm, int* err, ...)
    4749{
    48   char error_string[MPI_MAX_ERROR_STRING];
    49   int resultlen;
    50   MPI_Error_string(*err, error_string, &resultlen);
    51   throw Exception(error_string);
     50  int rank;
     51  char error_string[MPI_MAX_ERROR_STRING+1], comm_name[MPI_MAX_OBJECT_NAME+1];
     52  int error_len, comm_name_len;
     53
     54  MPI_Comm_rank(*comm, &rank);
     55  MPI_Error_string(*err, error_string, &error_len);
     56  MPI_Comm_get_name(*comm, comm_name, &comm_name_len);
     57
     58  std::stringstream error_concat;
     59  error_concat << "vmg: Rank " << rank << " on communicator \"" << comm_name << "\": " << error_string;
     60
     61  throw Exception(error_concat.str().c_str());
    5262}
    5363
Note: See TracChangeset for help on using the changeset viewer.