From ff8cc01f7fd871ab7cae98071a39786da4ecb3cf Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 10 Dec 2023 22:00:31 +0200 Subject: [PATCH] More test hangs --- src/Makevars | 1 + tests/testthat/test-basic.R | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Makevars b/src/Makevars index 18f2746..5a0ce01 100644 --- a/src/Makevars +++ b/src/Makevars @@ -1,5 +1,6 @@ PKG_CPPFLAGS = -I"../inst/include" -I"../inst/include/sundials" -I"./sundials/sundials" -D_REENTRANT -DSTAN_THREADS PKG_CPPFLAGS += -DSTRICT_R_HEADERS -D_HAS_AUTO_PTR_ETC=0 -DEIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS +PKG_CPPFLAGS += -DRCPP_PARALLEL_USE_TBB=1 PKG_CPPFLAGS += $(shell "${R_HOME}/bin/Rscript" -e "RcppParallel::CxxFlags()" | tail -n 1) PKG_CPPFLAGS += -include ../inst/include/sundials/stan_sundials_printf_override.hpp PKG_LIBS = $(shell "${R_HOME}/bin/Rscript" -e "RcppParallel::RcppParallelLibs()" | tail -n 1) diff --git a/tests/testthat/test-basic.R b/tests/testthat/test-basic.R index cb63da7..1db888b 100644 --- a/tests/testthat/test-basic.R +++ b/tests/testthat/test-basic.R @@ -29,7 +29,7 @@ test_that("stan_sample runs", { expect_no_error( samp_gd_par <- stan_sample(loglik_fun, inits, additional_args = list(y), grad_fun = grad, lower = c(-Inf, 0), num_threads = 2, - num_chains = 2, seed = 1234) + num_chains = 1, seed = 1234) ) expect_no_error( samp_gd_dense <- stan_sample(loglik_fun, inits, additional_args = list(y), grad_fun = grad, @@ -84,7 +84,7 @@ test_that("stan_pathfinder runs", { ) expect_no_error( path_gd_par <- stan_pathfinder(loglik_fun, inits, additional_args = list(y), grad_fun = grad, - num_threads = 2, num_paths = 2, lower = c(-Inf, 0), seed = 1234) + num_threads = 2, num_paths = 1, lower = c(-Inf, 0), seed = 1234) ) })