Author Topic: Restart a device calculation  (Read 3800 times)

0 Members and 1 Guest are viewing this topic.

Offline exenGT

  • Regular QuantumATK user
  • **
  • Posts: 12
  • Country: us
  • Reputation: 0
    • View Profile
Restart a device calculation
« on: August 9, 2017, 05:04 »
Hi All,

I have tried to restart a device calculation from a checkpoint file. "General info" in the toolbox shows that the checkpoint file has 162 steps of SCF iterations stored in it. The script I use to restart the calculation is the following:

configuration = nlread("Ni100-InAs100_InTerm_1e19_dev_rlx2_MGGA_checkpoint.hdf5")[0]
configuration.setCalculator(configuration.calculator(), initial_state=configuration)
configuration.update(force_restart=True)
nlsave("Ni100-InAs100_InTerm_1e19_dev_rlx2_MGGA.hdf5",configuration)

However, running this script gives an error message which reads:

Traceback (most recent call last):
  File "Ni100-InAs100_InTerm_1e19_dev_rlx2_MGGA_2.py", line 4, in <module>
    configuration.setCalculator(configuration.calculator(), initial_state=configuration)
  File "zipdir/NL/CommonConcepts/Configurations/DeviceConfiguration.py", line 1184, in setCalculator
  File "zipdir/NL/Calculators/SemiEmpirical/HuckelCalculator/ExtractState.py", line 147, in extractDeviceState
  File "zipdir/NL/Calculators/SemiEmpirical/HuckelCalculator/ExtractState.py", line 327, in extractStateUtility
  File "zipdir/NL/Calculators/SemiEmpirical/HuckelCalculator/ExtractState.py", line 261, in newCellIndex
NL.ComputerScienceUtilities.Exceptions.NLValueError: The argument configuration_1 is the same object as configuration_2, however, the object does not seem to have an updated calculator.

Could anyone explain why this happens, and help me resolve this issue? Thanks a lot!

Offline exenGT

  • Regular QuantumATK user
  • **
  • Posts: 12
  • Country: us
  • Reputation: 0
    • View Profile
Re: Restart a device calculation
« Reply #1 on: August 9, 2017, 05:06 »
Forget to add that I use ATK 2017.0.

Offline Daniele Stradi

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 286
  • Country: dk
  • Reputation: 3
    • View Profile
Re: Restart a device calculation
« Reply #2 on: August 9, 2017, 10:41 »
Hi,

your script should work fine, but it seems that the file you nlread  does not have an updated calculator:

The argument configuration_1 is the same object as configuration_2, however, the object does not seem to have an updated calculator.

I assume you have read the tutorial:
http://docs.quantumwise.com/tutorials/restarting_calculations/restarting_calculations.html

Could you attach the hdf5 file you try to read in and the input of the calculation?

Regards,
Daniele.

Offline Jess Wellendorff

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 933
  • Country: dk
  • Reputation: 29
    • View Profile
Re: Restart a device calculation
« Reply #3 on: August 9, 2017, 13:39 »
It looks like you unfortunately found a bug in ATK 2017: You did the restart in exactly the way prescribed in the tutorial, and it does not work. Please try this approach instead, which should avoid the error:  
Code
old_configuration = nlread("Ni100-InAs100_InTerm_1e19_dev_rlx2_MGGA_checkpoint.hdf5")[0]
configuration = nlread("Ni100-InAs100_InTerm_1e19_dev_rlx2_MGGA_checkpoint.hdf5")[0]
configuration.setCalculator(old_configuration.calculator(), initial_state=old_configuration)
configuration.update()
nlsave("Ni100-InAs100_InTerm_1e19_dev_rlx2_MGGA.hdf5", configuration)

Offline exenGT

  • Regular QuantumATK user
  • **
  • Posts: 12
  • Country: us
  • Reputation: 0
    • View Profile
Re: Restart a device calculation
« Reply #4 on: August 9, 2017, 19:49 »
Thank you so much Jess! This solves my problem.