Skip to content

Commit f209fc7

Browse files
authored
Update Makefile.rule
add note about NUM_THREADS for package maintainers, add examples of programs that cause affinity troubles
1 parent ea1716c commit f209fc7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Makefile.rule

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,16 @@ VERSION = 0.3.6.dev
7272

7373
# You can define the maximum number of threads. Basically it should be less
7474
# than or equal to the number of CPU threads. If you don't specify one, it's
75-
# automatically detected by the the script.
75+
# automatically detected by the the build system.
7676
# If SMT (aka. HT) is enabled on the system, it may or may not be beneficial to
7777
# restrict NUM_THREADS to the number of physical cores. By default, the automatic
7878
# detection includes logical CPUs, thus allowing the use of SMT.
79+
# Users may opt at runtime to use less than NUM_THREADS threads.
80+
#
81+
# Note for package maintainers: you can build OpenBLAS with a large NUM_THREADS
82+
# value (eg. 32-256) if you expect your users to use that many threads. Due to the way
83+
# some internal structures are allocated, using a large NUM_THREADS value has a RAM
84+
# footprint penalty, even if users reduce the actual number of threads at runtime.
7985
# NUM_THREADS = 24
8086

8187
# If you have enabled USE_OPENMP and your application would call
@@ -138,6 +144,7 @@ NO_WARMUP = 1
138144
# to the same core(s) as OpenBLAS, possibly binding all threads to a single core.
139145
# For this reason, affinity handling is disabled by default. Can be safely enabled if nothing
140146
# else modifies affinity settings.
147+
# Note: enabling affinity has been known to cause problems with NumPy and R
141148
NO_AFFINITY = 1
142149

143150
# If you are compiling for Linux and you have more than 16 numa nodes or more than 256 cpus

0 commit comments

Comments
 (0)