Author Topic: the restart script in ATK manual does not work  (Read 2171 times)

0 Members and 1 Guest are viewing this topic.

Offline njuxyh

  • QuantumATK Guru
  • ****
  • Posts: 163
  • Reputation: 0
    • View Profile
the restart script in ATK manual does not work
« on: December 27, 2010, 08:57 »
hi: everyone :
i am testing the restart script written in ATK mamual(2008,10,page 451,  it does not work(the script is wrong?)
 so i want to know the proper script for me to restart a relax job from a *.nc file. is the nc file the only needed file for restart? is the initial  structure information file VNL needed(i.e. 'atomic_configuration')?

the script is :

# Import the KohnSham module from ATK
from ATK.KohnSham import *
# Read self consistent calculation from NetCDF file
scf = restoreSelfConsistentCalculation('h2.nc')
# Set the force tolerance
opt = geometricOptimizationParameters(
force_tolerance=0.00001*electronVolt/Angstrom
)
# Set name of check point file
params = runtimeParameters(
verbosity_level=10
)
# Calculate the optimized atomic geometry
h2_opt = calculateOptimizedAtomicGeometry(
self_consistent_calculation=scf,
optimization_parameters=opt,
runtime_parameters=params
)
# Print the coordinates of the individual atoms
print '\nAtom coordinates\n---------------------------'
for coord in h2_opt.cartesianCoordinates():
 for c in coord:
  print '%7.4f' % (c.inUnitsOf(Angstrom)),




the out is :
raceback (most recent call last):
  File "relax-continue.py", line 17, in ?
    runtime_parameters=params
NLArgumentNameError: When the parameters, ['runtime_parameters'], are specified, the parameters, ['atomic_configuration', 'method', 'runtime_parameters'], must also be specified

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5428
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: the restart script in ATK manual does not work
« Reply #1 on: December 27, 2010, 11:55 »
It's a mistake in the manual. Remove the parameter "runtime_parameter" from the call to "calculateOptimizedAtomicGeometry" and the script will run fine - however, you will not see any output from the iterations. For this, add

import ATK
ATK.setVerbosityLevel(10)

to the script (above the call to "calculateOptimizedAtomicGeometry").