Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wildcards to generated _cfi.py files #44013

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

Dr15Jones
Copy link
Contributor

PR description:

The first wildcard denoted in a ParameterSet descriptions will be added to the cfi.py file via the allowAnyLabel mechanic.

PR validation:

Framework unit tests pass.

The first wildcard denoted in a ParameterSet descriptions will be
added to the _cfi.py file via the allowAnyLabel_ mechanic.
@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 19, 2024

cms-bot internal usage

@Dr15Jones
Copy link
Contributor Author

please test

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-44013/38939

  • This PR adds an extra 48KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @Dr15Jones for master.

It involves the following packages:

  • FWCore/Integration (core)
  • FWCore/ParameterSet (core)

@makortel, @Dr15Jones, @smuzaffar can you please review it and eventually sign? Thanks.
@makortel, @missirol, @wddgit this is something you requested to watch as well.
@sextonkennedy, @antoniovilela, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@Dr15Jones
Copy link
Contributor Author

@cms-sw/hlt-l2 FYI this will change the _cfi.py files for any module which declares a wildcard for a parameter label. This will now add a line to the _cfi.py configuration starting with allowAnyLabel_ = ... which naively looks like a declaration of a parameter with a label of allowAnyLabel_ but that is not the case. This might affect HLT cfi parsing logic.

@Martin-Grunewald
Copy link
Contributor

Sorry, the PR description is too terse for me to understand.
What is the problem to be solved by this PR?
Do you have an example new vs old?
Thanks!

@Dr15Jones
Copy link
Contributor Author

So previously, if the fillDescriptions contained something like

    edm::ParameterSetDescription desc;
    desc.addOptional<unsigned>("p_uint_opt", 0);
    desc.addWildcard<int>("*");

The module declaration in the _cfi.py file would only contain

     p_uint_opt = cms.uint32(0)

but with this change it would become

     p_uint_opt = cms.uint32(0),
     allowAnyLabel_ = cms.optional.int32

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-0f442f/37554/summary.html
COMMIT: d809da0
CMSSW: CMSSW_14_1_X_2024-02-19-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/44013/37554/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

@makortel
Copy link
Contributor

@Martin-Grunewald Do you have any further comments?

@Martin-Grunewald
Copy link
Contributor

Martin-Grunewald commented Feb 21, 2024

I do not understand the above example line

p_uint_opt = cms.uint32(0)

Shouldn't that be

p_uint_opt = cms.optional.uint32(0)

?

In any case, the line:

allowAnyLabel_ = cms.optional.int32

would be interpreted as a parameter of name allowAnyLabel_ but since cms.optional.int32 is also not understood by ConfDb parsing (since back then when it was introduced), the whole line would be ignored.
Thus if that is a top-level parameter, ConfDb would not allow it. Within a PSet, arbitrary parameters can by added in the GUI. In any case, cms.optional is not understood by parsing, would not be stored in ConfDb, and would not be put in a python config extracted from ConfDb.

So not useable at HLT, but also, so far we did not encounter an issue with the existing cms.optional (ie, ignoring seems fine?)

@Dr15Jones
Copy link
Contributor Author

p_uint_opt = cms.uint32(0)

Shouldn't that be

p_uint_opt = cms.optional.uint32(0)

Arg, you are right. I meant to use in the example

desc.add<unsigned>("p_uint_opt", 0);

but the lines dealing with p_uint_opt are not actually important to the example, only the wildcard.

@makortel
Copy link
Contributor

Thanks @Martin-Grunewald

@makortel
Copy link
Contributor

+core

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @sextonkennedy, @rappoccio, @antoniovilela (and backports should be raised in the release meeting by the corresponding L2)

@makortel
Copy link
Contributor

@Dr15Jones
Copy link
Contributor Author

@Martin-Grunewald on a related note, do you know how the ConfDb entries derived from _cfi.py files are actually handled? Does the code look at the _cfi.py as a text file or does it load it into python and then interrogate the python object? Thanks.

@rappoccio
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit cb690b8 into cms-sw:master Feb 23, 2024
11 checks passed
@Martin-Grunewald
Copy link
Contributor

@Martin-Grunewald on a related note, do you know how the ConfDb entries derived from _cfi.py files are actually handled? Does the code look at the _cfi.py as a text file or does it load it into python and then interrogate the python object? Thanks.

It loads it into python and goes from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants