15 #ifndef HWLOC_LINUX_LIBNUMA_H 
   16 #define HWLOC_LINUX_LIBNUMA_H 
   57 static __hwloc_inline 
int 
   59                                     unsigned long *mask, 
unsigned long *maxnode)
 
   62   unsigned long outmaxnode = -1;
 
   65   *maxnode = (*maxnode + 8*
sizeof(*mask) - 1) & ~(8*
sizeof(*mask) - 1);
 
   66   memset(mask, 0, *maxnode/8);
 
   73       mask[node->
os_index/
sizeof(*mask)/8] |= 1UL << (node->
os_index % (
sizeof(*mask)*8));
 
   74       if (outmaxnode == (
unsigned long) -1 || outmaxnode < node->os_index)
 
   86   *maxnode = outmaxnode+1;
 
  100 static __hwloc_inline 
int 
  102                                       unsigned long *mask, 
unsigned long *maxnode)
 
  105   unsigned long outmaxnode = -1;
 
  108   *maxnode = (*maxnode + 8*
sizeof(*mask) - 1) & ~(8*
sizeof(*mask) - 1);
 
  109   memset(mask, 0, *maxnode/8);
 
  118       mask[node->
os_index/
sizeof(*mask)/8] |= 1UL << (node->
os_index % (
sizeof(*mask)*8));
 
  119       if (outmaxnode == (
unsigned long) -1 || outmaxnode < node->os_index)
 
  131   *maxnode = outmaxnode+1;
 
  144 static __hwloc_inline 
int 
  146                                       const unsigned long *mask, 
unsigned long maxnode)
 
  155           && (mask[node->
os_index/
sizeof(*mask)/8] & (1UL << (node->
os_index % (
sizeof(*mask)*8)))))
 
  177 static __hwloc_inline 
int 
  179                                         const unsigned long *mask, 
unsigned long maxnode)
 
  188           && (mask[node->
os_index/
sizeof(*mask)/8] & (1UL << (node->
os_index % (
sizeof(*mask)*8)))))
 
  234 static __hwloc_inline 
struct bitmask *
 
  236 static __hwloc_inline 
struct bitmask *
 
  240   struct bitmask *bitmask = numa_allocate_cpumask();
 
  248         numa_bitmask_setbit(bitmask, node->
os_index);
 
  252       numa_bitmask_setbit(bitmask, 0);
 
  267 static __hwloc_inline 
struct bitmask *
 
  269 static __hwloc_inline 
struct bitmask *
 
  273   struct bitmask *bitmask = numa_allocate_cpumask();
 
  281         numa_bitmask_setbit(bitmask, node->
os_index);
 
  285       numa_bitmask_setbit(bitmask, 0);
 
  296 static __hwloc_inline 
int 
  298                                         const struct bitmask *bitmask)
 
  306       if (numa_bitmask_isbitset(bitmask, node->
os_index))
 
  310     if (numa_bitmask_isbitset(bitmask, 0))
 
  324 static __hwloc_inline 
int 
  326                                          const struct bitmask *bitmask)
 
  334       if (numa_bitmask_isbitset(bitmask, node->
os_index))
 
  338     if (numa_bitmask_isbitset(bitmask, 0))
 
