QcmPlab / CDMFT-LANC-ED

Exact Diagonalization solver for Quantum Cluster Problems.
7 stars 3 forks source link

Fix the broadcast of norm2 in ED_GF_NORMAL #2

Open lcrippa opened 2 years ago

lcrippa commented 2 years ago

as it stands, the norm of vvinit is broadcast in this way, whenever we need to add/remove a particle


if(MpiStatus)then
             if(MpiComm /= MPI_COMM_NULL)call Bcast_MPI(MpiComm,norm2)
             vecDim = vecDim_Hv_sector(jsector)
             allocate(vvloc(vecDim))
             if(MpiComm /= MPI_COMM_NULL) call scatter_vector_MPI(MpiComm,vvinit,vvloc)
             call sp_lanc_tridiag(MpiComm,spHtimesV_p,vvloc,alfa_,beta_)

this creates an issue when a large number of cores is used, and the vector is small: only the cores in mpi_comm_group will get the norm, the others will get nothing. Then when they creare impG, the weights will all be 0. When they try to invert it in order to get Sigma, they will fail. The solution can be

a) move the bcast after the delete_hv_sector line, where the communicator is reset b) implement the new functions added in the single-site code (e.g. tridiag_Hv_sector_normal)

b) is preferred for uniformity and future-proof