GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions | Variables
pumap.c File Reference
#include "ghost/pumap.h"
#include "ghost/machine.h"
#include "ghost/util.h"
#include "ghost/locality.h"
Include dependency graph for pumap.c:

Functions

ghost_error ghost_pumap_npu (int *nPUs, int numanode)
 Get the number of processing units in total or in a given NUMA node. More...
 
ghost_error ghost_pumap_nidle (int *nPUs, int numanode)
 Get the number of idle processing units in total or in a given NUMA node. More...
 
ghost_error ghost_pumap_setidle (hwloc_bitmap_t cpuset)
 Set the given CPU set in the PU map to idle. More...
 
ghost_error ghost_pumap_setidle_idx (int idx)
 Set the given index in the PU map to idle. More...
 
ghost_error ghost_pumap_setbusy (hwloc_bitmap_t cpuset)
 Set the given CPU set in the PU map to busy. More...
 
ghost_error ghost_pumap_get (ghost_pumap **map)
 Get the PU map. More...
 
ghost_error ghost_pumap_create (hwloc_cpuset_t cpuset)
 Create a PU map. More...
 
void ghost_pumap_destroy ()
 Destroy the PU map. More...
 
ghost_error ghost_pumap_string (char **str)
 Turn the PU mpa into a string. More...
 

Variables

static ghost_pumappumap = NULL
 
pthread_mutex_t ghost_pumap_mutex
 

Function Documentation

ghost_error ghost_pumap_create ( hwloc_cpuset_t  cpuset)

Create a PU map.

Parameters
cpusetThe CPU set to be covered by the PU map.
Returns
GHOST_SUCCESS on success or an error indicator.

Here is the call graph for this function:

void ghost_pumap_destroy ( )

Destroy the PU map.

ghost_error ghost_pumap_get ( ghost_pumap **  map)

Get the PU map.

Parameters
mapWhere to store the map.
Returns
GHOST_SUCCESS on success or an error indicator.
ghost_error ghost_pumap_nidle ( int *  nPUs,
int  numaNode 
)

Get the number of idle processing units in total or in a given NUMA node.

Parameters
nPUsWhere to store the number.
numaNodeThe NUMA node to consider or GHOST_NUMANODE_ANY.
Returns
GHOST_SUCCESS on success or an error indicator.

Here is the call graph for this function:

ghost_error ghost_pumap_npu ( int *  nPUs,
int  numaNode 
)

Get the number of processing units in total or in a given NUMA node.

Parameters
nPUsWhere to store the number.
numaNodeThe NUMA node to consider or GHOST_NUMANODE_ANY.
Returns
::GHOST_SUCCESS on success or an error indicator.

Here is the call graph for this function:

ghost_error ghost_pumap_setbusy ( hwloc_bitmap_t  cpuset)

Set the given CPU set in the PU map to busy.

Parameters
cpusetThe CPU set to be set busy.
Returns
GHOST_SUCCESS on success or an error indicator.

If the CPU set is not included in the PU map's CPU set an error is returned.

ghost_error ghost_pumap_setidle ( hwloc_bitmap_t  cpuset)

Set the given CPU set in the PU map to idle.

Parameters
cpusetThe CPU set to be set idle.
Returns
GHOST_SUCCESS on success or an error indicator.

If the CPU set is not included in the PU map's CPU set an error is returned.

ghost_error ghost_pumap_setidle_idx ( int  idx)

Set the given index in the PU map to idle.

Parameters
idxThe index.
Returns
GHOST_SUCCESS on success or an error indicator.

If the index is not included in the PU map's CPU set an error is returned.

Variable Documentation

pthread_mutex_t ghost_pumap_mutex
ghost_pumap* pumap = NULL
static