Author Topic: Trouble Restarting from a checkpoint file  (Read 15384 times)

0 Members and 1 Guest are viewing this topic.

Offline BandTheory

  • Heavy QuantumATK user
  • ***
  • Posts: 26
  • Reputation: 0
    • View Profile
Trouble Restarting from a checkpoint file
« on: February 18, 2010, 20:44 »
I am trying to restart an aborted calculation using a checkpoint file. It is my understanding that executeSelfConsistentCalculation() will take a restoreSelfConsistentCalculation object as an argument.  I tried this and got the following error:

Traceback (most recent call last):
  File "<string>", line 11, in ?
KeyError: 'Electrode'


My code basically looks like this.

from ATK.KohnSham import *
from ATK.MPI import*

sc_calc = restoreSelfConsistentCalculation('/filepath/filename.nc')

scf = executeSelfConsistentCalculation(
self_consitent_calculation = sc_calc
)


if processIsMaster():
        print calculateTotalEnergy(scf)

I'd like to salvage this calculation if possible and I would really appreciate the help.
Thanks,

BT



Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5538
  • Country: dk
  • Reputation: 90
    • View Profile
    • QuantumATK at Synopsys
Re: Trouble Restarting from a checkpoint file
« Reply #1 on: February 18, 2010, 22:09 »
You import the KohnSham module, but the restored SCF is a two-probe. So, try
Code
from ATK.TwoProbe import *
instead, and I think it will work.

Offline BandTheory

  • Heavy QuantumATK user
  • ***
  • Posts: 26
  • Reputation: 0
    • View Profile
Re: Trouble Restarting from a checkpoint file
« Reply #2 on: February 21, 2010, 04:23 »
I made the switch, but I receive the same error.  I also tried importing KhonSham and TwoProbe, but received the same output.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5538
  • Country: dk
  • Reputation: 90
    • View Profile
    • QuantumATK at Synopsys
Re: Trouble Restarting from a checkpoint file
« Reply #3 on: February 21, 2010, 19:18 »
Do you know if the original calculation was interrupted in the two-probe part or the equivalent electrode part? Unfortunately the (old) NetCDF files are not very transparent, so unless the standard approach works, there's probably not much that can be done manually either. There is a tool called ncview (ftp://cirrus.ucsd.edu/pub/ncview/) that you perhaps can use to inspect the contents of the NC file, but again, it seems unlikely this will resolve it. But post it, if you get it to work, and we can have a look and help you interpret it. There is a separate approach to using the NetCDF file, which is not a restart but rather an initialization. If you restore the SCF object in the same way, but use
Code
initial_calculation = sc_calc
instead, you can use the fact that you were already on your way to convergence to save time. Again, this requires the NC file to be in an appropriate state, so there is no guarantee this will work either, given the situation with the restart. Also note that in this case you have to define the entire calculation again, so what you do is go back to the original script and just insert two lines, one to restore the NC file, and one which adds the statement above to the executeSelfConsistentCalculation() call. Good luck!

Offline BandTheory

  • Heavy QuantumATK user
  • ***
  • Posts: 26
  • Reputation: 0
    • View Profile
Re: Trouble Restarting from a checkpoint file
« Reply #4 on: February 22, 2010, 18:17 »
Well I am using Neutral Atom density because I have heterogeneous electrodes.  I don't know if that makes any difference.

I think I will first try running my initial script with 'initial_calculation = sc_calc" and if that does not work I will just restart the whole thing from scratch.

Thanks for the help.

Offline hellboy

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: Trouble Restarting from a checkpoint file
« Reply #5 on: August 18, 2010, 15:09 »
Dear all, I had a power failure and have wrongly modified the script as shown below. I restored from 'crash.nc' and if you see the last few lines of the code after # Initialize self-consistent field calculation i defined checkpoint as 'crash_1.nc'. Now the program has created crash_1.nc and is modifying it regularly. Also, crash.nc is accesed frequently. The script below is only a sample, the program is still running and is doing two probe calculation. I do not know what is happening and request you to suggest a solution to save my time. If possible please suggest modifications to this script.
Code: python
from ATK.TwoProbe import *
old_scf = restoreSelfConsistentCalculation('crash.nc')
scf = executeSelfConsistentCalculation(self_consistent_calculation=old_scf)
from ATK.MPI import processIsMaster
import ivcurve

# Generate time stamp
if processIsMaster():
    import platform, time
    print '#',time.ctime()
    print '#',platform.node(),platform.platform()+'\n'

