Index: runtime/src/kmp.h =================================================================== --- runtime/src/kmp.h +++ runtime/src/kmp.h @@ -894,10 +894,14 @@ #else # if KMP_OS_UNIX && (KMP_ARCH_X86 || KMP_ARCH_X86_64) // HW TSC is used to reduce overhead (clock tick instead of nanosecond). - extern double __kmp_ticks_per_nsec; -# define KMP_NOW() __kmp_hardware_timestamp() -# define KMP_NOW_MSEC() ((kmp_uint64)(KMP_NOW()/__kmp_ticks_per_nsec)/KMP_USEC_PER_SEC) -# define KMP_BLOCKTIME_INTERVAL() (__kmp_dflt_blocktime * KMP_USEC_PER_SEC * __kmp_ticks_per_nsec) + extern kmp_uint64 __kmp_ticks_per_msec; +# if KMP_COMPILER_ICC +# define KMP_NOW() _rdtsc() +# else +# define KMP_NOW() __kmp_hardware_timestamp() +# endif +# define KMP_NOW_MSEC() (KMP_NOW()/__kmp_ticks_per_msec) +# define KMP_BLOCKTIME_INTERVAL() (__kmp_dflt_blocktime * __kmp_ticks_per_msec) # define KMP_BLOCKING(goal, count) ((goal) > KMP_NOW()) # else // System time is retrieved sporadically while blocking. Index: runtime/src/z_Linux_util.cpp =================================================================== --- runtime/src/z_Linux_util.cpp +++ runtime/src/z_Linux_util.cpp @@ -90,7 +90,7 @@ static kmp_cond_align_t __kmp_wait_cv; static kmp_mutex_align_t __kmp_wait_mx; -double __kmp_ticks_per_nsec; +kmp_uint64 __kmp_ticks_per_msec = 1000000; /* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */ @@ -2157,7 +2157,7 @@ } #if KMP_ARCH_X86 || KMP_ARCH_X86_64 -/* Measure clock tick per nanosecond */ +/* Measure clock ticks per millisecond */ void __kmp_initialize_system_tick() { @@ -2166,7 +2166,7 @@ kmp_uint64 goal = __kmp_hardware_timestamp() + delay; kmp_uint64 now; while ((now = __kmp_hardware_timestamp()) < goal); - __kmp_ticks_per_nsec = 1.0 * (delay + (now - goal)) / (__kmp_now_nsec() - nsec); + __kmp_ticks_per_msec = (kmp_uint64)(1e6 * (delay + (now - goal)) / (__kmp_now_nsec() - nsec)); } #endif