Project

General

Profile

Memoryusage  » History » Version 1

Nicolas Aunai, 17/10/2015 01:04 PM

1 1 Nicolas Aunai
h1. How can I check the memory usage of Heckle ?
2
3
There are different answers.
4
You might use your OS services and look for your process and how much memory it takes. Depending on the OS results may be different.
5
6
You can also use tools dedicated for monitoring memory consumption in computing facilities, like "idrmemmpi":http://www.idris.fr/ada/ada-doc_vmem.html at IDRIS.
7
8
Also, Heckle has its own monitoring tool, named HeckleMem, in the directory src/.
9
Heckle re-defines malloc() into memory_allocate() and free() into memory_free(). Those two functions are able to keep track of the amount of memory used by the code in real time.
10
11
any call to
12
13
<pre>
14
<code class="C">
15
memory_status();
16
</code>
17
</pre>
18
19
20
will print something like this ; 
21
22
<pre>
23
________ Memory Status __________
24
Rank 0 memory consumption : 3074586736 (B) 	 3002526 (KB) 	 2932 (MB) 	 2 (GB)
25
Rank 1 memory consumption : 3074586736 (B) 	 3002526 (KB) 	 2932 (MB) 	 2 (GB)
26
Rank 2 memory consumption : 3074586736 (B) 	 3002526 (KB) 	 2932 (MB) 	 2 (GB)
27
Rank 3 memory consumption : 3074586736 (B) 	 3002526 (KB) 	 2932 (MB) 	 2 (GB)
28
_________________________________
29
</pre>
30
31
32
33
Be aware that this function in its current form calls MPI_Barrier() and therefore should not be used in production runs
34
35
36
This code can also be called just for *estimating* the memory that should be required by each process, for a given heckle.txt. It is based on the size of the main structures allocated in the code, and quits just after printing the status.