CollectiveCheck.hpp
Go to the documentation of this file.
1/*
2 This file is part of The Open Porous Media project (OPM).
3
4 OPM is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 OPM is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with OPM. If not, see <http://www.gnu.org/licenses/>.
16*/
17
22#ifndef OPM_UPSCALING_COLLECTIVE_CHECK_HPP
23#define OPM_UPSCALING_COLLECTIVE_CHECK_HPP
24
25#include <functional>
26#include <stdexcept>
27
28namespace Opm {
29
35 class CollectiveFailure : public std::runtime_error
36 {
37 public:
38 using std::runtime_error::runtime_error;
39 };
40
62 void collectiveCheck(const std::function<void()>& work);
63
82 void abortParallelRun(int exitCode);
83
84} // namespace Opm
85
86#endif // OPM_UPSCALING_COLLECTIVE_CHECK_HPP
void const int double const int double double * work
Definition: blas_lapack.hpp:86
Exception thrown on every rank when at least one rank failed.
Definition: CollectiveCheck.hpp:36
Definition: ImplicitAssembly.hpp:43
void abortParallelRun(int exitCode)
Terminate all ranks because this rank cannot continue.
void collectiveCheck(const std::function< void()> &work)
Run a unit of work on all ranks and agree on its outcome.