jobmon_utils
Helpers for working with jobmon in the Climate Data CLI.
The main entrypoint is run_parallel_maybe_dry_run which mirrors
rra_tools.jobmon.run_parallel but adds a dry_run flag.
When dry_run is True, this helper:
* Expands flat_node_args or node_args into per-job CLI argument sets.
* Builds sbatch-like preview commands using the supplied task resources.
* Prints a short summary plus representative example commands.
* Returns a dummy success status without touching jobmon or the scheduler.
When dry_run is False, it simply delegates to
jobmon.run_parallel with identical semantics.
run_parallel_maybe_dry_run(*, runner: str, task_name: str, task_resources: Mapping[str, Any], flat_node_args: tuple[Sequence[str], Sequence[Sequence[Any]]] | None = None, node_args: Mapping[str, Sequence[Any]] | None = None, task_args: Mapping[str, Any] | None = None, log_root: str | Path | None = None, max_attempts: int | None = None, concurrency_limit: int | None = None, dry_run: bool) -> Any
Wrapper around jobmon.run_parallel with optional dry-run behavior.
Parameters
runner
The executable used for tasks, e.g. "cdtask" or "cdtask aggregate".
task_name
A short, human-readable name for the job group.
task_resources
Resource profile for the tasks (queue, cores, memory, runtime, project, ...).
flat_node_args
Tuple of (argument names, rows) describing per-node CLI arguments.
node_args
Mapping from argument name to a sequence of values; all combinations are used.
task_args
Shared CLI arguments that are the same for all nodes.
log_root
Optional log directory passed through to jobmon.
max_attempts
Maximum number of attempts; passed through to jobmon. Defaults to None
to match jobmon.run_parallel (jobmon then applies its own default).
dry_run
If True, only print sbatch-like previews instead of submitting.
Source code in src/climate_data/jobmon_utils.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |