parameters: (self)
docstring: Create the mille jobs based on the [dataset:<name>] sections.
docstring_summary: Create the mille jobs based on the [dataset:<name>] sections.
docstring_tokens: Create the mille jobs based on the [ dataset : <name > ] sections .
function: def _create_mille_jobs(self):
          """Create the mille jobs based on the [dataset:<name>] sections."""
  
          gt_regex = re.compile('setupGlobaltag\s*\=\s*[\"\'](.*?)[\"\']')
          sg_regex = re.compile("setupRunStartGeometry\s*\=\s*.*$", re.M)
          collection_regex = re.compile('setupCollection\s*\=\s*[\"\'](.*?)[\"\']')
          czt_regex = re.compile('setupCosmicsZeroTesla\s*\=\s*.*$', re.M)
          cdm_regex = re.compile('setupCosmicsDecoMode\s*\=\s*.*$', re.M)
          pw_regex = re.compile('setupPrimaryWidth\s*\=\s*.*$', re.M)
          json_regex = re.compile('setupJson\s*\=\s*.*$', re.M)
  
          first_dataset = True
          for name, dataset in self._datasets.items():
              print("="*75)
              # Build config from template/Fill in variables
              try:
                  with open(dataset["configTemplate"],"r") as f:
                      tmpFile = f.read()
              except IOError:
                  print("The config-template called", end=' ')
                  print(dataset["configTemplate"], "cannot be found.")
                  sys.exit(1)
  
              tmpFile = re.sub(gt_regex,
                               'setupGlobaltag = \"'+dataset["globaltag"]+'\"',
                               tmpFile)
              tmpFile = re.sub(sg_regex,
                               "setupRunStartGeometry = "+
                               self._general_options["FirstRunForStartGeometry"], tmpFile)
              tmpFile = re.sub(collection_regex,
                               'setupCollection = \"'+dataset["collection"]+'\"',
                               tmpFile)
              if "ALCARECOTkAlCosmics" in dataset["collection"]:
                  if dataset['cosmicsZeroTesla']:
                      tmpFile = re.sub(czt_regex,
                                       'setupCosmicsZeroTesla = True',
                                       tmpFile)
                  else :
                      tmpFile = re.sub(czt_regex,
                                      'setupCosmicsZeroTesla = False',
                                       tmpFile)
  
                  if dataset['cosmicsDecoMode']:
                       tmpFile = re.sub(cdm_regex,
                                       'setupCosmicsDecoMode = True',
                                       tmpFile)
                  else:
                      tmpFile = re.sub(cdm_regex,
                                       'setupCosmicsDecoMode = False',
                                       tmpFile)
  
              if dataset['primaryWidth'] > 0.0:
                  tmpFile = re.sub(pw_regex,
                                   'setupPrimaryWidth = '+str(dataset["primaryWidth"]),
                                   tmpFile)
              if dataset['json'] != '':
                  tmpFile = re.sub(json_regex,
                                   'setupJson = \"'+dataset["json"]+'\"',
                                   tmpFile)
  
              thisCfgTemplate = "tmp.py"
              with open(thisCfgTemplate, "w") as f:
                  f.write(tmpFile)
  
  
              # Set mps_setup append option for datasets following the first one
              append = "-a"
              if first_dataset:
                  append = ""
                  first_dataset = False
                  self._config_template = tmpFile
                  self._cms_process = mps_tools.get_process_object(thisCfgTemplate)
                  self._create_input_db()
  
              with open(thisCfgTemplate, "a") as f: f.write(self._override_gt)
  
  
              # create mps_setup command
              command = ["mps_setup.py",
                         "-m",
                         append,
                         "-M", self._general_options["pedeMem"],
                         "-N", name,
                         self._mille_script,
                         thisCfgTemplate,
                         dataset["inputFileList"],
                         str(dataset["njobs"]),
                         self._general_options["classInf"],
                         self._general_options["jobname"],
                         self._pede_script,
                         "cmscafuser:"+self._mss_dir]
              if dataset["numberOfEvents"] > 0:
                  command.extend(["--max-events", str(dataset["numberOfEvents"])])
              command = [x for x in command if len(x.strip()) > 0]
  
              # Some output:
              print("Creating jobs for dataset:", name)
              print("-"*75)
              print("Baseconfig:        ", dataset["configTemplate"])
              print("Collection:        ", dataset["collection"])
              if "ALCARECOTkAlCosmics" in dataset["collection"]:
                  print("cosmicsDecoMode:   ", dataset["cosmicsDecoMode"])
                  print("cosmicsZeroTesla:  ", dataset["cosmicsZeroTesla"])
              print("Globaltag:         ", dataset["globaltag"])
              print("Number of jobs:    ", dataset["njobs"])
              print("Inputfilelist:     ", dataset["inputFileList"])
              if dataset["json"] != "":
                  print("Jsonfile:          ", dataset["json"])
              if self._args.verbose:
                  print("Pass to mps_setup: ", " ".join(command))
  
              # call the command and toggle verbose output
              self._handle_process_call(command, self._args.verbose)
  
              # remove temporary file
              self._handle_process_call(["rm", thisCfgTemplate])
