-
Notifications
You must be signed in to change notification settings - Fork 865
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
Reenable high accuracy timers #285
Conversation
for MPI_Wtime and MPI_Wtick.
MPI_Wtime and MPI_Wtick. Merge branch 'topic/accurate_timers'
retest this please |
Test PASSed. |
Test PASSed. |
} | ||
|
||
#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.
The code (in the context) that was in this #else
block is buggy. rdtsc
must be used with a serializing cpuid
instruction to ensure that you are timing what you think you are timing. There's an even better pattern that should be used in general, though I'm not sure we can apply it to MPI_Wtime()
because we don't know if we are being called at the beginning of a timing region or at the end. For more information see http://www.intel.com/content/www/us/en/intelligent-systems/embedded-systems-training/ia-32-ia-64-benchmark-code-execution-paper.html
George, I've finished my review, see my inline comments on the PR (not sure if they show up in email or not). |
together with RDTSC. It is still not perfect, but hopefully much better than before.
Test FAILed. Build Log
Test FAILed. |
__asm__ __volatile__ ("cpuid\n\t" | ||
"rdtsc\n\t" | ||
: "=a" (a), "=d" (d) | ||
:: "%rax", "%rbx", "%rcx", "%rdx"); |
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.
I think you want to drop the %
characters in the clobber list (two places in this file, once in ia32/timer.h
). Untested, but that's my recollection of the syntax.
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.
The syntax seems to be correct. The problem is that I over-specified the
clobber list (rax and rdx) were already implied by the "=a" and "=d" one
line above.
George.
On Mon, Nov 24, 2014 at 3:29 PM, Dave Goodell [email protected]
wrote:
In opal/include/opal/sys/amd64/timer.h:
static inline opal_timer_t
opal_sys_timer_get_cycles(void)
{- opal_timer_t ret;
- asm volatile("rdtsc" : "=A"(ret));
- return ret;
-} +#if 0unsigned a, d;
**asm** **volatile** ("cpuid\n\t"
"rdtsc\n\t"
: "=a" (a), "=d" (d)
:: "%rax", "%rbx", "%rcx", "%rdx");
I think you want to drop the % characters in the clobber list (two places
in this file, once in ia32/timer.h). Untested, but that's my recollection
of the syntax.—
Reply to this email directly or view it on GitHub
https://github.com/open-mpi/ompi/pull/285/files#r20823713.
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.
I addressed all your concerns/suggestions. Thanks, they really make the
code cleaner and hopefully more robust. This is now ready to be merged.
On Mon, Nov 24, 2014 at 3:35 PM, George Bosilca [email protected] wrote:
The syntax seems to be correct. The problem is that I over-specified the
clobber list (rax and rdx) were already implied by the "=a" and "=d" one
line above.George.
On Mon, Nov 24, 2014 at 3:29 PM, Dave Goodell [email protected]
wrote:In opal/include/opal/sys/amd64/timer.h:
static inline opal_timer_t
opal_sys_timer_get_cycles(void)
{- opal_timer_t ret;
- asm volatile("rdtsc" : "=A"(ret));
- return ret;
-} +#if 0unsigned a, d;
**asm** **volatile** ("cpuid\n\t"
"rdtsc\n\t"
: "=a" (a), "=d" (d)
:: "%rax", "%rbx", "%rcx", "%rdx");
I think you want to drop the % characters in the clobber list (two
places in this file, once in ia32/timer.h). Untested, but that's my
recollection of the syntax.—
Reply to this email directly or view it on GitHub
https://github.com/open-mpi/ompi/pull/285/files#r20823713.
Test FAILed. Build Log
Test FAILed. |
Test FAILed. Build Log
Test FAILed. |
so they must be saved before.
retest this please. |
Test PASSed. |
Test PASSed. |
The current version looks good to me too. Thanks for fixing this, George. I'm assuming you'll push it. |
If the user specifies a --map-by <foo> option, then default to bind-t…
Fix hwloc version check ordering
As discussed on the user mailing list the current implementation of MPI_Wtime defaults to gettimeofday in most cases. This patch proposes a better approach by:
@goodell please review. Based on our discussion at SC I made sure that when available we are using the RDTSC-based timers.