---
name: "memkind_hbw"
section: "3"
platform: "linux"
package: "libmemkind-dev"
version: "1.14.0-2"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/memkind_hbw"
---

# memkind\_hbw(3)

high bandwidth memory memkind operations. Note: This is EXPERIMENTAL API. The functionality and the header file itself can be changed (including non-backward compatible changes) or removed.

## NAME

memkind\_hbw - high bandwidth memory memkind operations.\
 **Note:** This is EXPERIMENTAL API. The functionality and the header file itself can be changed (including non-backward compatible changes) or removed.

## SYNOPSIS

```

int memkind_hbw_check_available(struct memkind *kind);
int memkind_hbw_hugetlb_check_available(struct memkind *kind);
int memkind_hbw_get_mbind_nodemask(struct memkind *kind, unsigned long *nodemask, unsigned long maxnode);
int memkind_hbw_get_preferred_mbind_nodemask(struct memkind *kind, unsigned long *nodemask, unsigned long maxnode);
int memkind_hbw_all_get_mbind_nodemask(struct memkind *kind, unsigned long *nodemask, unsigned long maxnode);
void memkind_hbw_init_once(void);
void memkind_hbw_hugetlb_init_once(void);
void memkind_hbw_all_hugetlb_init_once(void);
void memkind_hbw_preferred_init_once(void);
void memkind_hbw_preferred_hugetlb_init_once(void);
void memkind_hbw_interleave_init_once(void);
```

## DESCRIPTION

High bandwidth memory memkind operations.

**memkind\_hbw\_check\_available**() returns zero if library was able to detect heterogeneous NUMA node bandwidths.   Returns **MEMKIND\_ERROR\_UNAVAILABLE** if the detection mechanism failed. Detection mechanism can be also overridden by the environment variable **MEMKIND\_HBW\_NODES** as described in the [**memkind**(3)](/memkind/3.md) man page.

**memkind\_hbw\_hugetlb\_check\_available**() In addition to checking for high bandwidth memory as is done by **memkind\_hbw\_check\_available**(), this also checks for 2MB huge pages as is done by **memkind\_hugetlb\_check\_available\_2mb**().

**memkind\_hbw\_get\_mbind\_nodemask**() sets the *nodemask* bit to one that corresponds to the high bandwidth NUMA nodes that has the closest NUMA distance to the CPU of the calling process. All other bits up to *maxnode* are set to zero. The *nodemask* can be used in conjunction with the [**mbind**(2)](/mbind/2.md) system call.

**Note:** The function will fail if two or more high bandwidth memory NUMA nodes are in the same the closest NUMA distance to the CPU of the calling process. **memkind\_hbw\_get\_preferred\_mbind\_nodemask**() sets the *nodemask* bit to one that corresponds to the high bandwidth NUMA node that has the closest NUMA distance to the CPU of the calling process. All other bits up to *maxnode* are set to zero. The *nodemask* can be used in conjunction with the [**mbind**(2)](/mbind/2.md) system call.

**memkind\_hbw\_all\_get\_mbind\_nodemask**() sets the *nodemask* bits to one that correspond to the all high bandwidth NUMA nodes in the system. All other bits up to *maxnode* are set to zero. The *nodemask* can be used in conjunction with the [**mbind**(2)](/mbind/2.md) system call.

**memkind\_hbw\_init\_once**() This function initializes **MEMKIND\_HBW** kind and it should not be called more than once. **Note:** **memkind\_hbw\_init\_once**() may reserve some extra memory.

**memkind\_hbw\_hugetlb\_init\_once**() This function initializes **MEMKIND\_HBW\_HUGETLB** kind and it should not be called more than once. **Note:** **memkind\_hbw\_hugetlb\_init\_once**() may reserve some extra memory.

**memkind\_hbw\_preferred\_init\_once**() This function initializes **MEMKIND\_HBW\_PREFERRED** kind and it should not be called more than once. **Note:** **memkind\_hbw\_preferred\_init\_once**() may reserve some extra memory.

**memkind\_hbw\_preferred\_hugetlb\_init\_once**() This function initializes **MEMKIND\_HBW\_PREFERRED\_HUGETLB** kind and it should not be called more than once. **Note:** **memkind\_hbw\_preferred\_hugetlb\_init\_once**() may reserve some extra memory.

**memkind\_hbw\_all\_hugetlb\_init\_once**() This function initializes **MEMKIND\_HBW\_ALL\_HUGETLB** kind and it should not be called more than once. **Note:** **memkind\_hbw\_all\_hugetlb\_init\_once**() may reserve some extra memory.

**memkind\_hbw\_interleave\_init\_once**() This function initializes **MEMKIND\_HBW\_INTERLEAVE** kind and it should not be called more than once. **Note:** **memkind\_hbw\_interleave\_init\_once**() may reserve some extra memory.

## COPYRIGHT

Copyright (C) 2014 - 2021 Intel Corporation. All rights reserved.

## SEE ALSO

[**memkind**(3)](/memkind/3.md), [**memkind\_arena**(3)](/memkind_arena/3.md), [**memkind\_default**(3)](/memkind_default/3.md), [**memkind\_hugetlb**(3)](/memkind_hugetlb/3.md), [**memkind\_pmem**(3)](/memkind_pmem/3.md), [**jemalloc**(3)](/jemalloc/3.md), [**mbind**(2)](/mbind/2.md), [**mmap**(2)](/mmap/2.md)
