CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 297 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 300 of file heppy_batch.py.

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

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