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 179 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 182 of file heppy_batch.py.

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

183  def PrepareJobUser(self, jobDir, value ):
184  '''Prepare one job. This function is called by the base class.'''
185  print value
186  print components[value]
187 
188  #prepare the batch script
189  scriptFileName = jobDir+'/batchScript.sh'
190  scriptFile = open(scriptFileName,'w')
191  storeDir = self.remoteOutputDir_.replace('/castor/cern.ch/cms','')
192  mode = self.RunningMode(options.batch)
193  if mode == 'LXPLUS':
194  scriptFile.write( batchScriptCERN( storeDir, value) ) # watch out arguments are swapped (although not used)
195  elif mode == 'PSI':
196  scriptFile.write( batchScriptPSI ( value, jobDir, storeDir ) ) # storeDir not implemented at the moment
197  elif mode == 'LOCAL':
198  scriptFile.write( batchScriptLocal( storeDir, value) ) # watch out arguments are swapped (although not used)
199  elif mode == 'PISA' :
200  scriptFile.write( batchScriptPISA( storeDir, value) )
201  scriptFile.close()
202  os.system('chmod +x %s' % scriptFileName)
203 
204  shutil.copyfile(cfgFileName, jobDir+'/pycfg.py')
205 # jobConfig = copy.deepcopy(config)
206 # jobConfig.components = [ components[value] ]
207  cfgFile = open(jobDir+'/config.pck','w')
208  pickle.dump( components[value] , cfgFile )
209  # pickle.dump( cfo, cfgFile )
210  cfgFile.close()
211 
def batchScriptCERN
Definition: heppy_batch.py:48
def batchScriptPISA
Definition: heppy_batch.py:15
def batchScriptLocal
Definition: heppy_batch.py:166