-
Notifications
You must be signed in to change notification settings - Fork 107
List of PSet tweaks applied by WMAgent during job runtime
Pset tweaking is tightly coupled in WMCore, WMControl and CMSSW, and it brings complications that affect the support of multiple python versions (in CMSSW and WMCore) and job configuration (Pset) tweaks applied during runtime.
This topic is meant to be an investigation of what exactly is tweaked by WMAgent - during the job runtime; what the source of the information is (things from the workflow description? things from the WMAgent job description? things based on the site and/or storage? things related to the data to be accessed? etc)
The following scripts are the main ones used in the PSet tweaking:
https://github.com/dmwm/WMCore/blob/master/src/python/PSetTweaks/PSetTweak.py https://github.com/dmwm/WMCore/blob/master/src/python/PSetTweaks/WMTweak.py
The standalone script in development to replace the tweaking part can be seen below: https://gist.github.com/davidlange6/3b0cb365aac669a714d9f288b0bf420d
-
WMAgent executes the following script per job: https://github.com/dmwm/WMCore/blob/master/etc/submit.sh
-
There, Job object is unpacked via Unpacker.py runtime script
- This creates job directory, unpacks the sandbox and setups environment so job can be called using the Startup runtime script
- Sandboxes are built via Taskmaker, which calls SandBoxCreator
- SandBoxCreator invokes the CMSSWFetcher plugin, which will fetch the config files and Pset tweaks for the step.
- PSetTweaks are gotten from configCache as a JSON
- This line reads a json dictionary file and creates a PSetTweak object, which is saved as another JSON file.
- Startup.py bootstraps the job and executes it
- The execution method will look and use the proper executor to run here (e.g.: the CMSSW executor)
- For a CMSSW executor, prescripts are added here and looked here, being SetupCMSSWPset the only one added by this method. This is where the Pset tweaking is called.
- Each CMSSW step (cmsRun1, cmsRun2, etc) will call SetupCMSSWPset once The command looks like this (note SetupCMSSWPset is called via ScriptInvoke)
2020-07-15 00:03:37,065:INFO:Scram: Invoking command: /cvmfs/cms.cern.ch/slc6_amd64_gcc491/cms/cmssw/CMSSW_7_4_0/external/slc6_amd64_gcc491/bin/python2.7 -m WMCore.WMRuntime.ScriptInvoke WMTaskSpace.cmsRun1 SetupCMSSWPset
- Note the command above calls SetupCMSSWPset via ScriptInvoke, which will load the job step object. This what we would need to change in WMCore
The WMTweak.applyTweak needs the following input parameters:
- Self.process, which is the stepSection object
- A PSetTweak object
- A fixupDict dictionary, to make sure Psets and configuration values exist.
Where the pset tweaks are defined at 4 different stages:
-
Task pset tweaks Input: StepSection of FwjReport object
-
Parameters modified:
- process.GlobalTag.globaltag - process.GlobalTag.DBParameters.transactionId
-
Parameters modified:
-
Job Pset tweaks
- Input: WMBS Job object
-
Parameters modified:
process.source.firstLuminosityBlock process.source.fileNames process.source.secondaryFileNames process.source.firstEvent process.maxEvents.input process.source.skipEvents process.source.lumisToProcess
-
Output module Pset tweaks
- Input parameters:
- Module output, gotten from here
- WMBS Job object
- Parameters modified:
process.<outMod>.fileName process.<outMod>.logicalFileName
- Where outMod is the output module, e.g.:
.input.outputModule = 'AODSIMoutput'
- Input parameters:
-
Random generator tweak
- Input parameters: None (but uses getBaggage() method from WMBS job object)
- Parameters modified:
process.RandomNumberGeneratorService.<randService>.initialSeed
- Where randService comes from:
RandomNumberGeneratorService.x_internal_name
Refer to the following presentation for details about the generation of these tweaks and how they are fetched in WMConfigCache:
The following repository:
https://gitlab.cern.ch/khurtado/psettweakmigration/
provides the following:
- A set of PSet tweaks and input files (inside the
test
directory) for the following stages:
- Task level, Job level, Output module level
It also provides the output files as gotten by the current Pset tweaks methods. They can be used with a standalone script replacement, as long as python includes the CMSSW release modules (details in the README file in the repository)
- A job sandbox environment
This allows the user to run a production job, generate and apply the Pset tweaks interactively. It can be used to modify SetupCMSSWPset with a different applyTweak method, for example.
Please, read the README file for more details on how to use these files.