QuantumATK Forum
QuantumATK => General Questions and Answers => Topic started by: asanchez on June 5, 2015, 15:31
-
Hi all,
When running a restarted calculation with a script like:
configuration = nlread('original_checkpoint_file.nc')[0]
configuration.setCalculator(configuration.calculator(), initial_state=configuration)
configuration.update(force_restart=True)
nlsave('output.nc', configuration)
How can one specify the checkpoint file to write to? Since there's no explicit specification of the calculator I don't know how to do it. Is there a way using the setCalculator method?
Thanks!
-
# read configuration from checkpoint file
configuration = nlread('original_checkpoint_file.nc')[0]
# Define the check point handler
checkpoint_handler = CheckpointHandler('/home/checkpoint.nc', 20*Minute)
# Clone the calculator method, with a new checkpoint handler
calculator = configuration.calculator()(checkpoint_handler=checkpoint_handler)
configuration.setCalculator(calculator, initial_state=configuration)
configuration.update(force_restart=True)
nlsave('output.nc', configuration)
-
For more details see also the Reference Manual:
http://www.quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.checkpointhandler.html
-
Very nice. Thanks!