/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Mdc/DedxCalibAlg/DedxCalibAlg-00-01-15/share/sub/checking_jobs.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 import os
00004 import sys
00005 import time
00006 
00007 if(len(sys.argv)<2):
00008     print("example: checking_jobs.py tag [seconds]")
00009     sys.exit()
00010 else:
00011     tag = str(sys.argv[1])
00012 
00013 if(len(sys.argv)==3):
00014     seconds = int(sys.argv[2])
00015 else:
00016     seconds = 60
00017 
00018 os.system("qstat | grep " + tag + " > checking_jobs_" + tag + ".txt")
00019 while(os.path.getsize("checking_jobs_" + tag + ".txt") > 1):
00020     time.sleep(seconds)
00021     os.system("qstat | grep " + tag + " > checking_jobs_" + tag + ".txt")
00022     time.sleep(seconds)
00023     os.system("qstat | grep " + tag + " >> checking_jobs_" + tag + ".txt")
00024     
00025 os.system("rm checking_jobs_" + tag + ".txt")
00026 print("Jobs tagged with \"" + tag + "\" are finished.")
00027 os.system("display ~/home/shell/sub/z.gif &")

Generated on Tue Nov 29 23:12:45 2016 for BOSS_7.0.2 by  doxygen 1.4.7