cmdstanr icon indicating copy to clipboard operation
cmdstanr copied to clipboard

MPI generated quantities

Open yizhang-yiz opened this issue 4 years ago • 1 comments

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
)

yizhang-yiz avatar Mar 24 '21 16:03 yizhang-yiz

Given the way we went with sample vs sample_mpi I think the first option should be the way to go.

rok-cesnovar avatar Mar 24 '21 18:03 rok-cesnovar