-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
faster edmConfigDump with --prune, also prunes unreferenced PSets #43276
base: master
Are you sure you want to change the base?
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43276/37684
|
A new Pull Request was created by @alkis-pap (Alkiviadis Papadopoulos) for master. It involves the following packages:
@cmsbuild, @smuzaffar, @makortel, @Dr15Jones can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
Thank you for the PR. Unfortunately the situation towards PSets is a bit complicated, and removing them from the top-level PSet does not generally work. For example, there is some code that goes to look for specific PSet(s) from the top-level PSet. In addition, the workflow management adds (untracked) PSet(s) to the The concept of I'd prefer to use a different name than
Could you give more details on a case where the |
Then I would propose to add a command line argument to
For example, it randomly crashes when using the release
I did some debugging and discovered that it crashes if the first element of a |
If the command line option would be named along Then the
Thank! Would it be possible for you to add a unit test in the |
Milestone for this pull request has been moved to CMSSW_14_1_X. Please open a backport if it should also go in to CMSSW_14_0_X. |
Milestone for this pull request has been moved to CMSSW_14_2_X. Please open a backport if it should also go in to CMSSW_14_1_X. |
ping (to make bot change milestone) |
Milestone for this pull request has been moved to CMSSW_15_0_X. Please open a backport if it should also go in to CMSSW_14_2_X. |
PR description:
edmConfigDump
with--prune
calls theprune
method of the process object which is extremely slow and can even fail for some configurations because it usesdelattr
to remove unused attributes. Instead it should simply avoid printing the unused attributes to the final output.Furthermore, it doesn't remove any PSets even though the data contained in most of them is already copied to the corresponding modules, adding thousands of lines of redundant data to the pruned config. Very few PSets are actually referenced by other PSets via
refToPSet_
and should be kept.The main changes in this PR:
prune
method ofProcess
was renamed to_unusedAttributes
. Instead of callingdelattr
, it collects the unused attribute names into a list (to preserve order) and returns it._unusedAttributes
also finds the names of all referenced PSets by recursively finding allrefToPSet_
attributes (elements of__dict__
not starting with'_'
) of objects and their children starting from the process object. All PSets that are not referenced are included in the returned list.prune
method was added because it's used in some tests (in the same file). It simply callsdelattr
for every attribute returned by_unusedAttributes
.dumpPython
has a new boolean argumentprune
. If set to true,_unusedAttributes
will be called and the resulting attributes will not be included in the outputedmConfigDump
doesn't callprune
but sets theprune
argument accordingly when callingdumpPython
PR validation:
Passes the tests in
FWCore/ParameterSet