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

263  def PrepareJobUser(self, jobDir, value ):
264  '''Prepare one job. This function is called by the base class.'''
265  print value
266  print components[value]
267 
268  #prepare the batch script
269  scriptFileName = jobDir+'/batchScript.sh'
270  scriptFile = open(scriptFileName,'w')
271  storeDir = self.remoteOutputDir_.replace('/castor/cern.ch/cms','')
272  mode = self.RunningMode(options.batch)
273  if mode == 'LXPLUS':
274  scriptFile.write( batchScriptCERN( jobDir, storeDir) )
275  elif mode == 'PSI':
276  scriptFile.write( batchScriptPSI ( value, jobDir, storeDir ) ) # storeDir not implemented at the moment
277  elif mode == 'LOCAL':
278  scriptFile.write( batchScriptLocal( storeDir, value) ) # watch out arguments are swapped (although not used)
279  elif mode == 'PISA' :
280  scriptFile.write( batchScriptPISA( storeDir, value) )
281  elif mode == 'PADOVA' :
282  scriptFile.write( batchScriptPADOVA( value, jobDir) )
283  elif mode == 'IC':
284  scriptFile.write( batchScriptIC(jobDir) )
285  scriptFile.close()
286  os.system('chmod +x %s' % scriptFileName)
287 
288  shutil.copyfile(cfgFileName, jobDir+'/pycfg.py')
289 # jobConfig = copy.deepcopy(config)
290 # jobConfig.components = [ components[value] ]
291  cfgFile = open(jobDir+'/config.pck','w')
292  pickle.dump( components[value] , cfgFile )
293  # pickle.dump( cfo, cfgFile )
294  cfgFile.close()
295 
def batchScriptCERN
Definition: heppy_batch.py:75
def batchScriptPISA
Definition: heppy_batch.py:43
def batchScriptLocal
Definition: heppy_batch.py:246
def batchScriptPADOVA
Definition: heppy_batch.py:14
def batchScriptIC
Definition: heppy_batch.py:226