"Kong, Fande" <[email protected]> writes:
>> Correct.  The hash needs to be converted to a matrix so the maximum
>> memory usage is about double that of precise preallocation in advance.
>>
>
>
> Will  the memory be released in the hash after assembling the matrix?

Of course.

>> But this is only the first assembly, which is usually done before
>> setting up preconditioners and Krylov spaces so in most cases would not
>> significantly affect the maximum memory usage of the application.
>>
>
> If the nonzero structure changes over Newton iterations, and the maximum
> memory usage of the application may be larger than that with the precise
> preallocation.

That qualifies as a "not usual" use case, and yes, that's why precise
preallocation is better when you have it.

Attachment: signature.asc
Description: PGP signature

Reply via email to