Abort.hpp
Go to the documentation of this file.
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 /// \file
5 /// Defines function Parallel::abort.
6 
7 #pragma once
8 
9 #include <charm++.h>
10 #include <exception>
11 #include <string>
12 
13 namespace Parallel {
14 
15 /// \ingroup ParallelGroup
16 /// Abort the program with an error message.
17 [[noreturn]] inline void abort(const std::string& message) {
18  CkAbort(message.c_str());
19  // the following call is never reached, but suppresses the warning that
20  // a 'noreturn' functions does return
21  std::terminate(); // LCOV_EXCL_LINE
22 }
23 
24 } // namespace Parallel
Contains functions that forward to Charm++ parallel functions.
Definition: Abort.hpp:13
void abort(const std::string &message)
Abort the program with an error message.
Definition: Abort.hpp:17