Skip to content

Fixing opal_timer_linux_find_freq() on x86 #3847

@zzzoom

Description

@zzzoom

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions