CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
batchHippy.MyBatchManager Class Reference

Public Member Functions

def __init__ (self)
 
def mkdir (self, dirname)
 
def submitJobs (self)
 

Public Attributes

 parser
 

Detailed Description

Batch manager specific to cmsRun processes.

Definition at line 17 of file batchHippy.py.

Constructor & Destructor Documentation

def batchHippy.MyBatchManager.__init__ (   self)

Definition at line 20 of file batchHippy.py.

20  def __init__(self):
21  # define options and arguments ====================================
22  self.parser = OptionParser()
23  self.parser.add_option("-o", "--outdir", dest="outputdir", type="string",
24  help="Name of the local output directory for your jobs. This directory will be created automatically.",
25  default="./")
26  self.parser.add_option("--commoncfg", dest="commoncfg", type="string",
27  help="Name of the common config file.",
28  default="python/common_cff_py.txt")
29  self.parser.add_option("--aligncfg", dest="aligncfg", type="string",
30  help="Name of the align. config file.",
31  default="python/align_tpl_py.txt")
32  self.parser.add_option("--niter", dest="niter", type="int",
33  help="Number of iterations",
34  default="15")
35  self.parser.add_option("--lst", "--listfile", "--lstfile", dest="lstfile", type="string",
36  help="lst file to read",
37  default=None)
38  self.parser.add_option("--iovs", "--iovfile", dest="iovfile", type="string",
39  help="IOV list to read",
40  default=None)
41  self.parser.add_option("-f", "--force", action="store_true",
42  dest="force", default=False,
43  help="Don't ask any questions, just over-write")
44  self.parser.add_option("--resubmit", action="store_true",
45  dest="resubmit", default=False,
46  help="Resubmit a job from the last iteration")
47  (self.opt,self.args) = self.parser.parse_args()
48 
49  self.mkdir(self.opt.outputdir)
50 
51  if(self.opt.lstfile is None):
52  print "Unspecified lst file."
53  sys.exit(1)
54  if(self.opt.iovfile is None):
55  print "Unspecified IOV list."
56  sys.exit(1)
57 
if(dp >Float(M_PI)) dp-
def mkdir(self, dirname)
Definition: batchHippy.py:58

Member Function Documentation

def batchHippy.MyBatchManager.mkdir (   self,
  dirname 
)

Definition at line 58 of file batchHippy.py.

References reco.if().

Referenced by batchmanager.BatchManager.PrepareJob().

58  def mkdir( self, dirname ):
59  mkdir = 'mkdir -p %s' % dirname
60  ret = os.system( mkdir )
61  if( ret != 0 ):
62  print 'Please remove or rename directory: ', dirname
63  sys.exit(4)
64 
if(dp >Float(M_PI)) dp-
def mkdir(self, dirname)
Definition: batchHippy.py:58
def batchHippy.MyBatchManager.submitJobs (   self)

Definition at line 65 of file batchHippy.py.

References reco.if().

65  def submitJobs(self):
66  jobcmd=""
67  if self.opt.resubmit:
68  jobcmd = 'scripts/reiterator_py {} {} {} {} {} {}'.format(
69  self.opt.niter,
70  self.opt.outputdir,
71  self.opt.iovfile
72  )
73  else:
74  jobcmd = 'scripts/iterator_py {} {} {} {} {} {}'.format(
75  self.opt.niter,
76  self.opt.outputdir,
77  self.opt.lstfile,
78  self.opt.iovfile,
79  self.opt.commoncfg,
80  self.opt.aligncfg
81  )
82  ret = os.system( jobcmd )
83  if( ret != 0 ):
84  sys.exit('Jobs cannot be submitted')
85 
86 
87 
88 
if(dp >Float(M_PI)) dp-

Member Data Documentation

batchHippy.MyBatchManager.parser

Definition at line 22 of file batchHippy.py.