# Opening vnlfile
if processIsMaster(): file = VNLFile('twoprobe.vnl')

# Scattering elements
left_surface_elements  = [Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon]
central_atom_elements  = [Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon]
right_surface_elements = [Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon, 
                          Carbon, Carbon, Carbon, Carbon]
scattering_elements = left_surface_elements + central_atom_elements + right_surface_elements

# Scattering coordinates
left_surface_coordinates  = [[ 10.32234097,   7.60652113,   2.46297622],
                             [  7.60652113,  10.32234097,   2.46297622],
                             [  4.89070082,   7.60652113,   2.46297622],
                             [  7.60652113,   4.89070082,   2.46297622],
                             [  9.95849037,   8.96443081,   2.46297622],
                             [  6.24861097,   9.95849037,   2.46297622],
                             [  5.25455189,   6.24861097,   2.46297622],
                             [  8.96443081,   5.25455189,   2.46297622],
                             [  9.52689552,   9.52689552,   3.69446445],
                             [  5.68614626,   9.52689552,   3.69446445],
                             [  5.68614626,   5.68614626,   3.69446445],
                             [  9.52689552,   5.68614626,   3.69446445],
                             [  8.30942726,  10.22980118,   3.69446445],
                             [  4.98324013,   8.30942726,   3.69446445],
                             [  6.903615  ,   4.98324013,   3.69446445],
                             [ 10.22980118,   6.903615  ,   3.69446445]]*Angstrom
central_atom_coordinates  = [[ 10.32234097,   7.60652113,   4.92602378],
                             [  9.52689552,   9.52689552,   6.15751189],
                             [  7.60652113,  10.32234097,   4.92602378],
                             [  5.68614626,   9.52689552,   6.15751189],
                             [  4.89070082,   7.60652113,   4.92602378],
                             [  5.68614626,   5.68614626,   6.15751189],
                             [  7.60652113,   4.89070082,   4.92602378],
                             [  9.52689552,   5.68614626,   6.15751189],
                             [  9.95849037,   8.96443081,   4.92602378],
                             [  8.30942726,  10.22980118,   6.15751189],
                             [  6.24861097,   9.95849037,   4.92602378],
                             [  4.98324013,   8.30942726,   6.15751189],
                             [  5.25455189,   6.24861097,   4.92602378],
                             [  6.903615  ,   4.98324013,   6.15751189],
                             [  8.96443081,   5.25455189,   4.92602378],
                             [ 10.22980118,   6.903615  ,   6.15751189],
                             [ 10.32234097,   7.60652113,   7.389     ],
                             [  9.52689552,   9.52689552,   8.62048811],
                             [  7.60652113,  10.32234097,   7.389     ],
                             [  5.68614626,   9.52689552,   8.62048811],
                             [  4.89070082,   7.60652113,   7.389     ],
                             [  5.68614626,   5.68614626,   8.62048811],
                             [  7.60652113,   4.89070082,   7.389     ],
                             [  9.52689552,   5.68614626,   8.62048811],
                             [  9.95849037,   8.96443081,   7.389     ],
                             [  8.30942726,  10.22980118,   8.62048811],
                             [  6.24861097,   9.95849037,   7.389     ],
                             [  4.98324013,   8.30942726,   8.62048811],
                             [  5.25455189,   6.24861097,   7.389     ],
                             [  6.903615  ,   4.98324013,   8.62048811],
                             [  8.96443081,   5.25455189,   7.389     ],
                             [ 10.22980118,   6.903615  ,   8.62048811]]*Angstrom
right_surface_coordinates = [[ 10.32234097,   7.60652113,   9.85146421],
                             [  7.60652113,  10.32234097,   9.85146421],
                             [  4.89070082,   7.60652113,   9.85146421],
                             [  7.60652113,   4.89070082,   9.85146421],
                             [  9.95849037,   8.96443081,   9.85146421],
                             [  6.24861097,   9.95849037,   9.85146421],
                             [  5.25455189,   6.24861097,   9.85146421],
                             [  8.96443081,   5.25455189,   9.85146421],
                             [  9.52689552,   9.52689552,  11.08295232],
                             [  5.68614626,   9.52689552,  11.08295232],
                             [  5.68614626,   5.68614626,  11.08295232],
                             [  9.52689552,   5.68614626,  11.08295232],
                             [  8.30942726,  10.22980118,  11.08295232],
                             [  4.98324013,   8.30942726,  11.08295232],
                             [  6.903615  ,   4.98324013,  11.08295232],
                             [ 10.22980118,   6.903615  ,  11.08295232]]*Angstrom
