ioda

Note

The uwtools drivers are idempotent, meaning that actions they successfully complete during one invocation are not repeated in subsequent invocations. For example, an asset like a configuration file will not be recreated when the driver is run again, even if its UW YAML configuration changes. To force recreation, remove the asset(s) in question – up to and including the entire provisioned run directory – then re-run the driver, which will recreate any missing assets based on the current configuration.

The uw mode for configuring and running the IODA components of the JEDI framework.

uw ioda --help
usage: uw ioda [-h] [--version] [--show-schema] TASK ...

Execute ioda tasks

Optional arguments:
  -h, --help
      Show help and exit
  --version
      Show version info and exit
  --show-schema
      Show driver schema and exit

Positional arguments:
  TASK
    configuration_file
      The executable's YAML configuration file
    files_copied
      Files copied for run
    files_linked
      Files linked for run
    provisioned_rundir
      Run directory provisioned with all required content
    run
      A run
    runscript
      The runscript
    show_output
      Show the output to be created by this component
    validate
      Validate the UW driver config

All tasks take the same arguments. For example:

uw ioda run --help
usage: uw ioda run --cycle CYCLE [-h] [--version] [--config-file PATH]
                   [--batch] [--dry-run] [--graph-file PATH]
                   [--key-path KEY[.KEY...]] [--schema-file PATH] [--quiet]
                   [--verbose]

A run

Required arguments:
  --cycle CYCLE
      The cycle in ISO8601 format (e.g. yyyy-mm-ddThh)

Optional arguments:
  -h, --help
      Show help and exit
  --version
      Show version info and exit
  --config-file PATH, -c PATH
      Path to UW YAML config file (default: read from stdin)
  --batch
      Submit job to batch scheduler
  --dry-run
      Only log info, making no changes
  --graph-file PATH
      Path to Graphviz DOT output [experimental]
  --key-path KEY[.KEY...]
      Dot-separated path of keys to driver config block
  --schema-file PATH
      Path to schema file to use for validation
  --quiet, -q
      Print no logging messages
  --verbose, -v
      Print all logging messages

Examples

The examples use a configuration file named config.yaml with contents similar to:

ioda:
  configuration_file:
    base_file: path/to/config.yaml
    update_values:
      baz: qux
  execution:
    batchargs:
      nodes: 1
      stdout: path/to/runscript.out
      walltime: "00:05:00"
    envcmds:
      - module load some-module
      - module load ioda-module
    executable: /path/to/a/ioda/exe
  files_to_copy:
    d/f2: /path/to/f2
    f1: /path/to/f1
  files_to_link:
    f3: /path/to/f3
    f4: d/f4
  rundir: /path/to/run/dir
platform:
  account: me
  scheduler: slurm

Its contents are described in section ioda.

  • Run ioda on an interactive node

    $ uw ioda run --config-file config.yaml --cycle 2024-05-22T12
    

The driver creates a runscript.ioda file in the directory specified by rundir: in the config and runs it, executing ioda.

  • Run ioda via a batch job

    $ uw ioda run --config-file config.yaml --cycle 2024-05-22T12 --batch
    

The driver creates a runscript.ioda file in the directory specified by rundir: in the config and submits it to the batch system. Running with --batch requires a correctly configured platform: block in config.yaml, as well as appropriate settings in the execution: block under ioda:.

  • Specifying the --dry-run flag results in the driver logging messages about actions it would have taken, without actually taking any.

    $ uw ioda run --config-file config.yaml --cycle 2024-05-22T12 --batch --dry-run
    
  • The --key-path option can be used to navigate from the top of the config to the driver’s configuration block. For example, specifying --key-path foo.bar with config

    foo:
      bar:
        driver:
          # driver config block
    

    is equivalent to using config

    driver:
      # driver config block
    

    without specifying --key-path.

  • Specifying the --show-schema flag, with no other options, prints the driver’s schema:

    uw ioda --show-schema >schema
    head -n20 schema
    
    {
      "properties": {
        "ioda": {
          "additionalProperties": false,
          "properties": {
            "configuration_file": {
              "additionalProperties": false,
              "anyOf": [
                {
                  "required": [
                    "base_file"
                  ]
                },
                {
                  "required": [
                    "update_values"
                  ]
                }
              ],
              "properties": {
    
  • Use the --schema-file option to specify a custom JSON Schema file with which to validate the driver config. A custom schema could range in complexity from the simplest, most permissive schema, {}, to one based on the internal schema shown by --show-schema.