Author Topic: How can I rerun the job?  (Read 6582 times)

0 Members and 1 Guest are viewing this topic.

Offline artingchen

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
How can I rerun the job?
« on: May 9, 2009, 06:52 »
hello, verybody.
I want to ask that when the running job is broken, I want to continue this job after its break. How can I retart the job?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: How can I rerun the job?
« Reply #1 on: May 9, 2009, 15:47 »
Provided you specified a checkpoint file for the calculation, follow the steps below. If you didn't, well, then there is no option but to rerun, of course. If the checkpoint file is called "mycalculation.nc", then make a new script
Code
from ATK.TwoProbe import *

oldscf = restoreSelfConsistentCalculation("mycalculation.nc")

scf = executeSelfConsistentCalculation(self_consistent_calculation=oldscf)
Any analysis (like, evaluation of transmission spectrum, etc) you had in the original script can be copied from the old script and added after these lines.

Offline artingchen

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: How can I rerun the job?
« Reply #2 on: May 10, 2009, 03:52 »
thank you, doctor blom!

Offline artingchen

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: How can I rerun the job?
« Reply #3 on: May 10, 2009, 06:33 »
doctor blom, I have edited the script following what you told me. the code
 
# Restore self consistent calculation from check point file
oldscf = restoreSelfConsistentCalculation(
    filename = '/home/ms/bpcur1-0.5.nc'
)
scf = executeSelfConsistentCalculation(self_consistent_calculation=oldscf)

runtime_parameters = runtimeParameters(
    verbosity_level = 1,
    checkpoint_filename = '/home/ms/xv/bpcur1.nc'
)

voltages = numpy.arange(0.,5.01,0.5)*Volt



ivcurve.runIVcurve (

    twoprobe_configuration,

    two_probe_method,

    runtime_parameters,

    voltages,

    vnl_filename='/home/ms/xv/bp_iv.vnl', sample_name='bp_iv',

    current_k_point_sampling = (10,10),

    current_number_of_points = 100

  )

when the job run, the electrode is calculted. the content of the calculted result is as follows:

# ----------------------------------------------------------------
# Electrodes Calculation
# ----------------------------------------------------------------
# sc  0 : Fermi Energy =    0.00000 Ry
# sc  1 : Fermi Energy =   -0.37496 Ry  dRho =  1.8700E+00
# sc  2 : Fermi Energy =   -0.35694 Ry  dRho =  1.2413E-02
# sc  3 : Fermi Energy =   -0.27741 Ry  dRho =  6.2172E-02
# sc  4 : Fermi Energy =   -0.27699 Ry  dRho =  1.2709E-02
# sc  5 : Fermi Energy =   -0.25859 Ry  dRho =  1.4290E-02
# sc  6 : Fermi Energy =   -0.27538 Ry  dRho =  9.5796E-03
# sc  7 : Fermi Energy =   -0.27439 Ry  Etot = -416.24910 Ry  dRho =  6.9657E-04
# sc  8 : Fermi Energy =   -0.27486 Ry  Etot = -416.24909 Ry  dRho =  3.6515E-04  dEtot =  9.7646E-07 Ry
# sc  0 : Fermi Energy =    0.00000 Ry
# sc  1 : Fermi Energy =   -0.37496 Ry  dRho =  1.8700E+00
# sc  2 : Fermi Energy =   -0.35694 Ry  dRho =  1.2413E-02


dose the job run rightly? does the former bpcur1-0.5.nc file be used as the initial datas for calculation?
« Last Edit: May 10, 2009, 09:37 by artingchen »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: How can I rerun the job?
« Reply #4 on: May 10, 2009, 06:50 »
Yes, the checkpoint file does not contain all electrode data, so this needs to be recalculated. It's typically a very small portion of the total calculation time anyway.

Offline artingchen

  • Heavy QuantumATK user
  • ***
  • Posts: 47
  • Reputation: 0
    • View Profile
