I have a question regarding using kwant for very large systems. In my research I am trying to model graphene-based devices on the order of L = W = 500 nm. I encounter a problem when trying to simulate electron density in these devices with Kwant.
The errors I get look like this:
Faulting application name: python.exe, version: 0.0.0.0, time stamp: 0x5488acd7 Faulting module name: _mumps.pyd, version: 0.0.0.0, time stamp: 0x54d2a92a Exception code: 0xc00000fd Fault offset: 0x000000000076e357 Faulting process id: 0x5018 Faulting application start time: 0x01d0811ecc4f2ba7 Faulting application path: C:\WinPython-64bit-18.104.22.168\python-2.7.9.amd64\python.exe Faulting module path: C:\WinPython-64bit-22.214.171.124\python-2.7.9.amd64\lib\site-packages\kwant\linalg_mumps.pyd Report Id: d70446a6-ed26-11e4-9806-b8ac6f4eb471
A little info on the system: I am running 64 bit python installed from the WinPython package. The IDE is Spyder. I've gotten all of the example codes to work as well as several of my own (albeit for smaller versions of the systems we would like to study).
From the error and doing some testing with the code, I've devised that it
must be a problem occuring solver itself. I have enough memory to build the system and I am pretty sure I am not running out of memory during the actual solving, although I am not positive. I am wondering if the mumps routine could be breaking for very large systems? When I run my code on a laptop with much less ram (~60 gb for the desktop vs 4 gb on the laptop) I end up with a memory error instead of a kernel crash.
I've attached a modified version of one of the tutorial codes, where I have added in a LDOS/electron density calculation and increased the dimensions of the simulation to 500x1000. The code successfully finalizes the device on my machine, but crashes the python kernel during the actual calculation.
I can get more ram for the machine if necessary, but I want to make sure that it isn't a problem related to the solver before sending the purchase order to my advisor.
Kwant seems extremely nice so we're hoping to use it in our research in the future! It is a lot better than the NEGF code I strung together in matlab!
Thanks for your compliment about Kwant.
The conductance calculation in your script needs about 1.4 GiB of RAM on my machine (Debian GNU/Linux, amd64 architecture). So while 500x1000 is large system, it should run with 2 GiB of RAM. See Fig. 7 of the Kwant paper for memory usage of the MUMPS solver.
Are you running the Kwant packages for Windows that were prepared by Christopher Gohlke? Unfortunately, none of us is an expert of the Windows system (or even uses it). The simplest stopgap solution that I can recommend you is to use some variant of Linux for your calculations.
Independently of that, we are interested to see Kwant running well under Windows. Could you please try to debug the issue a bit more? I find it curious that the failure mode seems to depend on how much RAM the machine has while you do not run out of memory.
“Exception code: 0xc00000fd” seems to mean stack overflow (not the website but a real one!). The default stack size in windows is 1024 kiB and as far as I can see it can be increased only upon compilation. While the default stack is 8192 kiB on Linux, I verified that your script runs even with a reduced stack of 256 kiB. So MUMPS does not seem to need a particularly large stack even for huge matrices.
If you are using Christoph Gohlke’s packages, it would be great if you could report the problem directly to him (I’m interested to be put in CC). He might now how to fix it.