Structure of a topology object. 
Definition: hwloc.h:331
static __hwloc_inline int hwloc_nodeset_from_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_nodeset_t nodeset, const struct bitmask *bitmask)
Convert libnuma bitmask bitmask into hwloc NUMA node set nodeset. 
Definition: linux-libnuma.h:325
HWLOC_DECLSPEC int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap, unsigned id) __hwloc_attribute_pure
Test whether index id is part of bitmap bitmap. 
hwloc_const_bitmap_t hwloc_const_cpuset_t
A non-modifiable hwloc_cpuset_t. 
Definition: hwloc.h:118
static __hwloc_inline struct bitmask * hwloc_nodeset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset) __hwloc_attribute_malloc
Convert hwloc NUMA node set nodeset into the returned libnuma bitmask. 
Definition: linux-libnuma.h:270
static __hwloc_inline int hwloc_nodeset_from_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_nodeset_t nodeset, const unsigned long *mask, unsigned long maxnode)
Convert the array of unsigned long mask into hwloc NUMA node set. 
Definition: linux-libnuma.h:178
HWLOC_DECLSPEC int hwloc_get_type_depth(hwloc_topology_t topology, hwloc_obj_type_t type)
Returns the depth of objects of type type. 
struct hwloc_obj_memory_s memory
Memory attributes. 
Definition: hwloc.h:337
HWLOC_DECLSPEC void hwloc_bitmap_zero(hwloc_bitmap_t bitmap)
Empty the bitmap bitmap. 
static __hwloc_inline int hwloc_cpuset_from_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_cpuset_t cpuset, const unsigned long *mask, unsigned long maxnode)
Convert the array of unsigned long mask into hwloc CPU set. 
Definition: linux-libnuma.h:145
static __hwloc_inline struct bitmask * hwloc_cpuset_to_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset) __hwloc_attribute_malloc
Convert hwloc CPU set cpuset into the returned libnuma bitmask. 
Definition: linux-libnuma.h:237
unsigned os_index
OS-provided physical index number. 
Definition: hwloc.h:334
HWLOC_DECLSPEC int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure
Test whether bitmap bitmap is empty. 
hwloc_bitmap_t hwloc_nodeset_t
A node set is a bitmap whose bits are set according to NUMA memory node physical OS indexes...
Definition: hwloc.h:133
static __hwloc_inline int hwloc_nodeset_to_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, unsigned long *mask, unsigned long *maxnode)
Convert hwloc NUMA node set nodeset into the array of unsigned long mask. 
Definition: linux-libnuma.h:101
HWLOC_DECLSPEC void hwloc_bitmap_or(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res. 
hwloc_bitmap_t hwloc_cpuset_t
A CPU set is a bitmap whose bits are set according to CPU physical OS indexes. 
Definition: hwloc.h:116
NUMA node. A set of processors around memory which the processors can directly access. 
Definition: hwloc.h:172
hwloc_uint64_t local_memory
Local memory (in bytes) 
Definition: hwloc.h:312
HWLOC_DECLSPEC void hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)
Copy the contents of bitmap src into the already allocated bitmap dst. 
HWLOC_DECLSPEC void hwloc_bitmap_fill(hwloc_bitmap_t bitmap)
Fill bitmap bitmap with all possible indexes (even if those objects don't exist or are otherwise unav...
static __hwloc_inline hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth(hwloc_topology_t topology, hwloc_const_cpuset_t set, unsigned depth, hwloc_obj_t prev)
Iterate through same-depth objects covering at least CPU set set. 
Definition: helper.h:307
hwloc_const_bitmap_t hwloc_const_nodeset_t
A non-modifiable hwloc_nodeset_t. 
Definition: hwloc.h:136
static __hwloc_inline hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology) __hwloc_attribute_pure
Get complete CPU set. 
Definition: helper.h:726
static __hwloc_inline hwloc_obj_t hwloc_get_next_obj_by_depth(hwloc_topology_t topology, unsigned depth, hwloc_obj_t prev)
Returns the next object at depth depth. 
static __hwloc_inline int hwloc_cpuset_from_linux_libnuma_bitmask(hwloc_topology_t topology, hwloc_cpuset_t cpuset, const struct bitmask *bitmask)
Convert libnuma bitmask bitmask into hwloc CPU set cpuset. 
Definition: linux-libnuma.h:297
No object of given type exists in the topology. 
Definition: hwloc.h:1079
struct hwloc_topology * hwloc_topology_t
Topology context. 
Definition: hwloc.h:577
hwloc_cpuset_t cpuset
CPUs covered by this object. 
Definition: hwloc.h:375
HWLOC_DECLSPEC void hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id)
Add index id in bitmap bitmap. 
static __hwloc_inline int hwloc_cpuset_to_linux_libnuma_ulongs(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, unsigned long *mask, unsigned long *maxnode)
Convert hwloc CPU set cpuset into the array of unsigned long mask. 
Definition: linux-libnuma.h:58