shankar1729 / jdftx

JDFTx: software for joint density functional theory
http://jdftx.org
82 stars 54 forks source link

Error encountered when running WannierEph.py #280

Closed mshammami closed 1 year ago

mshammami commented 1 year ago

Hi Professor Sundararaman, I tried running the WannierEph.py code as provided in the "Electron-phonon matrix elements" tutorial using the same .in files, however, it resulted in the following error:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/tmp/ipykernel_80138/1488143587.py in <module>
     52 # --- Read, reshape and expand e-ph matrix elements:
     53 iReducedEph = np.dot(np.mod(cellMapEph, phononSup[None,:]), phononSupStride)
---> 54 HePhReduced = np.fromfile('wannier.mlwfHePh').reshape((prodPhononSup,prodPhononSup,nModes,nBands,nBands)).swapaxes(1,2)
     55 HePhWannier = cellWeightsEph[:,None,:,:,None] * cellWeightsEph[None,:,:,None,:] * HePhReduced[iReducedEph][:,iReducedEph]
     56 

ValueError: cannot reshape array of size 600 into shape (8,8,3,5,5)

Is the format of the Wannier output files different from what the .py code suggests? Thank you! Kindly, Matthew

shankar1729 commented 1 year ago

Hi Matthew,

This should not be the case: I checked the script against outputs run with the latest code and everything still remained consistent.

Your wannier.mlwfHePh file appears to be 8x smaller than it should be based on that error message. Please check / post the wannier.out log file: was there an error in the generation of the wannier matrix elements?

Best, Shankar

mshammami commented 1 year ago

Yes, it seems like the calculation finishes, but the file generation is not successful for some reason? wannier_out.txt

shankar1729 commented 1 year ago

No, your output shows that the program crashes with a stacktrace while writing the mlwfHePh file.

I see that you are running this on Perlmutter, and this could be associated with CUDA-aware mpi support limitations on the Cray MPI there. Since this is a pretty quick run (takes 11 s on my laptop), you can reduce this to a single GPU, or switch to the CPU executable and see if that gets you to the final result.

Best, Shankar

mshammami commented 1 year ago

I see! Indeed, running the CPU executable resolves the issue (and the WannierEph.py script works properly). Thank you very much!

Kindly, Matthew