/af-fnal-lpc:lpc-condorfrom af-fnal-lpc
Runs CMS analysis jobs on the LPC HTCondor batch system at Fermilab: splits datasets, writes .jdl and wrapper scripts, handles XRootD inputs and EOS outputs, submits, monitors, and debugs failures.
Ships in af-fnal-lpc. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The LPC HTCondor pool runs your jobs on Fermilab worker nodes inside an
Alma9 Apptainer container. The job's scratch directory is mounted at
/srv, and the container sees /cvmfs but not NFS (/uscms_data,
nobackup, home) and not the EOS FUSE mount. So:
root://...), or ship small files with the job (< 1 GB total).xrdcp to root://cmseos.fnal.gov//store/user/<you>/....The workflow is: build jobs.txt → test the wrapper locally → submit one
job → submit everything → check outputs → resubmit the failures.
.jdl and its job.sh wrapper| Item | Fact (checked on cmslpc, 2026-10) |
|---|---|
| Submit host | An EL9 cmslpc node. The condor_submit wrapper picks a schedd: lpcschedd3/4/5.fnal.gov |
| Proxy | voms-proxy-init --valid 192:00 -voms cms. Picked up automatically; no x509userproxy line |
| Worker container | cms:rhel9 Apptainer (Alma9). Select another with +DesiredOS = "SL7" (or EL8, EL9) |
| Scratch | $_CONDOR_SCRATCH_DIR = /srv, about 40 GB disk per job |
| Python stack | /cvmfs/sft.cern.ch/lcg/views/LCG_109/x86_64-el9-gcc15-opt: Python 3.13, uproot 5.6, awkward 2.8, hist, iminuit 2.31, vector, mplhep, XRootD, fsspec-xrootd, coffea, hepdata_lib |
| Job index | queue jobid,inputs from jobs.txt. A fixed index survives resubmission (unlike $(Process)) |
voms-proxy-info -timeleft # > 0, else voms-proxy-init --valid 192:00 -voms cms
eosquota # outputs count against your EOS user quota
eos root://cmseos.fnal.gov mkdir -p /store/user/$USER/myanalysis/out # one path per call
eos root://cmseos.fnal.gov mkdir -p /store/user/$USER/myanalysis/test # for the one-job test (step 4)
scripts/make_filelist.py recurses an XRootD
directory (Open Data, EOS) or a DAS dataset, and writes
<index> <url1,url2,...> lines:
S=<skill-dir>/scripts # <skill-dir> = the directory holding this SKILL.md
# (in the cms-ml/marketplace repo: plugins/af-fnal-lpc/skills/lpc-condor)
$S/make_filelist.py --xrootd-dir root://eospublic.cern.ch//eos/opendata/cms/Run2016H/JetHT/NANOAOD/UL2016_MiniAODv2_NanoAODv9-v1 \
--files-per-job 5 -o jobs.txt # 72 files -> 15 jobs
$S/make_filelist.py --das /JetHT/Run2016H-UL2016_MiniAODv2_NanoAODv9-v1/NANOAOD -o jobs.txt # needs proxy
--max-files N takes the first N files in sorted path order (for test runs).
Choose --files-per-job from the one-job condor test (step 4), not the
local run: in validation, workers took 3–10× longer than the same work run
locally (cold CVMFS/XRootD). Aim for 30 min to a few hours per job.
Copy assets/job.sh, assets/job.jdl and, as a
starting point, assets/payload.py into your job directory.
Then set the OUTDIR default in the .jdl. The snippet below shows only the
key lines; the asset is the complete file.
Payload contract: job.sh runs
python3 payload.py --inputs <comma-separated root:// URLs> --output output_<jobid>.<OUT_EXT>.
Your payload must accept those two options and write exactly that one file.
OUT_EXT is root by default; change it in the .jdl environment line
(e.g. OUT_EXT=json). check_outputs.py --pattern must use the same name. To
run something other than payload.py, edit that one line in job.sh.
The wrapper:
USERENV_MODE=lcg by default, or cmssw with a tarball from EOS)xrdcps each output with 3 retries, removes the local copy, and exits non-zero on failureexecutable = job.sh
transfer_input_files = payload.py
if !defined JOBS # defaults, overridable on the command line
JOBS = jobs.txt
endif
if !defined OUTDIR
OUTDIR = root://cmseos.fnal.gov//store/user/<you>/<area>
endif
arguments = "$(jobid) $(inputs) $(OUTDIR)"
output = logs/job_$(Cluster)_$(jobid).out # cluster in the name: test logs aren't overwritten
log = logs/cluster_$(Cluster).log
queue jobid,inputs from $(JOBS)
OUT_EXT=root bash job.sh 0 "$(head -1 jobs.txt | cut -d' ' -f2)" root://cmseos.fnal.gov//store/user/$USER/myanalysis/test
# local runs don't read the .jdl `environment` line: pass the same OUT_EXT (and ENV_MODE) yourself
head -1 jobs.txt > jobs_one.txt
mkdir -p logs
condor_submit JOBS=jobs_one.txt OUTDIR=root://cmseos.fnal.gov//store/user/$USER/myanalysis/test job.jdl # 1 job, separate output
condor_submit job.jdl # then everything
condor_q # your jobs, but may lag ~1 min or miss a schedd: trust the job log
condor_q -name lpcschedd4.fnal.gov <cluster> # ask the schedd that has the job directly
condor_q -hold # held jobs and the reason
grep -E '^(005|012)' logs/cluster_*.log # terminated / held events
grep -A2 '^005' logs/cluster_*.log | grep 'return value' # exit codes
condor_tail -name lpcschedd4.fnal.gov <cluster>.<proc> # live stdout; needs the schedd
condor_rm -name lpcschedd4.fnal.gov <cluster> # remove; needs the schedd
condor_submit prints the cluster ("N job(s) submitted to cluster X") and
the schedd it used ("Attempting to submit jobs to lpcschedd4.fnal.gov"). The
cluster line can appear before the schedd line. Record both, because rm,
tail, hold and release need -name.
scripts/check_outputs.py lists the EOS area and writes the lines of missing or too-small jobs to a resubmit file. The index is kept, so outputs land under the same names:
$S/check_outputs.py --jobs jobs.txt --outdir root://cmseos.fnal.gov//store/user/$USER/myanalysis/out \
--pattern 'output_{jobid}.root' --min-bytes 1000 # pick for your output type (small JSON: ~100)
# exit 2 -> jobs_resubmit.txt written; set `queue jobid,inputs from jobs_resubmit.txt` and resubmit
Then merge the outputs: hadd from CMSSW/ROOT, or sum histograms in Python
reading root://cmseos.fnal.gov//... directly.
set -u breaks the LCG setup. Sourcing the LCG view under set -u
fails with setup.sh: line 18: COMPILER: unbound variable, so the job
exits within seconds with return value 1. Use set -eo pipefail, or
set +u around the source.$(VAR:default) silently breaks on hyphens. In a .jdl,
OUTDIR = $(OUTDIR:root://.../cms-tests) is passed to the job as the
literal unexpanded text whenever the default contains -. Then xrdcp writes
to a local file and the job still "succeeds" with no output on EOS (seen in
validation). Use if !defined OUTDIR … endif as in the template. The template
wrapper also refuses any OUTDIR that isn't root:// (exit 2).transfer_input_files (< 1 GB) and put large
ones on EOS.xrdcp and root://cmseos.fnal.gov//store/...,
never /eos/uscms/... paths.$USER is empty on workers. The wrapper exports it.getenv = true or a hard-coded x509userproxy. Set the
environment inside the wrapper, and let LPC handle the proxy.job.sh must be #!/bin/bash, with nothing before it.-name is required for condor_rm/tail/hold/release on the
refactored pool. Cluster IDs differ between schedds (we saw 4739665,
86238726 and 30979433 from different schedds)./eos. Submit from an NFS directory (nobackup is
fine). Logs are written there.file-indexes/ (non-ROOT text files).
make_filelist.py only takes *.root.condor_q alone. It can lag; the job log
(logs/cluster_*.log) is authoritative for submit, start and termination.For large productions on the LPC pool or CMS Connect (site vetoes,
microarchitecture, premix, schedd throttling), see the cmsconnect-lpc skill.
job.sh contract and writes a ROOT
histogram.-debugfile, proxy and DN registration, EOS stage-out
failures, and LPC support contacts.-name): https://uscms.org/uscms_at_work/computing/setup/condor_refactor.shtmlWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cms-ml/marketplace --plugin af-fnal-lpc2 skills in this plugin
Other plugins' skills for the same job