band-unfolding / banduppy

Python version ofthe BandUP code
GNU General Public License v3.0
17 stars 7 forks source link

out of memory #13

Open gmm05126 opened 2 years ago

gmm05126 commented 2 years ago

Dear all, Do you see a way to reduce RAM usage for unfolding large cases? I am running out of 512GB of RAM. Thanks, Martin

stepan-tsirkin commented 2 years ago

@gmm05126 , just for reference, what is the size of your system - number of atoms, bands, planewaves, kpoints in the path? What is the size of the .save directory or WAVECAR file?

One way is to use Ecut parameter, to through away higher plane waves, but one should be reasonable in that, as the unfolding weihts might be inaccurate.

Also, if you have many bands below/above the energy range of interest, you may exclude them uaing IBstart, IBend parameters

Other way is to unfold the path piecewise.

The problem is that the code loads all wavefunctions at a time, although it is not really needed. There is a way to modify irrep so that it loads wavefunctions for 1 kpoint, processes them, and then stores only the needed information, clearing the large arrays. But that needs to be done

stepan-tsirkin commented 2 years ago

@gmm05126 , could you try this branch of banduppy in combination with this branch of irrep.

Here the banduppy.Unfolding.unfold() method receives an extra parameter saveWF, which is False by default. https://github.com/band-unfolding/banduppy/blob/77550cebd08cae62bc8bfd564d13580bddd99019/banduppy/unfolding_path.py#L54

if saveWF==False the wavefunctions are read only when needed and removed after processing (not saved in memory).

see example : https://github.com/band-unfolding/banduppy/blob/77550cebd08cae62bc8bfd564d13580bddd99019/tutorials/QE-noSOC/run_banduppy.py#L77-L78

This may make the code a bit slower, if the same SCBZ point is unfolded to several PCBZ points, but hopefully not much, and will require less memory.

Please, try and tell me how it goes (I did not test much myself, so please report any bugs arising)