function_tokens: def _create_mille_jobs ( self ) : gt_regex = re . compile ( 'setupGlobaltag\s*\=\s*[\"\'](.*?)[\"\']' ) sg_regex = re . compile ( "setupRunStartGeometry\s*\=\s*.*$" , re . M ) collection_regex = re . compile ( 'setupCollection\s*\=\s*[\"\'](.*?)[\"\']' ) czt_regex = re . compile ( 'setupCosmicsZeroTesla\s*\=\s*.*$' , re . M ) cdm_regex = re . compile ( 'setupCosmicsDecoMode\s*\=\s*.*$' , re . M ) pw_regex = re . compile ( 'setupPrimaryWidth\s*\=\s*.*$' , re . M ) json_regex = re . compile ( 'setupJson\s*\=\s*.*$' , re . M ) first_dataset = True for name , dataset in self . _datasets . items ( ) : print ( "=" * 75 ) # Build config from template/Fill in variables try : with open ( dataset [ "configTemplate" ] , "r" ) as f : tmpFile = f . read ( ) except IOError : print ( "The config-template called" , end = ' ' ) print ( dataset [ "configTemplate" ] , "cannot be found." ) sys . exit ( 1 ) tmpFile = re . sub ( gt_regex , 'setupGlobaltag = \"' + dataset [ "globaltag" ] + '\"' , tmpFile ) tmpFile = re . sub ( sg_regex , "setupRunStartGeometry = " + self . _general_options [ "FirstRunForStartGeometry" ] , tmpFile ) tmpFile = re . sub ( collection_regex , 'setupCollection = \"' + dataset [ "collection" ] + '\"' , tmpFile ) if "ALCARECOTkAlCosmics" in dataset [ "collection" ] : if dataset [ 'cosmicsZeroTesla' ] : tmpFile = re . sub ( czt_regex , 'setupCosmicsZeroTesla = True' , tmpFile ) else : tmpFile = re . sub ( czt_regex , 'setupCosmicsZeroTesla = False' , tmpFile ) if dataset [ 'cosmicsDecoMode' ] : tmpFile = re . sub ( cdm_regex , 'setupCosmicsDecoMode = True' , tmpFile ) else : tmpFile = re . sub ( cdm_regex , 'setupCosmicsDecoMode = False' , tmpFile ) if dataset [ 'primaryWidth' ] > 0.0 : tmpFile = re . sub ( pw_regex , 'setupPrimaryWidth = ' + str ( dataset [ "primaryWidth" ] ) , tmpFile ) if dataset [ 'json' ] != '' : tmpFile = re . sub ( json_regex , 'setupJson = \"' + dataset [ "json" ] + '\"' , tmpFile ) thisCfgTemplate = "tmp.py" with open ( thisCfgTemplate , "w" ) as f : f . write ( tmpFile ) # Set mps_setup append option for datasets following the first one append = "-a" if first_dataset : append = "" first_dataset = False self . _config_template = tmpFile self . _cms_process = mps_tools . get_process_object ( thisCfgTemplate ) self . _create_input_db ( ) with open ( thisCfgTemplate , "a" ) as f : f . write ( self . _override_gt ) # create mps_setup command command = [ "mps_setup.py" , "-m" , append , "-M" , self . _general_options [ "pedeMem" ] , "-N" , name , self . _mille_script , thisCfgTemplate , dataset [ "inputFileList" ] , str ( dataset [ "njobs" ] ) , self . _general_options [ "classInf" ] , self . _general_options [ "jobname" ] , self . _pede_script , "cmscafuser:" + self . _mss_dir ] if dataset [ "numberOfEvents" ] > 0 : command . extend ( [ "--max-events" , str ( dataset [ "numberOfEvents" ] ) ] ) command = [ x for x in command if len ( x . strip ( ) ) > 0 ] # Some output: print ( "Creating jobs for dataset:" , name ) print ( "-" * 75 ) print ( "Baseconfig:        " , dataset [ "configTemplate" ] ) print ( "Collection:        " , dataset [ "collection" ] ) if "ALCARECOTkAlCosmics" in dataset [ "collection" ] : print ( "cosmicsDecoMode:   " , dataset [ "cosmicsDecoMode" ] ) print ( "cosmicsZeroTesla:  " , dataset [ "cosmicsZeroTesla" ] ) print ( "Globaltag:         " , dataset [ "globaltag" ] ) print ( "Number of jobs:    " , dataset [ "njobs" ] ) print ( "Inputfilelist:     " , dataset [ "inputFileList" ] ) if dataset [ "json" ] != "" : print ( "Jsonfile:          " , dataset [ "json" ] ) if self . _args . verbose : print ( "Pass to mps_setup: " , " " . join ( command ) ) # call the command and toggle verbose output self . _handle_process_call ( command , self . _args . verbose ) # remove temporary file self . _handle_process_call ( [ "rm" , thisCfgTemplate ] )