Skip to content

Commit ca8ca79

Browse files
authored
Underline importance of NUM_THREADS setting for BUFFER allocation
following augray's suggestion from #1451, and incorporating ashwinyes' comments from #1141 on the importance of NUM_THREADS even for single-threaded builds.
1 parent 0ab5bf1 commit ca8ca79

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: USAGE.md

+14
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ Please build OpenBLAS with larger `NUM_THREADS`. For example, `make
1414
NUM_THREADS=32` or `make NUM_THREADS=64`. In `Makefile.system`, we will set
1515
`MAX_CPU_NUMBER=NUM_THREADS`.
1616

17+
Despite its name, and due to the use of memory buffers in functions like SGEMM,
18+
the setting of NUM_THREADS can be relevant even for a single-threaded build
19+
of OpenBLAS, if such functions get called by multiple threads of a program
20+
that uses OpenBLAS. In some cases, the affected code may simply crash or throw
21+
a segmentation fault without displaying the above warning first.
22+
23+
Note that the number of threads used at runtime can be altered to differ from the
24+
value NUM_THREADS was set to at build time. At runtime, the actual number of
25+
threads can be set anywhere from 1 to the build's NUM_THREADS (note however,
26+
that this does not change the number of memory buffers that will be allocated,
27+
which is set at build time). The number of threads for a process can be set by
28+
using the mechanisms described below.
29+
30+
1731
#### How can I use OpenBLAS in multi-threaded applications?
1832

1933
If your application is already multi-threaded, it will conflict with OpenBLAS

0 commit comments

Comments
 (0)