TRIQS/mpi
1.3.0
C++ interface to MPI
Loading...
Searching...
No Matches
utils.hpp
Go to the documentation of this file.
1
// Copyright (c) 2024 Simons Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0.txt
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
//
15
// Authors: Thomas Hahn, Alexander Hampel, Olivier Parcollet, Nils Wentzell
16
21
22
#pragma once
23
24
#include <mpi.h>
25
26
#include <stdexcept>
27
#include <string>
28
29
namespace
mpi {
30
35
51
inline
void
check_mpi_call
(
int
errcode,
const
std::string &mpi_routine) {
52
if
(errcode != MPI_SUCCESS)
throw
std::runtime_error(
"MPI error "
+ std::to_string(errcode) +
" in MPI routine "
+ mpi_routine);
53
}
54
56
57
}
// namespace mpi
mpi::check_mpi_call
void check_mpi_call(int errcode, const std::string &mpi_routine)
Check the success of an MPI call.
Definition
utils.hpp:51
mpi
utils.hpp
Generated by
1.13.2