-
Notifications
You must be signed in to change notification settings - Fork 897
mpi/c: Force wtick/wtime to use gettimeofday #3184
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
Conversation
This variable is only used in one file, so make it static. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Several component-specific functions were named with a prefix of "opal_timer_base", which was quite confusing. Rename them to have a prefix "opal_timer_linux" to make it clear that they are here in this component (and different than *actual* opal_timer_base symbols). Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
* See open-mpi#3003 for a discussion about this patch. Once we get a better version in place we can revert this change. Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
@hppritcha @bosilca @hjelmn Please comment / review. There are 2 trivial cleanup commits for the Linux timer component; the 3rd commit does the temporary fix of nailing WTICK/WTIME down to always use |
I think the main question here is: (@bosilca @bwbarrett @hjelmn) How much do we want the |
#if OPAL_TIMER_CYCLE_NATIVE | ||
wtime = ((double) opal_timer_base_get_cycles()) / opal_timer_base_get_freq(); | ||
#elif OPAL_TIMER_USEC_NATIVE | ||
wtime = ((double) opal_timer_base_get_usec()) / 1000000.0; | ||
#endif | ||
#else | ||
/* Fall back to gettimeofday() if we have nothing else */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hjelmn + me suggest putting something like:
#if _LINUX_ && OPAL_HAVE_CLOCK_GETTIME
// ... use clock_gettime(..) ...
#else
// ... use gettimeofday(..) ...
#endif
That way, we don't need a new configure test -- we only use clock_gettime
if a) we're on Linux, and b) our existing configure test says that we have clock_gettime
(i.e., we sidestep the whole OS X problem).
Workaround for Issue #3003
wtick
/wtime
to usegettimeofday
instead of the high precision timers until we figure out a portable way to calibrate them.