|
Packit Service |
7f3b24 |
.\" SPDX-License-Identifier: BSD-2-Clause
|
|
Packit Service |
7f3b24 |
.\" Copyright (C) 2014 - 2020 Intel Corporation.
|
|
Packit |
345191 |
.\"
|
|
Packit |
345191 |
.TH "AUTOHBW" 7 "2016-07-28" "Intel Corporation" "AUTOHBW" \" -*- nroff -*-
|
|
Packit |
345191 |
.SH "NAME"
|
|
Packit |
345191 |
libautohbw.so \- An interposer library for redirecting heap allocations
|
|
Packit |
345191 |
.SH "SYNOPSIS"
|
|
Packit |
345191 |
.BR LD_PRELOAD=libautohbw.so
|
|
Packit |
345191 |
command {arguments ...}
|
|
Packit |
345191 |
.SH "DESCRIPTION"
|
|
Packit |
345191 |
.B AutoHBW
|
|
Packit |
345191 |
library
|
|
Packit |
345191 |
.BR (libautohbw.so)
|
|
Packit |
345191 |
is an interposer library for redirecting heap allocations
|
|
Packit |
345191 |
.B (malloc, calloc, realloc, valloc, posix_memalign, memlign)
|
|
Packit |
345191 |
to high-bandwidth
|
|
Packit |
345191 |
.B (HBW)
|
|
Packit |
345191 |
memory. Consequently, AutoHBW library can be used to
|
|
Packit |
345191 |
automatically allocate high-bandwidth memory without any modification to
|
|
Packit |
345191 |
source code of an application.
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
For instance, the following command-line runs existing binary /bin/ls with
|
|
Packit |
345191 |
AutoHBW library, automatically redirecting heap allocations (larger than a given
|
|
Packit |
345191 |
threshold) to high-bandwidth memory.
|
|
Packit |
345191 |
.IP
|
|
Packit |
345191 |
.B LD_PRELOAD=libautohbw.so
|
|
Packit |
345191 |
/bin/ls
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.SH "ENVIRONMENT"
|
|
Packit |
345191 |
|
|
Packit |
345191 |
The behavior of AutoHBW library is controlled by the following environment
|
|
Packit |
345191 |
variables.
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.PP
|
|
Packit |
345191 |
.B AUTO_HBW_SIZE=x:[y]
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
Indicates that any allocation larger than
|
|
Packit |
345191 |
.I x
|
|
Packit |
345191 |
and smaller than
|
|
Packit |
345191 |
.I y
|
|
Packit |
345191 |
should be
|
|
Packit |
345191 |
allocated in HBW memory.
|
|
Packit |
345191 |
.I x
|
|
Packit |
345191 |
and
|
|
Packit |
345191 |
.I y
|
|
Packit |
345191 |
can be followed by a K, M, or G to indicate
|
|
Packit |
345191 |
the size in Kilo/Memga/Giga bytes (e.g., 4K, 3M, 2G).
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
|
|
Packit |
345191 |
Examples:
|
|
Packit |
345191 |
.IP AUTO_HBW_SIZE=4K
|
|
Packit |
345191 |
# allocations larger than 4K allocated in HBW
|
|
Packit |
345191 |
.IP AUTO_HBW_SIZE=1M:5M
|
|
Packit |
345191 |
# allocations between 1M and 5M allocated in HBW
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.PP
|
|
Packit |
345191 |
.B AUTO_HBW_LOG=level
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
Sets the value of logging (printing)
|
|
Packit |
345191 |
.I level.
|
|
Packit |
345191 |
If
|
|
Packit |
345191 |
.I level
|
|
Packit |
345191 |
is:
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.IP -1
|
|
Packit |
345191 |
no messages are printed
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.IP 0
|
|
Packit |
345191 |
no allocations messages are printed but INFO messages are printed
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.IP 1
|
|
Packit |
345191 |
a log message is printed for each allocation (Default)
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.IP 2
|
|
Packit |
345191 |
a log message is printed for each allocation with a backtrace.
|
|
Packit |
345191 |
Redirect this output and use
|
|
Packit |
345191 |
.B autohbw_get_src_lines.pl
|
|
Packit |
345191 |
to find source lines for each allocation. Your application must
|
|
Packit |
345191 |
be compiled with
|
|
Packit |
345191 |
.B -g
|
|
Packit |
345191 |
to see source lines.
|
|
Packit |
345191 |
.PP
|
|
Packit |
345191 |
Notes:
|
|
Packit |
345191 |
.IP
|
|
Packit |
345191 |
1. Logging adds extra overhead. Therefore, for performance
|
|
Packit |
345191 |
critical runs, logging level should be 0
|
|
Packit |
345191 |
.IP
|
|
Packit |
345191 |
2. The amount of free memory printed with log messages is only
|
|
Packit |
345191 |
approximate -- e.g. pages that are not touched yet are excluded
|
|
Packit |
345191 |
.PP
|
|
Packit |
345191 |
Examples:
|
|
Packit |
345191 |
.IP AUTO_HBW_LOG=1
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.PP
|
|
Packit |
345191 |
.B AUTO_HBW_MEM_TYPE=memory_type
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
Sets the type of memory type that should be automatically allocated. By
|
|
Packit |
345191 |
default, this type is MEMKIND_HBW_PREFERRED, if MCDRAM is found in your
|
|
Packit |
345191 |
system; otherwise, the default is MEMKIND_DEFAULT. The names of memory
|
|
Packit |
345191 |
types are defined in
|
|
Packit |
345191 |
.B memkind(3)
|
|
Packit |
345191 |
man page.
|
|
Packit |
345191 |
.B memory_type
|
|
Packit |
345191 |
has to be one of
|
|
Packit |
345191 |
.B MEMKIND_DEFAULT, MEMKIND_HUGETLB, MEMKIND_INTERLEAVE, MEMKIND_HBW,
|
|
Packit |
345191 |
.B MEMKIND_HBW_PREFERRED, MEMKIND_HBW_HUGETLB, MEMKIND_HBW_PREFERRED_HUGETLB,
|
|
Packit |
345191 |
.B MEMKIND_HBW_GBTLB (DEPRECATED), MEMKIND_HBW_PREFERRED_GBTLB (DEPRECATED), MEMKIND_GBTLB (DEPRECATED),
|
|
Packit |
345191 |
.B MEMKIND_HBW_INTERLEAVE
|
|
Packit |
345191 |
|
|
Packit |
345191 |
If you are requesting any huge
|
|
Packit |
345191 |
TLB pages, please make sure that the requested type is currently enabled
|
|
Packit |
345191 |
in your OS.
|
|
Packit |
345191 |
|
|
Packit |
345191 |
Examples:
|
|
Packit |
345191 |
.IP AUTO_HBW_MEM_TYPE=MEMKIND_HBW_PREFERRED
|
|
Packit |
345191 |
# (default, if MCDRAM present)
|
|
Packit |
345191 |
.IP AUTO_HBW_MEM_TYPE=MEMKIND_DEFAULT
|
|
Packit |
345191 |
# (default, if MCDRAM absent)
|
|
Packit |
345191 |
.IP AUTO_HBW_MEM_TYPE=MEMKIND_HBW_HUGETLB
|
|
Packit |
345191 |
.IP AUTO_HBW_MEM_TYPE=MEMKIND_HUGETLB
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.PP
|
|
Packit |
345191 |
.B AUTO_HBW_DEBUG=0|1|2
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
Set the debug message printing level. Default is 0. This is mainly for
|
|
Packit |
345191 |
development.
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.SH "NOTES"
|
|
Packit |
345191 |
It is possible to temporarily disable/enable automatic HBW allocations by
|
|
Packit |
345191 |
calling disableAutoHBW() and enableAutoHBW() in source code. To call
|
|
Packit |
345191 |
these routines, please include
|
|
Packit |
345191 |
.B autohbw_api.h
|
|
Packit |
345191 |
header file and link with -lautohbw.
|
|
Packit |
345191 |
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
If high-bandwidth memory is not physically present in your system,
|
|
Packit |
345191 |
the environment variable
|
|
Packit |
345191 |
.B MEMKIND_HBW_NODES
|
|
Packit |
345191 |
must be set to indicate the high-bandwidth node as indicated in
|
|
Packit |
345191 |
.B memkind(3).
|
|
Packit |
345191 |
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.SH "EXAMPLES"
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
The following will run /bin/ls with AutoHBW library. Make sure that paths to
|
|
Packit |
345191 |
both libautohbw.so and libmemkind.so are included in
|
|
Packit |
345191 |
.B LD_LIBRARY_PATH.
|
|
Packit |
345191 |
.IP
|
|
Packit |
345191 |
.B LD_PRELOAD=libautohbw.so
|
|
Packit |
345191 |
/bin/ls -l
|
|
Packit |
345191 |
.PP
|
|
Packit |
345191 |
To run with MPI, a shell script must be created, with the correct LD_PRELOAD
|
|
Packit |
345191 |
command for each rank. For example, if we put
|
|
Packit |
345191 |
.B LD_PRELOAD=libautohbw.so /bin/ls
|
|
Packit |
345191 |
in a shell script named autohbw_test.sh, it can be executed with 2 MPI ranks as:
|
|
Packit |
345191 |
.br
|
|
Packit |
345191 |
.IP
|
|
Packit |
345191 |
.B mpirun -n 2 ./autohbw_test.sh
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.SH "COPYRIGHT"
|
|
Packit Service |
7f3b24 |
Copyright (C) 2014 - 2020 Intel Corporation. All rights reserved.
|
|
Packit |
345191 |
|
|
Packit |
345191 |
.SH "SEE ALSO"
|
|
Packit |
345191 |
.BR memkind(3)
|
|
Packit |
345191 |
.BR malloc (3),
|
|
Packit |
345191 |
.BR numactl (8),
|
|
Packit |
345191 |
|
|
Packit |
345191 |
|
|
Packit |
345191 |
|
|
Packit |
345191 |
|
|
Packit |
345191 |
|
|
Packit |
345191 |
|
|
Packit |
345191 |
|