scattering_coordinates = left_surface_coordinates + central_atom_coordinates + right_surface_coordinates

electrode_elements = [Carbon, Carbon, Carbon, Carbon, 
                      Carbon, Carbon, Carbon, Carbon, 
                      Carbon, Carbon, Carbon, Carbon, 
                      Carbon, Carbon, Carbon, Carbon]
electrode_coordinates = [[ 10.32234097,   7.60652113,   0.        ],
                         [  9.52689552,   9.52689552,   1.23148811],
                         [  7.60652113,  10.32234097,   0.        ],
                         [  5.68614626,   9.52689552,   1.23148811],
                         [  4.89070082,   7.60652113,   0.        ],
                         [  5.68614626,   5.68614626,   1.23148811],
                         [  7.60652113,   4.89070082,   0.        ],
                         [  9.52689552,   5.68614626,   1.23148811],
                         [  9.95849037,   8.96443081,   0.        ],
                         [  8.30942726,  10.22980118,   1.23148811],
                         [  6.24861097,   9.95849037,   0.        ],
                         [  4.98324013,   8.30942726,   1.23148811],
                         [  5.25455189,   6.24861097,   0.        ],
                         [  6.903615  ,   4.98324013,   1.23148811],
                         [  8.96443081,   5.25455189,   0.        ],
                         [ 10.22980118,   6.903615  ,   1.23148811]]*Angstrom

electrode_cell = [[ 15.2130418 ,   0.        ,   0.        ],
                  [  0.        ,  15.2130418 ,   0.        ],
                  [  0.        ,   0.        ,   2.46297625]]*Angstrom

# Set up electrodes
electrode_configuration = PeriodicAtomConfiguration(
    electrode_cell,
    electrode_elements,
    electrode_coordinates
    )

# Set up two-probe configuration
twoprobe_configuration = TwoProbeConfiguration(
    (electrode_configuration,electrode_configuration),
    scattering_elements,
    scattering_coordinates,
    electrode_repetitions=[[1,1],[1,1]],
    equivalent_atoms=([0,0],[1,56])
    )
if processIsMaster(): nlPrint(twoprobe_configuration)
if processIsMaster(): file.addToSample(twoprobe_configuration, 'twoprobe_configuration')

######################################################################
# Central region parameters
######################################################################
exchange_correlation_type = LDA.PZ

iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 400.0*Rydberg
)

basis_set_parameters = basisSetParameters(
    type = DoubleZetaPolarized,
    radial_sampling_dr = 0.001*Bohr,
    energy_shift = 0.01*Rydberg,
    delta_rinn = 0.8,
    v0 = 40.0*Rydberg,
    charge = 0.0,
    split_norm = 0.15
)

iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

electrode_voltages = (0.0,0.0)*Volt

two_probe_algorithm_parameters = twoProbeAlgorithmParameters(
    electrode_constraint = ElectrodeConstraints.Off,
    initial_density_type = InitialDensityType.EquivalentBulk
)

energy_contour_integral_parameters = energyContourIntegralParameters(
    circle_points = 30,
    integral_lower_bound = 3.0*Rydberg,
    fermi_line_points = 10,
    fermi_function_poles = 4,
    real_axis_infinitesimal = 0.01*electronVolt,
    real_axis_point_density = 0.02*electronVolt
)

two_center_integral_parameters = twoCenterIntegralParameters(
    cutoff = 2500.0*Rydberg,
    points = 1024
)

######################################################################
# Left electrode parameters
######################################################################
left_electrode_electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 400.0*Rydberg
)

left_electrode_iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

left_electrode_brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters(
    monkhorst_pack_parameters = (1, 1, 500)
)

left_electrode_iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

left_electrode_eigenstate_occupation_parameters = eigenstateOccupationParameters(
    temperature = 300.0*Kelvin
)

######################################################################
# Collect left electrode parameters
######################################################################
left_electrode_parameters = ElectrodeParameters(
    brillouin_zone_integration_parameters = left_electrode_brillouin_zone_integration_parameters,
    electron_density_parameters = left_electrode_electron_density_parameters,
    eigenstate_occupation_parameters = left_electrode_eigenstate_occupation_parameters,
    iteration_mixing_parameters = left_electrode_iteration_mixing_parameters,
    iteration_control_parameters = left_electrode_iteration_control_parameters
)

