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 295 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 298 of file heppy_batch.py.

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

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