PAPI 7.1.0.0
Loading...
Searching...
No Matches
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 */
23int 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 */
32extern 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 */
52extern 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 */
87int
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}
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_EINVAL
Definition: f90papi.h:115
int init_bgq(PAPI_mh_info_t *pMem_Info)
int _bgq_get_dmem_info(PAPI_dmem_info_t *pDmemInfo)
int _bgq_get_memory_info(PAPI_hw_info_t *pHwInfo, int pCPU_Type)
This file has the source code for a component that enables PAPI-C to access hardware monitoring count...
Return codes and api definitions.
A pointer to the following is passed to PAPI_get_dmem_info()
Definition: papi.h:865
long long locked
Definition: papi.h:874
long long shared
Definition: papi.h:870
long long text
Definition: papi.h:871
long long heap
Definition: papi.h:873
long long size
Definition: papi.h:867
long long library
Definition: papi.h:872
long long stack
Definition: papi.h:875
long long pagesize
Definition: papi.h:876
long long high_water_mark
Definition: papi.h:869
long long resident
Definition: papi.h:868
Hardware info structure.
Definition: papi.h:774
PAPI_mh_info_t mem_hierarchy
Definition: papi.h:793
mh for mem hierarchy maybe?
Definition: papi.h:767
int retval
Definition: zero_fork.c:53