QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: ramkrishna on December 4, 2013, 19:22

Title: checkpoint_handler
Post by: ramkrishna on December 4, 2013, 19:22
Dear Sir,
      My simulation crashes after running 3 days. So I want to restart the simulation by using the checkpoint file. Now, the default location of the checkpoint file is in the directory TEMP but I am running the simulations in a cluster and so it is admin protected. For this, I want to specify the checkpoint handler manually in the script so that it can go directly in the desktop. I was checking the manual http://quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.checkpointhandler.html how to specify this.
Here, I am little confused. Should I have to put the command

checkpoint_handler = CheckpointHandler('/home/checkpoint.nc', 20*Minute)

calculator = LCAOCalculator(checkpoint_handler=checkpoint_handler)


within the device calculator in the following manner?? or where exactly I have put this command

Code
 #----------------------------------------
# Device Calculator
#----------------------------------------
calculator = DeviceLCAOCalculator(
    basis_set=basis_set,
    exchange_correlation=exchange_correlation,
    numerical_accuracy_parameters=device_numerical_accuracy_parameters,
    electrode_calculators=
        [left_electrode_calculator, right_electrode_calculator],
    )

# Set Checkpoint file[/color]
checkpoint_handler = CheckpointHandler('/Desktop/checkpoint.nc', 20*Minute)

calculator = LCAOCalculator(checkpoint_handler=checkpoint_handler)


device_configuration.setCalculator(calculator)
nlprint(device_configuration)
device_configuration.update()
nlsave('Device_1.nc', device_configuration)

Please help.

Regards
Ramkrishna


Title: Re: checkpoint_handler
Post by: Anders Blom on December 4, 2013, 22:29
That is basically correct, but both "/home/checkpoint.nc" and "/Desktop" would likely not work... Probably it should be more like /home/yourusername/Desktop/checkpoint.nc or just /home/yourusername/checkpoint.nc.

Well, the idea is correct. Your code is wrong. The checkpoint must be set on the DeviceLCAOCalculator - you cannot set an LCAOCalculator on a DeviceConfiguration anyway.