PAPI 7.1.0.0
Loading...
Searching...
No Matches
papi_fwrappers.c File Reference
Include dependency graph for papi_fwrappers.c:

Go to the source code of this file.

Macros

#define PAPI_FCALL(function, caps, args)   void function args
 

Functions

 PAPI_FCALL (papif_accum, PAPIF_ACCUM,(int *EventSet, long long *values, int *check))
 
 PAPI_FCALL (papif_add_event, PAPIF_ADD_EVENT,(int *EventSet, int *Event, int *check))
 
 PAPI_FCALL (papif_add_named_event, PAPIF_ADD_NAMED_EVENT,(int *EventSet, char *EventName, int *check))
 
 PAPI_FCALL (papif_add_events, PAPIF_ADD_EVENTS,(int *EventSet, int *Events, int *number, int *check))
 
 PAPI_FCALL (papif_cleanup_eventset, PAPIF_CLEANUP_EVENTSET,(int *EventSet, int *check))
 
 PAPI_FCALL (papif_create_eventset, PAPIF_CREATE_EVENTSET,(int *EventSet, int *check))
 
 PAPI_FCALL (papif_assign_eventset_component, PAPIF_ASSIGN_EVENTSET_COMPONENT,(int *EventSet, int *cidx, int *check))
 
 PAPI_FCALL (papif_destroy_eventset, PAPIF_DESTROY_EVENTSET,(int *EventSet, int *check))
 
 PAPI_FCALL (papif_get_dmem_info, PAPIF_GET_DMEM_INFO,(long long *dest, int *check))
 
 PAPI_FCALL (papif_get_exe_info, PAPIF_GET_EXE_INFO,(char *fullname, char *name, long long *text_start, long long *text_end, long long *data_start, long long *data_end, long long *bss_start, long long *bss_end, int *check))
 
 PAPI_FCALL (papif_get_hardware_info, PAPIF_GET_HARDWARE_INFO,(int *ncpu, int *nnodes, int *totalcpus, int *vendor, char *vendor_string, int *model, char *model_string, float *revision, float *mhz))
 
 PAPI_FCALL (papif_num_cmp_hwctrs, PAPIF_num_cmp_hwctrs,(int *cidx, int *num))
 
 PAPI_FCALL (papif_thread_init, PAPIF_THREAD_INIT,(unsigned long int(*handle)(void), int *check))
 
 PAPI_FCALL (papif_list_events, PAPIF_LIST_EVENTS,(int *EventSet, int *Events, int *number, int *check))
 
 PAPI_FCALL (papif_get_multiplex, PAPIF_GET_MULTIPLEX,(int *EventSet, int *check))
 
 PAPI_FCALL (papif_set_multiplex, PAPIF_SET_MULTIPLEX,(int *EventSet, int *check))
 
 PAPI_FCALL (papif_perror, PAPIF_PERROR,(char *message))
 
 PAPI_FCALL (papif_query_event, PAPIF_QUERY_EVENT,(int *EventCode, int *check))
 
 PAPI_FCALL (papif_query_named_event, PAPIF_QUERY_NAMED_EVENT,(char *EventName, int *check))
 
 PAPI_FCALL (papif_get_event_info, PAPIF_GET_EVENT_INFO,(int *EventCode, char *symbol, char *long_descr, char *short_descr, int *count, char *event_note, int *flags, int *check))
 
 PAPI_FCALL (papif_event_code_to_name, PAPIF_EVENT_CODE_TO_NAME,(int *EventCode, char *out, int *check))
 
 PAPI_FCALL (papif_event_name_to_code, PAPIF_EVENT_NAME_TO_CODE,(char *in, int *out, int *check))
 
 PAPI_FCALL (papif_enum_event, PAPIF_ENUM_EVENT,(int *EventCode, int *modifier, int *check))
 
 PAPI_FCALL (papif_read, PAPIF_READ,(int *EventSet, long long *values, int *check))
 
 PAPI_FCALL (papif_read_ts, PAPIF_READ_TS,(int *EventSet, long long *values, long long *cycles, int *check))
 
 PAPI_FCALL (papif_remove_event, PAPIF_REMOVE_EVENT,(int *EventSet, int *Event, int *check))
 
 PAPI_FCALL (papif_remove_named_event, PAPIF_REMOVE_NAMED_EVENT,(int *EventSet, char *EventName, int *check))
 
 PAPI_FCALL (papif_remove_events, PAPIF_REMOVE_EVENTS,(int *EventSet, int *Events, int *number, int *check))
 
 PAPI_FCALL (papif_set_cmp_domain, PAPIF_SET_CMP_DOMAIN,(int *domain, int *cidx, int *check))
 
 PAPI_FCALL (papif_set_granularity, PAPIF_SET_GRANULARITY,(int *granularity, int *check))
 
 PAPI_FCALL (papif_set_cmp_granularity, PAPIF_SET_CMP_GRANULARITY,(int *granularity, int *cidx, int *check))
 
 PAPI_FCALL (papif_state, PAPIF_STATE,(int *EventSet, int *status, int *check))
 
 PAPI_FCALL (papif_stop, PAPIF_STOP,(int *EventSet, long long *values, int *check))
 
 PAPI_FCALL (papif_write, PAPIF_WRITE,(int *EventSet, long long *values, int *check))
 
 PAPI_FCALL (papif_lock, PAPIF_LOCK,(int *lock, int *check))
 
 PAPI_FCALL (papif_unlock, PAPIF_unlock,(int *lock, int *check))
 
 PAPI_FCALL (papif_get_preload, PAPIF_GET_PRELOAD,(char *lib_preload_env, int *check))
 
 PAPI_FCALL (papif_get_granularity, PAPIF_GET_GRANULARITY,(int *eventset, int *granularity, int *mode, int *check))
 
 PAPI_FCALL (papif_get_domain, PAPIF_GET_DOMAIN,(int *eventset, int *domain, int *mode, int *check))
 
 PAPI_FCALL (papif_set_event_domain, PAPIF_SET_EVENT_DOMAIN,(int *es, int *domain, int *check))
 
 PAPI_FCALL (papif_ipc, PAPIF_IPC,(float *rtime, float *ptime, long long *ins, float *ipc, int *check))
 
 PAPI_FCALL (papif_epc, PAPIF_EPC,(int event, float *rtime, float *ptime, long long *ref, long long *core, long long *evt, float *epc, int *check))
 
 PAPI_FCALL (papif_flips_rate, PAPIF_FLIPS_RATE,(int event, float *real_time, float *proc_time, long long *flpins, float *mflips, int *check))
 
 PAPI_FCALL (papif_flops_rate, PAPIF_FLOPS_RATE,(int event, float *real_time, float *proc_time, long long *flpops, float *mflops, int *check))
 
 PAPI_FCALL (papif_rate_stop, PAPIF_RATE_STOP,(int *check))
 
 PAPI_FCALL (papif_get_dev_type_attr, PAPIF_GET_DEV_TYPE_ATTR,(int *handle_index, int *attribute, int *value, char *string, int *check))
 
 PAPI_FCALL (papif_get_dev_attr, PAPIF_GET_DEV_ATTR,(int *handle_index, int *id, int *attribute, int *value, char *string, int *check))
 
 PAPI_FCALL (papif_hl_region_begin, PAPIF_HL_REGION_BEGIN,(char *name, int *check))
 
 PAPI_FCALL (papif_hl_read, PAPIF_HL_READ,(char *name, int *check))
 
 PAPI_FCALL (papif_hl_region_end, PAPIF_HL_REGION_END,(char *name, int *check))
 
 PAPI_FCALL (papif_hl_stop, PAPIF_HL_STOP,(int *check))
 

