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
Changed set to vector in PFDisplacedVertexSeed #23546
Changed set to vector in PFDisplacedVertexSeed #23546
Conversation
There was no fundamental reason to use a set rather than a vector. Even guaranteeing uniqueness of the elements in the container can be done efficiently with the vector. This should help with both memory size and speed.
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-23546/5135 |
I happen to have noticed this while trying to understand the IB failures using gcc 8. The use of the set bothered me so I changed it to a vector to improve its memory and CPU efficiency. |
please test |
The tests are being triggered in jenkins. |
A new Pull Request was created by @Dr15Jones (Chris Jones) for master. It involves the following packages: DataFormats/ParticleFlowReco @perrotta, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
As best as I can see from looking at the RECO comparisons, the extremely slight differences (usually just a shifting of an entry from one histogram bin to a neighboring bin) could be explained by slight precision shifts in the values. |
Hi @Dr15Jones : a set is ordered according to its element keys, while a vector is not. As a consequence, the order in which Still, it is not obvious to me how do those different orders can be responsible of the tiny changes that you notice in a few reco comparisons. Do you have an idea about how this can happen? You talk about some different precision, which could indeed be responsible of the tiny changes observed: where such a different precision is implemented in this PR? |
On 6/15/18 2:12 AM, perrotta wrote:
Hi @Dr15Jones <https://github.com/Dr15Jones> : a set is ordered
according to its element keys, while a vector is not. As a consequence,
the order in which |elements_| are accessed differs now, and with some
debug I could verify that in a few cases also the |displacedVertex|'s
get a different order with this PR wrt the baseline.
Still, it is not obvious to me how do those different orders can be
responsible of the tiny changes that you notice in a few reco
comparisons. Do you have an idea about how this can happen?
You talk about some different precision, which could indeed be
responsible of the tiny changes observed: where such a different
precision is implemented in this PR?
due to roundoffs, results of operations made on the same values in a
different order can be different.
Is a change of order actually meaningful? There should be no code that
assumes ordering
|
@Dr15Jones : well, I was waiting that you pointed out to me where there is such a variable saved in a different precision in your code (if this was what you meant by "slight precision shifts in the values") On the other hand, we agrees that the change of order of few of the displacedVertex's (due to the change of order of the elements_ of the Set vs Vector) could be deemed responsible of the tiny shifts seen in the outputs. And, by looking at the code I don't think that the order that was originally decided for the Therefore, if you have no objections, I could consider me ready to sign this off for reco |
@perrotta When I was saying 'slight precision shifts in the values' I just meant that if the code was doing math operations (say additions) based on the order of the items in the set, then changing the order can make slight changes to the values at the smallest precision scale. I had not meant to imply some change to saved values. Sorry for the confusion. Yes, please go ahead and sign off. |
+1
|
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. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
A vector should reduce memory and most likely speed up the use of PFDisplacedVertexSeed.
Added unit tests for the code I touched.