Debug dumping mechanism
Some failures of the code happen only rarely and are hard to reproduce. An example would be issues in finding the right Fermi level for non-monotonous smearing functions. For acquiring sufficient information when such issues occur and allow later debugging, DFTK has a feature to automatically drop a json file with some context (e.g. a representation of the basis, the eigenvalues and occupations, the SCF state etc.) in case such failures happen.
To activate this mechanism you need to do two things:
Set the DFTK package-level preference
debugdump_prefixto the location where you want the debugdump files to appear. This can be done conveniently using theDFTK.set_debugdump_prefix!("path/to/desired/location")function. This you need to do exactly once.In every script where you want to make use of debug dumping, make sure to add a
using JSON3as theJSON3package (which is dynamically loaded) is needed for the debug dumping feature to work.