mpiwg-tools / tools-issues

Tickets and Wiki for the MPI-Forum Tools Working Group
13 stars 2 forks source link

MPI_T High Resolution Timer #8

Closed kathrynmohror closed 6 years ago

kathrynmohror commented 8 years ago

We want to introduce a new, high resolution timer for tools into MPI. The problem with MPI_Wtime is that the resolution is generally too low to be useful for tools that measure fine-grained activities.

We want to define the timer (and associated "tick" routine to get resolution) such that resolution provided is the highest available on the platform.

jsquyres commented 8 years ago

Isn't this just a quality of implementation issue?

jsquyres commented 8 years ago

Per discussion on the 2016-04-14 teleconf:

mahermanns commented 8 years ago

What if an implementation would return an id that is unique for each independent time source?

This way, a tool could query such id on every process/thread and later check how many independent clock were used and even group processes according to the same clock source. If all processes retrieved the same id there is only one time source in the system, i.e., the time is global.

mahermanns commented 8 years ago

Another thing that arose from the discussion is whether such a new timer would live in the MPIT namespace or should rather be within the MPI namespace to replace MPI_Wtime. Maybe

MPI_Clock_get_time();
MPI_Clock_get_tick();
MPI_Clock_get_id();
mahermanns commented 7 years ago

Chicago meeting notes

Current state of proposal:

MPI_Ticks MPI_Wclock_ticks();
MPI_Ticks MPI_Wclock_ticks_per_second();

with MPI_Ticks being a 64-bit integer.

Straw vote on "Should we pursue this approach"?

Rolf pointed out that this timer should be an interface to the same time source as MPI_Wtime().

jsquyres commented 7 years ago

Is there a summary of your presentation about these interfaces that I can read?

My immediate questions to reading this ticket (which you may have covered in person):

I suggest having a look at POSIX clock_gettime() for inspiration. Time is not simple. 😦

mahermanns commented 7 years ago

Let's see if I can come to some immediate answers on the current state of the proposal

Ticks since when? Some time in the past. The wording would be kept similar to the one for MPI_Wtime().

Are ticks guaranteed to be monotonic? The current proposal would explicitly require the ticks to be monotonic. Actually, @RolfRabenseifner suggested to even have these new calls actually use the same timer that MPI_Wtime() uses. This would imply, through transitivity that the time reported by MPI_Wtime() would be required to be monotonic. @hjelmn pointed out that users actually expect this behavior. The requirement for MPI_Wtime() to return monotonic time would be part of a different ticket, though.

Are ticks_per_second() constant? My understanding at the meeting was that there is consensus on this being true. Also, @hjelmn argued that any reasonably new TSC-based timer is independent of the state of frequency scaling in the processor and will provide constant ticks. We may certainly need to discuss what choices implementations have when such a TSC-based timer is not available.