diff --git a/DESCRIPTION b/DESCRIPTION index 23d8587..db4c83b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: rethinking Type: Package Title: Statistical Rethinking book package -Version: 2.10 -Date: 2020-05-13 +Version: 2.11 +Date: 2020-06-26 Author: Richard McElreath Maintainer: Richard McElreath Imports: coda, MASS, mvtnorm, loo, shape diff --git a/R/ulam-function.R b/R/ulam-function.R index 17c4d67..9d4a041 100644 --- a/R/ulam-function.R +++ b/R/ulam-function.R @@ -1410,11 +1410,11 @@ ulam <- function( flist , data , pars , pars_omit , start , chains=1 , cores=1 , filex <- cmdstanr_model_write( model_code ) mod <- cmdstan_model( stan_file=filex[[1]], - exe_file=filex[[2]], + # exe_file=filex[[2]], compile=filex[[3]], cpp_options=list(stan_threads=TRUE) ) - set_num_threads( threads ) - cmdstanfit <- mod$sample( data=data , chains=chains , cores=cores , iter_sampling=iter , adapt_delta=as.numeric(control[['adapt_delta']]) , ... ) + # set_num_threads( threads ) + cmdstanfit <- mod$sample( data=data , chains=chains , parallel_chains=cores , iter_sampling=iter , adapt_delta=as.numeric(control[['adapt_delta']]) , threads_per_chain=threads , ... ) stanfit <- rstan::read_stan_csv(cmdstanfit$output_files()) } } else diff --git a/tests/rethinking_tests/test_cmdstanr_threads.R b/tests/rethinking_tests/test_cmdstanr_threads.R index c1d89b6..397b7c6 100644 --- a/tests/rethinking_tests/test_cmdstanr_threads.R +++ b/tests/rethinking_tests/test_cmdstanr_threads.R @@ -30,7 +30,7 @@ m2 <- ulam( a ~ normal(0,1.5), b ~ normal(0,0.5) ) , data=dat , - cmdstan=TRUE , threads=2 , chains=1 , cores=1 , refresh=1000 ) + cmdstan=TRUE , threads=2 , chains=2 , cores=2 , refresh=1000 ) # hierarchical version N_id <- round(N/10)