Skip to content

Fixing opal_timer_linux_find_freq() on x86 #3847

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

Open
zzzoom opened this issue Jul 11, 2017 · 2 comments
Open

Fixing opal_timer_linux_find_freq() on x86 #3847

zzzoom opened this issue Jul 11, 2017 · 2 comments

Comments

@zzzoom
Copy link
Contributor

zzzoom commented Jul 11, 2017

Due to the TSC frequency debacle in #3003 MPI_Wtime got switched back to clock_gettime() but opal_timer_linux_find_freq has been left broken. This only affects the one remaining call to opal_timer_base_get_freq left in opal_progress_set_event_poll_rate but I'd like to take a shot at fixing it anyway.

Some alternatives I've been thinking about:

  1. Measure the frequency between a couple of samples of rdtsc and clock_gettime. The longer the period the better, but opal_timer_linux_find_freq doesn't do much so it would take calling usleep for a few µs or taking the measurements elsewhere during opal_init. There's a small difference between sockets, so context switches + migration would be problematic. Ugh.
  2. Take bogomips instead of cpu MHz from /proc/cpuinfo, divide by 2 and hope it keeps working in the future. Linux tries to avoid breaking userspace, so it's probably a safe bet.
  3. Make it a configurable parameter and let users/admins worry about it.

Any comments?

@bosilca
Copy link
Member

bosilca commented Feb 5, 2018

According to the discussion on the MPI Forum #77 modern Intel processors have rdtsc ticking at the nominal processor frequency, regardless of power saving and frequency boosting (I paraphrased Jim Dinan).

@jdinan
Copy link

jdinan commented Feb 5, 2018

That's correct -- You can check for invariant TSC to confirm that the processor supports and is configured to provide this behavior. See: https://software.intel.com/en-us/forums/intel-isa-extensions/topic/280440. Linux should also set the constant_tsc flag in /proc/cpuinfo.

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

No branches or pull requests

4 participants