42 #ifndef TEUCHOS_PERFORMANCEMONITORBASE_H 43 #define TEUCHOS_PERFORMANCEMONITORBASE_H 228 static TEUCHOS_DEPRECATED
void clearTimer (
const std::string& name);
254 static std::map<std::string, RCP<T> > theCounters;
255 static int initialized;
257 theCounters.clear ();
276 typedef std::map<std::string, RCP<T> > map_type;
277 typedef typename map_type::iterator iter_type;
280 iter_type it = ctrs.find (name);
282 if (it == ctrs.end ()) {
283 newCounter =
rcp (
new T (name));
284 #ifdef HAVE_TEUCHOS_DEBUG 285 const bool wasNotThere = ctrs.insert (std::make_pair (name, newCounter)).second;
287 ! wasNotThere, std::logic_error,
288 "getNewCounter: insert() claims that timer \"" << name <<
"\" was " 289 "already there in the map, even though find() claims that it was not. " 290 "Please report this bug to the Teuchos developers.");
293 ctrs.insert (it, std::make_pair (name, newCounter));
294 #endif // HAVE_TEUCHOS_DEBUG 296 newCounter = it->second;
297 #ifdef HAVE_TEUCHOS_DEBUG 299 it->second.is_null (), std::logic_error,
300 "getNewCounter: Timer \"" << name <<
"\" was already there in the map, " 301 "but looking it up by name resulted in a null timer. " 302 "Please report this bug to the Teuchos developers.");
304 name != it->second->name (), std::logic_error,
305 "getNewCounter: Timer \"" << name <<
"\" was already there in the map, " 306 "but looking it up by name resulted in a timer with a different name \"" 307 << it->second->name () <<
"\". Please report this bug to the Teuchos " 309 #endif // HAVE_TEUCHOS_DEBUG 312 #ifdef HAVE_TEUCHOS_DEBUG 314 newCounter.
is_null (), std::logic_error,
315 "getNewCounter: At end of method, when creating timer \"" << name
316 <<
"\", newCounter is null. Please report this bug to the Teuchos " 318 #endif // HAVE_TEUCHOS_DEBUG 326 typedef std::map<std::string, RCP<T> > map_type;
327 typedef typename map_type::iterator iter_type;
330 iter_type it = ctrs.find (name);
331 if (it == ctrs.end ()) {
368 #endif // TEUCHOS_PERFORMANCEMONITORBASE_H
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
void mergeCounterNames(const Comm< int > &comm, const Array< std::string > &localNames, Array< std::string > &globalNames, const ECounterSetOp setOp)
Merge counter names over all processors.
Templated array class derived from the STL std::vector.
Abstract interface for distributed-memory communication.
Smart reference counting pointer class for automatic garbage collection.
ECounterSetOp
Set operation type for mergeCounterNames() to perform.
Reference-counted pointer class and non-member templated function implementations.
bool is_null() const
Returns true if the underlying pointer is null.