polaris.e3sm.init.assemble.AssembleStep

class polaris.e3sm.init.assemble.AssembleStep(component, name, subdir, readme_package, readme_filename='README')[source]

A base step for materializing a staged tree of E3SM input files.

Product steps write only their own outputs, and a subclass of this step links them into ASSEMBLED_FILES at their E3SM-facing paths, so what is in the tree is described in one place rather than in every step.

A subclass declares the products it stages as input files in its constructor. Its run() calls this class’s run(), which rebuilds the tree from empty and stages the README, and then calls stage() and stage_partitions(). Staging happens at run time because the staged paths carry names, such as the creation date, that come from config options a person may change after setup.

__init__(component, name, subdir, readme_package, readme_filename='README')[source]

Create a new step.

Parameters:
  • component (polaris.Component) – The component the step belongs to.

  • name (str) – The name of the step.

  • subdir (str) – The subdirectory for the step.

  • readme_package (str) – The package the README staged at the top of the tree comes from. What a tree does and does not hold is particular to the workflow that stages it, so each supplies its own.

  • readme_filename (str, optional) – The README’s filename in readme_package.

Methods

__init__(component, name, subdir, readme_package)

Create a new step.

add_cf_check([filename])

Check an output file for CF compliance after the step runs.

add_dependency(step[, name])

Add step as a dependency of this step (i.e. this step can't run until the dependency has finished).

add_input_file([filename, target, database, ...])

Add an input file to the step (but not necessarily to the MPAS model).

add_output_file(filename[, validate_vars, ...])

Add the output file to the step

add_property_check(filename, check_properties)

Add a single conservation comparison for an output file

check_cf()

Check the files added with add_cf_check() for CF compliance.

check_properties()

Check conservation properties of the output files of this step.

constrain_resources(available_resources)

Constrain cpus_per_task and ntasks based on the number of cores available to this step

process_inputs_and_outputs()

Process the inputs to and outputs from a step added with polaris.Step.add_input_file() and polaris.Step.add_output_file().

run()

Rebuild the staged tree from empty and stage the README.

runtime_setup()

Update attributes of the step at runtime before calling the run() method.

set_resources([cpus_per_task, ...])

Update the resources for the subtask.

set_shared_config(config[, link])

Replace the step's config parser with the shared config parser

setup()

Set up the task in the work directory, including downloading any dependencies.

stage(source, staged_path)

Link one product into the assembled tree at its E3SM-facing path.

stage_partitions(step, basename, path_func)

Link every partition the given step produced.

step_dir(step)

The work directory of another step, found from this one's.

validate_baselines()

Compare variables between output files in this step and in the same step from a baseline run if one was provided.

work_path(*filenames)

Get the absolute path to a file or directory in the step's work directory

Attributes

cores

the number of cores this step needs, in total

gpus

the number of GPUs this step needs, in total

may_span_nodes

whether this step's cores and GPUs may come from several nodes

min_cores

the number of cores this step needs in order to run at all

min_gpus

the number of GPUs this step requires, in total