NAME

PAPI_get_virt_cyc, PAPI_get_virt_usec - get virtual time counter values

CONTENTS

Synopsis
Description
Errors
Example
Author
Bugs
See Also

SYNOPSIS

C Interface

#include <papi.h> 

long_long PAPI_get_virt_cyc(void); 

long_long PAPI_get_virt_usec(void); 

Fortran Interface

#include fpapi.h 

PAPIF_get_virt_usec(C_LONG_LONG time) 

PAPIF_get_virt_cyc(C_LONG_LONG virt_cyc) 

PAPI_get_virt_cyc (3) 

DESCRIPTION

Both of these functions return the total number of virtual units from some arbitrary starting point. Virtual units accrue every time the process is running in user-mode on behalf of the process. Like the real time counters, these are guaranteed to exist on every platform PAPI supports. However on some platforms, the resolution can be as bad as 1/Hz as defined by the operating system.

ERRORS

These functions always succeed.

EXAMPLE


long_long s, e;
        
if (PAPI_library_init(PAPI_VER_CURRENT) != PAPI_VER_CURRENT)
  exit(1);

s = PAPI_get_virt_cyc();

your_slow_code();

e = PAPI_get_virt_cyc(); printf("Process has run for cycles: %lld\n",e-s);

AUTHOR

Philip J. Mucci <mucci@cs.utk.edu>

BUGS

This function has no known bugs.

SEE ALSO

PAPI_library_init (3), PAPI_get_real_usec (3), PAPI_get_real_cyc (3),
The PAPI Web Site: http://icl.cs.utk.edu/projects/papi


PAPI Function Reference PAPI_get_virt_cyc (3) December, 2001

  Innovative Computing Laboratory
2001 R&D Winner  
Contact PAPI: papi@cs.utk.edu Computer Science Department
  University of Tennessee