[Trilinos-Users] epetra_crsmatrix_storage_consumption

Blahos, Jiri j.blahos at imperial.ac.uk
Wed Sep 18 13:44:16 EDT 2019


Hi everyone,

 

I would like to ask about how much memory Epetra_CrsMatrix takes. 

 

I made a test case where I create a matrix with 104857600 nonzero elements
(the matrix has 10 * 1024 * 1024 rows and columns, each row has 10 nonzero
elements).

My expectation would be that this matrix would take around 1.17 GB of memory
(104857600 * 12 / 1024 / 1024 / 1024). The value 12 comes from 12 = 8 + 4,
array of doubles for values and array of ints for column indices. Row offset
array is significantly (10x in this case) smaller so it will only increase
the total memory by a bit. I construct the matrix with static profile since
I know it here. I call fillcomplete with the default value for optimise
storage which is true.

 

However, when I run the test case and observe ram consumption (in htop), the
matrix takes in total around 2.2GB. Even if I include the row array and use
8 bytes for int (long long) instead, I get the result of 1.64GB which is
still significantly less.

(104857600 * 16 + 1024 * 1024 * 10 * 8) / 1024 / 1024 / 1024 = 1.640625

I am using Trilinos 12.12.1, built in release.

 

Is there anything that I am missing? Any other allocations that happen
inside the matrix object, besides the arrays for values, col indices and row
offsets?

Is checking ram in htop not correct? 

 

Note, in practice I use much larger matrices so I wonder why the memory
taken is larger than I expect.

I attached the test code if someone wants to run it on their machine.

 

Regards,

Jiří

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190918/525b7a9f/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: main.cpp
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190918/525b7a9f/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5003 bytes
Desc: not available
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190918/525b7a9f/attachment.p7s>


More information about the Trilinos-Users mailing list