-
-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Trying to precompile model methods via compile_model_methods = TRUE
(to be used after fitting) causes the fits to fail if using future.plan(multisession)
Error in .Call(<pointer: (nil)>, data_path, seed) :
NULL value passed as symbol address
To Reproduce
library(cmdstanr)
library(future)
library(future.apply)
plan(multisession)
m <- cmdstan_model(
write_stan_file(
paste0(capture.output(print_example_program()), collapse = "")
),
compile_model_methods = TRUE
)
dat <- list(N = 3, K = 1, y = c(1, 0, 0), X = matrix(c(1, 1, 1), nrow = 3))
future_lapply(1:3, function(x) m$sample(data = dat), future.seed = TRUE)
Expected behavior
Sampling should work as expected, or if additional arguments are needed (e.g. for globals?) then guidance in documentation could help
Operating system
ubuntu 24.04
CmdStanR version number
0.9.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working