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 30 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 35 of file crabFunctions.py.
|
private |
Add crab_ to Foldername if needed.
getlog(self,name) |
Definition at line 254 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 188 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 140 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 80 of file crabFunctions.py.
References crabFunctions.CrabController.checkusername(), 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 271 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 246 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 200 of file crabFunctions.py.
References crabFunctions.CrabController._prepareFoldername(), and crabFunctions.CrabController.callCrabCommand().
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 227 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 214 of file crabFunctions.py.
References crabFunctions.CrabController._prepareFoldername(), and crabFunctions.CrabController.callCrabCommand().
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 121 of file crabFunctions.py.
References crabFunctions.CrabController._prepareFoldername(), crabFunctions.CrabController.callCrabCommand(), crabFunctions.CrabController.dry_run, 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 160 of file crabFunctions.py.
References crabFunctions.CrabController.callCrabCommand(), and crabFunctions.CrabController.dry_run.
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 103 of file crabFunctions.py.
References crabFunctions.CrabController.callCrabCommand(), ALIUtils.debug, crabFunctions.CrabController.debug, DTTTrigCorrectionFirst.debug, DTTPDeadWriter.debug, DTTTrigWriter.debug, DTT0CalibrationRMS.debug, DTT0Calibration.debug, DTNoiseComputation.debug, DTTTrigCalibration.debug, DTTMax.debug, DTVDriftCalibration.debug, crabFunctions.CrabController.dry_run, and harvestTrackValidationPlots.str.
crabFunctions.CrabController.crab_q |
Definition at line 70 of file crabFunctions.py.
Referenced by crabFunctions.CrabController.callCrabCommand().
crabFunctions.CrabController.debug |
Definition at line 38 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(), crabFunctions.CrabController.submit(), and pkg.AbstractPkg.write().
crabFunctions.CrabController.dry_run |
Definition at line 43 of file crabFunctions.py.
Referenced by crabFunctions.CrabController.resubmit(), crabFunctions.CrabController.status(), and crabFunctions.CrabController.submit().
crabFunctions.CrabController.logger |
Definition at line 54 of file crabFunctions.py.
Referenced by o2olib.O2OMgr.logger().
crabFunctions.CrabController.username |
Definition at line 49 of file crabFunctions.py.
Referenced by crabFunctions.CrabController.checkusername(), and crabFunctions.CrabController.checkwrite().
crabFunctions.CrabController.voGroup |
Definition at line 45 of file crabFunctions.py.
Referenced by crabFunctions.CrabController.checkwrite().
crabFunctions.CrabController.workingArea |
Definition at line 40 of file crabFunctions.py.
Referenced by crabFunctions.CrabController.crabFolders(), and crabFunctions.CrabController.resubmit().