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

Enable idle rate counter on demand #1489

Closed
wants to merge 3 commits into from
Closed

Enable idle rate counter on demand #1489

wants to merge 3 commits into from

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented May 1, 2015

This removes the need for compile time configuration of the idle-rate counters. Those will be enabled by default, but activated only when needed.

@@ -49,7 +51,7 @@
#include <boost/atomic.hpp>

#if defined(HPX_HAVE_SWAP_CONTEXT_EMULATION)
extern "C" void switch_to_fiber(void* lpFiber) throw();
extern "C" void HPX_EXPORT switch_to_fiber(void* lpFiber) throw();
Copy link
Member

Choose a reason for hiding this comment

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

Is this change related to the PR? If so, how?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably not, but for some weird reason I was not able to make it work without this change :/ It should probably a separate bug-fix, but I think it does not harm if it is left as a part of this PR.

@hkaiser
Copy link
Member Author

hkaiser commented May 8, 2015

Are there any objections to merge this?

@K-ballo
Copy link
Member

K-ballo commented May 8, 2015

I would have liked to see a proper review here, as this was already changed in the opposite direction (about a year or two ago), and concerns about it were raised on IRC. I am not familiar with the implementation of counters nor with the rationale for disabling idle-rate (overheads?) to do that review, but the general code looks ok and the pattern seems to be already used for other counters (incidentally, access to those extern bools are theoretically races).

This is not an objection.

@hkaiser
Copy link
Member Author

hkaiser commented May 8, 2015

I would have liked to see a proper review here, as this was already changed in the opposite direction (about a year or two ago), and concerns about it were raised on IRC

No, it never was implemented this way, it was always a compile time switch. @pagrubel was doing some analysis a while back. She said that it had no noticeable effect on performance. But ok, let's do a full review here.

incidentally, access to those extern bools are theoretically races

Yah, it's what's called a benign data race.

@K-ballo
Copy link
Member

K-ballo commented May 8, 2015

I would have liked to see a proper review here, as this was already changed in the opposite direction (about a year or two ago), and concerns about it were raised on IRC

No, it never was implemented this way, it was always a compile time switch. @pagrubel was doing some analysis a while back. She said that it had no noticeable effect on performance. But ok, let's do a full review here.

I'm not asking for a full review. The code looks sane, and anyone interested had plenty enough time to be made aware of the proposed change. I would have just liked the PR to be signed off by those who have expressed concern.

incidentally, access to those extern bools are theoretically races

Yah, it's what's called a benign data race.

They actually look like undefined behavior, access to them is still potentially concurrent regardless of the architecture and whatever codegen they produce. I'm not asking for this to change either, I know it to work and be portable (for now) despite not being standard conformant.

// We control whether to collect idle rates using this global bool.
// It will be set by any of the related performance counters. Once set it
// stays set, thus no race conditions will occur.
extern bool maintain_idle_rates;
Copy link
Member

Choose a reason for hiding this comment

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

Why does the bool have to be defined here as well? Especially since it is not used in that header anywhere?

@sithhell
Copy link
Member

sithhell commented May 8, 2015

I was hoping to see some comments from @pagrubel regarding the performance impact (if any) of those changes.

@pagrubel
Copy link
Member

pagrubel commented May 8, 2015

Yes, I’d like to run some tests. I haven’t had time as of yet. Now, I see hermione is having problems. Can you wait a bit?

Pat

@@ -551,8 +551,8 @@ system and application performance.
is `worker-thread#*` the counter will return the average time spent
executing one __hpx__-thread for all worker threads separately.
This counter is available only if the configuration time constants
`HPX_THREAD_MAINTAIN_CUMULATIVE_COUNTS` (default: ON) and
`HPX_THREAD_MAINTAIN_IDLE_RATES` are set to `ON` (default: OFF).]
Copy link
Member

Choose a reason for hiding this comment

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

These names look old, shouldn't these have been HPX_WITH_... already?

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, will fix

Copy link
Member Author

Choose a reason for hiding this comment

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

OTOH, this branch might be old enough to still have the old names.

Copy link
Member

Choose a reason for hiding this comment

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

The new names are used in the cmake_variables file above

@hkaiser
Copy link
Member Author

hkaiser commented May 20, 2015

Note to self: make sure this counter interacts with the existence of RTDSC or similar.

@sithhell
Copy link
Member

@pagrubel do you still need to run your performance regression tests? Could you share your scripts so that someone could take over that duty if you lack the time at the moment?

@pagrubel
Copy link
Member

pagrubel commented Jun 2, 2015

I ran the data and will look at it by tomorrow

Pat

@pagrubel
Copy link
Member

pagrubel commented Jun 3, 2015

Doesn't lgtm
I'm seeing some really bad idle_rate counts, bad variances between samples for some core counts.

@hkaiser
Copy link
Member Author

hkaiser commented Jun 3, 2015

Ok, thanks Pat! I'll close this without merging, then.

@hkaiser hkaiser closed this Jun 3, 2015
@hkaiser hkaiser deleted the idle_rate branch June 5, 2015 14:59
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

4 participants