######################################################################
# Right electrode parameters
######################################################################
right_electrode_electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 400.0*Rydberg
)

right_electrode_iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

right_electrode_brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters(
    monkhorst_pack_parameters = (1, 1, 500)
)

right_electrode_iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

right_electrode_eigenstate_occupation_parameters = eigenstateOccupationParameters(
    temperature = 300.0*Kelvin
)

######################################################################
# Collect right electrode parameters
######################################################################
right_electrode_parameters = ElectrodeParameters(
    brillouin_zone_integration_parameters = right_electrode_brillouin_zone_integration_parameters,
    electron_density_parameters = right_electrode_electron_density_parameters,
    eigenstate_occupation_parameters = right_electrode_eigenstate_occupation_parameters,
    iteration_mixing_parameters = right_electrode_iteration_mixing_parameters,
    iteration_control_parameters = right_electrode_iteration_control_parameters
)

######################################################################
# Initialize self-consistent field calculation
######################################################################
two_probe_method = TwoProbeMethod(
    electrode_parameters = (left_electrode_parameters,right_electrode_parameters),
    exchange_correlation_type = exchange_correlation_type,
    iteration_mixing_parameters = iteration_mixing_parameters,
    electron_density_parameters = electron_density_parameters,
    basis_set_parameters = basis_set_parameters,
    iteration_control_parameters = iteration_control_parameters,
    energy_contour_integral_parameters = energy_contour_integral_parameters,
    two_center_integral_parameters = two_center_integral_parameters,
    electrode_voltages = electrode_voltages,
    algorithm_parameters = two_probe_algorithm_parameters
)
if processIsMaster(): nlPrint(two_probe_method)

runtime_parameters = runtimeParameters(
    verbosity_level = 10,
    checkpoint_filename = 'crash_1.nc'
)

voltages=[0.0,0.5,1.0,1.5]*Volt

ivcurve.runIVcurve (
    twoprobe_configuration, 
    two_probe_method, 
    runtime_parameters,
    voltages, 
    vnl_filename='twoprobe_iv.vnl', sample_name='twoprobe', 
    current_k_point_sampling = (10,10),
    current_number_of_points = 100
  )
Moderator edit: use of code tags make it easier to read post
« Last Edit: August 23, 2010, 11:05 by Anders Blom »

Offline hellboy

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: Trouble Restarting from a checkpoint file
« Reply #6 on: August 21, 2010, 16:04 »
Ok, I modified script to start from checkpoint file. Kindly check.
Code: python
from ATK.TwoProbe import *
from ATK.MPI import processIsMaster
import ivcurve

# Generate time stamp
if processIsMaster():
    import platform, time
    print '#',time.ctime()
    print '#',platform.node(),platform.platform()+'\n'

# Opening vnlfile

if processIsMaster(): file = VNLFile('twoprobe.vnl')
old_scf = restoreSelfConsistentCalculation('crash.nc')
import ATK
ATK.setCheckpointFilename('crash1.nc')
ATK.setVerbosityLevel(10)
scf = executeSelfConsistentCalculation(self_consistent_calculation=old_scf)

voltages=[0.0,0.5,1.0,1.5]*Volt

ivcurve.runIVcurve (
    twoprobe_configuration,
    two_probe_method,
    runtime_parameters,
    voltages,
    vnl_filename='twoprobe_iv.vnl', sample_name='twoprobe',
    current_k_point_sampling = (10,10),
    current_number_of_points = 100
  )
Moderator edit: use of code tags make it easier to read post
« Last Edit: August 23, 2010, 11:04 by Anders Blom »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5538
  • Country: dk
  • Reputation: 90
    • View Profile
    • QuantumATK at Synopsys
Re: Trouble Restarting from a checkpoint file
« Reply #7 on: August 21, 2010, 19:47 »
I'm not sure what your question is...? The last script will fail because none of the variables you provide to "ivcurve" is defined.

