[gpaw-users] Restarting an optimization run
Jussi Enkovaara
jussi.enkovaara at aalto.fi
Thu Jan 17 13:55:45 CET 2013
On 2013-01-16 18:34, Jens Jørgen Mortensen wrote:
> Hi!
>
> I'd like to know how people continue optimization runs with GPAW that
> are killed in the middle of a force-calculation.
>
> Do you have some if-else magic in your script to handle both the first
> run and a continuation run or do just edit the first script to start
> from the last image in the trajectory file form the previous run?
>
> Do you worry about not repeating the force-calculation for the last
> image in the trajectory file you continue from? If yes, how?
Hi,
I have been continuing from gpw/hdf5 files with something like:
---------------
if os.path.isfile('restart.gpw'):
atoms, calc = restart('restart.gpw')
traj = PickleTrajectory(basename + '.traj', 'a', atoms=atoms)
else:
traj = basename + '.traj'
calc.attach(calc.write, 10, 'restart.gpw', mode='all')
opt = QuasiNewton(atoms, trajectory=traj, logfile='qn.log',
restart='qn.pckl')
opt.attach(calc.write, 1, 'restart.gpw', mode='all')
opt.run()
----------------
The restart file written after each relaxation step contains also the
forces, so force calculation for the previous image is not repeated.
The "calc.attach" allows continuing also from the middle of the force
calculation (forces are not written by this calc.write, so one needs
to attach observer also to optimizer).
Best regards,
Jussi
More information about the gpaw-users
mailing list