Author Topic: Memory Problem  (Read 12640 times)

idet2

  • Jr. Member
  • **
  • Posts: 21
  • Karma: +0/-0
Memory Problem
« on: November 06, 2007, 05:19:45 PM »
Hello Turbomole users.

I am having a problem with the latest version of Turbomole (v.5.9.1) and the way that the memory is handled.

First of all let me tell you what are the specifications of my system:

In each node there are two identical processors of the following type

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 3.06GHz
stepping        : 9
cpu MHz         : 3066.590
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 6132.12

and the available memory is 2GB (in each node).

The queueing system that is used is "Torque"

The problem that I am having is that every time a submit a run, the memory that is consumed is much more than the one it should.

To explain the above let me give you two realistic examples:

1) Using ri, marij and putting the keyword $ricore 700 the amount of memory that is bind is 2GB !!!!!!!!!

I was expecting that to be around 1GB (700MB defined by me plus another 300MB for the ri)

2) Same example but this time with $ricore 900 the consumed memory by that run is 1600MB!!!!!!


I cannot find a connection between all the runs and the extra memory that is consumed, since for me it looks random.

What is the mistake in this case??? Am I doing something wrong or is it the programm???

Regards,

G.

uwe

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 560
  • Karma: +0/-0
Re: Memory Problem
« Reply #1 on: November 07, 2007, 04:50:36 PM »
Hello,

$ricore is just for the memory of the RI integrals that shall be kept in core, this is not the overall memory that will be used by the programs! You can use $ricore 0 and no RI integrals will be stored in memory during the SCF iterations if your total memory is limited to 2 GB. Giving more $ricore just speeds up your calculation, but the effect can be small if you have a quite small or a very large input.

ridft checks for the additional matrices that are used in the code when having RI and subtracts that memory from the given $ricore to make sure that the total memory used by the RI part is not getting larger than the given amount of RAM (well, if you give 0 MB, the matrices are needed anyway, so RI will of course need additional memory). Hence, the amount of memory that is used heavily depends on the size of the input (number of basis sets and symmetry), so giving the same $ricore does not result in equivalent memory requirements.

The problem you have might come from parallel runs. You did not tell us if the calculations are running in serial or parallel mode, but if it was a parallel job, things are a bit different.

In the parallel case, all clients except the first one do not keep the RI matrices, so ridft adds the memory that is needed for them to $ricore - to avoid that, use $ricore_slaves, see the section about ridft in: http://www.turbo-forum.com/index.php?topic=116.0

Regards,

Uwe

idet2

  • Jr. Member
  • **
  • Posts: 21
  • Karma: +0/-0
Re: Memory Problem
« Reply #2 on: November 07, 2007, 09:09:17 PM »
Hello again.

I was talking about serial and not parallel runs. I understang what you are saying that for different systems (calculations), different memory is needed, but I am a bit confused. You are saying that "...subtracts that memory from the given $ricore to make sure that the total memory used by the RI part is not getting larger than the given amount of RAM" and then at the end "the same $ricore does not result in equivalent memory requirements."

So, I wanted to know is there a way to put an upper limit in the total memory usage? Is there a way to see how much memory is needed for my run before the beginning of the calculation?

Regards,

G.

uwe

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 560
  • Karma: +0/-0
Re: Memory Problem
« Reply #3 on: November 08, 2007, 02:53:37 PM »
Hello,

Quote
So, I wanted to know is there a way to put an upper limit in the total memory usage?

No. Not within Turbomole. But you can set the user limits in your shell. However, the programs will simply be killed if they try to use more than the given limits.

Quote
Is there a way to see how much memory is needed for my run before the beginning of the calculation?

No.

You could estimate the required memory:

1. density, fock matrix, DIIS matrices all need N*N/2 * 8 Byte, N number of basis functions,
    while the number of  basis functions is given in the control file, see keyword $rundimensions
    (Example: 4000 cartesian basis functions:  {4000*4000/2 * 8 Byte} * 4 = 244 MB  )
2. if you look at the output of ridft, there will be a line:
****************************************
 Memory allocated for RI-J    72 MByte
 ****************************************

   which gives the amount of memory needed for the RI part

3. plus additional memory that is used during diagonalization, etc. - and that is the most difficult part to determine. Turbomole uses highly optimized linear algebra routines (like BLAS, Lapack, etc.) that are provided by the hardware companies like Intel, IBM, AMD, HP, etc.. Depending on the task to be performed, some of those libraries will need additional memory (or a lot of stack size in case of Intel) which seems to gives better performance, but the user has no control over the exact amount of memory usage any more.

4. UHF calculations need twice as much as RHF runs (all matrices are kept for alpha and beta spin)

   (same example as above: C1, approx. 4000 cartesian basis functions, RHF: total of 800 MB in
     virtual space, gives about 500-600 MB in physical memory during run time).

With 2 GB per node you should be able to perform calculations in C1 symmetry with RI-DFT for structures with approx. 5000-6000 basis functions or perhaps more.

Regards,

Uwe

idet2

  • Jr. Member
  • **
  • Posts: 21
  • Karma: +0/-0
Re: Memory Problem
« Reply #4 on: November 09, 2007, 05:01:52 PM »
Thank you very much for the reply. It looks really informative.

If I get it correct, it doesn't matter how much memory I specify for $ricore if the calclulation is really huge. Is that correct?
The only thing is that less integrals for RI will be kept in the core, meaning that in the end I 'll have a much longer run.

Regards,

G.

uwe

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 560
  • Karma: +0/-0
Re: Memory Problem
« Reply #5 on: November 09, 2007, 05:25:39 PM »
Hi,

Quote
The only thing is that less integrals for RI will be kept in the core, meaning that in the end I 'll have a much longer run.

If you use $marij, and if you have a large calculation, the effect of the $ricore setting will be a few percent at most - simply because the number of integrals that have to be recalculated in each iteration is much larger than the few that are kept in core (unless you have a huge RAM) . But the integral routines of Turbomole are famous for being extremely fast - and they are... so it should not slow down the calculation that much if you set $ricore to zero.

Regards,

Uwe

idet2

  • Jr. Member
  • **
  • Posts: 21
  • Karma: +0/-0
Re: Memory Problem
« Reply #6 on: November 10, 2007, 12:26:20 AM »
Thanks a lot for clearing this matter out.

In my case that I am using $marij and my RAM is NOT huge I 'll keep the value of $ricore to something small in order to gain from the total required memory, since as you are saying the gain will be very small.

Thanks again,

G.