QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: ATK-user-zuox on January 9, 2016, 06:48

Title: problem about restarting from a check point
Post by: ATK-user-zuox on January 9, 2016, 06:48
Hello,recently i run a test script[Device.py] to set the
Code
DeviceLCAOCalculator( checkpoint_handler= CheckpointHandler('checkpoint-2.nc', 1*Minute),
and kille the job for restarting the jobs.i also get the [checkpoint-2.nc],but when i run the new py script[Device-restart.py], i get the  error message instantly
Code
Traceback (most recent call last):
  File "Device.py", line 495, in <module>
    device_configuration.setCalculator(DeviceLCAOCalculator(), initial_state= device_configuration)
  File "./zipdir/NL/CommonConcepts/Configurations/AtomicConfiguration.py", line 1222, in setCalculator
  File "./zipdir/NL/CommonConcepts/Calculator.py", line 58, in _supportConfiguration
  File "./zipdir/NL/CommonConcepts/Calculator.py", line 48, in _supportConfigurationType
  File "./zipdir/NL/Analysis/AnalysisUtilities.py", line 78, in checkConfiguration
NL.ComputerScienceUtilities.Exceptions.NLTypeError: The parameter, configuration, must be an instance of one of the following SurfaceConfiguration, DeviceConfiguration, NudgedElasticBand.

I have already read the Restarting stopped calculations toturial ,forum ,and the manual and i can't fix the problem in my code. Hope anyone could help! me!
Title: Re: problem about restarting from a check point
Post by: ATK-user-zuox on January 9, 2016, 06:53
The modified code i restart the job is
Code
device_configuration = nlread("checkpoint-2.nc",)[0]
device_configuration.setCalculator(DeviceLCAOCalculator(), initial_state= device_configuration)
nlprint(device_configuration)
device_configuration.update(force_restart=True)
nlsave('Device Gold.nc', device_configuration)
Title: Re: problem about restarting from a check point
Post by: Jess Wellendorff on January 14, 2016, 09:28
So this solves the problem?
Title: Re: problem about restarting from a check point
Post by: kanna on January 17, 2016, 08:42
Does this restart from where the simulation ended at 1 Minute ?
Title: Re: problem about restarting from a check point
Post by: ATK-user-zuox on January 17, 2016, 13:08
The jobs stopped instanly and  a another occurred :
Code
Traceback (most recent call last):
  File "Device.py", line 494, in <module>
    device_configuration = nlread("checkpoint-2.nc", DeviceConfiguration)[0]
IndexError: list index out of range
, i clear the
Title: Re: problem about restarting from a check point
Post by: Anders Blom on January 18, 2016, 10:18
The jobs stopped instanly and  a another occurred :
Code
Traceback (most recent call last):
  File "Device.py", line 494, in <module>
    device_configuration = nlread("checkpoint-2.nc", DeviceConfiguration)[0]
IndexError: list index out of range

This means there are no DeviceConfigurations in the file "checkpoint-2.nc". Probably you never even got to the device part. It is probably better to start the job from scratch.