cmdstanr
cmdstanr copied to clipboard
MPI generated quantities
Similar to sample_mpi method it make sense to have generated_quantities_mpi that is able to run the block with MPI. An alternative could be to have generated_quantities detect if the fitted_param is based on MPI run, if so it performs MPI run on the block. That is,
generate_quantities_mpi(
fitted_params,
mpi_cmd = "mpiexec", # use mpi
mpi_args = NULL, # use mpi
data = NULL,
seed = NULL,
output_dir = NULL,
sig_figs = NULL,
parallel_chains = getOption("mc.cores", 1),
threads_per_chain = NULL
)
or
generate_quantities(
fitted_params,
use_mpi_from_fitted_params = TRUE, # use mpi settings from fitted_params
data = NULL,
seed = NULL,
output_dir = NULL,
sig_figs = NULL,
parallel_chains = getOption("mc.cores", 1),
threads_per_chain = NULL
)
Given the way we went with sample vs sample_mpi I think the first option should be the way to go.