Author Topic: When a job gets finish?  (Read 5184 times)

0 Members and 1 Guest are viewing this topic.

Offline Jahangiri

  • Regular QuantumATK user
  • **
  • Posts: 14
  • Reputation: 0
    • View Profile
When a job gets finish?
« on: July 1, 2010, 10:44 »
Dear users and developers

I don't know how can I can get information about the job which I ran before.
I would like to know when my job has been terminated!

to be more clear suppose I ran a job like :

>>>>/opt/mpich2/bin/mpiexec -n 4 /opt/vnl-2008.10.0/atk/bin/atk twoprobe_NANOJUCNTIOIN_GOLD.py > OUT3

I believe I should have all information like the starting Time and ending time in my "OUT3" file,
But what I get in the last line of this file is just

>>>>

# sc 47 : q =  648.83112 e  Etot = -12235.98635 Ry  dRho =  9.1524E-05  dEtot =  4.2094E-05 Ry
# sc 48 : q =  648.83122 e  Etot = -12235.98635 Ry  dRho =  1.0115E-04  dEtot =  2.5569E-06 Ry

>>>>>
(I should mention I have changed the "verbosity" to one"

But what I need is CPU time and in general at least I would like to know when my job got over.

Thank you very much in advance

Best regards
Akbar Jahangiri

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5435
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: When a job gets finish?
« Reply #1 on: July 1, 2010, 11:10 »
Try adding
Code: python
import time
if processIsMaster():
    print "Job finished at", time.asctime()
at the end of your script. If not already included, you also need from ATK.MPI import processIsMaster Starting time is printed provided you have made the script in VNL, otherwise add a similar statement in the beginning too. You can also just look at the timestamp of the NC file to see when the job finished :)

Offline Jahangiri

  • Regular QuantumATK user
  • **
  • Posts: 14
  • Reputation: 0
    • View Profile
Re: When a job gets finish?
« Reply #2 on: July 1, 2010, 11:26 »
Dear Anders Blom

Thank you very much fro your prompt answer.

by the way can you let me know how can I see the steps in "nc" file, since i think (if I am right ) it is not a file like text or in a format readable by human?

Best regards
Akbar Jahangiri

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5435
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: When a job gets finish?
« Reply #3 on: July 1, 2010, 11:37 »
The NC file is binary, yes, but there are generic tools like "ncdump" that can open it. The "steps", as in each step in the SCF loop, are not saved in the NC file, only the final result.

Offline Jahangiri

  • Regular QuantumATK user
  • **
  • Posts: 14
  • Reputation: 0
    • View Profile
Re: When a job gets finish?
« Reply #4 on: July 1, 2010, 12:57 »
 Dear Anders Blom

unfortunately I could not find the time which job was finish at in the "nc" file, since it is very huge file full of numbers.
the only line which had some information regarding time is the following....

+++++++++++++++++++++++++++++++++++++++++++++++++++
// global attributes:
                :Generator = "2008.10.0" ;
                :ReleaseVersionString = "ATK 2008.10.0 Linux-x86_64 build 14677 2008-11-27" ;
                :TimeStamp = "Sat Jun 19 15:15:43 2010" ;
++++++++++++++++++++++++++++++++++++++++++++++++++++

and I think that is the starting time (which is even written at the beginning of OUT3 file).

Am I right?

I should mention right now I am doing the tutorial which is placed in the QuantumWise site (Gold Nano Junction) and I can compare the result with what is given in the Tutorial itself. But if I want to run any job other than Tutorials how to know the job is over?  that is one of the reasons that i would like to have a line at the end of file that Atk tells me the job is over.

Thank you very much.

Best regards
Akbar jahangiri


Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5435
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: When a job gets finish?
« Reply #5 on: July 1, 2010, 13:01 »
Not IN the nc file, just the time of the file itself, when it was created :)

ls -l *.nc

Offline Jahangiri

  • Regular QuantumATK user
  • **
  • Posts: 14
  • Reputation: 0
    • View Profile
Re: When a job gets finish?
« Reply #6 on: July 1, 2010, 13:46 »

:)Thank you ver much

Offline Jahangiri

  • Regular QuantumATK user
  • **
  • Posts: 14
  • Reputation: 0
    • View Profile
Re: When a job gets finish?
« Reply #7 on: July 6, 2010, 08:25 »
Dear Anders Blom

Regarding our previous discussion. I have added the line which you suggest to my script, but what I get is :

The same time is written for starting and ending job.
To be more clear I have these lines in my script :

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

but waht I get is >>>

++++++++++++++++++++++++++++++++++++++

# Thu Jul  1 14:49:27 2010
# Linux-2.6.31.5-127.fc12.x86_64-x86_64-with-redhat-12-Constantine

Job finished at Thu Jul  1 14:49:27 2010
_______________________________________________________________________
_______________________________________________________________________

this means the starting time and ending are the same !!

How can I write it in a way to have right answer?

Thank you very much
Best regards
Akbar



Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5435
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: When a job gets finish?
« Reply #8 on: July 6, 2010, 08:31 »
Yes... because you placed the "finished" statement in the beginning of the script. So it's printed immediately after the start time. You need to place the "finished" code in the END of the script. Remember the Python script is a program, it is executed in sequence. You should have
Code: python
# Top of script
import time
if processIsMaster():
    print "Job started at", time.asctime()

# The rest of the script, which calculates things...

# End of script
if processIsMaster():
    print "Job finished at", time.asctime()

Offline Jahangiri

  • Regular QuantumATK user
  • **
  • Posts: 14
  • Reputation: 0
    • View Profile
Re: When a job gets finish?
« Reply #9 on: July 6, 2010, 11:01 »
Dear Anders Blom

Yes ... that is right, I sometimes forget that is a program.
I have a question. I felt that I should learn Python to be able and really understand working working with VNL. Is that right ?

Thank you very much

Best regards
Akbar  :)

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5435
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: When a job gets finish?
« Reply #10 on: July 6, 2010, 11:09 »
Yes and no :)

It helps to know a bit of Python, but the more we improve the basic functionality (based on experiences from users), the less it should be necessary. For instance, in ATK 10.8, the start and finish times are automatically written to the log file ;)

But yes, some basic things like understanding that the script is executed as a program is vital, and being able to modify simple things yourself is very convenient and makes the use of ATK more efficient.

There are many basic Python tutorials on the internet, googling "python basic tutorial" gives a lot of suitable ones. Spending a few hours on that is time well invested, in my honest opinion; I promise that you will earn that time back many times when your use of ATK becomes more efficient, and you are able to solve simple problems or use more advanced functionality in the software.

Offline Jahangiri

  • Regular QuantumATK user
  • **
  • Posts: 14
  • Reputation: 0
    • View Profile
Re: When a job gets finish?
« Reply #11 on: July 6, 2010, 11:12 »
Dear Anders Blom

Thank you very much. That is of course really good suggestion.

Best regards
Akbar