QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: ruyam on November 24, 2014, 08:36

Title: Restart a calculation using checkpoint file error
Post by: ruyam on November 24, 2014, 08:36
I ran a calculation and it got ended. I tried to restart it using the checkpoint file, but it showed the following error:

  File "/home/ruyam/.vnl/test/test-1.py", line 1142, in <module>
    device_configuration.update(force_restart=True)
  File "./zipdir/NL/CommonConcepts/Configurations/AtomicConfiguration.py", line 1009, in update
NL.ComputerScienceUtilities.Exceptions.NLValueError: A calculator must be attached to the configuration for an update to execute.

I used the instruction given on the following QW link: http://quantumwise.com/publications/tutorials/item/502-restarting-stopped-calculations
Title: Re: Restart a calculation using checkpoint file error
Post by: Umberto Martinez on November 25, 2014, 10:24
can you attach your script?

As the message says you need to attach a calculator to the configuration before the update line.
This is done by the setCalculator line below

Code
configuration = nlread("checkpointfile.nc")[0]
configuration.setCalculator(configuration.calculator(), initial_state=configuration)
configuration.update(force_restart=True)
nlsave("file.nc",configuration)