In general, when running an IV sweep like this, you cannot just directly use the crashed calculation to restart, unless you modify the ivcurve.py script yourself. (Note that your variable "scf" is never used after it's defined.)

PS: A general suggestion: place Python code inside "code" tags, makes it much easier to read.

Offline hellboy

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: Trouble Restarting from a checkpoint file
« Reply #8 on: August 23, 2010, 08:06 »
Dear Sir, My question is

-- I am doing a two probe I-V char. estimation for which i made a check-point file. Now, I want to restart from the check-point file.
-- I don't have zero_bias.nc since the program was interrupted during two probe calculation part.
-- I don't know how to modify ivscript.py, which you have suggested.
-- Please see the attached script and if possible make corrections so as to restart from the check-point file.
-- Also, please give an example to start from zero_bias.nc.

best regards...

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: Trouble Restarting from a checkpoint file
« Reply #9 on: August 23, 2010, 10:35 »
Since you don't have the zero_bias.nc, a calculation restarting from the crashed job may not helpful to save time. It is better to do a completely new calculation.

The example for a calculation starting from zero voltage:
http://www.quantumwise.com/documents/manuals/ATK-2008.10/chap.litwoprobe.html#sect2.litwoprobe.running
« Last Edit: August 23, 2010, 10:48 by zh »

Offline hellboy

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: Trouble Restarting from a checkpoint file
« Reply #10 on: August 23, 2010, 10:43 »
Thank you Zh (sir).

-- I would also like to know the changes in the script/ivscript.py when I have "zero_bias.nc" and want to simulate on other bias values (bias sweep).

best regards....

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5538
  • Country: dk
  • Reputation: 90
    • View Profile
    • QuantumATK at Synopsys
Re: Trouble Restarting from a checkpoint file
« Reply #11 on: August 23, 2010, 10:56 »
I prefer not to post a new script to address this, it will just become too overloaded with options. Instead, let us show how easy it is to customize things in Python. If you open your ivcurve.py script in an editor and go to lines 46-47, you will find
Code: python
    # No initial calculation for the first voltage
    scf = None
Simply insert here your zero-bias calculation, like for instance
Code: python
    # Initial calculation for the first voltage
    scf = restoreSelfConsistentCalculation("zerobias.nc")
and you're good to go. (Remember to keep the original indentation depth; these lines appear inside a function. I kept the indentation in the above code lines, to make it easier to copy/paste them.)
« Last Edit: August 23, 2010, 10:58 by Anders Blom »

Offline hellboy

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: Trouble Restarting from a checkpoint file
« Reply #12 on: August 23, 2010, 14:54 »
Ok, I understood how to modify "ivscript.py" for restarting from "zero_bias.nc" I modified the code as you said, please check whether it is correct or not.
Code
from ATK.TwoProbe import *  
from ATK.MPI import processIsMaster  
import ivcurve  
   
# Generate time stamp  
 if processIsMaster():  
     import platform, time  
     print '#',time.ctime()  
     print '#',platform.node(),platform.platform()+'\n'  
   
 # Opening vnlfile  
   
 if processIsMaster(): file = VNLFile('twoprobe.vnl')  
 old_scf = restoreSelfConsistentCalculation('zero_bias.nc')  

 # New checkpoint file

 import ATK
 ATK.setCheckpointFilename('crash1.nc')  
 ATK.setVerbosityLevel(10)
 
# initialize self consistent calculation
  
 scf = executeSelfConsistentCalculation(self_consistent_calculation=old_scf)  

# Set up electrodes
electrode_configuration = PeriodicAtomConfiguration(
    electrode_cell,
    electrode_elements,
    electrode_coordinates
    )

# Set up two-probe configuration
twoprobe_configuration = TwoProbeConfiguration(
    (electrode_configuration,electrode_configuration),
    scattering_elements,
    scattering_coordinates,
    electrode_repetitions=[[1,1],[1,1]],
    equivalent_atoms=([0,0],[1,56])
    )
if processIsMaster(): nlPrint(twoprobe_configuration)
if processIsMaster(): file.addToSample(twoprobe_configuration, 'twoprobe_configuration')

######################################################################
# Central region parameters
######################################################################
exchange_correlation_type = LDA.PZ

iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 400.0*Rydberg
)

basis_set_parameters = basisSetParameters(
    type = DoubleZetaPolarized,
    radial_sampling_dr = 0.001*Bohr,
    energy_shift = 0.01*Rydberg,
    delta_rinn = 0.8,
    v0 = 40.0*Rydberg,
    charge = 0.0,
    split_norm = 0.15
)

iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

electrode_voltages = (0.0,0.0)*Volt

two_probe_algorithm_parameters = twoProbeAlgorithmParameters(
    electrode_constraint = ElectrodeConstraints.Off,
    initial_density_type = InitialDensityType.EquivalentBulk
)

energy_contour_integral_parameters = energyContourIntegralParameters(
    circle_points = 30,
    integral_lower_bound = 3.0*Rydberg,
    fermi_line_points = 10,
    fermi_function_poles = 4,
    real_axis_infinitesimal = 0.01*electronVolt,
    real_axis_point_density = 0.02*electronVolt
)

