GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Classes | Typedefs | Functions | Variables
pumap.h File Reference

Types and functions for the PU (processing unit) map functionality. More...

#include <hwloc.h>
#include "error.h"
Include dependency graph for pumap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ghost_pumap
 The PU (processing units) map containing all available processing units inside a given CPU set. More...
 

Typedefs

typedef struct ghost_pumap ghost_pumap
 The PU (processing units) map containing all available processing units inside a given CPU set. More...
 

Functions

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_get (ghost_pumap **map)
 Get the PU map. 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_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_npu (int *nPUs, int numaNode)
 Get the number of processing units in total or in a given NUMA node. More...
 
ghost_error ghost_pumap_string (char **str)
 Turn the PU mpa into a string. More...
 

Variables

pthread_mutex_t ghost_pumap_mutex
 

Detailed Description

Types and functions for the PU (processing unit) map functionality.

@{

Author
Moritz Kreutzer morit.nosp@m.z.kr.nosp@m.eutze.nosp@m.r@fa.nosp@m.u.de

Typedef Documentation

typedef struct ghost_pumap ghost_pumap

The PU (processing units) map containing all available processing units inside a given CPU set.

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