Re: How can I rerun the job?
« Reply #5 on: May 10, 2009, 09:35 »
doctor blom,
does the former bpcur1-0.5.nc file be used as the initial datas for  Equivalent Bulk Calculationcalculation?
Equivalent Bulk Calculationcalculation seem be restart without using the  former bpcur1-0.5.nc file. the content of the results is as follows:
# ----------------------------------------------------------------
# Electrodes Calculation
# ----------------------------------------------------------------
# sc  0 : Fermi Energy =    0.00000 Ry
# sc  1 : Fermi Energy =   -0.37496 Ry  dRho =  1.8700E+00
# sc  2 : Fermi Energy =   -0.35694 Ry  dRho =  1.2413E-02
# sc  3 : Fermi Energy =   -0.27741 Ry  dRho =  6.2172E-02
# sc  4 : Fermi Energy =   -0.27699 Ry  dRho =  1.2709E-02
# sc  5 : Fermi Energy =   -0.25859 Ry  dRho =  1.4290E-02
# sc  6 : Fermi Energy =   -0.27538 Ry  dRho =  9.5796E-03
# sc  7 : Fermi Energy =   -0.27439 Ry  Etot = -416.24910 Ry  dRho =  6.9657E-04
# sc  8 : Fermi Energy =   -0.27486 Ry  Etot = -416.24909 Ry  dRho =  3.6515E-04  dEtot =  9.7646E-07 Ry
# sc  0 : Fermi Energy =    0.00000 Ry
# sc  1 : Fermi Energy =   -0.37496 Ry  dRho =  1.8700E+00
# sc  2 : Fermi Energy =   -0.35694 Ry  dRho =  1.2413E-02
# sc  3 : Fermi Energy =   -0.27741 Ry  dRho =  6.2172E-02
# sc  4 : Fermi Energy =   -0.27699 Ry  dRho =  1.2709E-02
# sc  5 : Fermi Energy =   -0.25859 Ry  dRho =  1.4290E-02
# sc  6 : Fermi Energy =   -0.27538 Ry  dRho =  9.5796E-03
# sc  7 : Fermi Energy =   -0.27439 Ry  Etot = -416.24910 Ry  dRho =  6.9657E-04
# sc  8 : Fermi Energy =   -0.27486 Ry  Etot = -416.24909 Ry  dRho =  3.6515E-04  dEtot =  9.7646E-07 Ry
# ----------------------------------------------------------------
# Equivalent Bulk Calculation (Initial Density for TwoProbe)
# ----------------------------------------------------------------
# sc  0 : Fermi Energy =    0.00000 Ry
# sc  1 : Fermi Energy =   -0.44262 Ry  dRho =  3.6372E+02
# sc  2 : Fermi Energy =   -0.37231 Ry  dRho =  1.6327E+01
# sc  3 : Fermi Energy =   -0.33476 Ry  dRho =  1.7550E+01


dose the job run correctly? if it does, what is  the main difference between the original calculation and the later calculation.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: How can I rerun the job?
« Reply #6 on: May 10, 2009, 15:54 »
This case is a bit complex, since you are running an I-V curve calculation, using the external module "ivcurve". In this case, restarting doesn't work the way you may expect, perhaps. Restarting applies to a single calculation, while the I-V curve routine runs several calculations in sequence. If it already completed the evaluation of the current for, say, the first 2-3 points on the I-V curve, you can just leave out those values from the range of voltages, and start from another point. You may however want to recalculation the zero bias, as this can then be used as a starting point for higher voltages, which usually helps convergence. At the end of the day, the I-V curve module is really just a helper routine, it doesn't do anything you couldn't do by hand, that is, to run each voltage separately, and collect the current values for plotting. Plus, of course, reusing the converged density from the previous calculation to run the next higher bias. That's also why you always should start from zero bias, in this case, and in general. So, if you want biases from -1 to 1 V, in steps of 0.1, say, run 0. V first, then do -0.1 and +0.1, and so on. To reuse a previous calculation as initial guess for a new calculation, use the keyword initial_calculation to executeSelfConsistentCalculation():
Code
oldscf = restoreSelfConsistentCalculation('zerobias.nc')
scf = executeSelfConsistentCalculation(
    twoprobe_configuration,
    method,
    runtime_parameters,
    initial_calculation = oldscf
    )
(This code snippet is just to give an idea; needs to be polished to match your particular case.)