Author Topic: Is it possible to complete I-V curve calculation by restarting from a checkpoint  (Read 7128 times)

0 Members and 1 Guest are viewing this topic.

Offline Jin-Kyu Choi

  • Regular QuantumATK user
  • **
  • Posts: 24
  • Country: kr
  • Reputation: 0
    • View Profile
Hello, I'm Jin-Kyu Choi from Korea.
Because I'm a just beginner, so I would like to ask some simple and basic questions.
I would like to ask two questions.

1. As I learned from the Manual and Tutorial on the Quantumwise web, it seems be possible to specify the name, saving path, and saving time-interval of the checkpointfile. Could you let me know how to specify those things in the script file (*.py) ?

2. Because now I'm running the ATK program in a PC with a free license to practice utilization of it, computing resouces such as memory are not sufficient to complete some calculations like I-V curve for a metal-molecule-metal device (in a little big system, I usually get an error message for memory decifiency). So I want to ask that "is it possible to complete I-V curve calculation by restarting from a checkpoint file?".

Thank you for your kind reply.
« Last Edit: November 23, 2011, 08:46 by Jin-Kyu Choi »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Dear Jin-Kyu, a detailed description of how to control the checkpoint file can be found in the manual, and just this week we also published a small tutorial on the subject: http://quantumwise.com/publications/tutorials/mini-tutorials/142 There is a basic tutorial on I-V curves here: http://quantumwise.com/publications/tutorials/mini-tutorials/98 If the system is large, to put each bias point in a separate NC file (not really checkpoint file). For this you should change the "nlsave" statement to make a new file for each bias:
Code: python
nlsave("lih2li_iv_scf_bias_%g.nc" % voltage.inUnitsOf(Volt), device_configuration)
If the calculation is interrupted, you can restart by reading in the initial state from the last NC file and continuing the loop (edit the voltages list). For instance:
Code: python
# ... script as it was before ... until "for voltage in"
initial_state = nlread("lih2li_iv_scf_bias_0.3.nc", DeviceConfiguration)[0]
for voltage in [0.4, 0.5, 0.6, 0.7]*Volt:

    device_configuration.setCalculator(
        calculator(electrode_voltages=(-0.5*voltage,0.5*voltage)),
        initial_state=device_configuration
    )
    device_configuration.update()
    nlsave("lih2li_iv_scf_bias_%g.nc" % voltage.inUnitsOf(Volt), device_configuration)
There is no simple way to automate these things, but a few small edits of the script are all that's needed. Note that using a checkpoint file isn't really going to lower the memory consumption, however, so if this is a general problem you should look into what you can do to make the calculation smaller. How much RAM do you have? 4 Gb is often enough, provided you don't try to run in parallel on the machine, but of course it depends a lot on how many atoms you have.
« Last Edit: November 23, 2011, 09:43 by Anders Blom »

Offline Jin-Kyu Choi

  • Regular QuantumATK user
  • **
  • Posts: 24
  • Country: kr
  • Reputation: 0
    • View Profile
First of all, I would like to thank you for your kind introduction.
I'm running the ATK calculations on windows XP 64 bit OS with 8GB RAM.
As you recommanded, I will try to run the I-V curve calculation by examing current at each voltage.

Thank you.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
8 GB is quite a lot (i.e. sufficient) for most cases. Do you use a lot of k-points? That's the primary point where running in parallel can save memory.

Offline Jin-Kyu Choi

  • Regular QuantumATK user
  • **
  • Posts: 24
  • Country: kr
  • Reputation: 0
    • View Profile
I have been trying to calculate I-V curve for a metal-molecule-metal device with 117 atoms in the central region (Au:96, C:8, H:8, Si:2, S:2, O:1) and 4X4 Au electrodes.
Then I have failed in both cases of (1,1,50) and even (1,1,1) of k-points and 3 voltage points.

The error massege was the following:
Runtime Error!
Program:
This application has requested the Runtime to terminate it in an unusual way.
Please contact the applications' support team for more information.

After searching in the Forum, I thought the error was due to the memory deficiency.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Yes, the error message indicates you run out of memory. 1x1x1 k-points makes no sense - and doesn't really matter so much for the memory as you might think, because the kC points are only used for the electrodes.

There is one trick that can reduce memory a bit: try using NeutralAtoms instead of EquivalentBulk under the device algorithm settings. The calculation might run a bit longer, but as long as it can finish I guess that's better than the current situation.

Alternatively, you should be able to reduce the basis set of Au to DoubleZeta without any real loss of accuracy, this also reduces memory.

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
if the initial configuration read was from a different bias, then does it actually save time in calculation to use it? How does that work ... are there some base calculations needed that it can reuse? .. just had similar issue, trying solution above ..

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
You mean use a checkpoint file (not converged state) to initialize a different calculation? Why not use the converged state of the first case to start the second calculation?

The way "initial_state" works is that it reads the density matrix from the specified configuration rather than starting at neutral atoms. It's not a surefire way to always get better convergence, but at least if it's converged there is a rather good chance that it reduces the number of iterations needed to self-consistency.

Offline esp

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 318
  • Country: us
  • Reputation: 3
    • View Profile
    • University of Minnesota
ok i understand . i am doing as you suggest