yambo-code / yambo

This is the official GPL repository of the yambo code
http://www.yambo-code.eu/
GNU General Public License v2.0
99 stars 39 forks source link

Tech slk #139

Closed andrea-ferretti closed 1 month ago

andrea-ferretti commented 1 month ago

This branch contains several developments:

sangallidavide commented 1 month ago

Just one comment for eval_G_minus_G

I see you replaced the G_m_G_maxval_tmp procedure with the call to G_m_G_maxval=maxval(G_m_G)

However, this is done before the PP_redux(G_m_G), where G_m_G might be distributed of the MPI tasks. This would result in different MPI tasks having different values.

One should either move the maxval after the PP_Redux or (maybe more efficient ?) code

allocate(G_m_G_maxval_tmp(ncpu)
G_m_G_maxval_tmp(myid)=maxval(G_m_G)
PP_redux(G_m_G_maxval_tmp)
G_m_G_maxval=maxval(G_m_G_maxval_tmp)
andrea-ferretti commented 1 month ago

Absolutely, this needs fixing (I forgot to do it). I'll implement the second option with the redux (nicer not to have to do reductions with the max function).

sangallidavide commented 1 month ago

Rethinking. Rather than the second option, which anyway would do a redux on the whole G_m_G, I'd move back to the previous structure

 YAMBO_ALLOC(G_m_G_maxval_tmp,(iGo_))                                   
 G_m_G_maxval_tmp=0                                                    

with later

do i2=1,oGo_
     ..
     G_m_G_maxval_tmp(i2)=maxval(G_m_G(:,i2))       
enddo
PP_redux(G_m_G_maxval_tmp)
G_m_G_maxval=maxval(G_m_G_maxval_tmp)
andrea-ferretti commented 1 month ago

I agree, this is better ! coded and under testing now