Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
doku:papi_ll_fortran [2016/07/05 12:48] – ir | doku:papi_ll_fortran [2016/07/05 12:50] (current) – ir | ||
---|---|---|---|
Line 1: | Line 1: | ||
==== Interfacing with PAPI : Low level interface for Fortran ==== | ==== Interfacing with PAPI : Low level interface for Fortran ==== | ||
| | ||
+ | |||
| | ||
| | ||
Line 103: | Line 104: | ||
stop | stop | ||
endif | endif | ||
+ | |||
+ | END PROGRAM | ||
- | ====== d ====== | ||
- | < | ||
- | PROGRAM testpapi | ||
- | include ' | ||
- | integer check, evntst | ||
- | integer*8 t0, t1, c0, c1, value | ||
- | check = PAPI_NULL | ||
- | C | ||
- | C PAPI Initialization | ||
- | C | ||
- | check = PAPI_VER_CURRENT | ||
- | call PAPIF_library_init(check) | ||
- | if (check.ne.PAPI_VER_CURRENT) then | ||
- | | ||
- | | ||
- | stop | ||
- | endif | ||
- | C | ||
- | C PAPI Event Set Creation | ||
- | C | ||
- | evntst = PAPI_NULL | ||
- | call PAPIF_create_eventset(evntst, | ||
- | if (check.ne.PAPI_OK) then | ||
- | | ||
- | | ||
- | stop | ||
- | endif | ||
- | C | ||
- | C PAPI Specify a Particular Target Event to Analyze | ||
- | C PAPI_TOT_CYC | ||
- | C PAPI_FP_OPS | ||
- | C PAPI_L1_DCM | ||
- | C PAPI_L2_DCM | ||
- | C for other events see | ||
- | C / | ||
- | C | ||
- | call PAPIF_add_event(evntst, | ||
- | if (check.ne.PAPI_OK) then | ||
- | | ||
- | | ||
- | stop | ||
- | endif | ||
- | C | ||
- | C PAPI Time Estimators Initialization | ||
- | C | ||
- | call PAPIF_get_real_usec(t0) | ||
- | call PAPIF_get_real_cyc(c0) | ||
- | C | ||
- | C PAPI Counting Start | ||
- | C | ||
- | call PAPIF_start(evntst, | ||
- | if (check.ne.PAPI_OK) then | ||
- | | ||
- | | ||
- | stop | ||
- | endif | ||
- | |||
- | C | ||
- | C *** Here follows the original code section to be analyzed *** | ||
- | C | ||
- | |||
- | C | ||
- | C PAPI Counting Stop | ||
- | C | ||
- | call PAPIF_stop(evntst, | ||
- | if (check.ne.PAPI_OK) then | ||
- | | ||
- | | ||
- | stop | ||
- | endif | ||
- | C | ||
- | C PAPI Time Estimators Stop | ||
- | C | ||
- | call PAPIF_get_real_usec(t1) | ||
- | call PAPIF_get_real_cyc(c1) | ||
- | </ |