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

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