PAPI  5.7.0.0
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_start_counters, PAPIF_START_COUNTERS,(int *events, int *array_len, int *check))
 
 PAPI_FCALL (papif_read_counters, PAPIF_READ_COUNTERS,(long long *values, int *array_len, int *check))
 
 PAPI_FCALL (papif_stop_counters, PAPIF_STOP_COUNTERS,(long long *values, int *array_len, int *check))
 
 PAPI_FCALL (papif_accum_counters, PAPIF_ACCUM_COUNTERS,(long long *values, int *array_len, 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, PAPIF_FLIPS,(float *real_time, float *proc_time, long long *flpins, float *mflips, int *check))
 
 PAPI_FCALL (papif_flops, PAPIF_FLOPS,(float *real_time, float *proc_time, long long *flpops, float *mflops, 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))
 

Variables

i inherit inherit = *inherit
 
check = PAPI_set_opt( PAPI_INHERIT, &i )
 

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/48]

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

Definition at line 78 of file papi_fwrappers.c.

80 {
82 }
int EventSet
* check
int PAPI_accum(int EventSet, long long *values)
Definition: papi.c:2745
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
Here is the call graph for this function:

◆ PAPI_FCALL() [2/48]

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 }
int PAPI_add_event(int EventSet, int EventCode)
Definition: papi.c:1663
int EventSet
* check
static int Event[MAX_EVENTS]
Here is the call graph for this function:

◆ PAPI_FCALL() [3/48]

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 }
int EventSet
* check
int PAPI_add_named_event(int EventSet, const char *EventName)
Definition: papi.c:1876
Here is the call graph for this function:

◆ PAPI_FCALL() [4/48]

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 }
static int Events[NUM_EVENTS]
Definition: init_fini.c:8
int EventSet
int PAPI_add_events(int EventSet, int *Events, int number)
Definition: papi.c:5843
* check
Here is the call graph for this function:

◆ PAPI_FCALL() [5/48]

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

Definition at line 152 of file papi_fwrappers.c.

154 {
156 }
int EventSet
* check
int PAPI_cleanup_eventset(int EventSet)
Definition: papi.c:2890
Here is the call graph for this function:

◆ PAPI_FCALL() [6/48]

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

Definition at line 168 of file papi_fwrappers.c.

170 {
172 }
int EventSet
* check
int PAPI_create_eventset(int *EventSet)
Definition: papi.c:1464
Here is the call graph for this function:

◆ PAPI_FCALL() [7/48]

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 }
int EventSet
* check
static int cidx
int PAPI_assign_eventset_component(int EventSet, int cidx)
Definition: papi.c:1526
Here is the call graph for this function:

◆ PAPI_FCALL() [8/48]

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

Definition at line 200 of file papi_fwrappers.c.

202 {
204 }
int EventSet
* check
int PAPI_destroy_eventset(int *EventSet)
Definition: papi.c:2014
Here is the call graph for this function:

◆ PAPI_FCALL() [9/48]

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 {
220  *check = PAPI_get_dmem_info( ( PAPI_dmem_info_t * ) dest );
221 }
* check
A pointer to the following is passed to PAPI_get_dmem_info()
Definition: papi.h:872
int PAPI_get_dmem_info(PAPI_dmem_info_t *dest)
Definition: papi.c:6063
Here is the call graph for this function:

