error for restarting SOC calculation with nonzero nbndskip

Post here questions linked with issue while running the EPW code

Moderator: stiwari

Post Reply
AgentZero
Posts: 44
Joined: Tue Jul 05, 2016 8:41 am
Affiliation:

error for restarting SOC calculation with nonzero nbndskip

Post by AgentZero »

Dear all,

Recently, I am calculating electron-phonon coupling with SOC. The compound that I calculated has 44 electrons. In the construction of MLWFs, nbndsub=20 and nbndskip=32 are used. The first run is done for 6x6x4 fine k/q-meshes and 6x6x4 coarse k/q-meshes. After getting the epmatwp1 file, I try to restart my calculation
with 30x30x20 fine k/q-meshes.

But I get the following errors.

Skipping the first 32 bands:

The Fermi level will be determined with -20.00000 electrons
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Error in routine efermig (1):
internal error, cannot bracket Ef
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In the restarted calculation, I set
kmaps = .true.
epbwrite = .false.
epbread = .false.
epwwrite = .false.
epwread = .true.
wannierize =.false.

And I believe that files needed by restarted calculation has been properly prepared.
I guess that this error may be related to the determination of nelec for noncolin case.
For example, after the first run, the remaining number of electrons is 12 (44-32).
If this number (12) subtracts again the variable nbndskip (32) in the restarted run, we will get -20 electrons.
Btw, in another non-SOC calculation, restarted calculation can be successfully done with nonzero nbndskip.
Could your please tell me how to solve this problem? Any help will be appreciated!

Best wishes,
Miao Gao

sponce
Site Admin
Posts: 616
Joined: Wed Jan 13, 2016 7:25 pm
Affiliation: EPFL

Re: error for restarting SOC calculation with nonzero nbndsk

Post by sponce »

Hello,

I remember having solve a similar bug recently. I need to look if it solve your case as well.

In any case, the easiest for you is to modify the "crystal.fmt" by hand and to change the number 12 by 44 (third line of the file).

It should then work.

Best,

Samuel
Prof. Samuel Poncé
Chercheur qualifié F.R.S.-FNRS / Professeur UCLouvain
Institute of Condensed Matter and Nanosciences
UCLouvain, Belgium
Web: https://www.samuelponce.com

AgentZero
Posts: 44
Joined: Tue Jul 05, 2016 8:41 am
Affiliation:

Re: error for restarting SOC calculation with nonzero nbndsk

Post by AgentZero »

Dear Samuel,

Thank you very much for your reply! Following your suggestion, I checked the crystal.fmt file, the first three lines are:
4
12
44.
The number in the third line is already 44. Do you mean changing the second line?

Currently, my understanding for this problem is as follows. As can be seen from ephwann_shuffle.f90,

IF ( noncolin ) THEN
nelec = nelec - one * nbndskip
ELSE
nelec = nelec - two * nbndskip
ENDIF.

In the restarted calculation, the inner invariable "noncolin" will be .false..
It seems to me that the variable "noncolin" is determined through reading the output files generated by PWSCF.
In restarted calculation, epw will not need the data given by PWSCF. Thus noncolin is .false..
If we also set nbndskip=32 in the restarted run, we will get nelec=44-2*32=-20. Is my conjecture correct?

If you accept my conjecture, could you tell me how to set noncolin=.true. in a restarted run?
For a tested purpose, I set nbndskip=16 in the restarted run. Finally, the nelec is 44-2*16=12, which is as
the same as that in the first run (the calculation that generates epmatwp1 file). The tested run can be
done successfully. And the tested run has correct nelec, but noncolin is still .false.
I found that the electron-phonon coupling constant obtained in the tested run is wrong, with respect to the first run.
So correct nelec and noncolin (.true.) should be equally important in a restarted run with SOC.

Thanks again and look forward to your reply!

Best wishes,
Miao Gao

sponce
Site Admin
Posts: 616
Joined: Wed Jan 13, 2016 7:25 pm
Affiliation: EPFL

Re: error for restarting SOC calculation with nonzero nbndsk

Post by sponce »

Hello,

You are correct. Now I remember what I changed (currently in the trunk of QE, not public).

You can do the following:

Line 219 of ephwann_shuffle.f90

Code: Select all

    IF (mpime.eq.ionode_id) THEN
      !
      OPEN(unit=crystal,file='crystal.fmt',status='old',iostat=ios)
      READ (crystal,*) nat
      READ (crystal,*) nmodes
      READ (crystal,*) nelec
      READ (crystal,*) at
      READ (crystal,*) bg
      READ (crystal,*) omega
      READ (crystal,*) alat
      ALLOCATE( tau( 3, nat ) )
      READ (crystal,*) tau
      READ (crystal,*) amass
      ALLOCATE( ityp( nat ) )
      READ (crystal,*) ityp
      READ (crystal,*) isk
      READ (crystal,*) noncolin
      !
    ENDIF


And also add 1210 of ephwann_shuffle.f90

Code: Select all

    WRITE (crystal,*) nat
    WRITE (crystal,*) nmodes
    WRITE (crystal,*) nelec
    WRITE (crystal,*) at
    WRITE (crystal,*) bg
    WRITE (crystal,*) omega
    WRITE (crystal,*) alat
    WRITE (crystal,*) tau
    WRITE (crystal,*) amass
    WRITE (crystal,*) ityp
    WRITE (crystal,*) isk
    WRITE (crystal,*) noncolin


You may need to add
USE noncollin_module, ONLY : noncolin
around line 1188 (in the start of the epw_write routine).

This should correctly write the value of noncolin in the crystal.fmt file.

Best,

Samuel
Prof. Samuel Poncé
Chercheur qualifié F.R.S.-FNRS / Professeur UCLouvain
Institute of Condensed Matter and Nanosciences
UCLouvain, Belgium
Web: https://www.samuelponce.com

AgentZero
Posts: 44
Joined: Tue Jul 05, 2016 8:41 am
Affiliation:

Re: error for restarting SOC calculation with nonzero nbndsk

Post by AgentZero »

Dear Samuel,

Thank you very much for telling me this method. It works fine after further adding

CALL mp_bcast (noncolin, ionode_id, inter_pool_comm)
CALL mp_bcast (noncolin, root_pool, intra_pool_comm)

in ephwann_shuffle.f90 around Line 250.

Best,
Miao Gao

Post Reply