Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/sections/user_guide/yaml/components/execution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Example block:
- "--export=ALL"
- "--ntasks $SLURM_CPUS_ON_NODE"
mpicmd: srun
stacksize: 100M
threads: 8

batchargs:
Expand Down Expand Up @@ -83,6 +84,11 @@ mpicmd:

The MPI launch program (``mpiexec``, ``srun``, et al.). This entry is only used when configuring parallel components.

stacksize:
""""""""""

For drivers implementing support, exports the ``OMP_STACKSIZE`` environment variable to the execution environment, specifying the size of the stack for threads created by OpenMP. The value of this environment takes the form: *size* | *size*\ **B** | *size*\ **K** | *size*\ **M** | *size*\ **G**. When only *size* is provided, the unit is assumed to be kilobytes.

threads:
""""""""

Expand Down
11 changes: 8 additions & 3 deletions src/uwtools/drivers/stager.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def files_copied(self):
"""
taskname, config, rundir = self.taskname, self.config, self.rundir # type: ignore[attr-defined]
yield taskname("files copied")
yield [Copier(config=config.get("files_to_copy", {}), target_dir=rundir).go()]
files = config.get("files_to_copy", {})
yield [Copier(config=files, target_dir=rundir).go() if files else None]

@tasks
def files_hardlinked(self):
Expand All @@ -29,13 +30,16 @@ def files_hardlinked(self):
"""
taskname, config, rundir = self.taskname, self.config, self.rundir # type: ignore[attr-defined]
yield taskname("files hardlinked")
files = config.get("files_to_hardlink", {})
yield [
Linker(
config=config.get("files_to_hardlink", {}),
config=files,
target_dir=rundir,
hardlink=True,
fallback=STR.copy,
).go()
if files
else None
]

@tasks
Expand All @@ -45,4 +49,5 @@ def files_linked(self):
"""
taskname, config, rundir = self.taskname, self.config, self.rundir # type: ignore[attr-defined]
yield taskname("files linked")
yield [Linker(config=config.get("files_to_link", {}), target_dir=rundir).go()]
files = config.get("files_to_link", {})
yield [Linker(config=files, target_dir=rundir).go() if files else None]
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"mpicmd": {
"type": "string"
},
"stacksize": {
"type": "string"
},
"threads": {
"minimum": 1,
"type": "integer"
Expand Down
14 changes: 13 additions & 1 deletion src/uwtools/resources/jsonschema/gsi.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,19 @@
"type": "string"
},
"update_values": {
"$ref": "urn:uwtools:namelist"
"additionalProperties": {
"additionalProperties": {
"type": [
"array",
"boolean",
"number",
"string"
]
},
"type": "object"
},
"minProperties": 1,
"type": "object"
},
"validate": {
"type": "boolean"
Expand Down
4 changes: 2 additions & 2 deletions src/uwtools/tests/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,8 +1160,8 @@ def test_schema_gsi_namelist_update_values(gsi_prop):
)
# At least one namelist entry is required:
assert non_empty_dict(errors({}))
# At least one val/var pair is required:
assert non_empty_dict(errors({"nml": {}}))
# Allow for empty namelist entries:
assert not errors({"nml": {}})


def test_schema_gsi_rundir(gsi_prop):
Expand Down