OSPool HTCondor Scaffolder Skill
Skill Contract
- Activation: HTCondor, OSPool, OSG, distributed ensembles, or high-throughput parameter sweeps; not Slurm-specific HPC work.
- Authority: HTCondor submit design, DAG dependencies, file transfer, resource requests, checkpointing, and distributed dry runs.
- Preconditions: Runnable workload, enumerable tasks, transferable inputs and outputs, and required credentials held by the user.
- Effects: Generate submit files, DAGs, wrappers, and transfer plans; submit externally only when explicitly requested and authorized.
- Invariants: Preserve experiment parameters and input identity, isolate per-job outputs, and avoid unsupported shared-state assumptions.
- Outputs: Submit files, DAG or parameter configuration, wrapper scripts, transfer plan, and validation checklist.
- Handoffs: Route scientific-design changes to
omfa, implementation changes to omfb, and stewardship or lineage changes to fair with job and data evidence.
- Completion: Generated files pass available syntax or dry-run checks and unresolved pool-specific values are visible.
- Failure: Produce a non-submitting scaffold and identify missing portability or transfer facts when safe execution cannot be established.
- Provenance: When contributing execution evidence under
omf-artifacts/implementation/, record immutable entities, actual participants, authorization, inputs, parameters, environment, and outputs.
When to Use This Skill
Use this skill when:
- You have a working computational model and want to run it on the Open Science Grid (OSPool)
- You need to execute a parameter sweep or sensitivity analysis across many parameter combinations
- You want to submit batch jobs that leverage distributed HTCondor scheduling
- You need a dry-run mode to validate your job configuration before submission
- You are setting up checkpoint/restart for long-running simulations
Key Inputs
This skill works best with:
- Model executable or script (Python .py, R script, compiled binary, or bash wrapper)
- Parameter ranges (variables to sweep over, with min/max or discrete values)
- Input files (data files, configuration, or dependencies your model needs)
- Runtime estimate (approximate wall-clock time per job in minutes)
- Resource requirements (CPU cores, memory, scratch disk)
- Success criteria (what constitutes a successful run)
Step-by-Step Instructions
1. Prepare Your Model for OSPool
Before scaffolding, ensure:
- Model is self-contained: All code, dependencies, and input files can be packaged or referenced via HTTP
- Single entry point: Model can be invoked with a simple command:
python model.py --param1 value1 --param2 value2
- Output to stdout/file: Model writes results to a file (not database) so outputs can be staged back from the worker node
- No GUI/graphics: HTCondor jobs are headless; remove any display dependencies
- Reproducible with seed: If your model uses randomness, accept a seed parameter:
--seed 42
2. Define Parameter Space
Specify parameters to sweep:
# Example sweep configuration (YAML)
sweep_type: factorial # or: one-at-a-time, latin-hypercube
parameters:
population_size: [10, 50, 100]
patch_count: [5, 10, 20]
mutation_rate: [0.01, 0.05, 0.1]
replicas: 3 # replicate runs per parameter combination
The skill will generate all combinations (or use a design-of-experiments strategy).
3. Generate HTCondor Submit Files
The skill creates:
- Main submit file (.submit): Job description, input/output, resource requests
- DAG file (optional): Coordinate dependencies among jobs (e.g., run analysis after all simulations complete)
- Parameter sweep file (CSV or JSON): All parameter combinations to be executed
- Wrapper script (bash): Handles environment setup, input staging, and output staging
4. Dry-Run Validation
Before submitting to OSPool:
# Inspect the generated submit file before submitting. At minimum, check:
# - HTCondor syntax is valid
# - Executable is present or accessible
# - Input files are staged or remotely accessible
# - Output directory is writable
# - Resource requests are reasonable
Address any validation errors before proceeding.
5. Submit to OSPool
Once validated:
condor_submit my_job.submit
# Submits N jobs to OSPool
# Track status: condor_q
# Monitor: htop (if interactive) or check submission log
⚠️ Gotchas
- Path dependencies: HTCondor workers run in a sandbox directory. Use relative paths or stage files explicitly. Absolute paths like
/home/user/... will break on worker nodes.
- Environment differences: Worker nodes may have different OS versions, libraries, or Python versions. Container/Singularity is recommended for complex dependencies.
- Data staging: Large input files should be staged via HTTP or OSPool's data cache, not embedded in submit files.
- Output size: Limit per-job output size. HTCondor has file size caps. If outputs are large, write directly to OSPool storage or compress before staging back.
- Long-running jobs: HTCondor has wall-clock time limits (~24 hours typical). If your model runs longer, implement checkpointing or break into smaller jobs.
- Random seed conflicts: If multiple replicas use the same random seed, they'll produce identical results. The skill will assign unique seeds automatically if you set
replicas > 1.
Templates & Resources
This skill currently has no bundled references/, assets/, examples/, or
scripts/ files. Generate HTCondor submit files, DAGs, parameter sweep files,
and wrapper scripts directly from the guidance and examples in this SKILL.md.
If reusable validators or templates are added later, reference them here with
explicit load conditions.
Example
Input: Python model run_sim.py with parameters, parameter sweep config
Output:
HTCondor submit file (sim_sweep.submit):
universe = vanilla
executable = scripts/run_wrapper.sh
arguments = run_sim.py --population $(population) --patches $(patches)
input = run_sim.py, data.csv
output = results_$(ClusterId)_$(ProcId).csv
error = err_$(ClusterId)_$(ProcId).log
log = job_$(ClusterId)_$(ProcId).log
request_cpus = 1
request_memory = 512MB
request_disk = 1GB
queue 30 # 30 jobs (3 population × 2 patches × 5 replicates)
Parameter sweep file (swept combinations):
population,patches,seed
10,5,1001
10,5,1002
10,10,1001
...
100,20,1005
Validation output:
✓ Submit file syntax is valid
✓ Executable found: scripts/run_wrapper.sh
✓ Input files present: run_sim.py, data.csv
✓ Resource requests reasonable (1 CPU, 512MB RAM)
✓ Ready to submit: 30 total jobs
Quick Reference
| Task |
Command/Reference |
| Validate HTCondor config |
Review submit syntax, transfer directives, executable paths, and resource requests |
| Submit jobs |
condor_submit my_job.submit |
| Monitor jobs |
condor_q |
| Review logs |
Check .log, .out, and .err files |
For community feedback or issues, see the OMF Skills repository.
1---2name: ospool3description: Generate HTCondor job submission scripts, parameter sweep configurations, and batch job templates for running computational models on the Open Science Grid (OSPool). Use this skill when you need to run parameter sweeps, large ensembles, or distributed sensitivity analysis on OSPool infrastructure. Triggers: "run on OSPool", "generate HTCondor script", "set up batch parameter sweep", "submit to OSG", "create HTCondor DAG". Expected output: HTCondor submit files (.submit), DAG specification files, parameter sweep configuration, and submission checklist.4license: MIT5---67# OSPool HTCondor Scaffolder Skill89## Skill Contract1011- **Activation:** HTCondor, OSPool, OSG, distributed ensembles, or high-throughput parameter sweeps; not Slurm-specific HPC work.12- **Authority:** HTCondor submit design, DAG dependencies, file transfer, resource requests, checkpointing, and distributed dry runs.13- **Preconditions:** Runnable workload, enumerable tasks, transferable inputs and outputs, and required credentials held by the user.14- **Effects:** Generate submit files, DAGs, wrappers, and transfer plans; submit externally only when explicitly requested and authorized.15- **Invariants:** Preserve experiment parameters and input identity, isolate per-job outputs, and avoid unsupported shared-state assumptions.16- **Outputs:** Submit files, DAG or parameter configuration, wrapper scripts, transfer plan, and validation checklist.17- **Handoffs:** Route scientific-design changes to `omfa`, implementation changes to `omfb`, and stewardship or lineage changes to `fair` with job and data evidence.18- **Completion:** Generated files pass available syntax or dry-run checks and unresolved pool-specific values are visible.19- **Failure:** Produce a non-submitting scaffold and identify missing portability or transfer facts when safe execution cannot be established.20- **Provenance:** When contributing execution evidence under `omf-artifacts/implementation/`, record immutable entities, actual participants, authorization, inputs, parameters, environment, and outputs.2122## When to Use This Skill2324Use this skill when:2526- You have a working computational model and want to run it on the Open Science Grid (OSPool)27- You need to execute a parameter sweep or sensitivity analysis across many parameter combinations28- You want to submit batch jobs that leverage distributed HTCondor scheduling29- You need a dry-run mode to validate your job configuration before submission30- You are setting up checkpoint/restart for long-running simulations3132## Key Inputs3334This skill works best with:3536- **Model executable or script** (Python .py, R script, compiled binary, or bash wrapper)37- **Parameter ranges** (variables to sweep over, with min/max or discrete values)38- **Input files** (data files, configuration, or dependencies your model needs)39- **Runtime estimate** (approximate wall-clock time per job in minutes)40- **Resource requirements** (CPU cores, memory, scratch disk)41- **Success criteria** (what constitutes a successful run)4243## Step-by-Step Instructions4445### 1. Prepare Your Model for OSPool4647Before scaffolding, ensure:4849- **Model is self-contained:** All code, dependencies, and input files can be packaged or referenced via HTTP50- **Single entry point:** Model can be invoked with a simple command: `python model.py --param1 value1 --param2 value2`51- **Output to stdout/file:** Model writes results to a file (not database) so outputs can be staged back from the worker node52- **No GUI/graphics:** HTCondor jobs are headless; remove any display dependencies53- **Reproducible with seed:** If your model uses randomness, accept a seed parameter: `--seed 42`5455### 2. Define Parameter Space5657Specify parameters to sweep:5859```yaml60# Example sweep configuration (YAML)61sweep_type: factorial # or: one-at-a-time, latin-hypercube62parameters:63 population_size: [10, 50, 100]64 patch_count: [5, 10, 20]65 mutation_rate: [0.01, 0.05, 0.1]66replicas: 3 # replicate runs per parameter combination67```6869The skill will generate all combinations (or use a design-of-experiments strategy).7071### 3. Generate HTCondor Submit Files7273The skill creates:7475- **Main submit file** (.submit): Job description, input/output, resource requests76- **DAG file** (optional): Coordinate dependencies among jobs (e.g., run analysis after all simulations complete)77- **Parameter sweep file** (CSV or JSON): All parameter combinations to be executed78- **Wrapper script** (bash): Handles environment setup, input staging, and output staging7980### 4. Dry-Run Validation8182Before submitting to OSPool:8384```bash85# Inspect the generated submit file before submitting. At minimum, check:86# - HTCondor syntax is valid87# - Executable is present or accessible88# - Input files are staged or remotely accessible89# - Output directory is writable90# - Resource requests are reasonable91```9293Address any validation errors before proceeding.9495### 5. Submit to OSPool9697Once validated:9899```bash100condor_submit my_job.submit101# Submits N jobs to OSPool102# Track status: condor_q103# Monitor: htop (if interactive) or check submission log104```105106## ⚠️ Gotchas107108- **Path dependencies:** HTCondor workers run in a sandbox directory. Use relative paths or stage files explicitly. Absolute paths like `/home/user/...` will break on worker nodes.109- **Environment differences:** Worker nodes may have different OS versions, libraries, or Python versions. Container/Singularity is recommended for complex dependencies.110- **Data staging:** Large input files should be staged via HTTP or OSPool's data cache, not embedded in submit files.111- **Output size:** Limit per-job output size. HTCondor has file size caps. If outputs are large, write directly to OSPool storage or compress before staging back.112- **Long-running jobs:** HTCondor has wall-clock time limits (~24 hours typical). If your model runs longer, implement checkpointing or break into smaller jobs.113- **Random seed conflicts:** If multiple replicas use the same random seed, they'll produce identical results. The skill will assign unique seeds automatically if you set `replicas > 1`.114115## Templates & Resources116117This skill currently has no bundled `references/`, `assets/`, `examples/`, or118`scripts/` files. Generate HTCondor submit files, DAGs, parameter sweep files,119and wrapper scripts directly from the guidance and examples in this `SKILL.md`.120If reusable validators or templates are added later, reference them here with121explicit load conditions.122123## Example124125**Input:** Python model `run_sim.py` with parameters, parameter sweep config126127**Output:**1281291. **HTCondor submit file** (`sim_sweep.submit`):130131 ```132 universe = vanilla133 executable = scripts/run_wrapper.sh134 arguments = run_sim.py --population $(population) --patches $(patches)135 input = run_sim.py, data.csv136 output = results_$(ClusterId)_$(ProcId).csv137 error = err_$(ClusterId)_$(ProcId).log138 log = job_$(ClusterId)_$(ProcId).log139 request_cpus = 1140 request_memory = 512MB141 request_disk = 1GB142 queue 30 # 30 jobs (3 population × 2 patches × 5 replicates)143 ```1441452. **Parameter sweep file** (swept combinations):146147 ```csv148 population,patches,seed149 10,5,1001150 10,5,1002151 10,10,1001152 ...153 100,20,1005154 ```1551563. **Validation output:**157 ```158 ✓ Submit file syntax is valid159 ✓ Executable found: scripts/run_wrapper.sh160 ✓ Input files present: run_sim.py, data.csv161 ✓ Resource requests reasonable (1 CPU, 512MB RAM)162 ✓ Ready to submit: 30 total jobs163 ```164165---166167## Quick Reference168169| Task | Command/Reference |170| ------------------------ | ------------------------------------------ |171| Validate HTCondor config | Review submit syntax, transfer directives, executable paths, and resource requests |172| Submit jobs | `condor_submit my_job.submit` |173| Monitor jobs | `condor_q` |174| Review logs | Check `.log`, `.out`, and `.err` files |175176---177178For community feedback or issues, see the [OMF Skills](https://github.com/openmodelingfoundation/skills) repository.