File: PAPI.m

package info (click to toggle)
papi 5.7.0+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 9,856 kB
  • sloc: ansic: 93,265; fortran: 3,338; xml: 2,460; makefile: 815; sh: 290
file content (84 lines) | stat: -rw-r--r-- 5,253 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
% PAPI Performance API.
%    PAPI provides access to one of 8 Hardware Performance Monitoring functions.
%
%          ctrs = PAPI('num')   - Return the number of hardware counters.
%                 PAPI('start', 'event', ...) - 
%                                 Begin counting the specified events.
%    [val, ...] = PAPI('stop')  - Stop counting and return the current values.
%    [val, ...] = PAPI('read')  - Read the current values of the active counters.
%    [val, ...] = PAPI('accum') - Add the current values of the active counters 
%                                 to the input values.
%                 PAPI('ipc')   - Begin counting instructions.
%           ins = PAPI('ipc')   - Return the number of instructions executed
%                                 since the first call.
%    [ins, ipc] = PAPI('ipc')   - Return both the total number of instructions 
%                                 executed since the first call, and the 
%                                 incremental rate of instruction execution
%                                 since the last call.
%                 PAPI('flips')
%                 PAPI('flops') - Begin counting floating point 
%                                 instructions or operations.
%           ins = PAPI('flips')
%           ops = PAPI('flops') - Return the number of floating point instruc-
%                                 tions or operations since the first call.
%      [ins, mflips] = PAPI('flips')
%      [ops, mflops] = PAPI('flops') - 
%                                 Return both the number of floating point 
%                                 instructions or operations since the first  
%                                 call, and the incremental rate of floating  
%                                 point execution since since the last call.
%
%    DESCRIPTION
%    The PAPI function provides access to the PAPI Performance API.
%    PAPI takes advantage of the fact that most modern microprocessors
%    have built-in hardware support for counting a variety of basic operations
%    or events. PAPI uses these counters to track things like instructions 
%    executed, cycles elapsed, floating point instructions performed and 
%    a variety of other events.
%
%    There are 8 subfunctions within the PAPI call, as described below:
%      'num'   - provides information on the number of hardware counters built  
%                into this platform. The result of this call specifies how many  
%                events can be counted at once.
%      'start' - programs the counters with the named events and begins 
%                counting. The names of the events can be found in the PAPI
%                documentation. If a named event cannot be found, or cannot
%                be mapped, an error message is displayed.
%      'stop'  - stops counting and returns the values of the counters in the
%                same order as events were specified in the start command. 
%                'stop' also can be used to reset the counters for the ipc
%                flips and flops subfunctions described below.
%      'read'  - return the values of the counters without stopping them.
%      'accum' - adds the values of the counters to the input parameters and
%                returns them in the output parameters. Counting is not stopped.
%      'ipc'   - returns the total instructions executed since the first call 
%                to this subfunction, and the rate of execution of instructions  
%                (as instructions per cycle) since the last call.
%      'flips' - returns the total floating point instructions executed since 
%                the first call to this subfunction, and the rate of execution 
%                of floating point instructions (as mega-floating point
%                instructions per second, or mflips) since the last call.
%                A floating point instruction is defined as whatever this cpu
%                naturally counts as floating point instructions.
%      'flops' - identical to 'flips', except it measures floating point
%                operations rather than instructions. In many cases these two
%                counts may be identical. In some cases 'flops' will be a 
%                derived value that attempts to reproduce that which is
%                traditionally considered a floating point operation. For
%                example, a fused multiply-add would be counted as two
%                operations, even if it was only a single instruction.
%
%    In typical usage, the first five subfunctions: 'num', 'start', 'stop',
%    'read', and 'accum' are used together. 'num establishes the maximum number
%    of events that can be supplied to 'start'. After a 'start' is issued, 
%    'read' and 'accum' can be intermixed until a 'stop' is issued.
%
%    The three rate calls, 'ipc', 'flips', and 'flops' are intended to be used
%    independently. They cannot be mixed, because they use the same counter
%    resources. They can be used serially if they are separated by a 'stop'
%    call, which can also be used to reset the counters.
%
%   Copyright 2001 - 2004 The Innovative Computing Laboratory,
%                               University of Tennessee.
%   $Revision$  $Date$