46 #ifndef _ZOLTAN2_EXCEPTIONS_HPP_ 47 #define _ZOLTAN2_EXCEPTIONS_HPP_ 64 #define Z2_THROW_OUTSIDE_ERROR(env) \ 65 catch (std::exception &e) { \ 66 std::cerr<<(env).myRank_<<" "<<__FILE__<<","<<__LINE__<<","<<e.what()<<std::endl; \ 80 std::ostringstream emsg;
81 emsg << ffile <<
":" << lline
82 <<
" error: " << ffunc <<
" is not implemented." 87 const char *
what()
const throw() {
return msg.c_str(); }
92 #define Z2_THROW_NOT_IMPLEMENTED \ 93 { throw Zoltan2::NotImplemented(__FILE__, __LINE__, __func__zoltan2__); } 106 #define Z2_FORWARD_EXCEPTIONS \ 107 catch (std::runtime_error &e) { throw e; } \ 108 catch (std::logic_error &e) { throw e; } \ 109 catch (std::bad_alloc &e) { throw e; } \ 110 catch (std::exception &e) { throw e; } 121 #define Z2_THROW_EXPERIMENTAL(mystr) \ 123 std::ostringstream oss; \ 124 oss << (mystr) << std::endl \ 125 << "To experiment with this software, configure with " \ 126 << "-D Zoltan2_ENABLE_Experimental:BOOL=ON " \ 128 throw std::runtime_error(oss.str()); \ 140 #define Z2_THROW_EXPERIMENTAL_WOLF(mystr) \ 142 std::ostringstream oss; \ 143 oss << (mystr) << std::endl \ 144 << "To experiment with this software, configure with " \ 145 << "-D Zoltan2_ENABLE_Experimental_Wolf:BOOL=ON " \ 147 throw std::runtime_error(oss.str()); \ 154 #define Z2_THROW_SERIAL(mystr) \ 156 std::ostringstream oss; \ 157 oss << (mystr) << std::endl \ 158 << "This algorithm only runs in serial (Comm_Serial or MPI_Comm with worldsize=1). " \ 160 throw std::runtime_error(oss.str()); \ 170 #define Z2_ASSERT_VALUE(actual, expected) \ 172 if (actual != expected) \ 174 std::ostringstream oss; \ 175 oss << "Expected value " << expected << "does not match actual value"\ 176 << actual << "in" << __FILE__<<", "<<__LINE__ \ 178 throw std::runtime_error(oss.str()); \ 184 #define __func__zoltan2__ __FUNCTION__ 186 #define __func__zoltan2__ "unknown zoltan2 function" 189 #define __func__zoltan2__ __func__
const char * what() const
NotImplemented(const char *ffile, const int lline, const char *ffunc)
Exception thrown when a called base-class method is not implemented.