Electron self energy for GaN example

EPW developers,
I have attempted to calculate the electron self energy GaN by using the example, but adding the necessary variables to get the calculation of the electron self energy. I also cut down the number of kpoints to make the calculation run faster and changed the names of the directories to have pre-pending numbers, as is my preference (it doesn’t affect how the code runs). My input file is given below my sign off.

     What I find is that all of the values of the self energy are NAN. If I set lpolar=.false., then I get actual numbers. I ran the tests and confirmed that my build is sound. Also, when I try to run the code with the number of k/q-points (interpolated and coarse) from the example, i.e. not reduced as in the input file provided, I find that the calculation just seems to hang after the statement "BMN calculated" for the last q-point. 

     Any ideas what is going on here? I know these polar materials can be tricky, so perhaps I am missing something obvious, e.g. using such a coarse starting grid is not good for systems with a polar divergence. Any suggestions would be most welcome.

best,

Derek

–
&inputepw
prefix = ‘gan’
amass(1) = 69.723
amass(2) = 14.007
outdir = ‘./’

elph = .true.
kmaps = .false.
epbwrite = .false.
epbread = .false.

lpolar = .true.

epwwrite = .false.
epwread = .false.

nbndsub = 18
nbndskip = 0

wannierize = .true.
num_iter = 500
!dis_win_max = 11
!dis_froz_max= 11
proj(1) = ‘N:sp3’
proj(2) = ‘Ga:d’

elinterp = .true.
phinterp = .true.

tshuffle2 = .true.
tphases = .false.

elecselfen = .true.
phonselfen = .false.
a2f = .false.

parallel_k = .true.
parallel_q = .false.

fsthick = 5.0
eptemp = 300.0
degaussw = 0.5
efermi_read = .false.
fermi_energy= 9.9775

dvscf_dir = ‘../01-phonons/save’
filkf = ‘path.dat’
filukk = ‘gan.ukk’
nk1 = 3
nk2 = 3
nk3 = 3
nq1 = 3
nq2 = 3
nq3 = 3

nqf1 = 20
nqf2 = 20
nqf3 = 20
/
6 cartesian
0.000000000 0.000000000 0.000000000 0.0740741
0.000000000 0.000000000 0.204484747 0.1481481
0.000000000 0.384900179 0.000000000 0.4444444
0.000000000 0.384900179 0.204484747 0.8888889
0.333333333 0.577350269 0.000000000 0.1481481
0.333333333 0.577350269 0.204484747 0.2962963

Dear Derek,

Such coarse starting grids are surely not good enough to interpolate properly the various quantities, but it shouldn’t lead to any NAN values. May I suggest you try to plot the electron and (in particular) phonon band structure to see if anything is going wrong - for example with the ph save folder? You can do this by adding ‘band_plot=.true.’ in the input, and specifying the BZ path both in ‘filqf’ and ‘fikf’ (you can use the one provided in the example for both).

Best
Carla

Hi Carla,
Many thanks for your response. I’ll take a look at the phonon and electron band structures to make sure everything looks alright. I have used this version of espresso for other purposes and everything was fine, but perhaps there’s something funny going on here. If so, I’ll let you know.

    I of course knew the starting grid was too course to get meaningful numbers - my primary purpose was to try running the electron self energy code for a polar material, and I figured starting on an example would be a good idea. In general, when I work out examples I try to use relatively low convergence parameters so I don't waste a ton of time waiting for the result to come out because many times the result is garbage, for one reason or another (usually not related to convergence). That has obviously been the case here.

best,

Derek

Dear Derek,

The code should clearly not produce NAN because of a coarse grid.

However, since you seem to have an issue, may I suggest that you to try to run the example as is.
It should take a few hours.
If the problem persists, there might be a compilation issue or a bug in the code.
If it works, you might work from there and decrease the k/q grids. If you indeed run into NAN just by decreasing the grid I will try to investigate it in detail as that should clearly not happen.

Best,

Samuel