two_center_integral_parameters = twoCenterIntegralParameters(
    cutoff = 2500.0*Rydberg,
    points = 1024
)

######################################################################
# Left electrode parameters
######################################################################
left_electrode_electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 400.0*Rydberg
)

left_electrode_iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

left_electrode_brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters(
    monkhorst_pack_parameters = (1, 1, 500)
)

left_electrode_iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

left_electrode_eigenstate_occupation_parameters = eigenstateOccupationParameters(
    temperature = 300.0*Kelvin
)

######################################################################
# Collect left electrode parameters
######################################################################
left_electrode_parameters = ElectrodeParameters(
    brillouin_zone_integration_parameters = left_electrode_brillouin_zone_integration_parameters,
    electron_density_parameters = left_electrode_electron_density_parameters,
    eigenstate_occupation_parameters = left_electrode_eigenstate_occupation_parameters,
    iteration_mixing_parameters = left_electrode_iteration_mixing_parameters,
    iteration_control_parameters = left_electrode_iteration_control_parameters
)

######################################################################
# Right electrode parameters
######################################################################
right_electrode_electron_density_parameters = electronDensityParameters(
    mesh_cutoff = 400.0*Rydberg
)

right_electrode_iteration_control_parameters = iterationControlParameters(
    tolerance = 1e-005,
    criterion = IterationControl.TotalEnergy,
    max_steps = 100
)

right_electrode_brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters(
    monkhorst_pack_parameters = (1, 1, 500)
)

right_electrode_iteration_mixing_parameters = iterationMixingParameters(
    algorithm = IterationMixing.Pulay,
    diagonal_mixing_parameter = 0.1,
    quantity = IterationMixing.Hamiltonian,
    history_steps = 6
)

right_electrode_eigenstate_occupation_parameters = eigenstateOccupationParameters(
    temperature = 300.0*Kelvin
)

######################################################################
# Collect right electrode parameters
######################################################################
right_electrode_parameters = ElectrodeParameters(
    brillouin_zone_integration_parameters = right_electrode_brillouin_zone_integration_parameters,
    electron_density_parameters = right_electrode_electron_density_parameters,
    eigenstate_occupation_parameters = right_electrode_eigenstate_occupation_parameters,
    iteration_mixing_parameters = right_electrode_iteration_mixing_parameters,
    iteration_control_parameters = right_electrode_iteration_control_parameters
)

######################################################################
# Initialize self-consistent field calculation
######################################################################
two_probe_method = TwoProbeMethod(
    electrode_parameters = (left_electrode_parameters,right_electrode_parameters),
    exchange_correlation_type = exchange_correlation_type,
    iteration_mixing_parameters = iteration_mixing_parameters,
    electron_density_parameters = electron_density_parameters,
    basis_set_parameters = basis_set_parameters,
    iteration_control_parameters = iteration_control_parameters,
    energy_contour_integral_parameters = energy_contour_integral_parameters,
    two_center_integral_parameters = two_center_integral_parameters,
    electrode_voltages = electrode_voltages,
    algorithm_parameters = two_probe_algorithm_parameters
)
if processIsMaster(): nlPrint(two_probe_method)

voltages=[0.0,0.5,1.0,1.5]*Volt

ivcurve.runIVcurve (
    twoprobe_configuration, 
    two_probe_method, 
    runtime_parameters,
    voltages, 
    vnl_filename='twoprobe_iv.vnl', sample_name='twoprobe', 
    current_k_point_sampling = (10,10),
    current_number_of_points = 100
  )

Offline hellboy

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: Trouble Restarting from a checkpoint file
« Reply #13 on: August 31, 2010, 16:22 »
Dear Sir,

the script ivcurve.py should generate separate checkpoint file for each bias voltage.

---I found it true in windows-XP, but even if i provide a path to the check point files, they are unfortunately stored in C:/documents and settings/user folder. I don not know why ?

---In Linux, only one check point file is created in the desired location, instead of one file for each bias. I do not know why?

Please explain....

best,

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5538
  • Country: dk
  • Reputation: 90
    • View Profile
    • QuantumATK at Synopsys
Re: Trouble Restarting from a checkpoint file
« Reply #14 on: August 31, 2010, 23:21 »
The question is probably quite easy to answer if one sees all the relevant scripts, but very difficult to answer without them...