Skip to content

Commit 3cf17b4

Browse files
authored
Small fixes/improvements to docs/Multithreading.md. (#764)
Details: - Added reminders that #include "blis.h" must be added to source files in order to access BLIS API function prototypes. Thanks to Barry Smith for suggesting this improvement. - Fixed pre-existing typos. - CREDITS file update.
1 parent dbc7981 commit 3cf17b4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CREDITS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ but many others have contributed code, ideas, and feedback, including
104104
Rene Sitt
105105
Tony Skjellum @tonyskjellum (The University of Tennessee at Chattanooga)
106106
Mikhail Smelyanskiy (Intel, Parallel Computing Lab)
107+
Barry Smith @BarrySmith (Argonne National Laboratory)
107108
Nathaniel Smith @njsmith
108109
Shaden Smith @ShadenSmith
109110
Tyler Smith @tlrmchlsmth (The University of Texas at Austin)

docs/Multithreading.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ If `BLIS_THREAD_IMPL` is not set, BLIS will attempt to query its shorthand alter
197197

198198
## Globally at runtime
199199

200+
***Note:** If you want to gain access to BLIS API function prototypes, be sure to #include "blis.h" from the relevant source files in your application.*
201+
200202
If you still wish to set the parallelization scheme globally, but you want to do so at runtime, BLIS provides a thread-safe API for specifying multithreading. Think of these functions as a way to modify the same internal data structure into which the environment variables are read. (Recall that the environment variables are only read once, when BLIS is initialized).
201203

202204
**Note**: If you set parallelization globally via environment variables and *then* your application *also* uses the global runtime API to set the ways of parallelism, the global runtime API will prevail.
@@ -246,7 +248,7 @@ This will result in both OpenMP and pthreads implementations being compiled and
246248
```c
247249
void bli_thread_set_thread_impl( timpl_t ti );
248250
```
249-
The function takes a `timpl_t`, which is an enumerated type that has three valid values corresponding to the four possible threading implementations: `BLIS_OPENMP`, `BLIS_POSIX`, `BLIS_HPX`, and `BLIS_SINGLE`. Forcing use of pthreads is as simple as calling:
251+
The function takes a `timpl_t`, which is an enumerated type that has four valid values corresponding to the four possible threading implementations: `BLIS_OPENMP`, `BLIS_POSIX`, `BLIS_HPX`, and `BLIS_SINGLE`. Forcing use of pthreads is as simple as calling:
250252
```c
251253
bli_thread_set_thread_impl( BLIS_POSIX )
252254
```
@@ -258,7 +260,9 @@ Note that if `BLIS_SINGLE` is specified, any other-related parameters previously
258260
259261
## Locally at runtime
260262
261-
In addition to the global methods based on environment variables and runtime function calls, BLIS also offers a local, *per-call* method of requesting parallelism at runtime. This method has the benefit of being thread-safe and flexible; your application can spawn two threads at the application level, with each thread requesting different degrees of parallelism from their respective calls to level-3 BLIS operations.
263+
***Note:** If you want to gain access to BLIS API function prototypes, be sure to #include "blis.h" from the relevant source files in your application.*
264+
265+
In addition to the global methods based on environment variables and runtime function calls, BLIS also offers a local, *per-call* method of requesting parallelism at runtime. This method has the benefit of being thread-safe and flexible; your application can spawn two or more threads at the application level, with each thread requesting different degrees of parallelism from their respective calls to level-3 BLIS operations.
262266
263267
As with environment variables and the global runtime API, there are two ways to specify parallelism: the automatic way and the manual way. Both ways involve allocating a BLIS-specific object, initializing the object and encoding the desired parallelization, and then passing a pointer to the object into one of the expert interfaces of either the [typed](docs/BLISTypedAPI.md) or [object](docs/BLISObjectAPI) APIs. We provide examples of utilizing this threading object below.
264268
@@ -321,7 +325,7 @@ This will result in both OpenMP and pthreads implementations being compiled and
321325
```c
322326
void bli_rntm_set_thread_impl( timpl_t ti, rntm_t* rntm );
323327
```
324-
The function takes a `timpl_t`, which is an enumerated type that has three valid values corresponding to the four possible threading implementations: `BLIS_OPENMP`, `BLIS_POSIX`, `BLIS_HPX`, and `BLIS_SINGLE`. Forcing use of pthreads is as simple as calling:
328+
The function takes a `timpl_t`, which is an enumerated type that has four valid values corresponding to the four possible threading implementations: `BLIS_OPENMP`, `BLIS_POSIX`, `BLIS_HPX`, and `BLIS_SINGLE`. Forcing use of pthreads is as simple as calling:
325329
```c
326330
bli_rntm_set_thread_impl( BLIS_POSIX, &rntm );
327331
```

0 commit comments

Comments
 (0)