Hi Samuel and and Carla,

  On Carla's advice, I plotted the phonon and electronic band structures. The electronic band structure was fine, but for a 3x3x3 coarse grid there were some negative phonon frequencies away from gamma, i.e. not due to ASR issues. However, when I increase to a 4x4x4 grid I get frequencies very similar to the 6x6x6 case, but again I get NANs for all the ImSig's. 

   As for your suggestion Samuel, I've tried running the 6x6x6 case with appropriate flags to get the electron self energy, but the code seems to hang after the matrix elements at the final q-point are calculated, i.e. after the "BMN computed" statement. If I request velocity matrix elements, it dies after the statement is printed saying the velocity matrix elements have been computed. Have you observed this behavior before? Perhaps it is a problem with my build. However, I do not get this hanging for the smaller grids (3x3x3,4x4x4) I've tried. I've seen the hanging go on for 20 hours on 192 Haswell processors. 

   I'm compiling with intel 13.1.3 compilers and impi (also using mkl 13.5.192 and fftw 3.3.3). This is on the computer at the National Renewable Energy Laboratory in the US, Peregrine. I see your test farm does use intel 13.1.3, but only openmpi, mpich, and mvapich are used (no impi). Maybe this is an issue. I could also try using your exact compilation flags (I just used the flags from the configure script for QE).

  Let me know if you have any other concrete ideas other than playing with compilers, libraries, etc. Thanks for your help!

best,

Derek

Hello Derek,

The hanging for the 6x6x6 suggests memory issue.
Could you try with the input flag:

[code:21lxazx7]etf_mem = .false.[/code:21lxazx7]

If that does not work, I will try to debug it this weekend using intel 13.1.3 + impi.

Best,

Samuel

Samuel,
Sounds good. I added this flag and re-submitted. I’ll let you know what happens after it runs.

best,

Derek

Hi Samuel,
Good news: using etf_mem = .false. did make the example run. Bad news: I still get NANs.

     So, that's where we stand. I am going to try to fiddle with the build just once before I pass this problem off to you. I am going to try to update to more recent intel compilers and see if that makes a difference. 

best,

Derek

The epw.in file in the earlier email has:

epbwrite = .false.
epbread = .false.

epwwrite = .false.
epwread = .false.

What does that mean? Does it mean these files are stored in memory?

Nandan.

Nandan,
Yeah, that is my understanding.

best,

Derek

Yes, using those options no restart is possible as the main quantities are not stored on disk.

Hi Samuel,
After playing with different versions of intel compilers on Peregrine, I think my build is sound. Everything else I’ve used in the QE distribution with this build, e.g. ph.x and pw.x, have worked fine. The non-polar EPW also seems to work fine. So, I’m guessing that either impi doesn’t play nicely with the polar code, or perhaps there is a bug in the polar code. It could always be something else, but those seem like the two top options to me.

    Next week I'll try building with gnu and openmpi and see if that changes anything. If you try to debug it and find anything, please let me know.

best,

Derek

Dear Derek,

Thank you for reporting the issue and your extra testings.

I will try to reproduce the NaN and debug.

From my experience, impi is usually a bit faster than free alternatives like openmpi or mpich but somewhat more unstable. Currently EPW is tested the most with openmpi so you might look at that if you want.

Best,

Samuel

Dear Derek

I have tried running the GaN example again. To reduce slightly the computational time, I changed fsthick to 2 and the k path is only along the MGA directions, so that doesn’t really affect the results.

I cannot reproduce the NAN results that you have for the polar case. I tried using both 4x4x4 and 6x6x6 coarse starting grids, as already pointed out with the 6x6x6 grids there’s the caveat to use the etf_mem=.false. flag if there is a memory issue. Anyway a 4x4x4 grid is quite fast and almost converged.

We did find a small bug related to the implementation of the inversion symmetry (inv. symm. was not implemented in EPW-3, and has to be included in GaN). We will commit it, in the meanwhile you need to add in elphon_shuffle_wrap.f90, line 580:
CALL loadumat ( nbnd, nbndsub, nks, nkstot, xq, cu, cuq, lwin, lwinq )
!
IF (lpolar) CALL compute_bmn_para3 ( nbnd, nbndsub, nks, cu, cuq, bmat(:,:,:,nqc) )

Let us know if that fixes the problem?

Best
Carla

Hi Carla and Samuel,
Many thanks for your input. I was traveling and hence had to put this issue aside. I am returning to it now and will test the issue of openmpi vs impi and the fix suggested by Carla. I’ll report back to you what I find.

best,

Derek