CMS 3D CMS Logo

List of all members | Public Member Functions
heppy_batch.MyBatchManager Class Reference
Inheritance diagram for heppy_batch.MyBatchManager:

Public Member Functions

def PrepareJobUser (self, jobDir, value)
 

Detailed Description

Batch manager specific to cmsRun processes.

Definition at line 296 of file heppy_batch.py.

Member Function Documentation

def heppy_batch.MyBatchManager.PrepareJobUser (   self,
  jobDir,
  value 
)
Prepare one job. This function is called by the base class.

Definition at line 299 of file heppy_batch.py.

References heppy_batch.batchScriptCERN(), heppy_batch.batchScriptIC(), heppy_batch.batchScriptLocal(), heppy_batch.batchScriptPADOVA(), heppy_batch.batchScriptPISA(), edm.print(), and batchmanager.BatchManager.RunningMode().

299  def PrepareJobUser(self, jobDir, value ):
300  '''Prepare one job. This function is called by the base class.'''
301  print(value)
302  print(components[value])
303 
304  #prepare the batch script
305  scriptFileName = jobDir+'/batchScript.sh'
306  scriptFile = open(scriptFileName,'w')
307  storeDir = self.remoteOutputDir_.replace('/castor/cern.ch/cms','')
308  mode = self.RunningMode(options.batch)
309  if mode == 'LXPLUS':
310  scriptFile.write( batchScriptCERN( jobDir, storeDir ) )
311  elif mode == 'PSI':
312  scriptFile.write( batchScriptPSI ( value, jobDir, storeDir ) ) # storeDir not implemented at the moment
313  elif mode == 'LOCAL':
314  scriptFile.write( batchScriptLocal( storeDir, value) ) # watch out arguments are swapped (although not used)
315  elif mode == 'PISA' :
316  scriptFile.write( batchScriptPISA( storeDir, value) )
317  elif mode == 'PADOVA' :
318  scriptFile.write( batchScriptPADOVA( value, jobDir) )
319  elif mode == 'IC':
320  scriptFile.write( batchScriptIC(jobDir) )
321  scriptFile.close()
322  os.system('chmod +x %s' % scriptFileName)
323 
324  shutil.copyfile(cfgFileName, jobDir+'/pycfg.py')
325 # jobConfig = copy.deepcopy(config)
326 # jobConfig.components = [ components[value] ]
327  cfgFile = open(jobDir+'/config.pck','w')
328  pickle.dump( components[value] , cfgFile )
329  # pickle.dump( cfo, cfgFile )
330  cfgFile.close()
331  if hasattr(self,"heppyOptions_"):
332  optjsonfile = open(jobDir+'/options.json','w')
333  optjsonfile.write(json.dumps(self.heppyOptions_))
334  optjsonfile.close()
335 
def batchScriptPADOVA(index, jobDir='./')
Definition: heppy_batch.py:16
def batchScriptIC(jobDir)
Definition: heppy_batch.py:263
def batchScriptPISA(index, remoteDir='')
Definition: heppy_batch.py:45
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def PrepareJobUser(self, jobDir, value)
Definition: heppy_batch.py:299
def batchScriptLocal(remoteDir, index)
Definition: heppy_batch.py:283
def batchScriptCERN(jobDir, remoteDir='')
Definition: heppy_batch.py:77