File: setRcppMLthreads.Rd

package info (click to toggle)
r-cran-rcppml 0.3.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 368 kB
  • sloc: cpp: 1,134; sh: 13; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 1,297 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/threads.R
\name{setRcppMLthreads}
\alias{setRcppMLthreads}
\title{Set the number of threads RcppML should use}
\usage{
setRcppMLthreads(threads)
}
\arguments{
\item{threads}{number of threads to be used in RcppML functions that are parallelized with OpenMP.}
}
\description{
The number of threads is 0 by default (corresponding to all available threads), but can be set manually using this function. If you clear environment variables or affect the "RcppMLthreads" environment variable specifically, you will need to set your number of preferred threads again.
}
\details{
The number of threads set affects OpenMP parallelization only for functions in the RcppML package. It does not affect other R packages that use OpenMP. Parallelization is used for projection of linear factor models with rank > 2, calculation of mean squared error for linear factor models, and for divisive clustering.
}
\examples{
\dontrun{
# set serial configuration
setRcppMLthreads(1)
getRcppMLthreads()

# restore default parallel configuration, 
# letting OpenMP decide how many threads to use
setRcppMLthreads(0)
getRcppMLthreads()
}
}
\seealso{
\code{\link{getRcppMLthreads}}
}
\author{
Zach DeBruine
}