polaris.setup.setup_tasks
- polaris.setup.setup_tasks(work_dir, task_list=None, numbers=None, config_file=None, machine=None, baseline_dir=None, component_path=None, suite_name='custom', suite_component=None, cached=None, free_running=None, copy_executable=False, clean_tasks=False, model=None, build=None, branch=None, clean_build=None, quiet_build=None, cmake_flags=None, debug=None, component_args=None)[source]
Set up one or more tasks
- Parameters:
work_dir (str) – A directory that will serve as the base for creating task directories
task_list (list of str, optional) – Relative paths for a tasks to set up
numbers (list of str, optional) – Task numbers to setup, as listed from
polaris list, optionally with a suffixcto indicate that all steps in that task should be cachedconfig_file ({str, None}, optional) – Configuration file with custom options for setting up and running tasks
machine (str, optional) – The name of one of the machines with defined config options, which can be listed with
polaris list --machinesbaseline_dir (str, optional) – Location of baselines that can be compared to
component_path (str, optional) – The relative or absolute path to the location where the model and default namelists have been (or will be) built
suite_name (str, optional) – The name of the suite if tasks are being set up through a suite or
'custom'if notsuite_component (str, optional) – The name of the component the suite belongs to, which is where its config file comes from. A suite may contain tasks from other components, so this is not necessarily the component of any of the tasks. Defaults to the component of the first task.
cached (list of list of str, optional) – For each task in
tasks, which steps (if any) should read their outputs from the cache, or a list with “_all” as the first entry if all steps in the task should use cached outputs. These override the task’sfree_running_steps.free_running (list of list of str, optional) – For the single task in
tasks, which steps (if any) should be forced free-running (not cached), overridingdefault_cached, or a list with"_all"as the first entry if all steps should be free-running. A step may not appear in bothcachedandfree_running.copy_executable (bool, optional) – Whether to copy the model executable to the work directory
clean_tasks (bool, optional) – Whether to delete the contents of the task work directories before setting up tasks
model (str, optional) – The model to run
build (bool, optional) – Whether to build the model
branch (str, optional) – The relative or absolute path to the base of the component branch to build. If not provided,
component_pathmust point to an existing build.clean_build (bool, optional) – Whether to clean the build directory before building the model.
clean_build = Trueimpliesbuild = True.quiet_build (bool, optional) – Whether to build the model without output. Implies
build = True.cmake_flags (str, optional) – Additional flags to pass to make or CMake when building the model
debug (bool, optional) – Whether to build the model in debug mode
component_args (dict of dict, optional) – The model, component path and branch for components other than the one that owns the tasks, with the component names as keys. These come from the
--<component>_model,--<component>_pathand--<component>_branchflags.
- Returns:
tasks (dict of polaris.Task) – A dictionary of tasks, with the relative path in the work directory as keys