52 default_workspace_store = default_workspace_store_in;
57 return default_workspace_store;
62 if( workspace_store ) {
64 <<
"\n*** Statistics for autmatic array workspace:" 65 <<
"\n Number of megabytes of preallocated workspace = " 67 <<
"\n Number of megabytes needed = " 69 <<
"\n Number of allocations using preallocated workspace = " 71 <<
"\n Number of dynamic allocations beyond preallocated workspace = " 77 <<
"\n*** Statistics for autmatic array workspace:" 78 <<
"\n No workspace storage was allocated!\n";
87 : workspace_begin_(NULL)
88 , workspace_end_(NULL)
90 , num_static_allocations_(0)
91 , num_dyn_allocations_(0)
92 , num_current_bytes_total_(0)
93 , num_max_bytes_needed_(0)
107 ,
"WorkspaceStore::set_workspace_size(...) : Error, " 108 "You can not reset the workspace size when any RawWorkspace objects " 109 "are using workspace!" );
165 ,
"RawWorkspace::~RawWorkspace(...): Error, " 166 "Invalid usage of RawWorkspace class, corrupted WorspaceStore object!" );
172 #ifdef __PGI // Should not have to define this since it should not be called! 173 void* RawWorkspace::operator
new(size_t)
WorkspaceStore * workspace_store_
size_t num_current_bytes_total_
int num_dyn_allocations() const
Return the number of dynamic memory allocations granted thus far. This is the number of memory alloca...
TEUCHOSCORE_LIB_DLL_EXPORT void set_default_workspace_store(const Teuchos::RCP< WorkspaceStore > &default_workspace_store)
Set pointer to global workspace object.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
size_t num_bytes_total() const
Return the total number of bytes that where initially allocated.
size_t num_max_bytes_needed() const
Return the maximum storage in bytes needed. This is the maximum total amount of * storage that was ne...
int num_static_allocations() const
Return the number of static memory allocations granted thus far. This is the number of memory allocat...
~RawWorkspace()
Deallocate workspace.
int num_static_allocations_
size_t num_max_bytes_needed_
size_t num_bytes_remaining() const
Return the number of bytes remaining currently.
size_t num_bytes() const
Return the number of bytes of raw workspace.
WorkspaceStore(size_t num_bytes)
Workspace encapsulation class.
Smart reference counting pointer class for automatic garbage collection.
void protected_initialize(size_t num_bytes)
TEUCHOSCORE_LIB_DLL_EXPORT void print_memory_usage_stats(const WorkspaceStore *workspace_store, std::ostream &out)
Print statistics on memory usage.
TEUCHOSCORE_LIB_DLL_EXPORT Teuchos::RCP< WorkspaceStore > get_default_workspace_store()
Get the global workspace object set by set_default_workspace_store().