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 197 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 200 of file heppy_batch.py.

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

201  def PrepareJobUser(self, jobDir, value ):
202  '''Prepare one job. This function is called by the base class.'''
203  print value
204  print components[value]
205 
206  #prepare the batch script
207  scriptFileName = jobDir+'/batchScript.sh'
208  scriptFile = open(scriptFileName,'w')
209  storeDir = self.remoteOutputDir_.replace('/castor/cern.ch/cms','')
210  mode = self.RunningMode(options.batch)
211  if mode == 'LXPLUS':
212  scriptFile.write( batchScriptCERN( storeDir, value) ) # watch out arguments are swapped (although not used)
213  elif mode == 'PSI':
214  scriptFile.write( batchScriptPSI ( value, jobDir, storeDir ) ) # storeDir not implemented at the moment
215  elif mode == 'LOCAL':
216  scriptFile.write( batchScriptLocal( storeDir, value) ) # watch out arguments are swapped (although not used)
217  elif mode == 'PISA' :
218  scriptFile.write( batchScriptPISA( storeDir, value) )
219  elif mode == 'IC':
220  scriptFile.write( batchScriptIC(jobDir) )
221  scriptFile.close()
222  os.system('chmod +x %s' % scriptFileName)
223 
224  shutil.copyfile(cfgFileName, jobDir+'/pycfg.py')
225 # jobConfig = copy.deepcopy(config)
226 # jobConfig.components = [ components[value] ]
227  cfgFile = open(jobDir+'/config.pck','w')
228  pickle.dump( components[value] , cfgFile )
229  # pickle.dump( cfo, cfgFile )
230  cfgFile.close()
231 
def batchScriptCERN
Definition: heppy_batch.py:48
def batchScriptPISA
Definition: heppy_batch.py:15
def batchScriptLocal
Definition: heppy_batch.py:185
def batchScriptIC
Definition: heppy_batch.py:165