Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-13 03:15:35

0001 #!/usr/bin/env python3
0002 #
0003 #
0004 #  Fetch jobs that have DONE status
0005 #  This step is mainly foreseen in case job result files need
0006 #  to be copied from a spool area.
0007 #  On LSF batch, the job output is already in our directories,
0008 #  hence this function does hardly anything except for calling
0009 #  mps_check.py.
0010 
0011 from builtins import range
0012 import Alignment.MillePedeAlignmentAlgorithm.mpslib.Mpslibclass as mpslib
0013 import os
0014 
0015 # update database
0016 os.system("mps_update.py > /dev/null")
0017 
0018 lib = mpslib.jobdatabase()
0019 lib.read_db()
0020 
0021 # loop over DONE jobs
0022 for i in range(len(lib.JOBID)):
0023     # check also "FETCH" to recover from possibly failed runs of 'mps_fetch.py'
0024     if lib.JOBSTATUS[i] in ("DONE", "EXIT", "FETCH", "DISABLEDFETCH"):
0025         # move the LSF output to /jobData/
0026         theJobDir = 'jobData/'+lib.JOBDIR[i]
0027         theBatchDirectory = r"LSFJOB_"+ lib.JOBID[i]
0028 
0029         command = 'mv  %s/* %s/ > /dev/null 2>&1' % (theBatchDirectory, theJobDir)
0030         os.system(command)
0031         command = 'rm -rf '+theBatchDirectory
0032         os.system(command)
0033 
0034         # update the status
0035         if 'DISABLED' in lib.JOBSTATUS[i]:
0036             lib.JOBSTATUS[i] = 'DISABLEDFETCH'
0037         else:
0038             lib.JOBSTATUS[i] = 'FETCH'
0039 
0040 lib.write_db()
0041 
0042 # call mps_check
0043 os.system('mps_check.py')
0044