Skip to content

Commit

Permalink
omp thread limit
Browse files Browse the repository at this point in the history
  • Loading branch information
helske committed Oct 24, 2023
1 parent 6eff0a8 commit 3b5c6c1
Show file tree
Hide file tree
Showing 23 changed files with 31 additions and 1 deletion.
4 changes: 3 additions & 1 deletion NEWS.md
@@ -1,4 +1,4 @@
bssm 2.0.2 (Release date: 2023-09-04)
bssm 2.0.2 (Release date: 2023-10-18)
=====================================
* Switched to markdown NEWS with a plan to be more clear about the future
changes in the package.
Expand All @@ -11,6 +11,8 @@ bssm 2.0.2 (Release date: 2023-09-04)
* Removed explicit C++ version requirement as required by new CRAN policies.
* Removed `magrittr` dependency and switched to native pipe, leading to
requirement for R 4.1.0+.
* Added Sys.setenv("OMP_THREAD_LIMIT" = 2) to fix weird CRAN issues with
parallelisation on Debian.

bssm 2.0.1 (Release date: 2022-05-02)
==============
Expand Down
1 change: 1 addition & 0 deletions R/approx.R
Expand Up @@ -31,6 +31,7 @@
#' @export
#' @rdname gaussian_approx
#' @examples
#' Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
#' data("poisson_series")
#' model <- bsm_ng(y = poisson_series, sd_slope = 0.01, sd_level = 0.1,
#' distribution = "poisson")
Expand Down
5 changes: 5 additions & 0 deletions R/bssm-package.R
Expand Up @@ -89,6 +89,7 @@
#' time ts ts.union tsp tsp<- sd na.omit
#' @useDynLib bssm
#' @examples
#' Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
#' # Create a local level model (latent random walk + noise) to the Nile
#' # dataset using the bsm_lg function:
#' model <- bsm_lg(Nile,
Expand Down Expand Up @@ -138,6 +139,7 @@ NULL
#' \url{https://stat.fi/tup/tilastotietokannat/index_en.html}.
#' @keywords datasets
#' @examples
#' Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
#' data("drownings")
#' model <- bsm_ng(drownings[, "deaths"], u = drownings[, "population"],
#' xreg = drownings[, "summer_temp"], distribution = "poisson",
Expand Down Expand Up @@ -165,6 +167,7 @@ NULL
#' Time Series Analysis by State Space Methods. Oxford University Press.
#' https://doi.org/10.1093/acprof:oso/9780199641178.001.0001
#' @examples
#' Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
#' data("exchange")
#' model <- svm(exchange, rho = uniform(0.97,-0.999,0.999),
#' sd_ar = halfnormal(0.175, 2), mu = normal(-0.87, 0, 2))
Expand All @@ -188,6 +191,7 @@ NULL
#' Scand J Statist. 1-38. https://doi.org/10.1111/sjos.12492
#'
#' @examples
#' Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
#' # The data was generated as follows:
#' set.seed(321)
#' slope <- cumsum(c(0, rnorm(99, sd = 0.01)))
Expand Down Expand Up @@ -241,6 +245,7 @@ NULL
#' https://doi.org/10.32614/RJ-2021-103
#'
#' @examples
#' Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
#' # reproducing the model:
#' data("negbin_series")
#' # Construct model for bssm
Expand Down
1 change: 1 addition & 0 deletions R/ekpf_filter.R
Expand Up @@ -21,6 +21,7 @@ ekpf_filter <- function(model, particles, ...) {
#' @rdname ekpf_filter
#' @examples
#' \donttest{ # Takes a while
#' Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
#' set.seed(1)
#' n <- 50
#' x <- y <- numeric(n)
Expand Down
2 changes: 2 additions & 0 deletions R/kfilter.R
Expand Up @@ -69,6 +69,7 @@ kfilter.nongaussian <- function(model, ...) {
#' @export
#' @examples
#' \donttest{ # Takes a while on CRAN
#' Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
#' set.seed(1)
#' mu <- -0.2
#' rho <- 0.7
Expand Down Expand Up @@ -138,6 +139,7 @@ ekf <- function(model, iekf_iter = 0) {
#' @export
#' @examples
#' \donttest{ # Takes a while on CRAN
#' Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
#' set.seed(1)
#' mu <- -0.2
#' rho <- 0.7
Expand Down
1 change: 1 addition & 0 deletions R/models.R
Expand Up @@ -61,6 +61,7 @@ default_update_fn <- function(theta) {
#' @return An object of class \code{ssm_ulg}.
#' @export
#' @examples
#' Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
#'
#' # Regression model with time-varying coefficients
#' set.seed(1)
Expand Down
1 change: 1 addition & 0 deletions R/post_correction.R
Expand Up @@ -174,6 +174,7 @@ suggest_N <- function(model, theta,
#' @export
#' @examples
#' \donttest{
#' Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
#' set.seed(1)
#' n <- 300
#' x1 <- sin((2 * pi / 12) * 1:n)
Expand Down
1 change: 1 addition & 0 deletions man/bssm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/drownings.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/ekf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/ekpf_filter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/exchange.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/gaussian_approx.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/negbin_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/poisson_series.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/post_correct.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/ssm_ulg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/ukf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/test_all.R
@@ -1,2 +1,4 @@
Sys.setenv("OMP_THREAD_LIMIT" = 2)

library("testthat")
test_check("bssm")
1 change: 1 addition & 0 deletions vignettes/bssm.Rmd
Expand Up @@ -14,6 +14,7 @@ vignette: |
---

```{r, echo = FALSE}
Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
if (!requireNamespace("rmarkdown") ||
!rmarkdown::pandoc_available("1.12.3")) {
warning(call. = FALSE, "These vignettes assume rmarkdown and pandoc version",
Expand Down
1 change: 1 addition & 0 deletions vignettes/growth_model.Rmd
Expand Up @@ -14,6 +14,7 @@ vignette: |
---

```{r, echo = FALSE}
Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
if (!requireNamespace("rmarkdown") ||
!rmarkdown::pandoc_available("1.12.3")) {
warning(call. = FALSE, "These vignettes assume rmarkdown and pandoc version 1.12.3. These were not found. Older versions will not work.")
Expand Down
1 change: 1 addition & 0 deletions vignettes/psi_pf.Rmd
Expand Up @@ -16,6 +16,7 @@ bvignette: |
```

```{r, echo = FALSE}
Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
if (!requireNamespace("rmarkdown") ||
!rmarkdown::pandoc_available("1.12.3")) {
warning(call. = FALSE, "These vignettes assume rmarkdown and pandoc version 1.12.3. These were not found. Older versions will not work.")
Expand Down
1 change: 1 addition & 0 deletions vignettes/sde_model.Rmd
Expand Up @@ -14,6 +14,7 @@ vignette: |
---

```{r, echo = FALSE}
Sys.setenv("OMP_THREAD_LIMIT" = 2) # For CRAN
if (!requireNamespace("rmarkdown") ||
!rmarkdown::pandoc_available("1.12.3")) {
warning(call. = FALSE, "These vignettes assume rmarkdown and pandoc version 1.12.3. These were not found. Older versions will not work.")
Expand Down

0 comments on commit 3b5c6c1

Please sign in to comment.