Go to the documentation of this file. 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 #define Z2_FORWARD_EXCEPTIONS \ 81 catch (std::runtime_error &e) { throw e; } \ 82 catch (std::logic_error &e) { throw e; } \ 83 catch (std::bad_alloc &e) { throw e; } \ 84 catch (std::exception &e) { throw e; } 95 #define Z2_THROW_EXPERIMENTAL(mystr) \ 97 std::ostringstream oss; \ 98 oss << (mystr) << std::endl \ 99 << "To experiment with this software, configure with " \ 100 << "-D Zoltan2_ENABLE_Experimental:BOOL=ON " \ 102 throw std::runtime_error(oss.str()); \ 114 #define Z2_THROW_EXPERIMENTAL_WOLF(mystr) \ 116 std::ostringstream oss; \ 117 oss << (mystr) << std::endl \ 118 << "To experiment with this software, configure with " \ 119 << "-D Zoltan2_ENABLE_Experimental_Wolf:BOOL=ON " \ 121 throw std::runtime_error(oss.str()); \ 128 #define Z2_THROW_SERIAL(mystr) \ 130 std::ostringstream oss; \ 131 oss << (mystr) << std::endl \ 132 << "This algorithm only runs in serial (Comm_Serial or MPI_Comm with worldsize=1). " \ 134 throw std::runtime_error(oss.str()); \ 144 #define Z2_ASSERT_VALUE(actual, expected) \ 146 if (actual != expected) \ 148 std::ostringstream oss; \ 149 oss << "Expected value " << expected << "does not match actual value"\ 150 << actual << "in" << __FILE__<<", "<<__LINE__ \ 152 throw std::runtime_error(oss.str()); \ 158 #define __func__zoltan2__ __FUNCTION__ 160 #define __func__zoltan2__ "unknown zoltan2 function" 163 #define __func__zoltan2__ __func__