Variables

i inherit inherit = *inherit
 
check = PAPI_set_opt( PAPI_INHERIT, &i )
 
static void * sysdetect_fort_handle
 
handle_index = 0
 

Macro Definition Documentation

◆ PAPI_FCALL

#define PAPI_FCALL (   function,
  caps,
  args 
)    void function args

Definition at line 37 of file papi_fwrappers.c.

Function Documentation

◆ PAPI_FCALL() [1/51]

PAPI_FCALL ( papif_accum  ,
PAPIF_ACCUM  ,
(int *EventSet, long long *values, int *check  
)

Definition at line 78 of file papi_fwrappers.c.

80{
82}
Accumulate and reset counters in an EventSet.
static int EventSet
Definition: init_fini.c:8
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
* check

◆ PAPI_FCALL() [2/51]

PAPI_FCALL ( papif_add_event  ,
PAPIF_ADD_EVENT  ,
(int *EventSet, int *Event, int *check  
)

Definition at line 94 of file papi_fwrappers.c.

96{
98}
static int Event[MAX_EVENTS]
add PAPI preset or native hardware event to an event set

◆ PAPI_FCALL() [3/51]

PAPI_FCALL ( papif_add_events  ,
PAPIF_ADD_EVENTS  ,
(int *EventSet, int *Events, int *number, int *check  
)

Definition at line 136 of file papi_fwrappers.c.

138{
139 *check = PAPI_add_events( *EventSet, Events, *number );
140}
add multiple PAPI presets or native hardware events to an event set

◆ PAPI_FCALL() [4/51]

PAPI_FCALL ( papif_add_named_event  ,
PAPIF_ADD_NAMED_EVENT  ,
(int *EventSet, char *EventName, int *check  
)

Definition at line 119 of file papi_fwrappers.c.

121{
122 *check = PAPI_add_named_event( *EventSet, EventName );
123}
add PAPI preset or native hardware event by name to an EventSet

◆ PAPI_FCALL() [5/51]

PAPI_FCALL ( papif_assign_eventset_component  ,
PAPIF_ASSIGN_EVENTSET_COMPONENT  ,
(int *EventSet, int *cidx, int *check  
)

Definition at line 184 of file papi_fwrappers.c.

186{
188}
Assign a component index to an existing but empty EventSet.
static int cidx

◆ PAPI_FCALL() [6/51]

PAPI_FCALL ( papif_cleanup_eventset  ,
PAPIF_CLEANUP_EVENTSET  ,
(int *EventSet, int *check  
)

Definition at line 152 of file papi_fwrappers.c.

154{
156}
Empty and destroy an EventSet.

◆ PAPI_FCALL() [7/51]

PAPI_FCALL ( papif_create_eventset  ,
PAPIF_CREATE_EVENTSET  ,
(int *EventSet, int *check  
)

Definition at line 168 of file papi_fwrappers.c.

170{
172}
Create a new empty PAPI EventSet.

◆ PAPI_FCALL() [8/51]

PAPI_FCALL ( papif_destroy_eventset  ,
PAPIF_DESTROY_EVENTSET  ,
(int *EventSet, int *check  
)

Definition at line 200 of file papi_fwrappers.c.

202{
204}
Empty and destroy an EventSet.

◆ PAPI_FCALL() [9/51]

PAPI_FCALL ( papif_enum_event  ,
PAPIF_ENUM_EVENT  ,
(int *EventCode, int *modifier, int *check  
)

Definition at line 866 of file papi_fwrappers.c.

868{
869 *check = PAPI_enum_event( EventCode, *modifier );
870}
Enumerate PAPI preset or native events.

◆ PAPI_FCALL() [10/51]

PAPI_FCALL ( papif_epc  ,
PAPIF_EPC  ,
(int event, float *rtime, float *ptime, long long *ref, long long *core, long long *evt, float *epc, int *check  
)

Definition at line 1355 of file papi_fwrappers.c.

1359{
1360 *check = PAPI_epc( event, rtime, ptime, ref, core, evt, epc );
1361}
Simplified call to get arbitrary events per cycle, real and processor time.

◆ PAPI_FCALL() [11/51]

PAPI_FCALL ( papif_event_code_to_name  ,
PAPIF_EVENT_CODE_TO_NAME  ,
(int *EventCode, char *out, int *check  
)

Definition at line 782 of file papi_fwrappers.c.

785{
786#if defined(_FORTRAN_STRLEN_AT_END)
787 char tmp[PAPI_MAX_STR_LEN];
788 int i;
789 *check = PAPI_event_code_to_name( *EventCode, tmp );
790 /* tmp has \0 within PAPI_MAX_STR_LEN chars so strncpy is safe */
791 strncpy( out_str, tmp, ( size_t ) out_len );
792 /* overwrite any NULLs and trailing garbage in out_str */
793 for ( i = ( int ) strlen( tmp ); i < out_len; out_str[i++] = ' ' );
794#else
795 /* The array "out" passed by the user must be sufficiently long */
796 *check = PAPI_event_code_to_name( *EventCode, out );
797#endif
798}
double tmp
int i
Convert a numeric hardware event code to a name.
#define PAPI_MAX_STR_LEN
Definition: f90papi.h:77

◆ PAPI_FCALL() [12/51]

PAPI_FCALL ( papif_event_name_to_code  ,
PAPIF_EVENT_NAME_TO_CODE  ,
(char *in, int *out, int *check  
)

Definition at line 814 of file papi_fwrappers.c.

817{
818#if defined(_FORTRAN_STRLEN_AT_END)
819 int slen, i;
820 char tmpin[PAPI_MAX_STR_LEN];
821
822 /* What is the maximum number of chars to copy ? */
823 slen = in_len < PAPI_MAX_STR_LEN ? in_len : PAPI_MAX_STR_LEN;
824 strncpy( tmpin, in_str, ( size_t ) slen );
825
826 /* Remove trailing blanks from initial Fortran string */
827 for ( i = slen - 1; i > -1 && tmpin[i] == ' '; tmpin[i--] = '\0' );
828
829 /* Make sure string is NULL terminated before call */
830 tmpin[PAPI_MAX_STR_LEN - 1] = '\0';
831 if ( slen < PAPI_MAX_STR_LEN )
832 tmpin[slen] = '\0';
833
834 *check = PAPI_event_name_to_code( tmpin, out );
835#else
836 /* This will have trouble if argument in is not null terminated */
837 *check = PAPI_event_name_to_code( in, out );
838#endif
839}
Convert a name to a numeric hardware event code.

◆ PAPI_FCALL() [13/51]

PAPI_FCALL ( papif_flips_rate  ,
PAPIF_FLIPS_RATE  ,
(int event, float *real_time, float *proc_time, long long *flpins, float *mflips, int *check  
)

Definition at line 1373 of file papi_fwrappers.c.

1376{
1377 *check = PAPI_flips_rate( event, real_time, proc_time, flpins, mflips );
1378}
Simplified call to get Mflips/s (floating point instruction rate), real and processor time.

◆ PAPI_FCALL() [14/51]

PAPI_FCALL ( papif_flops_rate  ,
PAPIF_FLOPS_RATE  ,
(int event, float *real_time, float *proc_time, long long *flpops, float *mflops, int *check  
)

Definition at line 1390 of file papi_fwrappers.c.

1393{
1394 *check = PAPI_flops_rate( event, real_time, proc_time, flpops, mflops );
1395}
Simplified call to get Mflops/s (floating point operation rate), real and processor time.

◆ PAPI_FCALL() [15/51]

PAPI_FCALL ( papif_get_dev_attr  ,
PAPIF_GET_DEV_ATTR  ,
(int *handle_index, int *id, int *attribute, int *value, char *string, int *check  
)

Definition at line 1515 of file papi_fwrappers.c.

1522{
1523 int i;
1524 const char *string_ptr;
1525 *handle_index = 0;
1526 *check = PAPI_OK;
1527
1528 assert(sysdetect_fort_handle);
1529
1530 switch(*attribute) {
1591 *check = PAPI_get_dev_attr(sysdetect_fort_handle, *id, *attribute,
1592 value);
1593 break;
1596 *check = PAPI_get_dev_attr(sysdetect_fort_handle, *id, *attribute,
1597 &string_ptr);
1598 if (*check != PAPI_OK) {
1599 break;
1600 }
1601#if defined(_FORTRAN_STRLEN_AT_END)
1602 strncpy(string, string_ptr, (size_t) string_len);
1603 for ( i = ( int ) strlen(string_ptr); i < PAPI_MAX_STR_LEN;
1604 string[i++] = ' ' );
1605#else
1606 strcpy(string, string_ptr);
1607 for ( i = ( int ) strlen(string_ptr); i < PAPI_MAX_STR_LEN;
1608 string[i++] = ' ' );
1609#endif
1610 break;
1611 default:
1612 *check = PAPI_EINVAL;
1613 }
1614 return;
1615}
returns device attributes
#define PAPI_DEV_ATTR__ROCM_UINT_WG_DIM_Y
Definition: f90papi.h:169
#define PAPI_DEV_ATTR__CUDA_UINT_THR_PER_BLK
Definition: f90papi.h:226
#define PAPI_DEV_ATTR__CUDA_UINT_WARP_SIZE
Definition: f90papi.h:114
#define PAPI_DEV_ATTR__CPU_UINT_L1D_CACHE_LINE_COUNT
Definition: f90papi.h:32
#define PAPI_DEV_ATTR__ROCM_UINT_GRD_DIM_Y
Definition: f90papi.h:258
#define PAPI_DEV_ATTR__ROCM_UINT_WAVE_PER_CU
Definition: f90papi.h:163
#define PAPI_DEV_ATTR__CUDA_UINT_BLK_PER_SM
Definition: f90papi.h:156
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_DEV_ATTR__CUDA_ULONG_UID
Definition: f90papi.h:192
#define PAPI_DEV_ATTR__CPU_UINT_FAMILY
Definition: f90papi.h:142
#define PAPI_DEV_ATTR__CPU_UINT_SOCKET_COUNT
Definition: f90papi.h:125
#define PAPI_DEV_ATTR__CPU_UINT_THR_PER_NUMA
Definition: f90papi.h:155
#define PAPI_DEV_ATTR__CPU_UINT_L1I_CACHE_LINE_SIZE
Definition: f90papi.h:213
#define PAPI_DEV_ATTR__CUDA_UINT_BLK_DIM_Z
Definition: f90papi.h:117
#define PAPI_DEV_ATTR__ROCM_UINT_WAVEFRONT_SIZE
Definition: f90papi.h:252
#define PAPI_DEV_ATTR__CUDA_UINT_UNIFIED_ADDR
Definition: f90papi.h:279
#define PAPI_DEV_ATTR__CUDA_UINT_SM_COUNT
Definition: f90papi.h:249
#define PAPI_DEV_ATTR__CPU_UINT_L3U_CACHE_ASSOC
Definition: f90papi.h:35
#define PAPI_DEV_ATTR__CUDA_UINT_GRD_DIM_Y
Definition: f90papi.h:106
#define PAPI_DEV_ATTR__CPU_UINT_L1I_CACHE_SIZE
Definition: f90papi.h:251
#define PAPI_DEV_ATTR__CPU_UINT_L3U_CACHE_LINE_SIZE
Definition: f90papi.h:128
#define PAPI_DEV_ATTR__CPU_UINT_THREAD_COUNT
Definition: f90papi.h:181
#define PAPI_DEV_ATTR__CPU_UINT_NUMA_COUNT
Definition: f90papi.h:18
#define PAPI_DEV_ATTR__CPU_UINT_L1I_CACHE_LINE_COUNT
Definition: f90papi.h:56
#define PAPI_DEV_ATTR__CUDA_UINT_MANAGED_MEM
Definition: f90papi.h:183
#define PAPI_DEV_ATTR__CPU_UINT_L3U_CACHE_SIZE
Definition: f90papi.h:259
#define PAPI_DEV_ATTR__ROCM_UINT_COMP_CAP_MINOR
Definition: f90papi.h:228
#define PAPI_EINVAL
Definition: f90papi.h:115
#define PAPI_DEV_ATTR__CPU_UINT_L2U_CACHE_SIZE
Definition: f90papi.h:31
#define PAPI_DEV_ATTR__CUDA_UINT_BLK_DIM_Y
Definition: f90papi.h:217
#define PAPI_DEV_ATTR__ROCM_CHAR_DEVICE_NAME
Definition: f90papi.h:84
#define PAPI_DEV_ATTR__CUDA_UINT_SHM_PER_BLK
Definition: f90papi.h:216
#define PAPI_DEV_ATTR__ROCM_UINT_WORKGROUP_SIZE
Definition: f90papi.h:118
#define PAPI_DEV_ATTR__CPU_UINT_L2U_CACHE_LINE_COUNT
Definition: f90papi.h:15
#define PAPI_DEV_ATTR__ROCM_UINT_COMP_CAP_MAJOR
Definition: f90papi.h:34
#define PAPI_DEV_ATTR__CPU_CHAR_NAME
Definition: f90papi.h:246
#define PAPI_DEV_ATTR__CUDA_UINT_GRD_DIM_X
Definition: f90papi.h:42
#define PAPI_DEV_ATTR__ROCM_ULONG_UID
Definition: f90papi.h:28
#define PAPI_DEV_ATTR__CPU_UINT_L3U_CACHE_LINE_COUNT
Definition: f90papi.h:182
#define PAPI_DEV_ATTR__CUDA_UINT_MEMCPY_OVERLAP
Definition: f90papi.h:273
#define PAPI_DEV_ATTR__ROCM_UINT_SHM_PER_WG
Definition: f90papi.h:33
#define PAPI_DEV_ATTR__CUDA_UINT_COMP_CAP_MINOR
Definition: f90papi.h:135
#define PAPI_DEV_ATTR__CUDA_UINT_MAP_HOST_MEM
Definition: f90papi.h:151
#define PAPI_DEV_ATTR__CPU_UINT_L1D_CACHE_ASSOC
Definition: f90papi.h:23
#define PAPI_DEV_ATTR__CUDA_UINT_SHM_PER_SM
Definition: f90papi.h:218
#define PAPI_DEV_ATTR__CPU_UINT_STEPPING
Definition: f90papi.h:153
#define PAPI_DEV_ATTR__ROCM_UINT_CU_COUNT
Definition: f90papi.h:191
#define PAPI_DEV_ATTR__CUDA_UINT_BLK_DIM_X
Definition: f90papi.h:166
#define PAPI_DEV_ATTR__ROCM_UINT_SIMD_PER_CU
Definition: f90papi.h:92
#define PAPI_DEV_ATTR__ROCM_UINT_WG_DIM_X
Definition: f90papi.h:145
#define PAPI_DEV_ATTR__CUDA_UINT_MULTI_KERNEL
Definition: f90papi.h:55
#define PAPI_DEV_ATTR__CPU_UINT_L2U_CACHE_ASSOC
Definition: f90papi.h:207
#define PAPI_DEV_ATTR__CUDA_UINT_GRD_DIM_Z
Definition: f90papi.h:267
#define PAPI_DEV_ATTR__ROCM_UINT_GRD_DIM_X
Definition: f90papi.h:49
#define PAPI_DEV_ATTR__CPU_UINT_L1D_CACHE_SIZE
Definition: f90papi.h:184
#define PAPI_DEV_ATTR__CPU_UINT_MODEL
Definition: f90papi.h:98
#define PAPI_DEV_ATTR__ROCM_UINT_WG_DIM_Z
Definition: f90papi.h:241
#define PAPI_DEV_ATTR__ROCM_UINT_GRD_DIM_Z
Definition: f90papi.h:20
#define PAPI_DEV_ATTR__CPU_UINT_L2U_CACHE_LINE_SIZE
Definition: f90papi.h:232
#define PAPI_DEV_ATTR__CPU_UINT_CORE_COUNT
Definition: f90papi.h:41
#define PAPI_DEV_ATTR__CPU_UINT_L1I_CACHE_ASSOC
Definition: f90papi.h:47
#define PAPI_DEV_ATTR__CPU_UINT_L1D_CACHE_LINE_SIZE
Definition: f90papi.h:205
#define PAPI_DEV_ATTR__CUDA_CHAR_DEVICE_NAME
Definition: f90papi.h:81
#define PAPI_DEV_ATTR__CUDA_UINT_COMP_CAP_MAJOR
Definition: f90papi.h:69
static void * sysdetect_fort_handle
* handle_index

◆ PAPI_FCALL() [16/51]

PAPI_FCALL ( papif_get_dev_type_attr  ,
PAPIF_GET_DEV_TYPE_ATTR  ,
(int *handle_index, int *attribute, int *value, char *string, int *check  
)

Definition at line 1450 of file papi_fwrappers.c.

1456{
1457 const char *string_ptr;
1458 int i;
1459 *handle_index = 0;
1460 *check = PAPI_OK;
1461
1462 assert(sysdetect_fort_handle);
1463
1464 switch(*attribute) {
1469 value);
1470 break;
1474 &string_ptr);
1475 if (*check != PAPI_OK) {
1476 break;
1477 }
1478#if defined(_FORTRAN_STRLEN_AT_END)
1479 strncpy(string, string_ptr, string_len);
1480 for ( i = ( int ) string_len; i < PAPI_MAX_STR_LEN;
1481 string[i++] = ' ' );
1482#else
1483 strcpy(string, string_ptr);
1484 for ( i = ( int ) strlen(string_ptr); i < PAPI_MAX_STR_LEN;
1485 string[i++] = ' ' );
1486#endif
1487 break;
1488 default:
1489 *check = PAPI_EINVAL;
1490 }
1491 *handle_index = 0;
1492 return;
1493}
returns device type attributes
#define PAPI_DEV_TYPE_ATTR__INT_PAPI_ID
Definition: f90papi.h:59
#define PAPI_DEV_TYPE_ATTR__INT_COUNT
Definition: f90papi.h:140
#define PAPI_DEV_TYPE_ATTR__INT_VENDOR_ID
Definition: f90papi.h:116
#define PAPI_DEV_TYPE_ATTR__CHAR_NAME
Definition: f90papi.h:126
#define PAPI_DEV_TYPE_ATTR__CHAR_STATUS
Definition: f90papi.h:239

◆ PAPI_FCALL() [17/51]

PAPI_FCALL ( papif_get_dmem_info  ,
PAPIF_GET_DMEM_INFO  ,
(long long *dest, int *check  
)

Definition at line 217 of file papi_fwrappers.c.

219{
221}
Get information about the dynamic memory usage of the current program.
A pointer to the following is passed to PAPI_get_dmem_info()
Definition: papi.h:865

◆ PAPI_FCALL() [18/51]

PAPI_FCALL ( papif_get_domain  ,
PAPIF_GET_DOMAIN  ,
(int *eventset, int *domain, int *mode, int *check  
)

Definition at line 1260 of file papi_fwrappers.c.

1262{
1263 PAPI_option_t d;
1264
1265 if ( *mode == PAPI_DEFDOM ) {
1266 *domain = PAPI_get_opt( *mode, (PAPI_option_t *) NULL );
1267 *check = PAPI_OK;
1268 } else if ( *mode == PAPI_DOMAIN ) {
1269 d.domain.eventset = *eventset;
1270 if ( ( *check = PAPI_get_opt( *mode, &d ) ) == PAPI_OK ) {
1271 *domain = d.domain.domain;
1272 }
1273 } else {
1274 *check = PAPI_EINVAL;
1275 }
1276}
Get PAPI library or event set options.
#define PAPI_DOMAIN
Definition: f90papi.h:159
#define PAPI_DEFDOM
Definition: f90papi.h:188
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:843
PAPI_domain_option_t domain
Definition: papi.h:849

◆ PAPI_FCALL() [19/51]

PAPI_FCALL ( papif_get_event_info  ,
PAPIF_GET_EVENT_INFO  ,
(int *EventCode, char *symbol, char *long_descr, char *short_descr, int *count, char *event_note, int *flags, int *check  
)

Definition at line 723 of file papi_fwrappers.c.

727{
729 ( void ) flags; /*Unused */
730#if defined(_FORTRAN_STRLEN_AT_END)
731 int i;
732 if ( ( *check = PAPI_get_event_info( *EventCode, &info ) ) == PAPI_OK ) {
733 strncpy( symbol, info.symbol, ( size_t ) symbol_len );
734 for ( i = ( int ) strlen( info.symbol ); i < symbol_len;
735 symbol[i++] = ' ' );
736 strncpy( long_descr, info.long_descr, ( size_t ) long_descr_len );
737 for ( i = ( int ) strlen( info.long_descr ); i < long_descr_len;
738 long_descr[i++] = ' ' );
739 strncpy( short_descr, info.short_descr, ( size_t ) short_descr_len );
740 for ( i = ( int ) strlen( info.short_descr ); i < short_descr_len;
741 short_descr[i++] = ' ' );
742
743 *count = ( int ) info.count;
744
745 int note_len=0;
746
747 strncpy( event_note, info.note, ( size_t ) event_note_len );
748 note_len=strlen(info.note);
749
750 for ( i = note_len; i < event_note_len;
751 event_note[i++] = ' ' );
752 }
753#else
754/* printf("EventCode: %d\n", *EventCode ); -KSL */
755 if ( ( *check = PAPI_get_event_info( *EventCode, &info ) ) == PAPI_OK ) {
756 strncpy( symbol, info.symbol, PAPI_MAX_STR_LEN );
757 strncpy( long_descr, info.long_descr, PAPI_MAX_STR_LEN );
758 strncpy( short_descr, info.short_descr, PAPI_MAX_STR_LEN );
759 *count = info.count;
760 if (info.note)
761 strncpy( event_note, info.note,
763 }
764/* printf("Check: %d\n", *check); -KSL */
765#endif
766}
static long count
Get the event's name and description info.
int
Definition: sde_internal.h:89
unsigned int count
Definition: papi.h:981
char note[PAPI_HUGE_STR_LEN]
Definition: papi.h:1007
char short_descr[PAPI_MIN_STR_LEN]
Definition: papi.h:961
char symbol[PAPI_HUGE_STR_LEN]
Definition: papi.h:960
char long_descr[PAPI_HUGE_STR_LEN]
Definition: papi.h:963

◆ PAPI_FCALL() [20/51]

PAPI_FCALL ( papif_get_exe_info  ,
PAPIF_GET_EXE_INFO  ,
(char *fullname, char *name, long long *text_start, long long *text_end, long long *data_start, long long *data_end, long long *bss_start, long long *bss_end, int *check  
)

Definition at line 243 of file papi_fwrappers.c.

248{
250/* WARNING: The casts from vptr_t to long below WILL BREAK on systems with
251 64-bit addresses. I did it here because I was lazy. And because I wanted
252 to get rid of those pesky gcc warnings. If you find a 64-bit system,
253 conditionalize the cast with (yet another) #ifdef...
254*/
255 if ( ( *check = PAPI_get_opt( PAPI_EXEINFO, &e ) ) == PAPI_OK ) {
256#if defined(_FORTRAN_STRLEN_AT_END)
257 int i;
258 strncpy( fullname, e.exe_info->fullname, ( size_t ) fullname_len );
259 for ( i = ( int ) strlen( e.exe_info->fullname ); i < fullname_len;
260 fullname[i++] = ' ' );
261 strncpy( name, e.exe_info->address_info.name, ( size_t ) name_len );
262 for ( i = ( int ) strlen( e.exe_info->address_info.name ); i < name_len;
263 name[i++] = ' ' );
264#else
265 strncpy( fullname, e.exe_info->fullname, PAPI_MAX_STR_LEN );
267#endif
268 *text_start = ( long ) e.exe_info->address_info.text_start;
269 *text_end = ( long ) e.exe_info->address_info.text_end;
270 *data_start = ( long ) e.exe_info->address_info.data_start;
271 *data_end = ( long ) e.exe_info->address_info.data_end;
272 *bss_start = ( long ) e.exe_info->address_info.bss_start;
273 *bss_end = ( long ) e.exe_info->address_info.bss_end;
274 }
275}
#define PAPI_EXEINFO
Definition: f90papi.h:36
const char * name
Definition: rocs.c:225
long long int long long
Definition: sde_internal.h:85
vptr_t text_start
Definition: papi.h:686
char name[PAPI_HUGE_STR_LEN]
Definition: papi.h:685
vptr_t text_end
Definition: papi.h:687
vptr_t bss_start
Definition: papi.h:690
vptr_t data_end
Definition: papi.h:689
vptr_t data_start
Definition: papi.h:688
vptr_t bss_end
Definition: papi.h:691
char fullname[PAPI_HUGE_STR_LEN]
Definition: papi.h:697
PAPI_address_map_t address_info
Definition: papi.h:698
PAPI_exe_info_t * exe_info
Definition: papi.h:857

◆ PAPI_FCALL() [21/51]

PAPI_FCALL ( papif_get_granularity  ,
PAPIF_GET_GRANULARITY  ,
(int *eventset, int *granularity, int *mode, int *check  
)

Definition at line 1232 of file papi_fwrappers.c.

1234{
1235 PAPI_option_t g;
1236
1237 if ( *mode == PAPI_DEFGRN ) {
1238 *granularity = PAPI_get_opt( *mode, &g );
1239 *check = PAPI_OK;
1240 } else if ( *mode == PAPI_GRANUL ) {
1241 g.granularity.eventset = *eventset;
1242 if ( ( *check = PAPI_get_opt( *mode, &g ) ) == PAPI_OK ) {
1243 *granularity = g.granularity.granularity;
1244 }
1245 } else {
1246 *check = PAPI_EINVAL;
1247 }
1248}
#define PAPI_DEFGRN
Definition: f90papi.h:26
#define PAPI_GRANUL
Definition: f90papi.h:179
PAPI_granularity_option_t granularity
Definition: papi.h:847

◆ PAPI_FCALL() [22/51]

PAPI_FCALL ( papif_get_hardware_info  ,
PAPIF_GET_HARDWARE_INFO  ,
(int *ncpu, int *nnodes, int *totalcpus, int *vendor, char *vendor_string, int *model, char *model_string, float *revision, float *mhz)   
)

Definition at line 304 of file papi_fwrappers.c.

316{
317 const PAPI_hw_info_t *hwinfo;
318 int i;
319 hwinfo = PAPI_get_hardware_info( );
320 if ( hwinfo == NULL ) {
321 *ncpu = 0;
322 *nnodes = 0;
323 *totalcpus = 0;
324 *vendor = 0;
325 *model = 0;
326 *revision = 0;
327 *mhz = 0;
328 } else {
329 *ncpu = hwinfo->ncpu;
330 *nnodes = hwinfo->nnodes;
331 *totalcpus = hwinfo->totalcpus;
332 *vendor = hwinfo->vendor;
333 *model = hwinfo->model;
334 *revision = hwinfo->revision;
335 *mhz = hwinfo->cpu_max_mhz;
336#if defined(_FORTRAN_STRLEN_AT_END)
337 strncpy( vendor_str, hwinfo->vendor_string, ( size_t ) vendor_len );
338 for ( i = ( int ) strlen( hwinfo->vendor_string ); i < vendor_len;
339 vendor_str[i++] = ' ' );
340 strncpy( model_str, hwinfo->model_string, ( size_t ) model_len );
341 for ( i = ( int ) strlen( hwinfo->model_string ); i < model_len;
342 model_str[i++] = ' ' );
343#else
344 (void)i; /* unused... */
345 /* This case needs the passed strings to be of sufficient size *
346 * and will include the NULL character in the target string */
347 strcpy( vendor_string, hwinfo->vendor_string );
348 strcpy( model_string, hwinfo->model_string );
349#endif
350 }
351 return;
352}
get information about the system hardware
int model
Definition: pfmlib_amd64.c:86
amd64_rev_t revision
Definition: pfmlib_amd64.c:81
Hardware info structure.
Definition: papi.h:774
char vendor_string[PAPI_MAX_STR_LEN]
Definition: papi.h:782
int nnodes
Definition: papi.h:779
int model
Definition: papi.h:783
int totalcpus
Definition: papi.h:780
int vendor
Definition: papi.h:781
float revision
Definition: papi.h:785
int ncpu
Definition: papi.h:775
char model_string[PAPI_MAX_STR_LEN]
Definition: papi.h:784
int cpu_max_mhz
Definition: papi.h:790

◆ PAPI_FCALL() [23/51]

PAPI_FCALL ( papif_get_multiplex  ,
PAPIF_GET_MULTIPLEX  ,
(int *EventSet, int *check  
)

Definition at line 603 of file papi_fwrappers.c.

605{
607}
Get the multiplexing status of specified event set.

◆ PAPI_FCALL() [24/51]

PAPI_FCALL ( papif_get_preload  ,
PAPIF_GET_PRELOAD  ,
(char *lib_preload_env, int *check  
)

Definition at line 1201 of file papi_fwrappers.c.

1204{
1205 PAPI_option_t p;
1206#if defined(_FORTRAN_STRLEN_AT_END)
1207 int i;
1208
1209 if ( ( *check = PAPI_get_opt( PAPI_PRELOAD, &p ) ) == PAPI_OK ) {
1210 strncpy( lib_preload_env, p.preload.lib_preload_env,
1211 ( size_t ) lib_preload_env_len );
1212 for ( i = ( int ) strlen( p.preload.lib_preload_env );
1213 i < lib_preload_env_len; lib_preload_env[i++] = ' ' );
1214 }
1215#else
1216 if ( ( *check = PAPI_get_opt( PAPI_PRELOAD, &p ) ) == PAPI_OK ) {
1217 strncpy( lib_preload_env, p.preload.lib_preload_env, PAPI_MAX_STR_LEN );
1218 }
1219#endif
1220}
#define PAPI_PRELOAD
Definition: f90papi.h:37
char lib_preload_env[PAPI_MAX_STR_LEN]
Definition: papi.h:619
PAPI_preload_info_t preload
Definition: papi.h:844

◆ PAPI_FCALL() [25/51]

PAPI_FCALL ( papif_hl_read  ,
PAPIF_HL_READ  ,
(char *name, int *check  
)

Definition at line 1749 of file papi_fwrappers.c.

1751{
1752 *check = PAPI_hl_read( name );
1753}
Read performance events inside of a region and store the difference to the corresponding beginning of...

◆ PAPI_FCALL() [26/51]

PAPI_FCALL ( papif_hl_region_begin  ,
PAPIF_HL_REGION_BEGIN  ,
(char *name, int *check  
)

Definition at line 1680 of file papi_fwrappers.c.

1682{
1684}
Read performance events at the beginning of a region.

◆ PAPI_FCALL() [27/51]

PAPI_FCALL ( papif_hl_region_end  ,
PAPIF_HL_REGION_END  ,
(char *name, int *check  
)

Definition at line 1812 of file papi_fwrappers.c.

1814{
1816}
Read performance events at the end of a region and store the difference to the corresponding beginnin...

◆ PAPI_FCALL() [28/51]

PAPI_FCALL ( papif_hl_stop  ,
PAPIF_HL_STOP  ,
(int *check  
)

Definition at line 1865 of file papi_fwrappers.c.

1867{
1868 *check = PAPI_hl_stop( );
1869}
Stop a running high-level event set.

◆ PAPI_FCALL() [29/51]

PAPI_FCALL ( papif_ipc  ,
PAPIF_IPC  ,
(float *rtime, float *ptime, long long *ins, float *ipc, int *check  
)

Definition at line 1338 of file papi_fwrappers.c.

1341{
1342 *check = PAPI_ipc( rtime, ptime, ins, ipc );
1343}
Simplified call to get instructions per cycle, real and processor time.

◆ PAPI_FCALL() [30/51]

PAPI_FCALL ( papif_list_events  ,
PAPIF_LIST_EVENTS  ,
(int *EventSet, int *Events, int *number, int *check  
)

Definition at line 572 of file papi_fwrappers.c.

574{
575 *check = PAPI_list_events( *EventSet, Events, number );
576}
list the events in an event set

◆ PAPI_FCALL() [31/51]

PAPI_FCALL ( papif_lock  ,
PAPIF_LOCK  ,
(int *lock, int *check  
)

Definition at line 1143 of file papi_fwrappers.c.

1145{
1146 *check = PAPI_lock( *lock );
1147}
atomic_p lock[]
Definition: aix.c:25
Lock one of two mutex variables defined in papi.h.

◆ PAPI_FCALL() [32/51]

PAPI_FCALL ( papif_num_cmp_hwctrs  ,
PAPIF_num_cmp_hwctrs  ,
(int *cidx, int *num)   
)

Definition at line 381 of file papi_fwrappers.c.

383{
384 *num = PAPI_num_cmp_hwctrs( *cidx );
385}
Return the number of hardware counters for the specified component.

◆ PAPI_FCALL() [33/51]

PAPI_FCALL ( papif_perror  ,
PAPIF_PERROR  ,
(char *message)   
)

Definition at line 640 of file papi_fwrappers.c.

643{
644#if defined(_FORTRAN_STRLEN_AT_END)
645 char tmp[PAPI_MAX_STR_LEN];
646 Fortran2cstring( tmp, message, PAPI_MAX_STR_LEN, message_len );
647
648 PAPI_perror( tmp );
649#else
650 PAPI_perror( message );
651#endif
652}
Produces a string on standard error, describing the last library error.
static void Fortran2cstring(char *cstring, char *Fstring, int clen, int Flen)
Here is the call graph for this function:

◆ PAPI_FCALL() [34/51]

PAPI_FCALL ( papif_query_event  ,
PAPIF_QUERY_EVENT  ,
(int *EventCode, int *check  
)

Definition at line 672 of file papi_fwrappers.c.

674{
675 *check = PAPI_query_event( *EventCode );
676}
Query if PAPI event exists.

◆ PAPI_FCALL() [35/51]

PAPI_FCALL ( papif_query_named_event  ,
PAPIF_QUERY_NAMED_EVENT  ,
(char *EventName, int *check  
)

Definition at line 697 of file papi_fwrappers.c.

699{
700 *check = PAPI_query_named_event( EventName );
701}
Query if a named PAPI event exists.

◆ PAPI_FCALL() [36/51]

PAPI_FCALL ( papif_rate_stop  ,
PAPIF_RATE_STOP  ,
(int *check  
)

Definition at line 1407 of file papi_fwrappers.c.

1409{
1410 *check = PAPI_rate_stop( );
1411}
Stop a running event set of a rate function.

◆ PAPI_FCALL() [37/51]

PAPI_FCALL ( papif_read  ,
PAPIF_READ  ,
(int *EventSet, long long *values, int *check  
)

Definition at line 882 of file papi_fwrappers.c.

884{
886}
Read hardware counters from an event set.

◆ PAPI_FCALL() [38/51]

PAPI_FCALL ( papif_read_ts  ,
PAPIF_READ_TS  ,
(int *EventSet, long long *values, long long *cycles, int *check  
)

Definition at line 898 of file papi_fwrappers.c.

900{
901 *check = PAPI_read_ts( *EventSet, values, cycles );
902}
Read hardware counters with a timestamp.

◆ PAPI_FCALL() [39/51]

PAPI_FCALL ( papif_remove_event  ,
PAPIF_REMOVE_EVENT  ,
(int *EventSet, int *Event, int *check  
)

Definition at line 914 of file papi_fwrappers.c.

916{
918}
removes a hardware event from a PAPI event set.

◆ PAPI_FCALL() [40/51]

PAPI_FCALL ( papif_remove_events  ,
PAPIF_REMOVE_EVENTS  ,
(int *EventSet, int *Events, int *number, int *check  
)

Definition at line 956 of file papi_fwrappers.c.

958{
959 *check = PAPI_remove_events( *EventSet, Events, *number );
960}
Remove an array of hardware event codes from a PAPI event set.

◆ PAPI_FCALL() [41/51]

PAPI_FCALL ( papif_remove_named_event  ,
PAPIF_REMOVE_NAMED_EVENT  ,
(int *EventSet, char *EventName, int *check  
)

Definition at line 939 of file papi_fwrappers.c.

941{
942 *check = PAPI_remove_named_event( *EventSet, EventName );
943}
removes a named hardware event from a PAPI event set.

◆ PAPI_FCALL() [42/51]

PAPI_FCALL ( papif_set_cmp_domain  ,
PAPIF_SET_CMP_DOMAIN  ,
(int *domain, int *cidx, int *check  
)

Definition at line 1017 of file papi_fwrappers.c.

1019{
1020 *check = PAPI_set_cmp_domain( *domain, *cidx );
1021}
Set the default counting domain for new event sets bound to the specified component.

◆ PAPI_FCALL() [43/51]

PAPI_FCALL ( papif_set_cmp_granularity  ,
PAPIF_SET_CMP_GRANULARITY  ,
(int *granularity, int *cidx, int *check  
)

Definition at line 1049 of file papi_fwrappers.c.

1051{
1052 *check = PAPI_set_cmp_granularity( *granularity, *cidx );
1053}
Set the default counting granularity for eventsets bound to the specified component.

◆ PAPI_FCALL() [44/51]

PAPI_FCALL ( papif_set_event_domain  ,
PAPIF_SET_EVENT_DOMAIN  ,
(int *es, int *domain, int *check  
)

Definition at line 1300 of file papi_fwrappers.c.

1302{
1303 PAPI_option_t d;
1304
1305 d.domain.domain = *domain;
1306 d.domain.eventset = *es;
1307 *check = PAPI_set_opt( PAPI_DOMAIN, &d );
1308}
Set PAPI library or event set options.

◆ PAPI_FCALL() [45/51]

PAPI_FCALL ( papif_set_granularity  ,
PAPIF_SET_GRANULARITY  ,
(int *granularity, int *check  
)

Definition at line 1033 of file papi_fwrappers.c.

1035{
1036 *check = PAPI_set_granularity( *granularity );
1037}
Set the default counting granularity for eventsets bound to the cpu component.

◆ PAPI_FCALL() [46/51]

PAPI_FCALL ( papif_set_multiplex  ,
PAPIF_SET_MULTIPLEX  ,
(int *EventSet, int *check  
)

Definition at line 619 of file papi_fwrappers.c.

621{
623}
Convert a standard event set to a multiplexed event set.

◆ PAPI_FCALL() [47/51]

PAPI_FCALL ( papif_state  ,
PAPIF_STATE  ,
(int *EventSet, int *status, int *check  
)

Definition at line 1095 of file papi_fwrappers.c.

1097{
1098 *check = PAPI_state( *EventSet, status );
1099}
Return the counting state of an EventSet.

◆ PAPI_FCALL() [48/51]

PAPI_FCALL ( papif_stop  ,
PAPIF_STOP  ,
(int *EventSet, long long *values, int *check  
)

Definition at line 1111 of file papi_fwrappers.c.

1113{
1115}
Stop counting hardware events in an event set.

◆ PAPI_FCALL() [49/51]

PAPI_FCALL ( papif_thread_init  ,
PAPIF_THREAD_INIT  ,
(unsigned long int(*handle)(void), int *check  
)

Definition at line 556 of file papi_fwrappers.c.

558{
560}
static papi_handle_t handle
Definition: Gamum.c:21
Initialize thread support in the PAPI library.

◆ PAPI_FCALL() [50/51]

PAPI_FCALL ( papif_unlock  ,
PAPIF_unlock  ,
(int *lock, int *check  
)

Definition at line 1159 of file papi_fwrappers.c.

1161{
1162 *check = PAPI_unlock( *lock );
1163}
Unlock one of the mutex variables defined in papi.h.

◆ PAPI_FCALL() [51/51]

PAPI_FCALL ( papif_write  ,
PAPIF_WRITE  ,
(int *EventSet, long long *values, int *check  
)

Definition at line 1127 of file papi_fwrappers.c.

1129{
1131}
Write counter values into counters.

Variable Documentation

◆ check

* check = PAPI_set_opt( PAPI_INHERIT, &i )

Definition at line 1325 of file papi_fwrappers.c.

◆ handle_index

* handle_index = 0

Definition at line 1428 of file papi_fwrappers.c.

◆ inherit

i inherit inherit = *inherit

Definition at line 1324 of file papi_fwrappers.c.

◆ sysdetect_fort_handle

void* sysdetect_fort_handle
static

Definition at line 1413 of file papi_fwrappers.c.