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

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