85 std::string baseMsg = std::string(
"Level ") +
86 boost::lexical_cast<std::string>(level) +
87 std::string(
" assertion violation\n") +
88 #if defined(NEKTAR_DEBUG) || defined(NEKTAR_FULLDEBUG)
89 std::string(
"Where : ") + boost::lexical_cast<std::string>(routine) + std::string(
"[") + boost::lexical_cast<std::string>(lineNumber) + std::string(
"]\n") + std::string(
"Message : ") +
96 #if defined(NEKTAR_USE_MPI)
100 MPI_Initialized(&flag);
103 MPI_Comm_rank(MPI_COMM_WORLD,&rank);
108 std::string btMessage(
"");
109 #if defined(NEKTAR_FULLDEBUG)
115 btSize = backtrace(btArray, 40);
116 btStrings = backtrace_symbols(btArray, btSize);
118 for (
int i = 0 ; i < btSize ; ++i)
120 btMessage += std::string(btStrings[i]) +
"\n";
133 (*outStream) << btMessage;
134 (*outStream) <<
"Fatal : " << baseMsg << std::endl;
138 std::cerr << btMessage;
139 std::cerr << std::endl <<
"Fatal : " << baseMsg
143 #if defined(NEKTAR_USE_MPI)
148 MPI_Barrier(MPI_COMM_WORLD);
152 throw NekError(baseMsg);
159 (*outStream) << btMessage;
160 (*outStream) <<
"Warning: " << baseMsg << std::endl;
164 std::cerr << btMessage;
165 std::cerr <<
"Warning: " << baseMsg << std::endl;
170 std::cerr <<
"Unknown warning type: " << baseMsg << std::endl;
static boost::optional< std::ostream & > outStream
string msg
print "Adding",units.name, hash(units), units.description(), print "(was",id(_u),"now",id(units),")" Ensure referenced units exist