Repository navigation
Fix SCF residuals and density mixing on double grids - #8513
AsTonyshment wants to merge 6 commits into
Conversation
1dd61f3 to
3f0626f
Compare
3f0626f to
1936949
Compare
| for (int j = 0; j < 3; j++) | ||
| { | ||
| setmem_complex_op()(this->wfcr, 0, this->charge->nrxx); | ||
| setmem_complex_op()(this->wfcr, 0, this->basis->nmaxgr); |
There was a problem hiding this comment.
it's not clear to me, what is 'basis->nmaxgr' instead of 'charge->nrxx'?
There was a problem hiding this comment.
Here, nmaxgr = max(npw, nrxx): npw is the number of plane-wave coefficients, and nrxx is the number of real-space grid points on this MPI process. We use wfcr for an in-place FFT, so it first holds the reciprocal-space coefficients and then the real-space data. It needs enough space for whichever is larger.
With double grids, charge->nrxx refers to the larger density grid, so using it here can write past the end of wfcr, causing segmentation fault.
The name is indeed pretty cryptic :( I'd guess parameters with odd names like this were probably all inherited from QE. I've added comments in the code to explain this.
…netic-energy density generation
1936949 to
a0086a3
Compare
What's Changed?
Fix #8510.
scf_thr_type=2.