Page 1 of 1

BSE calculation of spin polarized system in 4.1.4

Posted: Fri Dec 15, 2017 8:09 am
by wufeng
Dear Developers,
I met a problem when performing BSE calculation of spin polarized system with yambo 4.1.4. It raises an error at Wave Function Phases step:

Code: Select all

   [06.04.02] Wave-Function Phases
   ===============================
   [ERROR] STOP signal received while in :[06.04.02] Wave-Function Phases
   [ERROR]EMPTY WF index @ b:1 k:1 spin:2 ID:0
This error occurs for multiple different systems in parallel. For serial run there is no error.

From the source code, in src/parallel/PARALLEL_WF_index.F I found only the first spin is set during initialization:

Code: Select all

   do ib=1,NB
     b_filling(ib)=0
     if (states_to_load(ib,ik,1)) b_filling(ib)=1
   enddo
   !
   call PP_redux_wait(b_filling,COMM=PAR_COM_density%COMM)
   !
   do ib=1,NB
     if (b_filling(ib)==0.and.PAR_COM_density%CPU_id==0)  states_to_load(ib,ik,1)=.TRUE.
   enddo
And from debugger, states_to_load(1,1,2) is always FALSE so the error will be raised later when accessed.

I managed to change the line to

Code: Select all

 states_to_load(ib,ik,:)=.TRUE.
and the code works again. Not sure if the result is correct, however.

Is spin 2 skipped here as intended or is it a bug?

Thanks very much!

Re: BSE calculation of spin polarized system in 4.1.4

Posted: Fri Dec 15, 2017 6:39 pm
by wufeng
The input/output/LOG is attached.

Re: BSE calculation of spin polarized system in 4.1.4

Posted: Fri Dec 15, 2017 6:42 pm
by Daniele Varsano
Dear Feng Wu,
we have already reproduced the error you reported,
we will fix it as soon as possible and let you know.

Best,

Daniele

Re: BSE calculation of spin polarized system in 4.1.4

Posted: Fri Dec 15, 2017 8:20 pm
by Davide Sangalli
Dear Feng Wu,
if you mean you replaced in src/parallel/PARALEL_WF_index.F

Code: Select all

     if (b_filling(ib)==0.and.PAR_COM_density%CPU_id==0)  states_to_load(ib,ik,1)=.TRUE.
with

Code: Select all

     if (b_filling(ib)==0.and.PAR_COM_density%CPU_id==0)  states_to_load(ib,ik,:)=.TRUE.
then I would say that your solution is correct, while the previous version was buggy.

D.

Re: BSE calculation of spin polarized system in 4.1.4

Posted: Sat Dec 16, 2017 12:01 am
by wufeng
Davide Sangalli wrote:Dear Feng Wu,
if you mean you replaced in src/parallel/PARALEL_WF_index.F

Code: Select all

     if (b_filling(ib)==0.and.PAR_COM_density%CPU_id==0)  states_to_load(ib,ik,1)=.TRUE.
with

Code: Select all

     if (b_filling(ib)==0.and.PAR_COM_density%CPU_id==0)  states_to_load(ib,ik,:)=.TRUE.
then I would say that your solution is correct, while the previous version was buggy.

D.
Yes that is exactly what I did. Thanks very much.

Re: BSE calculation of spin polarized system in 4.1.4

Posted: Wed Jan 03, 2018 4:22 am
by martinspenke
Dear Davide,

I checked this line of code in 4.2.0, and the bug was present. However,
I never obtained the mentioned error above for a spin polarized system when performing BSE calculations!!!
Does this bug change the BSE results or only the parallelization efficiency?

Best,
Martin

Re: BSE calculation of spin polarized system in 4.1.4

Posted: Wed Jan 03, 2018 10:09 am
by Davide Sangalli
If the calculation were affected the code would have crashed, with the message

Code: Select all

       [06.04.02] Wave-Function Phases
       ===============================
       [ERROR] STOP signal received while in :[06.04.02] Wave-Function Phases
       [ERROR]EMPTY WF index @ b:1 k:1 spin:2 ID:0

However it only happens very seldom that such part of the code is activated.
In short, when computing the BSE kernel, yambo tries to get the matrix elements associated to k-points outside the IBZ by "rotating" the matrix elements in the IBZ.
To do that, it first check that there are no problems with the phase of the WFs. In some special cases there is a phase factor and the matrix element need to be recomputed.
In the unlucky case that the CPU which needs to compute the matrix element for k out of the IBZ has not the the corresponding WF in the IBZ among the list of WFs to be loaded in memory, the subroutine src/parallel/PARALEL_WF_index.F takes care of adding such WF to the list.

Best,
D.