R/test_if_forked_cluster.R

Defines functions test_if_forked_cluster

test_if_forked_cluster <- function(){
  is_forked <- value(future(parallelly::isForkedChild()))
  if (is_forked) {
    msg <- cli::format_error(
      "parallel mcmc samplers cannot be run with a fork cluster"
    )
    stop(
      msg,
      call. = FALSE
    )
  }
}

Try the greta package in your browser

Any scripts or data that you put into this service are public.

greta documentation built on Sept. 8, 2022, 5:10 p.m.