pxftimes

Date:

10-20-2011

NAME

PXFTIMES - Gets process times

SYNOPSIS

INTEGER jtms, itime, ierror
CALL PXFTIMES(jtms,, itime,ierror)

IMPLEMENTATION

Cray Linux Environment (CLE)

STANDARDS

IEEE Std 1003.9-1992 standard interface for FORTRAN 77

DESCRIPTION

The PXFTIMES subroutine uses the times(2) system call to access system and user CPU time and wall-clock time for the current process and any child processes.

Components of the tms structure are:

tms_utime

User CPU time

tms_stime

System CPU time

tms_cutime

User CPU time of terminated child processes

tms_cstime

System CPU time of terminated child processes

The processing time for a child process is included in the tms_cutime and tms_cstime elements of the tms structure when the parent process waits for child process termination.

All arguments must be of default kind unless documented otherwise. Default kind is KIND=4 for integer, real, complex, and logical arguments.

The following is a list of valid arguments for this routine:

jtms,

A handle of type tms created with PXFSTRUCTCREATE(3F).

itime

An output integer variable for the number of system hardware clock ticks since some arbitrary point in the past (for example, system startup time). This point does not change from one invocation to another during the execution of the process.

ierror

An output integer variable that contains zero if PXFTIMES was successful or nonzero if PXFTIMES was not successful.

EXAMPLES

This example shows how to use the PXFTIMES routine to retrieve system and user CPU time information since the beginning of process execution.

      program testpxf
      integer itime, jtms, ierror, itmp
c create the tms struct
      call PXFSTRUCTCREATE('tms',jtms,ierror)
      print *,'structcreate error = ',ierror
c call PXFTIMES and print out returned information
      call PXFTIMES(jtms,itime,ierror)
      print *,'time = ',itime
      call PXFINTGET(jtms,'tms_utime',itmp,ierror)
      print *,'tms_utime = ',itmp,' ',ierror
      call PXFINTGET(jtms,'tms_stime',itmp,ierror)
      print *,'tms_stime = ',itmp,' ',ierror
      call PXFINTGET(jtms,'tms_cutime',itmp,ierror)
      print *,'tms_cutime = ',itmp,' ',ierror
      call PXFINTGET(jtms,'tms_cstime',itmp,ierror)
      print *,'tms_cstime = ',itmp,' ',ierror
c free the tms struct
      call PXFSTRUCTFREE(jtms,ierror)
      end

SEE ALSO

times(2)

PXFSTRUCTCREATE(3F)