cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.07k stars 4.28k forks source link

Add option in cmsDriver to include further inline configuration #45408

Open vlimant opened 2 months ago

vlimant commented 2 months ago

I was looking at https://gitlab.cern.ch/cmshcal/hcalpfg/hcalnanoprod/-/blob/main/test/globalrun_cfg.py and it could be useful to have cmsDriver include a parameter parsing for parameter in the process. Like cmsDriver ... --parse maxEvents.input,maxEvents.output,options.numberOfThreads which would generate the general python configuration, with argument parsing code added.

cmsbuild commented 2 months ago

cms-bot internal usage

cmsbuild commented 2 months ago

A new Issue was created by @vlimant.

@Dr15Jones, @antoniovilela, @makortel, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

makortel commented 2 months ago

assign Configuration/Applications

cmsbuild commented 2 months ago

New categories assigned: operations

@davidlange6,@rappoccio,@antoniovilela,@fabiocos you have been requested to review this Pull request/Issue and eventually sign? Thanks

vlimant commented 2 months ago

something like this https://github.com/cms-sw/cmssw/compare/master...vlimant:cmssw:process_attribute_parsing could work. It is missing a mechanism to pick up automatically the parameter type and multiplicity from the existing or allowed parameter type : @makortel is there some FW functionality for this ?

makortel commented 2 months ago

The cms.Process has static methods defaultOptions_(), defaultMaxEvents_(), and defaultMaxLuminosityBlocks_() that each return a PSet of those top-level parameters with the default values of the contained parameters. You could use those to inspect the allowed parameter type(s) and multiplicity.

Alternatively you could also construct a "dummy" cms.Process object and inspect its default values. That would be a bit more expensive though.