intro_timing

Date:

10-12-2011

NAME

INTRO_TIMING - Lists library routines that retrieve timing information

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

A variety of library routines are available to retrieve timing information. These routines use the real-time clock (RT) as well as information from the kernel.

CPU TIMING

The following routines are appropriate for retrieving elapsed CPU timing information:

  • cpu_time() for Fortran

  • second() for Fortran

  • getrusage() for C

  • times() for C

  • The cpu_time() intrinsic subroutine is defined by the Fortran standard. It returns the user CPU time as a floating point value. See the cpu_time(3i) man page.

  • The second() intrinsic function is an extension to the Fortran standard. It returns the elapsed CPU time as a floating point value. See the second(3f) man page.

  • The getrusage() system call retrieves information about the user time and the system time. The getrusage() system call is described in X/OPEN. See the getrusage(2) man page.

  • The times() system call retrieves the CPU time for the process and its child processes. The time is split into user CPU time and system CPU time. The times() system call is described in POSIX.1. See the times(2) man page.

WALL CLOCK TIMING

The following routines retrieve wall clock timing information:

  • system_clock() for Fortran

  • clock() for C

  • rtc() for Fortran

  • _rtc() for C

  • irtc() for Fortran

  • second() for Fortran

  • secondr() for Fortran

  • timef() for Fortran

  • The system_clock() intrinsic subroutine is defined by the Fortran standard and returns the numeric data from a real-time clock. The compiler generates inline code for this routine. To provide greater portability, a Fortran program should use system_clock() for wall clock timing. See the system_clock(3i) man page.

  • The clock() function is used to measure intervals of execution time and is defined by the ANSI C standard. It returns the amount of CPU time used. See the clock(3c) man page.

  • The rtc() and _rtc() routines return the value of the real-time clock as a floating point value, whereas irtc() returns an integer value. Use a 64-bit integer for the clock value. The irtc() and rtc() routines are extensions to the Fortran standard. They may be handled as inline intrinsic functions by the Fortran and C compilers. See the rtc(3i) man page.

  • The second() routine returns the elapsed user CPU time in seconds for the current program as a floating point value. The second() routine is an extension to the Fortran standard. See the second(3f) man page.

  • The secondr() routine returns the value of the real-time clock as a floating point value. This is an extension to the Fortran standard. See the secondr(3f) man page.

  • The timef() routine returns a floating point value representing the elapsed wall-clock time from RT in milliseconds since the initial call to timef(). This is an extension to the Fortran standard. See the timef(3f) man page.

TIME-OF-DAY TIMING

The following routines retrieve time-of-day information:

  • gettimeofday() for C

  • date_and_time() for Fortran

  • The gettimeofday() function is described in POSIX.1 and retrieves the time of day in seconds and microseconds. See the gettimeofday(3) man page.

  • The date_and_time() subroutine is described in the Fortran standard. See the date_and_time(3i) man page.

SEE ALSO

getrusage(2), times(2)

gettimeofday(3)

clock(3c)

second(3f), secondr(3f), timef(3f)

cpu_time(3i), date_and_time(3i), rtc(3i), system_clock(3i)

Cray Fortran Reference Manual

Cray C and C++ Reference Manual