run_forecasts: Run forecasting for a model in parallel when possible

View source: R/run-forecasts.R

run_forecastsR Documentation

Run forecasting for a model in parallel when possible

Description

Run forecasting for a model in parallel when possible

Usage

run_forecasts(
  model = NULL,
  model_path = NULL,
  forecast_yrs = get_assess_yr():(get_assess_yr() + 3),
  ss_exe = NULL,
  ...
)

Arguments

model

The SS3 model output as loaded by create_rds_file()

model_path

The directory containing the model

forecast_yrs

A vector of forecast years

ss_exe

The name of the SS3 executable. If run standalone, this will be ss_executable. If run from the context of of the bookdown document, this will be set as a YAML key/tag

...

Arguments passed to fetch_ct_levels()

Details

The function will check to see if you can run the forecasting in parallel. If you are on Windows, or calling the code from an Rstudio console, you will be asked if you want to continue in sequential mode. To run in parallel (multicore) mode, you must be on a Mac or Linux machine, and NOT using Rstudio. You must also call this function from Rscript or the terminal R program. You can also use a bash script containing ⁠Rscript - e "R code here"⁠. See the scripts located in the bash-scripts directory

Value

base::invisible()


pacific-hake/hake-assessment documentation built on July 21, 2024, 8:19 a.m.