MEMKIND_HBW(3)

πŸ’– MEMKIND_HBW β€” high bandwidth memory memkind operations πŸ’–

ok so bestie. welcome to MEMKIND_HBW(3), the manual page for the high bandwidth memory memkind operations. this is the one where your code gets to hang out with the fast memory. sit down, hydrate, let's go ✨

⚠️ REAL TALK: this is EXPERIMENTAL API. the functionality AND the header file itself can be changed (including non-backward compatible changes) or removed. like, entirely. so don't build your whole personality on it, okay? 🫢

✨ 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. that's the whole vibe. now let's meet the cast πŸ’…

🧚 the checkers

  • memkind_hbw_check_available() β€” returns zero if the library was able to detect heterogeneous NUMA node bandwidths. if the detection mechanism failed, you get MEMKIND_ERROR_UNAVAILABLE back instead. also, the detection mechanism can be overridden by the environment variable MEMKIND_HBW_NODES, as described in the memkind(3) man page. iykyk.
  • 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(). two for one, we love a multitasker πŸ’–

πŸŽ€ the nodemask girlies

  • 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) 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) 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) system call. ALL of them. every single one. periodt.

πŸ‘‘ the init-once-ers

these are giving "call me one time and one time only" energy. literally.

  • 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.
🫢 lowkey the "may reserve some extra memory" note is on every single one of them. not me repeating it six times. that's just the canon, bestie.

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


🌈 SEE ALSO 🌈


ok that's the whole page, you ate it, go forth and allocate πŸ’…βœ¨

Intel Corporation β€” 2016-06-13 β€” MEMKIND_HBW(3) πŸŽ€ thanks for reading, bestie, love u, bye πŸ¦‹

πŸ“¦ where this page comes from