49 #ifndef SHYLU_DEBUG_MANAGER_HPP 50 #define SHYLU_DEBUG_MANAGER_HPP 59 #include "ShyLUCore_config.h" 61 #ifdef HAVE_SHYLUCORE_MPI 65 #include "Teuchos_oblackholestream.hpp" 86 inline void setDebugLevel(
int debugLevel) { debugLevel_ = debugLevel; };
89 inline std::ostream& stream()
91 if ( debugLevel_ && iPrint_ )
99 inline void print(
int debugLevel,
const std::string &output);
101 inline void printInAllTasks(
int debugLevel,
const std::string &output);
106 inline void print(
int debugLevel,
const char *output);
108 inline void printInAllTasks(
int debugLevel,
const char *output);
110 inline void error(
const std::string &output);
124 debugLevel_(debugLevel),
127 #ifdef HAVE_SHYLUCORE_MPI 129 MPI_Initialized(&mpiStarted);
130 if (mpiStarted) MPI_Comm_rank(MPI_COMM_WORLD, &myPID_);
135 iPrint_ = (myPID_ == 0);
138 inline void DebugManager::print(
int debugLevel,
const std::string &output)
141 if (debugLevel <= debugLevel_ && iPrint_)
146 inline void DebugManager::print(
int debugLevel,
const char *output)
149 if (debugLevel <= debugLevel_ && iPrint_)
154 inline void DebugManager::printInAllTasks(
int debugLevel,
155 const std::string &output)
158 if (debugLevel <= debugLevel_)
159 *myOS_ <<
"PID =" << myPID_ <<
" " << output;
163 inline void DebugManager::printInAllTasks(
int debugLevel,
167 if (debugLevel <= debugLevel_)
168 *myOS_ <<
"PID =" << myPID_ <<
" " << output;
173 inline void DebugManager::error(
const std::string &output)
175 *myOS_ <<
"PID =" << myPID_ <<
" " << output;
178 #endif // SHYLU_DEBUG_MANAGER_HPP Call reponsible for handeling debugging.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)