SAPT Memory Problem


I have run into a memory error while running SAPT calculations that I am not sure how to solve. Running SAPT calculations on very small systems (like H2O-N2, H2O-CO2, or H2O-H2S) has not been an issue. As soon as I increase the system size a little, I run into the following error.

john@john-Precision-T5600:/media/john/Scratch$ psi4 -o water_ethane_SAPT.out -n 4
Traceback (most recent call last):
File “/home/john/psi4/bin/psi4”, line 269, in
File “”, line 41, in
File “/home/john/psi4/lib/psi4/driver/”, line 492, in energy
wfn = procedures[‘energy’][lowername](lowername, molecule=molecule, **kwargs)
File “/home/john/psi4/lib/psi4/driver/procrouting/”, line 3438, in run_sapt
e_sapt = core.sapt(dimer_wfn, monomerA_wfn, monomerB_wfn)

Fatal Error: Not enough memory
Error occurred in file: /home/john/psi4source/psi4/src/psi4/libsapt_solver/ on line: 219
The most recent 5 function calls were:

psi::PsiException::PsiException(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, char const*, int)

This error has come up for systems like H2O-C2H6 or CH3OH-CH3OH which I don’t consider to be large at all. I attached the input and output files for review. (1023 Bytes) (943 Bytes)
methanol_methanol_SAPT.out.txt (60.7 KB)
water_ethane_SAPT.out.txt (57.0 KB)

The troubling thing is that I know my system has TONS of free RAM compared to what the output file indicates is the system requirements should be (110 gigabytes of free RAM)! The disk drive available is also >900 gigabytes.

john@john-Precision-T5600:/media/john/Scratch$ free
total used free shared buff/cache available
Mem: 131983624 7715204 110936400 91712 13332020 123000072
Swap: 134172668 0 134172668

Compare the free RAM to the estimated memory usage of 1067.1 MB for the CH3OH-CH3OH SAPT calculation and 746.8 MB for the H2O-C2H6 SAPT calculation (see the attached output files, memory estimates shown right at the end). The system resources are two orders of magnitude larger than what the PSI4 output file indicates I would need to complete the calculation.

I originally encountered the error on my XPS 8500 (32gb ram, 1 x 4 core I7) which has a slightly older build of PSI4. I recently rebuilt psi4 on my T5600 (128gb ram, 2 x 8 core Xeon) and still get the same error. The version of PSI4 on my T5600 is fairly up to date as well (Psi4 1.2rc4.dev1, Git: Rev {master} 2514c2b).

Maybe SAPT is actually very resource intense? I don’t think this is true since the documentation states that…

A brief note on memory usage: the higher-order SAPT code assumes that certain quantities can be held in core. This code requires sufficient memory to hold 3o2v2+v2Naux arrays in core. With this requirement computations on the adenine-thymine complex can be performed with an aug-cc-pVTZ basis in less than 64GB of memory.

If adenine-thymine can be run using less than 64 gigabytes of RAM, then certainly H2O-C2H6 should work fine with 110 gigabytes of free ram, right? Is there something in the input that I should change? Any help is greatly appreciated!!


How about using ‘memory’ keyword to allocate more memorys?


memory 10gb

…your input

Unfortunately, adding a memory keyword did not seem to help. I added 50000mb explicitly, which should be plenty. (1.0 KB) (962 Bytes)
methanol_methanol_SAPT.out.txt (60.8 KB)
water_ethane_SAPT.out.txt (57.0 KB)

I checked my system resources right after I ran both files. Here is the output.

john@john-Precision-T5600:/media/john/Scratch$ free
total used free shared buff/cache available
Mem: 131983624 7615664 110965700 91584 13402260 123097472
Swap: 134172668 0 134172668

What is troubling is that the output files state the resources should be much lower than what I have available.

  • Water-Ethane output states --> “Estimated memory usage: 746.8 MB” right before it throws the error.
  • Methanol-Methanol output states --> “Estimated memory usage: 1067.1 MB” right before it throws the error.


How about change ‘set memory …’ to just ‘memory …’ ?

I can’t believe that I missed that…the documentation clearly points this out.

By default, PSI4 assumes that 500 MiB of memory are available. While this is enough for many computations, many of the algorithms will perform better if more is available. To specify memory, the memory keyword should be used.

All I did was add the following to my input files. Everything works fine now. Rookie mistake.

memory 50000mb

Thanks @Pistack1234 !!



Aggh, that has bitten us all. Once upon a time, memory had to be known at main {}-time, so couldn’t be an ordinary option. We should change that at the next API cataclysm.

1 Like