cimg.openmp | R Documentation |
On supported architectures CImg can parallelise many operations using OpenMP (e.g. imager.combine
). Use this function to turn parallelisation on or off.
cimg.use.openmp(mode = "adaptive", nthreads = 1, verbose = FALSE)
cimg.limit.openmp()
mode |
Either "adaptive","always" or "none". The default is adaptive (parallelisation for large images only). |
nthreads |
The number of OpenMP threads that imager should use. The default is 1. Set to 0 to get no more than 2, based on OpenMP environment variables. |
verbose |
Whether to output information about the threads being set. |
You need to be careful that nthreads is not higher than the value in the system environment variable OMP_THREAD_LIMIT (this can be checked with Sys.getenv('OMP_THREAD_LIMIT')). The OMP_THREAD_LIMIT thread limit usually needs to be correctly set before launching R, so using Sys.setenv once a session has started is not certain to work.
NULL (function is used for side effects)
cimg.limit.openmp()
: Limit OpenMP thread count to no more than 2, based on OpenMP environment variables.
Simon Barthelme
cimg.use.openmp("never") #turn off parallelisation
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.