aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/mem.cc
Commit message (Collapse)AuthorAge
* CarpetLib: Slight change to memstat outputErik Schnetter2008-01-14
| | | | darcs-hash:20080114151720-dae7b-42dbfa9f1277cb48f790484705f3ba484f2487a4.gz
* CarpetLib: Enforce memory limit via operating systemErik Schnetter2007-09-28
| | | | | | Enforce memory limit by calling setrlimit for RLIMIT_AS. darcs-hash:20070928154922-dae7b-2b3436bfe35452de19b9765279c1bb81997f9497.gz
* CarpetLib: Output mallinfo statisticsErik Schnetter2007-05-26
| | | | | | | | | Some systems have a function mallinfo which reports malloc statistics. Output this statistics together with Carpet's statistics. This reports how much memory the process has allocated in total, and how much of that memory is unused. darcs-hash:20070526200455-dae7b-6ad24ac03d382090658f3c165835b795d9f302f1.gz
* CarpetLib: Add class mempoolErik Schnetter2007-05-26
| | | | | | | | | | | A mempool (memory pool) is a large chunk of memory. You can allocate pieces of it. In order to simplify things there is no way to free a piece again. If the mempool is destroyed, then all its memory is freed. This is dangerous: you have to make sure that no one continues to use that memory afterwards. Using a memory pool for short-lived objects can reduce memory fragmentation. darcs-hash:20070526195001-dae7b-b419df094d19b85dbf145debdf62da2dc57823af.gz
* CarpetLib: Simplify timer interfaceErik Schnetter2007-03-12
| | | | | | | | | | | Remove some parameters which are not necessary: CarpetLib::print_timestats CarpetLib::timestat_disable Allow the value -1 as well as 0 to disable output for timers and memory statistics. darcs-hash:20070312160854-dae7b-6c60bf0c64a5cac03da97595bb30bb2b47568165.gz
* CarpetLib: Use AT to index std::vectorErik Schnetter2007-02-03
| | | | | | | | Define a macro AT() to index into std::vector. Depending on the macro NDEBUG, AT() is defined either as at(), providing index checking, or as operator[], providing no checking. darcs-hash:20070203205854-dae7b-a1999c88c95ba12b1ee66505f712aefdd67d7e6f.gz
* CarpetLib: Poison newly allocated memory if desiredErik Schnetter2006-07-31
| | | | | | | | | Poison newly allocated memory if desired. This is potentially more thorough that Carpet's poisoning, since it is applied to all allocated memory. It is not applied after time level cycling, though, so it cannot replace Carpet's poisoning. darcs-hash:20060731152325-dae7b-d039ee958161690c9430e70a8051d400273b819e.gz
* CarpetLib: Use double instead of size_t for memory statisticsErik Schnetter2006-07-31
| | | | | | | | | Use double instead of size_t for memory statistics. size_t works fine for keeping statistics on a single processor, but there can be overflow on multiple processors. double may be inexact, but will not overflow. darcs-hash:20060731152039-dae7b-51a07bfa276c18a59b400a4aef09ab3f2cfc1490.gz
* CarpetLib: Output memory statistics to fileErik Schnetter2005-11-19
| | | | | | | Add new parameter CarpetLib::memstat_file. If set, then memory statistics are periodically written to this file. darcs-hash:20051119201538-dae7b-88c8b8cd5b9d2643d1be6e682f2aa32e7a00ef2d.gz
* CarpetLib: Output memory statistics, and limit maximum memory usageErik Schnetter2005-07-27
| | | | | | | | | | | | Introduce a new parameter print_memstats_every. When non-zero, output the current and total allocated amount of memory (per process). Introduce a new parameter max_allowed_memory_MB. When more than that amount should be allocated on the current processor, abort the run. Only memory for grid variables counts; memory for administrative overhead is ignored. darcs-hash:20050727201851-891bb-c1ff9fc30ff949d576d500fbf70ad7fb5084836a.gz
* CarpetLib: Introduce new class mem<T> for memory managementErik Schnetter2005-03-05
Introduce a new class mem<T> for memory management. Memory management has become sufficiently complicated to move into its own class. The class mem<T> features: 1. Allocating nelem items of type T 2. Managing contiguous regions of memory for several data<T> objects for vector groups 3. Allowing a pointer to a memory region to be passed in, which is used instead of allocating memory through new 4. Reference counting, so that the mem<T> object only goes away once the last using data<T> object does not need it any more. This makes it unnecessary to delete the first data<T> objects for a grid function group last. darcs-hash:20050305174647-891bb-e1f53adca34e5a668af96c662845cca0f259f8e6.gz