QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: exenGT on August 9, 2017, 05:04

Title: Restart a device calculation
Post by: exenGT 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!
Title: Re: Restart a device calculation
Post by: exenGT on August 9, 2017, 05:06
Forget to add that I use ATK 2017.0.
Title: Re: Restart a device calculation
Post by: Daniele Stradi 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.
Title: Re: Restart a device calculation
Post by: Jess Wellendorff 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)
Title: Re: Restart a device calculation
Post by: exenGT on August 9, 2017, 19:49
Thank you so much Jess! This solves my problem.