PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
linux-bgq-memory.c
Go to the documentation of this file.
1 /*
2  * File: linux-bgq-memory.c
3  * CVS: $Id$
4  * Author: Heike Jagode
5  * jagode@eecs.utk.edu
6  * Mods:
7  *
8  */
9 
10 
11 
12 #include "papi.h"
13 #include "papi_internal.h"
14 #include "linux-bgq.h"
15 #ifdef __LINUX__
16 #include <limits.h>
17 #endif
18 #include <stdio.h>
19 
20 /*
21  * Prototypes...
22  */
23 int init_bgq( PAPI_mh_info_t * pMem_Info );
24 
25 // inline void cpuid(unsigned int *, unsigned int *,unsigned int *,unsigned int *);
26 
27 /*
28  * Get Memory Information
29  *
30  * Fills in memory information - effectively set to all 0x00's
31  */
32 extern int
33 _bgq_get_memory_info( PAPI_hw_info_t * pHwInfo, int pCPU_Type )
34 {
35  int retval = 0;
36 
37  switch ( pCPU_Type ) {
38  default:
39  //fprintf(stderr,"Default CPU type in %s (%d)\n",__FUNCTION__,__LINE__);
40  retval = init_bgq( &pHwInfo->mem_hierarchy );
41  break;
42  }
43 
44  return retval;
45 }
46 
47 /*
48  * Get DMem Information for BG/Q
49  *
50  * NOTE: Currently, all values set to -1
51  */
52 extern int
54 {
55 // pid_t xPID = getpid();
56 // prpsinfo_t xInfo;
57 // char xFile[256];
58 // int xFD;
59 
60 // sprintf(xFile, "/proc/%05d", xPID);
61 // if ((fd = open(xFile, O_RDONLY)) < 0) {
62 // SUBDBG("PAPI_get_dmem_info can't open /proc/%d\n", xPID);
63 // return (PAPI_ESYS);
64 // }
65 // if (ioctl(xFD, PIOCPSINFO, &xInfo) < 0) {
66 // return (PAPI_ESYS);
67 // }
68 // close(xFD);
69 
70  pDmemInfo->size = PAPI_EINVAL;
71  pDmemInfo->resident = PAPI_EINVAL;
72  pDmemInfo->high_water_mark = PAPI_EINVAL;
73  pDmemInfo->shared = PAPI_EINVAL;
74  pDmemInfo->text = PAPI_EINVAL;
75  pDmemInfo->library = PAPI_EINVAL;
76  pDmemInfo->heap = PAPI_EINVAL;
77  pDmemInfo->locked = PAPI_EINVAL;
78  pDmemInfo->stack = PAPI_EINVAL;
79  pDmemInfo->pagesize = PAPI_EINVAL;
80 
81  return PAPI_OK;
82 }
83 
84 /*
85  * Cache configuration for BG/Q
86  */
87 int
88 init_bgq( PAPI_mh_info_t * pMem_Info )
89 {
90  memset( pMem_Info, 0x0, sizeof ( *pMem_Info ) );
91  //fprintf(stderr,"mem_info not est up [%s (%d)]\n",__FUNCTION__,__LINE__);
92 
93  return PAPI_OK;
94 }
memset(eventId, 0, size)
Hardware info structure.
Definition: papi.h:777
This file has the source code for a component that enables PAPI-C to access hardware monitoring count...
PAPI_mh_info_t mem_hierarchy
Definition: papi.h:796
return PAPI_OK
Definition: linux-nvml.c:458
long long heap
Definition: papi.h:876
return PAPI_EINVAL
Definition: linux-nvml.c:408
Return codes and api definitions.
long long resident
Definition: papi.h:871
A pointer to the following is passed to PAPI_get_dmem_info()
Definition: papi.h:868
long long pagesize
Definition: papi.h:879
long long locked
Definition: papi.h:877
long long library
Definition: papi.h:875
mh for mem hierarchy maybe?
Definition: papi.h:770
int _bgq_get_memory_info(PAPI_hw_info_t *pHwInfo, int pCPU_Type)
long long shared
Definition: papi.h:873
long long text
Definition: papi.h:874
long long stack
Definition: papi.h:878
ssize_t retval
Definition: libasync.c:338
int init_bgq(PAPI_mh_info_t *pMem_Info)
long long size
Definition: papi.h:870
int _bgq_get_dmem_info(PAPI_dmem_info_t *pDmemInfo)
long long high_water_mark
Definition: papi.h:872