How to force psi4 use memdfjk

Hi,
I am a newbie,
I am trying to do a series of complex calculation (like B3LYP aug-pcSseg-2) with gliclazide molecule (nearly 170 electrons)
As I guess, because calculation is complex software prefer to use disk (diskdfjk) instead of ram (memdfjk), this makes calculations slower and sometimes failed.
So I just want to learn how I can force psi4 to use RAM (memdfjk) instead of disk (diskdfjk)?

For the ones who will give an answer to this question “THANK YOU”

You can set ‘scf_type: mem_dfjk’. There is a small bug causing disk jk to be chosen in Psi4 currently even in cases where mem jk is better. The switch between the two is dependent on if mem jk can avoid using disk for which it is marginally slower.

1 Like

Dear @dgasmith firstly thank you for your answer
I tried it (with and without “:”) but it didn’t work
Am I doing something wrong?

My input:

molecule mymol {
0 1
S 1.684137466791 1.473148143253 0.932843423917
O -0.117008936340 0.501280105573 -1.379129268353
O 1.423964503248 2.719013523805 0.223999287691
O 2.033889759368 1.441338123769 2.355640612398
N -2.553684460704 -0.728359209294 -0.962829422952
N -1.677418585673 -0.400033712161 0.083982661247
N 0.253711974626 0.539953001820 0.902439232377
C -4.574262431328 -1.722673580979 -0.024873385206
C -4.852304054970 -0.203367669764 -0.323912181645
C -4.562007335194 -1.846952159332 1.519866023768
C -5.010551658313 0.473464941895 1.062869154636
C -3.237004225878 -2.018362890331 -0.749332787552
C -3.642417436903 0.249491605469 -1.180806211217
C -5.419958911801 -0.668247914327 2.008243754968
C -0.490374186757 0.240592983545 -0.255969473391
C 2.918340382816 0.544085726774 0.031651149698
C 2.977574569256 0.632235544521 -1.361149952354
C 3.825695769435 -0.237821895342 0.748662157279
C 4.886275930631 -0.883706470835 -1.344822412966
C 3.960561550080 -0.087376610552 -2.035297611796
C 4.802169586287 -0.947597980488 0.052877496482
C 5.966412520392 -1.631039349291 -2.089750330697
H -5.373297132530 -2.351186090096 -0.432598088797
H -5.781056846199 -0.083973024917 -0.891864814732
H -3.537109270124 -1.743075474590 1.903895684759
H -4.925941059089 -2.820970635656 1.864611798129
H -5.728860171081 1.300132995803 1.045211236829
H -4.054605217004 0.903654154697 1.394971349919
H -2.573740794999 -2.699629873753 -0.211263404640
H -3.432775815832 -2.449386269244 -1.739320234338
H -3.897622664451 0.216670350922 -2.246830459267
H -3.283437052262 1.258117786310 -0.960366978021
H -6.484729186977 -0.900864671116 1.873203253718
H -5.270630383724 -0.430055676087 3.067509373578
H -2.080848773556 -0.126465576508 0.978542907674
H 0.116707978569 0.006671037697 1.754140583910
H 2.256321103584 1.236239222744 -1.897340811082
H 3.771261496120 -0.274301652858 1.831262393621
H 4.009435892041 -0.028977229791 -3.119787219612
H 5.513005982630 -1.557068457742 0.605480848511
H 6.301788662797 -2.512410679420 -1.533713908462
H 5.619182696694 -1.960047958436 -3.074730565324
H 6.845040258142 -0.992520370318 -2.251479259826
}
set
{basis pcseg-2
scf_type: mem_dfjk
}
memory 2000 MB

optimize(“b3lyp”)

I am getting an error:

Traceback (most recent call last):
File “/home/mert/psi4conda/bin/psi4”, line 261, in
content = psi4.process_input(content)
File “/home/mert/psi4conda/lib//python3.6/site-packages/psi4/driver/inputparser.py”, line 659, in process_input
temp = re.sub(set_commands, process_set_commands, temp)
File “/home/mert/psi4conda/lib/python3.6/re.py”, line 191, in sub
return _compile(pattern, flags).sub(repl, string, count)
File “/home/mert/psi4conda/lib//python3.6/site-packages/psi4/driver/inputparser.py”, line 169, in process_set_commands
bad_option_syntax(command)
File “/home/mert/psi4conda/lib//python3.6/site-packages/psi4/driver/inputparser.py”, line 54, in bad_option_syntax
raise TestComparisonError(message)
psi4.driver.p4util.exceptions.TestComparisonError: Unsupported syntax:

scf_type: mem_dfjk

I found this: http://www.psicode.org/psi4manual/1.2/scf.html

According to the webpage, true keyword is “MEM_DF”

When I try with “mem_df”:

set
{
basis pcseg-2
scf_type mem_df
}
memory 2000 MB

optimize(“b3lyp”)

The result:

==> MemDFJK: Density-Fitted J/K Matrices <==

J tasked:                   Yes
K tasked:                   Yes
wK tasked:                   No
OpenMP threads:               3
Memory [MiB]:              1287
Algorithm:                 Disk
Schwarz Cutoff:           1E-12
Mask sparsity (%):      41.8861
Fitting Condition:        1E-10

Although it put memdfjk title, it used “Algorithm: Disk”. As I know this is a bug of last stable version: https://github.com/psi4/psi4/pull/1667

Correct, there is no current way around this bug at the moment and will be patched in version 1.4. There are two algorithms named MemDFJK and DiskDFJK to signify which regime they are optimized for; however, both can use entirely in-memory and on-disk operations.

1 Like

I just tried “scf_type mem_df” for Psi4 1.2.1 release (on Kubuntu 19.10),

==> Integral Setup <==

DFHelper Memory: AOs need 41.241 [GiB]; user supplied 8.382 [GiB]. Turning off in-core AOs.

==> MemDFJK: Density-Fitted J/K Matrices <==

J tasked:                   Yes
K tasked:                   Yes
wK tasked:                   No
OpenMP threads:              12
Memory (MB):               8583
Algorithm:                 Disk
Schwarz Cutoff:           1E-12
Mask sparsity (%):      22.6212
Fitting Condition:        1E-12

Although program stated that “DFHelper Memory: AOs need 41.241 [GiB]; user supplied 8.382 [GiB]. Turning off in-core AOs”, it did not use disk (I followed I/O write and read) but run on RAM and CPU.

Result is same for Psi4 1.3.2

==> Integral Setup <==

DFHelper Memory: AOs need 33.025 GiB; user supplied 7.544 GiB. Turning off in-core AOs.

==> MemDFJK: Density-Fitted J/K Matrices <==

J tasked:                   Yes
K tasked:                   Yes
wK tasked:                   No
OpenMP threads:              12
Memory [MiB]:              7724
Algorithm:                 Disk
Schwarz Cutoff:           1E-12
Mask sparsity (%):      22.6212
Fitting Condition:        1E-10

Although the software says “Algorithm: Disk”, it mainly runs on RAM and CPU.

Yes, this is the expected bug and the patch is in the upcoming Psi4 1.4 release.

Please conda install Psi4 -c Psi4/label/dev To get a prerelease.

1 Like