Back to home page

Project CMSSW displayed by LXR

 
 

    


Warning, /GeneratorInterface/Herwig7Interface/scripts/README.md is written in an unsupported language. File is not indexed.

0001 # Parallelization script
0002 Parallelization script for Herwig7 in CMSSW
0003 
0004 Table of Contents
0005 =================
0006 
0007   * [Parallelization script](#parallelization-script)
0008     * [Possible Options](#possible-options)
0009     * [Examples](#examples)
0010     * [Warnings](#warnings)
0011 
0012 
0013 ## Parallelization script
0014 * This script sets up parallel jobs for the build, integrate and run step when using Herwig with the CMSSW framework.
0015 * It takes a cmsRun file, adjusts the parameters in it accordingly to the options and saves them to temporary cmsRun files. For each step a different cmsRun file is created. The original file remains unaltered.
0016 * In order to adjust the options in the cmsRun file quite simple regular expressions are used. Comments in the file in the process.generator part may confuse this script. Check the temporary cmsRun files if errors occur.
0017 
0018 ## Possible options:
0019 * -b/--build : sets the number of build jobs and starts the build step.
0020 * -i/--integrate : sets the maximal number of integration jobs
0021   * This option already has to be set when the build step is invoked. The integration step will be performed if this option is set, unless --nointegration is chosen.
0022   * The actual number of integration jobs may be smaller. It is determined by the number of files in Herwig-scratch/Build.
0023 * -r/--run : sets the number of run jobs and starts the run step.
0024   * A parallelized run step is achieved by calling cmsRun an according number of times with different seeds for Herwig. The built in feature of Herwig won't be used.
0025 
0026 
0027 * --nointegration : use this option to set up several integration jobs without actually performing them
0028 * --stoprun: use this option if you want to create the cmsRun files without calling cmsRun
0029   * This option may be useful if one wants to change some file names, in order to avoid conflicts if multiple run steps are chosen
0030 * --resumerun: no new cmsRun files for the run step will be created
0031   * For this option to work 'temporary' cmsRun files complying to the naming scheme have to be availible. Only files up to the number of jobs defined by --run will be considered.
0032 * --keepfiles : don't remove the created temporary cmsRun files
0033 * --l/--log: write the output of each shell command called in a seperate log file
0034   * This avoids clutter in the terminal. Every process can be watched seperately by `tail -f INSERTNAME.log`
0035 
0036 ## Examples
0037 ### Short example
0038   * Set up 10 build jobs, 10 integrate jobs and 10 run jobs with the configuration in INSERT\_CMSRUN\_FILENAME.py:
0039 ```
0040 ./parallelization.py INSERT_CMSRUN_FILENAME.py --build 10 --integrate 10 --run 10
0041 ```
0042 
0043 ### Long example
0044   * Set up one build job, which prepares 4 integrate jobs, but stopping before the integration:
0045     * This imitates the behavior of `Herwig build --maxjobs 10`
0046 ```
0047 ./parallelization.py INSERT_CMSRUN_FILENAME.py --build 1 --integrate 4 --nointegration
0048 ```
0049   * Integrate those jobs:
0050 ```
0051 ./parallelization.py INSERT_CMSRUN_FILENAME.py --integrate 4
0052 ```
0053   * Create ten cmsRun files (with ten different seeds):
0054 ```
0055 ./parallelization.py INSERT_CMSRUN_FILENAME.py --run 10 --stoprun
0056 ```
0057   * Now would be the moment to adjust the created files (Maybe change the filenames for the output to ten different names). They are named INSERT\_CMSRUN\_FILENAME\_py\_run\_X.py where X goes from 0 to 9.
0058   * Execute the cmsRun files:
0059 ```
0060 ./parallelization.py INSERT_CMSRUN_FILENAME.py --run 10 --resumerun
0061 ```
0062     * Note that the file name is the original one. In this case this file won't be read anymore, it's name just determines the prefix in front of \_py\_run\_X.py .
0063     * No files will be deleted after this run. This script only deletes files it has created in the same run.
0064 
0065 ### Additional option
0066   * If one plans to make a second run with the existing config (or with some small changes, which don't affect build or integrate step), one can keep the files.
0067 ```
0068 ./parallelization INSERT_CMSRUN_FILENAME.py --build 1 --integrate 1 --run 1 --keepfiles
0069 ```
0070     * Now the files INSERT\_CMSRUN\_FILENAME\_py\_build.py, INSERT\_CMSRUN\_FILENAME\_py\_integrate\_0.py and INSERT\_CMSRUN\_FILENAME\_py\_run\_0.py are kept in the current directory. 
0071 
0072   * Rerun the existing file INSERT\_CMSRUN\_FILENAME\_py\_run\_0.py via:
0073 ```
0074 ./parallelization INSERT_CMSRUN_FILENAME.py --run 1 --resumerun
0075 
0076 ```
0077 
0078 ## Warnings
0079 * Existing files with the same names as described in the naming scheme will be overwritten.
0080  * in the given file name all dots are replaced by underscores and either \_build.py, \_integrate\_X.py or \_run\_X.py is appended
0081 * Comments in the cmsRun file may confuse this script.
0082 
0083 
0084 
0085 
0086 
0087 
0088 
0089 
0090 
0091 
0092