]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpi/src/error_string.cpp
1 // Copyright (C) 2018 Alain Miniussi <alain.miniussi -at- oca.eu>.
3 // Use, modification and distribution is subject to the Boost Software
4 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
8 #include <boost/mpi/error_string.hpp>
10 namespace boost
{ namespace mpi
{
12 std::string
error_string(int err
)
14 char buffer
[MPI_MAX_ERROR_STRING
];
16 int status
= MPI_Error_string(err
, buffer
, &len
);
17 if (status
== MPI_SUCCESS
) {
18 return std::string(buffer
);
20 std::ostringstream out
;
21 if (status
== MPI_ERR_ARG
) {
22 out
<< "<invalid MPI error code " << err
<< ">";
24 out
<< "<got error " << status
25 << " while probing MPI error " << err
<< ">";