The CrabController class. More...
Public Member Functions | |
def | __init__ (self, debug=0, logger=None, workingArea=None, voGroup=None, username=None) |
The constructor. More... | |
def | callCrabCommand (self, crabArgs) |
Call crab command in a new process and return result dict. More... | |
def | checkusername (self) |
Returns the hn name for a user with valid proxy. More... | |
def | checkwrite (self, site='T2_DE_RWTH', path='noPath') |
Check if crab can write to specified site. More... | |
def | commandlineOptions (self, parser=optparse.OptionParser( 'usage:%prog')) |
Populates an existing optparse parser or returns a new one with options for crab functions. More... | |
def | crabFolders (self) |
Return list of all crab folders in workin area (default cwd) More... | |
def | getlog (self, name) |
Call crab getlog. More... | |
def | readCrabConfig (self, name) |
Read a crab config and return python object. More... | |
def | report (self, name) |
Call crab report command and return path to lumiSummary. More... | |
def | resubmit (self, name, joblist=None) |
Resubmit all failed tasks in job or specified list of jobs in task. More... | |
def | status (self, name) |
Check crab status. More... | |
def | submit (self, name) |
Check if crab can write to specified site. More... | |
Public Attributes | |
crab_q | |
debug | |
dry_run | |
logger | |
username | |
voGroup | |
workingArea | |
Private Member Functions | |
def | _prepareFoldername (self, name) |
Add crab_ to Foldername if needed. More... | |
The CrabController class.
This class can be used to manage Analyses using crab3
Definition at line 31 of file crabFunctions.py.
def crabFunctions.CrabController.__init__ | ( | self, | |
debug = 0 , |
|||
logger = None , |
|||
workingArea = None , |
|||
voGroup = None , |
|||
username = None |
|||
) |
The constructor.
self | The object pointer. |
self | A previously defined logger. Crab log messages will use this logger as their parent logger. |
Definition at line 36 of file crabFunctions.py.
|
private |
Add crab_ to Foldername if needed.
getlog(self,name) |
Definition at line 255 of file crabFunctions.py.
Referenced by crabFunctions.CrabController.getlog(), crabFunctions.CrabController.report(), and crabFunctions.CrabController.resubmit().
def crabFunctions.CrabController.callCrabCommand | ( | self, | |
crabArgs | |||
) |
Call crab command in a new process and return result dict.
self | The object pointer |
crabArgs | A list of arguments for crab beginning with the command |
Definition at line 189 of file crabFunctions.py.
References crabFunctions.CrabController.crab_q.
Referenced by crabFunctions.CrabController.getlog(), crabFunctions.CrabController.report(), crabFunctions.CrabController.resubmit(), crabFunctions.CrabController.status(), and crabFunctions.CrabController.submit().
def crabFunctions.CrabController.checkusername | ( | self | ) |
Returns the hn name for a user with valid proxy.
self: CrabController
self | The object pointer. |
Definition at line 141 of file crabFunctions.py.
References crabFunctions.CrabController.username.
Referenced by crabFunctions.CrabController.checkwrite().
def crabFunctions.CrabController.checkwrite | ( | self, | |
site = 'T2_DE_RWTH' , |
|||
path = 'noPath' |
|||
) |
Check if crab can write to specified site.
self: CrabController
self | The object pointer. site string |
site | The Site symbol [default:T2_DE_RWTH] path string |
path | lfn path to check write permission in. see twiki WorkBookCRAB3Tutorial |
Definition at line 81 of file crabFunctions.py.
References crabFunctions.CrabController.checkusername(), relativeConstraints.error, info(), crabFunctions.CrabController.logger, crabFunctions.CrabController.username, and crabFunctions.CrabController.voGroup.
def crabFunctions.CrabController.commandlineOptions | ( | self, | |
parser = optparse.OptionParser( 'usage: %prog' ) |
|||
) |
Populates an existing optparse parser or returns a new one with options for crab functions.
This functions populates a previously created (or new) instance of a optparse parser object with options needed by crab functions. It is possible to add three kinds of options:
parser | A previously created parser oject which should be extenden [default: new instance] |
Definition at line 272 of file crabFunctions.py.
def crabFunctions.CrabController.crabFolders | ( | self | ) |
Return list of all crab folders in workin area (default cwd)
self | The object pointer |
Definition at line 247 of file crabFunctions.py.
References crabFunctions.CrabController.workingArea.
def crabFunctions.CrabController.getlog | ( | self, | |
name | |||
) |
Call crab getlog.
self | The object pointer. name string |
Definition at line 201 of file crabFunctions.py.
References crabFunctions.CrabController._prepareFoldername(), crabFunctions.CrabController.callCrabCommand(), relativeConstraints.error, and crabFunctions.CrabController.logger.
def crabFunctions.CrabController.readCrabConfig | ( | self, | |
name | |||
) |
Read a crab config and return python object.
self | The object pointer. |
name | The sample name (crab request name) |
Definition at line 228 of file crabFunctions.py.
def crabFunctions.CrabController.report | ( | self, | |
name | |||
) |
Call crab report command and return path to lumiSummary.
self | The object pointer |
name | The crab3 request name, a.k.a the sample name |
Definition at line 215 of file crabFunctions.py.
References crabFunctions.CrabController._prepareFoldername(), crabFunctions.CrabController.callCrabCommand(), relativeConstraints.error, and crabFunctions.CrabController.logger.
def crabFunctions.CrabController.resubmit | ( | self, | |
name, | |||
joblist = None |
|||
) |
Resubmit all failed tasks in job or specified list of jobs in task.
self: CrabController
self | The object pointer. name string |
name | The crab3 request name, a.k.a the sample name joblist list of strings |
joblist | The crab3 request name, a.k.a the sample name |
Definition at line 122 of file crabFunctions.py.
References crabFunctions.CrabController._prepareFoldername(), crabFunctions.CrabController.callCrabCommand(), crabFunctions.CrabController.dry_run, info(), crabFunctions.CrabController.logger, and crabFunctions.CrabController.workingArea.
def crabFunctions.CrabController.status | ( | self, | |
name | |||
) |
Check crab status.
self: CrabController
self | The object pointer. name string |
name | The crab3 request name, a.k.a the sample name |
Definition at line 161 of file crabFunctions.py.
References crabFunctions.CrabController.callCrabCommand(), crabFunctions.CrabController.dry_run, relativeConstraints.error, info(), crabFunctions.CrabController.logger, and print().
def crabFunctions.CrabController.submit | ( | self, | |
name | |||
) |
Check if crab can write to specified site.
self | The object pointer. name string |
name | The crab3 config file name |
Definition at line 104 of file crabFunctions.py.
References crabFunctions.CrabController.callCrabCommand(), ALIUtils.debug, crabFunctions.CrabController.debug, DTTTrigCorrectionFirst.debug, DTT0CalibrationRMS.debug, DTTTrigWriter.debug, DTTPDeadWriter.debug, DTNoiseComputation.debug, DTT0Calibration.debug, DTTTrigCalibration.debug, DTTMax.debug, DTVDriftCalibration.debug, crabFunctions.CrabController.dry_run, info(), crabFunctions.CrabController.logger, and str.
crabFunctions.CrabController.crab_q |
Definition at line 71 of file crabFunctions.py.
Referenced by crabFunctions.CrabController.callCrabCommand().
crabFunctions.CrabController.debug |
Definition at line 39 of file crabFunctions.py.
Referenced by util.rrapi.RRApi.dprint(), rrapi.RRApi.dprint(), pkg.AbstractPkg.generate(), rrapi.RRApi.get(), util.rrapi.RRApi.get(), pkg.AbstractPkg.get_kwds(), runTauIdMVA.TauIDEmbedder.loadMVA_WPs_run2_2017(), runTauIdMVA.TauIDEmbedder.runTauID(), crabFunctions.CrabController.submit(), and pkg.AbstractPkg.write().
crabFunctions.CrabController.dry_run |
Definition at line 44 of file crabFunctions.py.
Referenced by crabFunctions.CrabController.resubmit(), crabFunctions.CrabController.status(), and crabFunctions.CrabController.submit().
crabFunctions.CrabController.logger |
Definition at line 55 of file crabFunctions.py.
Referenced by o2olib.O2OJobMgr.add(), crabFunctions.CrabController.checkwrite(), o2olib.O2OJobMgr.dumpConfig(), o2olib.O2ORunMgr.endJob(), o2olib.O2ORunMgr.executeJob(), crabFunctions.CrabController.getlog(), o2olib.O2OJobMgr.getSession(), o2olib.O2OJobMgr.listConfig(), looper.Looper.loop(), cmsHarvester.CMSHarvester.option_handler_book_keeping_file(), cmsHarvester.CMSHarvester.option_handler_debug(), cmsHarvester.CMSHarvester.option_handler_force(), cmsHarvester.CMSHarvester.option_handler_frontier_connection(), cmsHarvester.CMSHarvester.option_handler_globaltag(), cmsHarvester.CMSHarvester.option_handler_harvesting_mode(), cmsHarvester.CMSHarvester.option_handler_harvesting_type(), cmsHarvester.CMSHarvester.option_handler_input_spec(), cmsHarvester.CMSHarvester.option_handler_no_ref_hists(), cmsHarvester.CMSHarvester.option_handler_ref_hist_mapping_file(), crabFunctions.CrabController.report(), crabFunctions.CrabController.resubmit(), o2olib.O2OJobMgr.runManager(), o2olib.O2OJobMgr.set(), o2olib.O2OJobMgr.setConfig(), o2olib.O2OJobMgr.setInterval(), o2olib.O2ORunMgr.startJob(), crabFunctions.CrabController.status(), and crabFunctions.CrabController.submit().
crabFunctions.CrabController.username |
Definition at line 50 of file crabFunctions.py.
Referenced by crabFunctions.CrabController.checkusername(), and crabFunctions.CrabController.checkwrite().
crabFunctions.CrabController.voGroup |
Definition at line 46 of file crabFunctions.py.
Referenced by crabFunctions.CrabController.checkwrite().
crabFunctions.CrabController.workingArea |
Definition at line 41 of file crabFunctions.py.
Referenced by crabFunctions.CrabController.crabFolders(), and crabFunctions.CrabController.resubmit().