Commit 1210b71a authored by Norio Yamaguchi's avatar Norio Yamaguchi Committed by Pavan Balaji
Browse files

Revert "Time trace with rdtsc"

This reverts commit 05059e74e6869b62f9d10d9e8874aa1d6df5c1a1.
parent 96b4b7b3
...@@ -65,20 +65,6 @@ ...@@ -65,20 +65,6 @@
#include <limits.h> #include <limits.h>
#endif #endif
#if 1 /* for rdtsc timer */
extern uint64_t rdtsc_prog_start, rdtsc_prog_end, rdtsc_wait_sum;
static inline uint64_t MPI_rdtsc_light(void )
{
uint64_t x;
__asm__ __volatile__("rdtscp;" /* rdtscp don't jump over earlier instructions */
"shl $32, %%rdx;"
"or %%rdx, %%rax" :
"=a"(x) :
:
"%rcx", "%rdx", "memory");
return x;
}
#endif
#if defined(HAVE_LONG_LONG_INT) #if defined(HAVE_LONG_LONG_INT)
/* tt#1776: some platforms have "long long" but not a LLONG_MAX/ULLONG_MAX, /* tt#1776: some platforms have "long long" but not a LLONG_MAX/ULLONG_MAX,
* usually because some feature test macro has turned them off in glibc's * usually because some feature test macro has turned them off in glibc's
......
...@@ -19,9 +19,6 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status) __attribute__((weak,alias ...@@ -19,9 +19,6 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status) __attribute__((weak,alias
#endif #endif
/* -- End Profiling Symbol Block */ /* -- End Profiling Symbol Block */
#if 1 /* for rdtsc timer */
uint64_t rdtsc_prog_start, rdtsc_prog_end, rdtsc_wait_sum;
#endif
/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build /* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
the MPI routines */ the MPI routines */
#ifndef MPICH_MPI_FROM_PMPI #ifndef MPICH_MPI_FROM_PMPI
......
...@@ -53,14 +53,8 @@ double MPI_Wtime( void ) ...@@ -53,14 +53,8 @@ double MPI_Wtime( void )
MPIR_ERRTEST_INITIALIZED_ORDIE(); MPIR_ERRTEST_INITIALIZED_ORDIE();
MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WTIME); MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_WTIME);
#if 1 /* for rdtsc timer */
uint64_t _t = MPI_rdtsc_light();
if(_t & (0xffffULL<<48)) { _t &= ~(0xffffULL<<48); }
d = _t;
#else
MPID_Wtime( &t ); MPID_Wtime( &t );
MPID_Wtime_todouble( &t, &d ); MPID_Wtime_todouble( &t, &d );
#endif
MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WTIME); MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_WTIME);
return d; return d;
......
...@@ -7,21 +7,9 @@ ...@@ -7,21 +7,9 @@
#if !defined(MPICH_MPIDI_CH3_POST_H_INCLUDED) #if !defined(MPICH_MPIDI_CH3_POST_H_INCLUDED)
#define MPICH_MPIDI_CH3_POST_H_INCLUDED #define MPICH_MPIDI_CH3_POST_H_INCLUDED
#if 1 /* for rdtsc timer */
#define MPIDI_CH3_Progress_start(progress_state_) \
(progress_state_)->ch.completion_count = OPA_load_int(&MPIDI_CH3I_progress_completion_count); \
rdtsc_prog_start = MPI_rdtsc_light();
#define MPIDI_CH3_Progress_end(progress_state_) \
rdtsc_prog_end = MPI_rdtsc_light(); \
if (rdtsc_prog_end < rdtsc_prog_start) \
rdtsc_wait_sum += ((rdtsc_prog_end - rdtsc_prog_start) & ((1ULL << 48) - 1)); \
else \
rdtsc_wait_sum += (rdtsc_prog_end - rdtsc_prog_start);
#else
#define MPIDI_CH3_Progress_start(progress_state_) \ #define MPIDI_CH3_Progress_start(progress_state_) \
(progress_state_)->ch.completion_count = OPA_load_int(&MPIDI_CH3I_progress_completion_count); (progress_state_)->ch.completion_count = OPA_load_int(&MPIDI_CH3I_progress_completion_count);
#define MPIDI_CH3_Progress_end(progress_state_) #define MPIDI_CH3_Progress_end(progress_state_)
#endif
enum { enum {
MPIDI_CH3_start_packet_handler_id = 128, MPIDI_CH3_start_packet_handler_id = 128,
......
...@@ -22,27 +22,6 @@ int MPID_Finalize(void) ...@@ -22,27 +22,6 @@ int MPID_Finalize(void)
MPIDI_FUNC_ENTER(MPID_STATE_MPID_FINALIZE); MPIDI_FUNC_ENTER(MPID_STATE_MPID_FINALIZE);
#if 1 /* for rdtsc timer */
{ /* MPID_Wtime_init */
unsigned long long t1, t2;
struct timeval tv1, tv2;
double td1, td2, nsec_per_tick;
gettimeofday(&tv1, NULL);
t1 = MPI_rdtsc_light();
usleep(250000);
gettimeofday(&tv2, NULL);
t2 = MPI_rdtsc_light();
td1 = (tv1.tv_sec * 1000000.0 + tv1.tv_usec) * 1000;
td2 = (tv2.tv_sec * 1000000.0 + tv2.tv_usec) * 1000;
nsec_per_tick = (td2 - td1) / (double)(t2 - t1);
printf("[%2d] : %llu(tick) * %f(nsec/tick) = %f(msec)\n", MPIDI_Process.my_pg_rank, rdtsc_wait_sum, nsec_per_tick, rdtsc_wait_sum * nsec_per_tick / 1000000.0);
}
#endif
/* /*
* Wait for all posted receives to complete. For now we are not doing * Wait for all posted receives to complete. For now we are not doing
* this since it will cause invalid programs to hang. * this since it will cause invalid programs to hang.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment