PAPI  5.3.0.0
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.

{
   APIDBG("Entry: dest: %p, *dest: %p, cpu_num: %d\n", dest, *dest, cpu_num);

   int retval;
   CpuInfo_t *cpu;
   int i;

   if ( ( cpu = allocate_cpu(cpu_num) ) == NULL ) {
      *dest = NULL;
      return PAPI_ENOMEM;
   }

   /* Call the component to fill in anything special. */
   for ( i = 0; i < papi_num_components; i++ ) {
      if (_papi_hwd[i]->cmp_info.disabled) continue;
      retval = _papi_hwd[i]->init_thread( cpu->context[i] );
      if ( retval ) {
     free_cpu( &cpu );
     *dest = NULL;
     return retval;
      }
   }

   insert_cpu( cpu );

   *dest = cpu;
   return PAPI_OK;
}

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.

{
   APIDBG("Entry: here: %p\n", here);
    
   CpuInfo_t *tmp = NULL;
   int retval = PAPI_OK;

   _papi_hwi_lock( CPUS_LOCK );

   tmp = _papi_hwi_lookup_cpu(cpu_num);
   if ( tmp == NULL ) {
      retval = _papi_hwi_initialize_cpu( &tmp, cpu_num );
   }

   /* Increment use count */
   tmp->num_users++;

   if ( retval == PAPI_OK ) {
      *here = tmp;
   }

   _papi_hwi_unlock( CPUS_LOCK );
    
   return retval;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 306 of file cpus.c.

{
   APIDBG("Entry: cpu: %p, cpu_num: %d\n", cpu, cpu->cpu_num);

   free_cpu( &cpu );

   return PAPI_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines