Record memory consumption during computation.
More...
#include <memory.h>
|
static double | record (const std::string &class_name, const std::string &name, const long &n, const std::string &type, const bool accumulate=false) |
| Record memory consumed during computation.
|
|
static void | record (const std::string &name_in, const size_t &n_in, const bool accumulate=false) |
| Record memory consumed during computation.
|
|
static double & | get_total (void) |
|
static void | finish (std::ofstream &ofs) |
|
static void | print_all (std::ofstream &ofs) |
| Print memory consumed (> 1 MB) in a file.
|
|
static void | print (const int find_in) |
|
static double | calculate_mem (const long &n, const std::string &type) |
| Calculate memory requirements for various types of data.
|
|
Record memory consumption during computation.
- Author
- Mohan
- Note
- 8 bit = 1 Byte; 1024 Byte = 1 KB; 1024 KB = 1 MB; 1024 MB = 1 GB
◆ Memory()
ModuleBase::Memory::Memory |
( |
| ) |
|
◆ ~Memory()
ModuleBase::Memory::~Memory |
( |
| ) |
|
◆ calculate_mem()
double ModuleBase::Memory::calculate_mem |
( |
const long & |
n, |
|
|
const std::string & |
type |
|
) |
| |
|
static |
Calculate memory requirements for various types of data.
- Parameters
-
n | The number of a type of data |
type | The type of data |
- Returns
- double
◆ finish()
void ModuleBase::Memory::finish |
( |
std::ofstream & |
ofs | ) |
|
|
static |
◆ get_total()
static double & ModuleBase::Memory::get_total |
( |
void |
| ) |
|
|
inlinestatic |
◆ print()
void ModuleBase::Memory::print |
( |
const int |
find_in | ) |
|
|
static |
◆ print_all()
void ModuleBase::Memory::print_all |
( |
std::ofstream & |
ofs | ) |
|
|
static |
Print memory consumed (> 1 MB) in a file.
- Parameters
-
ofs | The output file stream for print out memory records |
◆ record() [1/2]
double ModuleBase::Memory::record |
( |
const std::string & |
class_name, |
|
|
const std::string & |
name, |
|
|
const long & |
n, |
|
|
const std::string & |
type, |
|
|
const bool |
accumulate = false |
|
) |
| |
|
static |
Record memory consumed during computation.
- Parameters
-
class_name | The name of a class |
name | The name of a quantity |
n | The number of the quantity |
type | The type of data |
accumulate | Useless, always set false |
- Returns
- double
◆ record() [2/2]
void ModuleBase::Memory::record |
( |
const std::string & |
name_in, |
|
|
const size_t & |
n_in, |
|
|
const bool |
accumulate = false |
|
) |
| |
|
static |
Record memory consumed during computation.
- Parameters
-
name | The name of a quantity |
n | The number of the quantity |
accumulate | Useless, always set false |
◆ bool_memory
int ModuleBase::Memory::bool_memory = sizeof(bool) |
|
staticprivate |
◆ class_name
std::string * ModuleBase::Memory::class_name |
|
staticprivate |
◆ complex_matrix_memory
int ModuleBase::Memory::complex_matrix_memory = 2*sizeof(double) |
|
staticprivate |
◆ consume
double * ModuleBase::Memory::consume |
|
staticprivate |
◆ double_memory
int ModuleBase::Memory::double_memory = sizeof(double) |
|
staticprivate |
◆ float_memory
int ModuleBase::Memory::float_memory = sizeof(float) |
|
staticprivate |
◆ init_flag
bool ModuleBase::Memory::init_flag = false |
|
staticprivate |
◆ int_memory
int ModuleBase::Memory::int_memory = sizeof(int) |
|
staticprivate |
◆ n_memory
int ModuleBase::Memory::n_memory = 1000 |
|
staticprivate |
◆ n_now
int ModuleBase::Memory::n_now = 0 |
|
staticprivate |
◆ name
std::string * ModuleBase::Memory::name |
|
staticprivate |
◆ short_memory
int ModuleBase::Memory::short_memory = sizeof(short) |
|
staticprivate |
◆ total
double ModuleBase::Memory::total = 0.0 |
|
staticprivate |
The documentation for this class was generated from the following files:
- /home/runner/work/abacus-develop/abacus-develop/source/source_base/memory.h
- /home/runner/work/abacus-develop/abacus-develop/source/source_base/memory.cpp