QMCPACK
AppAbort.cpp
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source
3 // License. See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2020 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Lab
8 //
9 // Refactored from: Communicate.cpp
10 ////////////////////////////////////////////////////////////////////////////////
11 
12 #include "AppAbort.h"
13 #include <iostream>
14 #include "config.h"
15 
16 #ifdef HAVE_MPI
17 #include <mpi.h>
18 
19 void breakableAppAbort(const std::string& str_msg)
20 {
21  std::cerr << str_msg << '\n';
22  MPI_Abort(MPI_COMM_WORLD, 1);
23 }
24 #else
25 void breakableAppAbort(const std::string& str_msg)
26 {
27  std::cerr << str_msg << '\n';
28  exit(1);
29 }
30 #endif
void breakableAppAbort(const std::string &str_msg)
break on this function to catch any APP_ABORT call in debugger
Definition: AppAbort.cpp:25