AUTOHBW(7)
β¨ AUTOHBW β the libautohbw.so glow-up β¨
ok so bestie, welcome to AUTOHBW(7), aka the manual page for libautohbw.so β an interposer library for redirecting heap allocations. it's giving malloc-but-make-it-fast π
π SYNOPSIS
LD_PRELOAD=libautohbw.so command {arguments ...}
πΈ DESCRIPTION
k so here's the tea. AutoHBW library (libautohbw.so) is an interposer library for redirecting heap allocations β and by "heap allocations" I mean malloc, calloc, realloc, valloc, posix_memalign, and memlign β straight into high-bandwidth (HBW) memory. and the way that means you can justβ¦ automatically allocate high-bandwidth memory without touching a single line of your application's source code?? iconic behavior, no notes π«Ά
like, for instance, this command-line right here runs the existing binary /bin/ls with the AutoHBW library, and it automatically redirects heap allocations (the ones bigger than a given threshold) to high-bandwidth memory:
LD_PRELOAD=libautohbw.so /bin/ls
literally zero source changes. the app doesn't even know. main character energy fr fr β¨
π¦ ENVIRONMENT
the behavior of the AutoHBW library is controlled by these environment variables, and you're gonna want to know all of them:
AUTO_HBW_SIZE=x:[y]
says that any allocation larger than x and smaller than y should be allocated in HBW memory. x and y can be followed by a K, M, or G to indicate the size in Kilo/Memga/Giga bytes (e.g., 4K, 3M, 2G).
Examples:
AUTO_HBW_SIZE=4Kβ# allocations larger than 4K allocated in HBWAUTO_HBW_SIZE=1M:5Mβ# allocations between 1M and 5M allocated in HBW
AUTO_HBW_LOG=level
sets the value of the logging (printing) level. if level is:
-1β no messages are printed0β no allocations messages are printed but INFO messages are printed1β a log message is printed for each allocation (Default)2β a log message is printed for each allocation with a backtrace. redirect this output and useautohbw_get_src_lines.plto find source lines for each allocation. your application must be compiled with-gto see source lines.
Notes:
- logging adds extra overhead. therefore, for performance critical runs, logging level should be
0 - the amount of free memory printed with log messages is only approximate β e.g. pages that are not touched yet are excluded
Examples:
AUTO_HBW_LOG=1
AUTO_HBW_MEM_TYPE=memory_type
sets the type of memory type that should be automatically allocated. by default, this type is MEMKIND_HBW_PREFERRED, if MCDRAM is found in your system; otherwise, the default is MEMKIND_DEFAULT. the names of memory types are defined in memkind(3) man page. memory_type has to be one of:
MEMKIND_DEFAULTMEMKIND_HUGETLBMEMKIND_INTERLEAVEMEMKIND_HBWMEMKIND_HBW_PREFERREDMEMKIND_HBW_HUGETLBMEMKIND_HBW_PREFERRED_HUGETLBMEMKIND_HBW_GBTLB(DEPRECATED)MEMKIND_HBW_PREFERRED_GBTLB(DEPRECATED)MEMKIND_GBTLB(DEPRECATED)MEMKIND_HBW_INTERLEAVE
π¨ if you are requesting any huge TLB pages, please make sure that the requested type is currently enabled in your OS. do not skip this step bestie, it will not be cute.
Examples:
AUTO_HBW_MEM_TYPE=MEMKIND_HBW_PREFERREDβ# (default, if MCDRAM present)AUTO_HBW_MEM_TYPE=MEMKIND_DEFAULTβ# (default, if MCDRAM absent)AUTO_HBW_MEM_TYPE=MEMKIND_HBW_HUGETLBAUTO_HBW_MEM_TYPE=MEMKIND_HUGETLB
AUTO_HBW_DEBUG=0|1|2
set the debug message printing level. default is 0. this is mainly for development.
π NOTES
it is possible to temporarily disable/enable automatic HBW allocations by calling disableAutoHBW() and enableAutoHBW() in source code. to call these routines, please include the autohbw_api.h header file and link with -lautohbw. (yes, actual code this time. she contains multitudes.)
if high-bandwidth memory is not physically present in your system, the environment variable MEMKIND_HBW_NODES must be set to indicate the high-bandwidth node as indicated in memkind(3). don't forget it or it's gonna be a whole thing π
π₯ EXAMPLES
the following will run /bin/ls with the AutoHBW library. make sure that paths to both libautohbw.so and libmemkind.so are included in LD_LIBRARY_PATH.
LD_PRELOAD=libautohbw.so /bin/ls -l
to run with MPI, a shell script must be created, with the correct LD_PRELOAD command for each rank. for example, if we put LD_PRELOAD=libautohbw.so /bin/ls in a shell script named autohbw_test.sh, it can be executed with 2 MPI ranks as:
mpirun -n 2 ./autohbw_test.sh
slay. go forth and interpose π§
π COPYRIGHT
Copyright (C) 2014 - 2020 Intel Corporation. All rights reserved.
π SEE ALSO
and that's the whole page bestie, tysm for reading π this one came from Intel Corporation, dated 2016-07-28, and it lives in section AUTOHBW(7). periodt. π
π¦ where this page comes from
- centos-stream 9: memkind 1.11.0-2.el9 Β· BSD
- debian bookworm: libmemkind-dev 1.14.0-2 Β· BSD-3-Clause
- fedora 43: memkind 1.14.0-11.fc43 Β· BSD-2-Clause
- ubuntu jammy: libmemkind-dev 1.13.0-1 Β· BSD-3-Clause
- ubuntu noble: libmemkind-dev 1.14.0-3build1 Β· BSD-3-Clause
- π the page's license: BSD-2-Clause
- Copyright (C) 2014 - 2020 Intel Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms