test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
heppy_batch.MyBatchManager Class Reference
Inheritance diagram for heppy_batch.MyBatchManager:

Public Member Functions

def PrepareJobUser
 

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().

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()
def batchScriptCERN
Definition: heppy_batch.py:76
def batchScriptPISA
Definition: heppy_batch.py:44
def batchScriptLocal
Definition: heppy_batch.py:282
def batchScriptPADOVA
Definition: heppy_batch.py:15
def batchScriptIC
Definition: heppy_batch.py:262