How To: Generate Steering Files

This might help you to run several Mokka, or Marlin jobs in parallel, e.g. on the Grid or the Batch Cluster, with similar input parameters.

The Master File

You have to write a master steering file, that holds the information what your job should actually do. Everything that has to be varied later on, like input and output files, is described by a placeholder

<marlin>
   <execute>
      <!--Stuff not doing reco, but needed by other processors-->
      <processor name="MyProcessor"/>
   </execute>

   <global>
      <parameter name="LCIOInputFiles"> /nfs/flc/lc4/pool/myName/__MyInputLCIOFile__.slcio </parameter>
      <parameter name="MaxRecordNumber" value="201"/>
      <parameter name="SkipNEvents" value="0"/>
   </global>

   <processor name="MyProcessor" type="Processor">
     <parameter name="OutputFileName" type="string" value="/nfs/flc/lc4/pool/myName/__MyOutputFile__.root "/>
   </processor>
</marlin>

Make sure the placeholders are unique, in this case __MyInputLCIOFile__ and __MyOutputFile__, since they will be replaced later on. It is also always recommanded you to give the full path. Otherwise you might have to search for your outputfiles at the end.

The Shell Script

Now you have to write a shell script that is replacing the placeholders in your master file. This could look similar to

for i in $(seq 1 9)
  do sed -e "s/__MyInputLCIOFile__/Run12345.000${i}/g" \
         -e "s/__MyOutputFile__/MyRootFileName.000${i}/g"  \
         < myMasterSteeringFile.xml \
         > MySteeringFile.000${i}.xml
done

This will read myMasterSteeringFile.xml and globally replace __MyLCIOFile__ with a certain runnumber and __MyOutputFile__ is globally replaced by MyRootFilename.0001. The result is written into MySteeringFile.0001.xml.

GenerateSteeringFiles (last edited 2009-06-16 18:32:14 by localhost)