Is vexx wasting time computing empty bands?
Luca Baguet who's doing a postdoc here noticed that vexx_k (and vexx_gamma as well, most likely) is wasting quite a bit of time when there are empty bands by carefully computing their contribution to the exchange operator, and then multiplying it by zero.
As I've not been using this part of the code for a while, I wanted to ask your opinion to see if we're not missing something. In vexx_k there are several loops like
DO jbnd=jstart, jend
that add up the contributions that form rhoc(:,jbnd-jstart+1)
with jstart and jend define as
jstart = 0
jend = 0
DO ipair=1, max_pairs
IF(egrp_pairs(1,ipair,my_egrp_id+1).eq.ibnd)THEN
IF(jstart.eq.0)THEN
jstart = egrp_pairs(2,ipair,my_egrp_id+1)
jend = jstart
ELSE
jend = egrp_pairs(2,ipair,my_egrp_id+1)
END IF
END IF
END DO
!
jstart = max(jstart,jblock_start)
jend = min(jend,jblock_end)
However, at a later point, we're going to multiply rhoc by x_occupation(jbnd,ik), which for empty bands is zero. As far as I can see it is never used again.
Would it be sufficient to limit jend to the full bands? Would this just break the load balance when using bands parallelization?
cheers