GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pumap.h
Go to the documentation of this file.
1 
7 #ifndef GHOST_PUMAP_H
8 #define GHOST_PUMAP_H
9 #include <hwloc.h>
10 
11 #include "error.h"
12 
16 typedef struct ghost_pumap {
24  hwloc_obj_t **PUs;
28  hwloc_cpuset_t cpuset;
34  hwloc_cpuset_t busy;
38  int nDomains;
39 } ghost_pumap;
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
52  ghost_error ghost_pumap_create(hwloc_cpuset_t cpuset);
56  void ghost_pumap_destroy();
74  ghost_error ghost_pumap_setidle(hwloc_bitmap_t cpuset);
94  ghost_error ghost_pumap_setbusy(hwloc_bitmap_t cpuset);
103  ghost_error ghost_pumap_nidle(int *nPUs, int numaNode);
104 
113  ghost_error ghost_pumap_npu(int *nPUs, int numaNode);
114 
124  ghost_error ghost_pumap_string(char **str);
125 
126  extern pthread_mutex_t ghost_pumap_mutex;
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 
133 #endif
ghost_error ghost_pumap_setidle_idx(int idx)
Set the given index in the PU map to idle.
Definition: pumap.c:76
ghost_error ghost_pumap_get(ghost_pumap **map)
Get the PU map.
Definition: pumap.c:106
ghost_error ghost_pumap_nidle(int *nPUs, int numaNode)
Get the number of idle processing units in total or in a given NUMA node.
Definition: pumap.c:37
pthread_mutex_t ghost_pumap_mutex
Definition: pumap.c:7
ghost_error ghost_pumap_string(char **str)
Turn the PU mpa into a string.
Definition: pumap.c:252
Types, functions and macros for error handling.
hwloc_cpuset_t busy
A bitmap indicating busy cores.
Definition: pumap.h:34
ghost_error
Error return type.
Definition: error.h:23
The PU (processing units) map containing all available processing units inside a given CPU set...
Definition: pumap.h:16
int nDomains
The number of NUMA domains covered by the CPU map.
Definition: pumap.h:38
ghost_error ghost_pumap_npu(int *nPUs, int numaNode)
Get the number of processing units in total or in a given NUMA node.
Definition: pumap.c:9
hwloc_cpuset_t cpuset
The cpuset for this CPU map.
Definition: pumap.h:28
ghost_error ghost_pumap_setbusy(hwloc_bitmap_t cpuset)
Set the given CPU set in the PU map to busy.
Definition: pumap.c:91
hwloc_obj_t ** PUs
Ordered list of processing units (PU).
Definition: pumap.h:24
ghost_error ghost_pumap_setidle(hwloc_bitmap_t cpuset)
Set the given CPU set in the PU map to idle.
Definition: pumap.c:61
ghost_error ghost_pumap_create(hwloc_cpuset_t cpuset)
Create a PU map.
Definition: pumap.c:122
void ghost_pumap_destroy()
Destroy the PU map.
Definition: pumap.c:232
struct ghost_pumap ghost_pumap
The PU (processing units) map containing all available processing units inside a given CPU set...