1PAPIF(3) PAPI PAPIF(3)
2
3
4
6 PAPIF - Performance Application Programming Interface (Fortran)
7
8
10 #include fpapi.h
11 call PAPIF_function_name(arg1,arg2,...,check")
12
13
14
16 Fortran Calling Interface The PAPI library comes with a specific For‐
17 tran library interface. The Fortran interface covers the complete
18 library with a few minor exceptions. Functions returning C pointers to
19 structures, such as PAPI_get_opt(3) and PAPI_get_executable_info(3) ,
20 are either not implemented in the Fortran interface, or implemented
21 with different calling semantics.
22
23 Semantics for specific functions in the Fortran interface are docu‐
24 mented on the equivalent C man page. For example, the semantics and
25 functionality of PAPIF_accum are covered in the PAPI_accum(3) man page.
26
27 For most architectures the following relation holds between the pseudo-
28 types listed and Fortran variable types.
29
30
31 ┌───────────────┬──────────────────────────────┬───────────────────────┐
32 │ Pseuodo-type │ Fortran type │ Description │
33 │C_INT │ INTEGER │ Default Integer type │
34 │C_FLOAT │ REAL │ Default Real type │
35 │C_LONG_LONG │ INTEGER*8 │ Extended size integer │
36 │C_STRING │ CHARACTER*(PAPI_MAX_STR_LEN) │ Fortran string │
37 │C_INT FUNCTION │ EXTERNAL INTEGER FUNCTION │ Fortran function │
38 │ │ │ returning integer │
39 │ │ │ result │
40 │C_INT(*) │ Array of corresponding type │ C_TYPE(*) refers to │
41 │C_FLOAT(*) │ │ an array of the cor‐ │
42 │C_LONG_LONG(*) │ │ responding Fortan │
43 │ │ │ type. The length of │
44 │ │ │ the array needed is │
45 │ │ │ context dependent. It │
46 │ │ │ may be e.g. │
47 │ │ │ PAPI_MAX_HWCTRS or │
48 │ │ │ PAPIF_num_counters. │
49 └───────────────┴──────────────────────────────┴───────────────────────┘
50
51 Array arguments must be of sufficent size to hold the input/output
52 from/to the subroutine for predictable behavior. The array length is
53 indicated either by the accompanying argument or by internal PAPI defi‐
54 nitions. For details on this see the corresponding C routine.
55
56 Subroutines accepting C_STRING as an argument are on most implementa‐
57 tions capable of reading the character string length as provided by
58 Fortran. In these implementations the string is truncated or space
59 padded as necessary. For other implementations the length of the char‐
60 acter array is assumed to be of sufficient size. No character string
61 longer than PAPI_MAX_STR_LEN is returned by the PAPIF interface.
62
63
65 The return code of the corresponding C routine is returned in the argu‐
66 ment check in the Fortran interface.
67
68
70 The PAPI Interface: PAPI(3)
71
72
73
74PAPI Programmer's Reference September, 2004 PAPIF(3)