◆ PAPI_FCALL() [10/48]

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 {
249  PAPI_option_t e;
250 /* WARNING: The casts from caddr_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_OK
Definition: fpapi.h:105
static const char * name
Definition: fork_overflow.c:31
caddr_t text_end
Definition: papi.h:699
#define PAPI_EXEINFO
Definition: fpapi.h:60
caddr_t bss_start
Definition: papi.h:702
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:849
* check
int PAPI_get_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:4143
caddr_t text_start
Definition: papi.h:698
PAPI_address_map_t address_info
Definition: papi.h:710
PAPI_exe_info_t * exe_info
Definition: papi.h:864
caddr_t data_start
Definition: papi.h:700
caddr_t bss_end
Definition: papi.h:703
caddr_t data_end
Definition: papi.h:701
char fullname[PAPI_HUGE_STR_LEN]
Definition: papi.h:709
char name[PAPI_HUGE_STR_LEN]
Definition: papi.h:697
int i
Definition: fileop.c:140
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
Here is the call graph for this function:

◆ PAPI_FCALL() [11/48]

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 }
Hardware info structure.
Definition: papi.h:781
float revision
Definition: papi.h:792
char model_string[PAPI_MAX_STR_LEN]
Definition: papi.h:791
int nnodes
Definition: papi.h:786
char vendor_string[PAPI_MAX_STR_LEN]
Definition: papi.h:789
int vendor
Definition: papi.h:788
int model
Definition: papi.h:790
int cpu_max_mhz
Definition: papi.h:797
int totalcpus
Definition: papi.h:787
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
Definition: papi.c:6185
int i
Definition: fileop.c:140
int ncpu
Definition: papi.h:782
Here is the call graph for this function:

◆ PAPI_FCALL() [12/48]

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 }
int PAPI_num_cmp_hwctrs(int cidx)
Definition: papi.c:3965
static int cidx
Here is the call graph for this function:

◆ PAPI_FCALL() [13/48]

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 {
559  *check = PAPI_thread_init( handle );
560 }
* check
int PAPI_thread_init(unsigned long int(*id_fn)(void))
Definition: papi.c:123
Here is the call graph for this function:

◆ PAPI_FCALL() [14/48]

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 }
static int Events[NUM_EVENTS]
Definition: init_fini.c:8
int EventSet
* check
int PAPI_list_events(int EventSet, int *Events, int *number)
Definition: papi.c:6001
Here is the call graph for this function:

◆ PAPI_FCALL() [15/48]

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

Definition at line 603 of file papi_fwrappers.c.

605 {
607 }
int EventSet
* check
int PAPI_get_multiplex(int EventSet)
Definition: papi.c:4028
Here is the call graph for this function:

◆ PAPI_FCALL() [16/48]

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

Definition at line 619 of file papi_fwrappers.c.

621 {
623 }
int EventSet
* check
int PAPI_set_multiplex(int EventSet)
Definition: papi.c:3333
Here is the call graph for this function:

◆ PAPI_FCALL() [17/48]

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 }
static void Fortran2cstring(char *cstring, char *Fstring, int clen, int Flen)
double tmp
void PAPI_perror(const char *msg)
Definition: papi.c:4653
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
Here is the call graph for this function:

◆ PAPI_FCALL() [18/48]

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 }
* check
int PAPI_query_event(int EventCode)
Definition: papi.c:684
Here is the call graph for this function:

◆ PAPI_FCALL() [19/48]

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 }
* check
int PAPI_query_named_event(const char *EventName)
Definition: papi.c:756
Here is the call graph for this function:

◆ PAPI_FCALL() [20/48]

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 {
728  PAPI_event_info_t info;
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 }
#define PAPI_OK
Definition: fpapi.h:105
unsigned int count
Definition: papi.h:988
char long_descr[PAPI_HUGE_STR_LEN]
Definition: papi.h:970
* check
int PAPI_get_event_info(int EventCode, PAPI_event_info_t *info)
Definition: papi.c:835
char symbol[PAPI_HUGE_STR_LEN]
Definition: papi.h:967
char short_descr[PAPI_MIN_STR_LEN]
Definition: papi.h:968
char note[PAPI_HUGE_STR_LEN]
Definition: papi.h:1014
static long count
int i
Definition: fileop.c:140
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
Here is the call graph for this function:

◆ PAPI_FCALL() [21/48]

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
* check
int PAPI_event_code_to_name(int EventCode, char *out)
Definition: papi.c:915
int i
Definition: fileop.c:140
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
Here is the call graph for this function:

◆ PAPI_FCALL() [22/48]

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 }
int PAPI_event_name_to_code(const char *in, int *out)
Definition: papi.c:1004
* check
int i
Definition: fileop.c:140
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
Here is the call graph for this function:

◆ PAPI_FCALL() [23/48]

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 }
int PAPI_enum_event(int *EventCode, int modifier)
Definition: papi.c:1152
* check
Here is the call graph for this function:

◆ PAPI_FCALL() [24/48]

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

Definition at line 882 of file papi_fwrappers.c.

884 {
885  *check = PAPI_read( *EventSet, values );
886 }
int EventSet
* check
int PAPI_read(int EventSet, long long *values)
Definition: papi.c:2559
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
Here is the call graph for this function:

◆ PAPI_FCALL() [25/48]

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 }
int EventSet
* check
int PAPI_read_ts(int EventSet, long long *values, long long *cycles)
Definition: papi.c:2648
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
Here is the call graph for this function:

◆ PAPI_FCALL() [26/48]

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 }
int PAPI_remove_event(int EventSet, int EventCode)
Definition: papi.c:1758
int EventSet
* check
static int Event[MAX_EVENTS]
Here is the call graph for this function:

◆ PAPI_FCALL() [27/48]

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 }
int EventSet
* check
int PAPI_remove_named_event(int EventSet, const char *EventName)
Definition: papi.c:1961
Here is the call graph for this function:

◆ PAPI_FCALL() [28/48]

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 }
static int Events[NUM_EVENTS]
Definition: init_fini.c:8
int EventSet
int PAPI_remove_events(int EventSet, int *Events, int number)
Definition: papi.c:5931
* check
Here is the call graph for this function:

◆ PAPI_FCALL() [29/48]

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 }
* check
int PAPI_set_cmp_domain(int domain, int cidx)
Definition: papi.c:5758
static int cidx
Here is the call graph for this function:

◆ PAPI_FCALL() [30/48]

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 }
* check
int PAPI_set_granularity(int granularity)
Definition: papi.c:5557
Here is the call graph for this function:

◆ PAPI_FCALL() [31/48]

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 }
int PAPI_set_cmp_granularity(int granularity, int cidx)
Definition: papi.c:5622
* check
static int cidx
Here is the call graph for this function:

◆ PAPI_FCALL() [32/48]

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 }
int EventSet
* check
int PAPI_state(int EventSet, int *status)
Definition: papi.c:3053
long long status
Definition: iozone.c:1335
Here is the call graph for this function:

◆ PAPI_FCALL() [33/48]

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

Definition at line 1111 of file papi_fwrappers.c.

1113 {
1114  *check = PAPI_stop( *EventSet, values );
1115 }
int PAPI_stop(int EventSet, long long *values)
Definition: papi.c:2314
int EventSet
* check
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
Here is the call graph for this function:

◆ PAPI_FCALL() [34/48]

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

Definition at line 1127 of file papi_fwrappers.c.

1129 {
1130  *check = PAPI_write( *EventSet, values );
1131 }
int PAPI_write(int EventSet, long long *values)
Definition: papi.c:2813
int EventSet
* check
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
Here is the call graph for this function:

◆ PAPI_FCALL() [35/48]

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 }
* check
atomic_p lock[]
Definition: aix.c:25
int PAPI_lock(int lck)
Definition: papi.c:6401
Here is the call graph for this function:

◆ PAPI_FCALL() [36/48]

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 }
* check
atomic_p lock[]
Definition: aix.c:25
int PAPI_unlock(int lck)
Definition: papi.c:6421
Here is the call graph for this function:

◆ PAPI_FCALL() [37/48]

PAPI_FCALL ( papif_start_counters  ,
PAPIF_START_COUNTERS  ,
(int *events, int *array_len, int *check  
)

Definition at line 1177 of file papi_fwrappers.c.

1179 {
1180  *check = PAPI_start_counters( events, *array_len );
1181 }
* check
char events[MAX_EVENTS][BUFSIZ]
int PAPI_start_counters(int *events, int array_len)
Definition: papi_hl.c:597
Here is the call graph for this function:

◆ PAPI_FCALL() [38/48]

PAPI_FCALL ( papif_read_counters  ,
PAPIF_READ_COUNTERS  ,
(long long *values, int *array_len, int *check  
)

Definition at line 1193 of file papi_fwrappers.c.

1195 {
1196  *check = PAPI_read_counters( values, *array_len );
1197 }
* check
int PAPI_read_counters(long long *values, int array_len)
Definition: papi_hl.c:710
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
Here is the call graph for this function:

◆ PAPI_FCALL() [39/48]

PAPI_FCALL ( papif_stop_counters  ,
PAPIF_STOP_COUNTERS  ,
(long long *values, int *array_len, int *check  
)

Definition at line 1209 of file papi_fwrappers.c.

1211 {
1212  *check = PAPI_stop_counters( values, *array_len );
1213 }
* check
int PAPI_stop_counters(long long *values, int array_len)
Definition: papi_hl.c:807
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
Here is the call graph for this function:

◆ PAPI_FCALL() [40/48]

PAPI_FCALL ( papif_accum_counters  ,
PAPIF_ACCUM_COUNTERS  ,
(long long *values, int *array_len, int *check  
)

Definition at line 1225 of file papi_fwrappers.c.

1227 {
1228  *check = PAPI_accum_counters( values, *array_len );
1229 }
int PAPI_accum_counters(long long *values, int array_len)
Definition: papi_hl.c:760
* check
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
Here is the call graph for this function:

◆ PAPI_FCALL() [41/48]

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

Definition at line 1256 of file papi_fwrappers.c.

1259 {
1260  *check = PAPI_ipc( rtime, ptime, ins, ipc );
1261 }
int PAPI_ipc(float *rtime, float *ptime, long long *ins, float *ipc)
Definition: papi_hl.c:320
* check
Here is the call graph for this function:

◆ PAPI_FCALL() [42/48]

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 1273 of file papi_fwrappers.c.

1277 {
1278  *check = PAPI_epc( event, rtime, ptime, ref, core, evt, epc );
1279 }
* check
int PAPI_epc(int event, float *rtime, float *ptime, long long *ref, long long *core, long long *evt, float *epc)
Definition: papi_hl.c:387
Here is the call graph for this function:

◆ PAPI_FCALL() [43/48]

PAPI_FCALL ( papif_flips  ,
PAPIF_FLIPS  ,
(float *real_time, float *proc_time, long long *flpins, float *mflips, int *check  
)

Definition at line 1291 of file papi_fwrappers.c.

1294 {
1295  *check = PAPI_flips( real_time, proc_time, flpins, mflips );
1296 }
* check
int PAPI_flips(float *rtime, float *ptime, long long *flpins, float *mflips)
Definition: papi_hl.c:204
Here is the call graph for this function:

◆ PAPI_FCALL() [44/48]

PAPI_FCALL ( papif_flops  ,
PAPIF_FLOPS  ,
(float *real_time, float *proc_time, long long *flpops, float *mflops, int *check  
)

Definition at line 1308 of file papi_fwrappers.c.

1311 {
1312  *check = PAPI_flops( real_time, proc_time, flpops, mflops );
1313 }
int PAPI_flops(float *rtime, float *ptime, long long *flpops, float *mflops)
Definition: papi_hl.c:263
* check
Here is the call graph for this function:

◆ PAPI_FCALL() [45/48]

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

Definition at line 1351 of file papi_fwrappers.c.

1354 {
1355  PAPI_option_t p;
1356 #if defined(_FORTRAN_STRLEN_AT_END)
1357  int i;
1358 
1359  if ( ( *check = PAPI_get_opt( PAPI_PRELOAD, &p ) ) == PAPI_OK ) {
1360  strncpy( lib_preload_env, p.preload.lib_preload_env,
1361  ( size_t ) lib_preload_env_len );
1362  for ( i = ( int ) strlen( p.preload.lib_preload_env );
1363  i < lib_preload_env_len; lib_preload_env[i++] = ' ' );
1364  }
1365 #else
1366  if ( ( *check = PAPI_get_opt( PAPI_PRELOAD, &p ) ) == PAPI_OK ) {
1367  strncpy( lib_preload_env, p.preload.lib_preload_env, PAPI_MAX_STR_LEN );
1368  }
1369 #endif
1370 }
#define PAPI_OK
Definition: fpapi.h:105
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:849
* check
int PAPI_get_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:4143
#define PAPI_PRELOAD
Definition: fpapi.h:56
PAPI_preload_info_t preload
Definition: papi.h:851
char lib_preload_env[PAPI_MAX_STR_LEN]
Definition: papi.h:622
int i
Definition: fileop.c:140
#define PAPI_MAX_STR_LEN
Definition: fpapi.h:43
Here is the call graph for this function:

◆ PAPI_FCALL() [46/48]

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

Definition at line 1382 of file papi_fwrappers.c.

1384 {
1385  PAPI_option_t g;
1386 
1387  if ( *mode == PAPI_DEFGRN ) {
1388  *granularity = PAPI_get_opt( *mode, &g );
1389  *check = PAPI_OK;
1390  } else if ( *mode == PAPI_GRANUL ) {
1391  g.granularity.eventset = *eventset;
1392  if ( ( *check = PAPI_get_opt( *mode, &g ) ) == PAPI_OK ) {
1393  *granularity = g.granularity.granularity;
1394  }
1395  } else {
1396  *check = PAPI_EINVAL;
1397  }
1398 }
#define PAPI_OK
Definition: fpapi.h:105
#define PAPI_GRANUL
Definition: fpapi.h:52
#define PAPI_EINVAL
Definition: fpapi.h:106
PAPI_granularity_option_t granularity
Definition: papi.h:854
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:849
* check
int PAPI_get_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:4143
#define PAPI_DEFGRN
Definition: fpapi.h:51
Here is the call graph for this function:

◆ PAPI_FCALL() [47/48]

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

Definition at line 1410 of file papi_fwrappers.c.

1412 {
1413  PAPI_option_t d;
1414 
1415  if ( *mode == PAPI_DEFDOM ) {
1416  *domain = PAPI_get_opt( *mode, (PAPI_option_t *) NULL );
1417  *check = PAPI_OK;
1418  } else if ( *mode == PAPI_DOMAIN ) {
1419  d.domain.eventset = *eventset;
1420  if ( ( *check = PAPI_get_opt( *mode, &d ) ) == PAPI_OK ) {
1421  *domain = d.domain.domain;
1422  }
1423  } else {
1424  *check = PAPI_EINVAL;
1425  }
1426 }
#define PAPI_OK
Definition: fpapi.h:105
#define PAPI_EINVAL
Definition: fpapi.h:106
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:849
* check
int PAPI_get_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:4143
#define PAPI_DEFDOM
Definition: fpapi.h:49
#define PAPI_DOMAIN
Definition: fpapi.h:50
PAPI_domain_option_t domain
Definition: papi.h:856
Here is the call graph for this function:

◆ PAPI_FCALL() [48/48]

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

Definition at line 1450 of file papi_fwrappers.c.

1452 {
1453  PAPI_option_t d;
1454 
1455  d.domain.domain = *domain;
1456  d.domain.eventset = *es;
1457  *check = PAPI_set_opt( PAPI_DOMAIN, &d );
1458 }
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:849
int PAPI_set_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:3465
* check
#define PAPI_DOMAIN
Definition: fpapi.h:50
PAPI_domain_option_t domain
Definition: papi.h:856
Here is the call graph for this function:

Variable Documentation

◆ check

* check = PAPI_set_opt( PAPI_INHERIT, &i )

Definition at line 1475 of file papi_fwrappers.c.

◆ inherit

i inherit inherit = *inherit

Definition at line 1474 of file papi_fwrappers.c.