Skip to content

Commit

Permalink
Merge pull request #808 from katrinabrock/fix-cmdstan-1293
Browse files Browse the repository at this point in the history
Clarify meaning of "set flag" in cmdstan-guide
  • Loading branch information
WardBrian authored Aug 21, 2024
2 parents 5ae71eb + c120bdb commit 9a6b9fb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/cmdstan-guide/parallelization.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ on how to rewrite Stan models to use these functions see [Stan's User guide chap
Once a model is rewritten to use the above-mentioned functions, the model
must be compiled with the `STAN_THREADS` makefile flag. The flag can be
supplied in the `make` call but we recommend writing the flag to the
`make/local` file.
`make/local` file. If the `STAN_THREADS` flag is defined/non-empty,
threads will be enabled.


An example of the contents of `make/local` to enable threading with TBB:

Expand Down Expand Up @@ -77,7 +79,7 @@ implementations are [MPICH](https://www.mpich.org/) and [OpenMPI](https://www.op
Once a model is rewritten to use `map_rect`, additional makefile flags
must be written to the `make/local`. These are:

- `STAN_MPI`: Enables the use of MPI with Stan if `true`.
- `STAN_MPI`: Enables the use of MPI with Stan if defined.
- `CXX`: The name of the MPI C++ compiler wrapper. Typically `mpicxx`.
- `TBB_CXX_TYPE`: The C++ compiler the MPI wrapper wraps. Typically `gcc` on Linux and `clang` on macOS.

Expand Down Expand Up @@ -158,8 +160,8 @@ Follow Intel's install instructions given [here](https://software.intel.com/cont
### Compiling

In order to enable the OpenCL backend the model
must be compiled with the `STAN_OPENCL` makefile flag. The flag can be
supplied in the `make` call but we recommend writing the flag to the
must be compiled with the `STAN_OPENCL` makefile flag defined/non-empty.
The flag can be supplied in the `make` call but we recommend writing the flag to the
`make/local` file.

An example of the contents of `make/local` to enable parallelization
Expand All @@ -169,7 +171,7 @@ with OpenCL:
STAN_OPENCL=true
```

If you are using OpenCL with an integrated GPU you also need to add the `INTEGRATED_OPENCL` flag, as the sharing of memory between CPU and GPU is slightly different with integrated graphics:
If you are using OpenCL with an integrated GPU you also need to define the `INTEGRATED_OPENCL` flag, as the sharing of memory between CPU and GPU is slightly different with integrated graphics:

```
INTEGRATED_OPENCL=true
Expand Down

0 comments on commit 9a6b9fb

Please sign in to comment.