-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory record in LCAO code is not correct #3831
Comments
As we know, memory usage involves several cases:
So usually we should focus on the 1st and 2nd point, especially the 2nd one. Furthermore, I think it is better to analyze them independently(stack-memory v.s. time, heap-memory v.s. time) rather than analyze the whole memory usage(memory v.s. time).
At last, we should define the problem:
|
I suggest to overload new and delete operators to record memory usage. |
I don't think so, the first reason is the new and delete would be called many times, the record memory operators would lead to poor performance; the second reason is there are some containers don't use the new or delete, such as containers in STL, maybe they use malloc or others; the third reason is the purpose of memory records in ABACUS is not for record exact memory cost, but for developers to analyze the memory cost of algorithm, only few classes or functions are the hotspots, we only need to find and record them. |
To the first reason, the overloaded operators can only used in memory debugging mode but not global scope. Solving the current memory record error is important, however we may not depend on developers to find and record memory every time in the future. |
Please also pay attention to #3852 |
Describe the Code Quality Issue
There are memory related issues now:
#3789 there are some errors in memory loggings.
#3675 Memory cost is too large in LCAO code, and the loggings is not enough.
#3710 Memory cost in PW code is not enough too.
#3657 Memory cost is too large in NSPIN=4 calculation in LCAO code.
Additional Context
There are two methods to record the used memory in ABACUS:
cmake -B build -DDEBUG_INFO=1
and then check the remaining memory in everyModuleBase::TITLE()
function.MEMORY(MB)
block in OUT.{suffix}/running_{calculation}.log .Ideally, these two method can get same peak memory cost in one calculation, but now they are not.
We should try to follow all memory records in
TITLE
to fix the omissiveModuleBase::Memory::record()
.Task list for Issue attackers (only for developers)
The text was updated successfully, but these errors were encountered: