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

Rearrange #ifdef STAT_TSB so file var statCount does not appear #2412

Merged
merged 1 commit into from Feb 13, 2014
Merged

Rearrange #ifdef STAT_TSB so file var statCount does not appear #2412

merged 1 commit into from Feb 13, 2014

Conversation

gartung
Copy link
Member

@gartung gartung commented Feb 11, 2014

This is obviously used for local debugging and file vars are not thread safe.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @gartung (Patrick Gartung) for CMSSW_7_1_X.

Rearrange #ifdef STAT_TSB so file var statCount does not appear

It involves the following packages:

RecoTracker/CkfPattern
RecoTracker/FinalTrackSelectors
RecoTracker/TrackProducer

@nclopezo, @cmsbuild, @anton-a, @thspeer, @slava77, @Degano can you please review it and eventually sign? Thanks.
@gpetruc, @ghellwig, @GiacomoSguazzoni, @rovere, @cerati this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
@nclopezo, @ktf you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@cmsbuild
Copy link
Contributor

@anton-a
Copy link

anton-a commented Feb 12, 2014

+1
6d56ee8
jenkins and code inspection

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_1_X IBs unless changes (tests are also fine). @nclopezo, @ktf can you please take care of it?

@ktf
Copy link
Contributor

ktf commented Feb 12, 2014

Is the ifdef-ed code actually used?

@anton-a
Copy link

anton-a commented Feb 12, 2014

possibly for some testing/debugging - I could not find STAT_TSB defined in standard code

@ktf
Copy link
Contributor

ktf commented Feb 12, 2014

Can we actually find out with the tracking people and remove if not used (or add proper support for this kind of profiling so that it makes sense in multithreading?)

@anton-a
Copy link

anton-a commented Feb 12, 2014

OK. I will contact them and will follow up.

@ktf
Copy link
Contributor

ktf commented Feb 13, 2014

Ok, looks like this is Vincenzo's code. now that I look at it, what is the problem with the original code?

@gartung
Copy link
Member Author

gartung commented Feb 13, 2014

On 2/13/2014 4:56 AM, Giulio Eulisse wrote:

Ok, looks like this is Vincenzo's code. now that I look at it, what is
the problem with the original code?


Reply to this email directly or view it on GitHub
#2412 (comment).

The struct is a non-const file var.

@ktf
Copy link
Contributor

ktf commented Feb 13, 2014

But it does nothing right?

@gartung
Copy link
Member Author

gartung commented Feb 13, 2014

On 2/13/2014 7:19 AM, Giulio Eulisse wrote:

But it does nothing right?


Reply to this email directly or view it on GitHub
#2412 (comment).

True. But why leave it in if it does nothing.

@ktf
Copy link
Contributor

ktf commented Feb 13, 2014

Reply to this email directly or view it on GitHub
#2412 (comment).
True. But why leave it in if it does nothing.

Discussing with Vincenzo, he actually uses it for developing tracking
code, so it's a valid use case. Given the code is safe in the
multithreaded case, I would not change it further.

@gartung
Copy link
Member Author

gartung commented Feb 13, 2014

@Dr15Jones can you comment please.

@Dr15Jones
Copy link
Contributor

Having it in confuses the static analyzer. If Patrick has already done the work in #defining it out why not allow it?

@ktf
Copy link
Contributor

ktf commented Feb 13, 2014

Because scattering the code of ifdefs for what is a static analyser
false positive is not a good idea, IMHO. Either we agree that the code
needs to be removed (and the author, Vincenzo, does not) or we clean up
the false positive. Can't we fix it with an attribute like we have done
elsewhere?

On 13 Feb 2014, at 16:02, Chris Jones wrote:

Having it in confuses the static analyzer. If Patrick has already done
the work in #defining it out why not allow it?


Reply to this email directly or view it on GitHub:
#2412 (comment)

@gartung
Copy link
Member Author

gartung commented Feb 13, 2014

On 2/13/2014 9:21 AM, Giulio Eulisse wrote:

Because scattering the code of ifdefs for what is a static analyser
false positive is not a good idea, IMHO. Either we agree that the code
needs to be removed (and the author, Vincenzo, does not) or we clean up
the false positive. Can't we fix it with an attribute like we have done
elsewhere?

On 13 Feb 2014, at 16:02, Chris Jones wrote:

Having it in confuses the static analyzer. If Patrick has already done
the work in #defining it out why not allow it?


Reply to this email directly or view it on GitHub:
#2412 (comment)


Reply to this email directly or view it on GitHub
#2412 (comment).

OK. I will add the [[cms::threadsafe]] attribute instead.

@gartung
Copy link
Member Author

gartung commented Feb 13, 2014

So your concern is esthetics of the code????

@ktf
Copy link
Contributor

ktf commented Feb 13, 2014

My concern is polluting code with something unnecessary. If we can do it with a one line solution rather than a multitude of ifdefs, why not?

@cmsbuild
Copy link
Contributor

Pull request #2412 was updated. @nclopezo, @cmsbuild, @anton-a, @thspeer, @slava77, @Degano can you please check and sign again.

@ktf
Copy link
Contributor

ktf commented Feb 13, 2014

@nclopezo please just check it compiles fine.

@@ -78,7 +78,7 @@
};
#endif

StatCount statCount;
[[cms::thread_safe]] StatCount statCount;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is misleading. If we are going to do this then it should be

#ifdef STAT_TSB
StatCount statCount;
#else
[[cms::thread_safe]] StatCount statCount;
#endif

That will properly describe the case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

@cmsbuild
Copy link
Contributor

Pull request #2412 was updated. @nclopezo, @cmsbuild, @anton-a, @thspeer, @slava77, @Degano can you please check and sign again.

@cmsbuild
Copy link
Contributor

@ktf
Copy link
Contributor

ktf commented Feb 13, 2014

Fine with me. Can you please squash the commits?

@cmsbuild
Copy link
Contributor

Pull request #2412 was updated. @nclopezo, @cmsbuild, @anton-a, @thspeer, @slava77, @Degano can you please check and sign again.

@gartung
Copy link
Member Author

gartung commented Feb 13, 2014

Squashed.

@ktf
Copy link
Contributor

ktf commented Feb 13, 2014

Thanks. Bypassing this. Complain if not ok.

ktf added a commit that referenced this pull request Feb 13, 2014
Misc fixes -- Flag as ok clang static analyser false positive for statCount.
@ktf ktf merged commit 73634e2 into cms-sw:CMSSW_7_1_X Feb 13, 2014
@gartung gartung deleted the remove-file-local-StatCount branch February 13, 2014 15:59
@nclopezo nclopezo modified the milestones: CMSSW_7_1_0_pre4, CMSSW_7_1_0_pre3 Feb 24, 2014
@nclopezo nclopezo modified the milestones: CMSSW_7_1_0_pre5, CMSSW_7_1_0_pre4 Mar 10, 2014
@cmsbuild
Copy link
Contributor

ggovi pushed a commit to ggovi/cmssw that referenced this pull request Jan 11, 2017
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.

None yet

6 participants