FFT library for wavelet Poisson solver

161 views
Skip to first unread message

Nicklas Österbacka

unread,
Mar 10, 2021, 5:42:14 AM3/10/21
to cp2k
Hi!

I'm working towards doing some calculations on adsorption energies on slabs using CP2K 6.1 and would prefer to use non-periodic boundary conditions in the surface normal direction. As I have little experience with aperiodic DFT I ran some small tests to compare with periodic calculations.

The wavelet Poisson solver requires the use of the FFTSG FFT library according to the manual, but using FFTW3 instead yields virtually the same result for the geometry optimization of an oxygen molecule in a 20x20x20 Å box with no periodicity in any direction. (I realize that the box is much larger than necessary.) The energy difference between the two solvers is about 2e-13 Ha, while the difference in O-O bond length is about 3e-9 Å.

As the calculation using FFTW3 ran about 20 % faster it seems preferable to using FFTSG, but I want to make sure that CP2K isn't doing anything unexpected when combining FFTW3 with the wavelet Poisson solver. Is the manual incorrect on the FFTSG requirement, or is it perhaps only required for XZ periodicity?

Any insight would be appreciated!
Nicklas

hut...@chem.uzh.ch

unread,
Mar 11, 2021, 6:59:58 AM3/11/21
to cp...@googlegroups.com
Hi

I think the manual is not correct in this case. The wavelet solver
uses its own FFT library. The wavelet FFT library is the same as the
FFTSG library in CP2K and they share the allowed FFT roots.
That is the reason behind the statement in the manual.
However, we restricted the allowed roots when using the FFTW3 to more
or less the same as in FFTSG (not exactly). But I think
they will only diverge for very large grids.
So, you can use FFTW3 in CP2K with the wavelet solver. Should there
be an inconsistency of grid sizes, this will be checked in the wavelet
solver and the code will stop with an error message.

regards

Juerg Hutter
--------------------------------------------------------------
Juerg Hutter Phone : ++41 44 635 4491
Institut für Chemie C FAX : ++41 44 635 6838
Universität Zürich E-mail: hut...@chem.uzh.ch
Winterthurerstrasse 190
CH-8057 Zürich, Switzerland
---------------------------------------------------------------

-----cp...@googlegroups.com wrote: -----
To: "cp2k" <cp...@googlegroups.com>
From: "Nicklas Österbacka"
Sent by: cp...@googlegroups.com
Date: 03/10/2021 11:42AM
Subject: [CP2K:14920] FFT library for wavelet Poisson solver
--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/5efc1d76-1d28-4d02-bbde-eecc987f4e20n%40googlegroups.com.

Nicklas Österbacka

unread,
Mar 11, 2021, 11:56:06 AM3/11/21
to cp2k
Hi!

Excellent. Thank you for the reply!

Follow-up question: Some of the slabs I will be considering are quite large, so I will need to set EXTENDED_FFT_LENGTHS to True. This leads to a shift in total energy, at least with FFTW3, as expected per the documentation. Could this lead to inconsistencies in results with the wavelet solver using FFTW3?

All the best,
Nicklas

hut...@chem.uzh.ch

unread,
Mar 12, 2021, 3:58:01 AM3/12/21
to cp...@googlegroups.com
Hi

there should never be inconsistencies, but you might run into
incompatibilities. The code will stop in this case. If your
grid has more than 1000 points in one direction, we will have
to hack the code or use some "cutoff magic" to get it running.

regards

Juerg Hutter
--------------------------------------------------------------
Juerg Hutter Phone : ++41 44 635 4491
Institut für Chemie C FAX : ++41 44 635 6838
Universität Zürich E-mail: hut...@chem.uzh.ch
Winterthurerstrasse 190
CH-8057 Zürich, Switzerland
---------------------------------------------------------------

-----cp...@googlegroups.com wrote: -----
To: "cp2k" <cp...@googlegroups.com>
From: "Nicklas Österbacka"
Sent by: cp...@googlegroups.com
Date: 03/11/2021 05:56PM
Subject: Re: [CP2K:14939] FFT library for wavelet Poisson solver
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/682852af-1b8b-44dc-9197-cf6ad2b44978n%40googlegroups.com.

Nicklas Österbacka

unread,
Mar 12, 2021, 8:08:29 AM3/12/21
to cp2k

Hi!

Great - thank you the hasty reply!

All the best,
Nicklas
Reply all
Reply to author
Forward
0 new messages