cpus.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CpuInfo_t

Functions

int _papi_hwi_initialize_cpu (CpuInfo_t **dest, unsigned int cpu_num)
int _papi_hwi_shutdown_cpu (CpuInfo_t *cpu)
int _papi_hwi_lookup_or_create_cpu (CpuInfo_t **here, unsigned int cpu_num)

Detailed Description

Author: Gary Mohr gary.mohr@bull.com

Definition in file cpus.h.


Function Documentation

int _papi_hwi_initialize_cpu ( CpuInfo_t **  dest,
unsigned int  cpu_num 
)

Definition at line 275 of file cpus.c.

00276 {
00277    APIDBG("Entry: dest: %p, *dest: %p, cpu_num: %d\n", dest, *dest, cpu_num);
00278 
00279    int retval;
00280    CpuInfo_t *cpu;
00281    int i;
00282 
00283    if ( ( cpu = allocate_cpu(cpu_num) ) == NULL ) {
00284       *dest = NULL;
00285       return PAPI_ENOMEM;
00286    }
00287 
00288    /* Call the component to fill in anything special. */
00289    for ( i = 0; i < papi_num_components; i++ ) {
00290       if (_papi_hwd[i]->cmp_info.disabled) continue;
00291       retval = _papi_hwd[i]->init_thread( cpu->context[i] );
00292       if ( retval ) {
00293      free_cpu( &cpu );
00294      *dest = NULL;
00295      return retval;
00296       }
00297    }
00298 
00299    insert_cpu( cpu );
00300 
00301    *dest = cpu;
00302    return PAPI_OK;
00303 }

Here is the call graph for this function:

Here is the caller graph for this function:

int _papi_hwi_lookup_or_create_cpu ( CpuInfo_t **  here,
unsigned int  cpu_num 
)

Definition at line 59 of file cpus.c.

00060 {
00061    APIDBG("Entry: here: %p\n", here);
00062     
00063    CpuInfo_t *tmp = NULL;
00064    int retval = PAPI_OK;
00065 
00066    _papi_hwi_lock( CPUS_LOCK );
00067 
00068    tmp = _papi_hwi_lookup_cpu(cpu_num);
00069    if ( tmp == NULL ) {
00070       retval = _papi_hwi_initialize_cpu( &tmp, cpu_num );
00071    }
00072 
00073    /* Increment use count */
00074    tmp->num_users++;
00075 
00076    if ( retval == PAPI_OK ) {
00077       *here = tmp;
00078    }
00079 
00080    _papi_hwi_unlock( CPUS_LOCK );
00081     
00082    return retval;
00083 }

Here is the call graph for this function:

Here is the caller graph for this function:

int _papi_hwi_shutdown_cpu ( CpuInfo_t cpu  ) 

Definition at line 306 of file cpus.c.

00307 {
00308    APIDBG("Entry: cpu: %p, cpu_num: %d\n", cpu, cpu->cpu_num);
00309 
00310    free_cpu( &cpu );
00311 
00312    return PAPI_OK;
00313 }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on 17 Nov 2016 for PAPI by  doxygen 1.6.1