/af-cern-lxplus:lxplus-htcondorfrom af-cern-lxplus
Helps write and debug CERN HTCondor (lxbatch) submit files: sizing memory/CPU/GPU, choosing schedd vs EosSubmit, picking JobFlavour, handling held/idle/removed jobs, staging outputs to EOS with xrdcp, and DAGMan campaigns.
Ships in af-cern-lxplus. 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.
None: SKILL.md is the whole skill.
CERN batch (lxbatch) is HTCondor, submitted from lxplus. Unlike a plain
pool, the CERN schedds rewrite parts of your job: they derive CPUs from
memory, overwrite requirements, enforce wall time through +JobFlavour,
and reject /eos paths on the standard schedds. Most idle, held and
removed jobs trace back to one of those. Make jobs self-contained (CVMFS
software, tarball code, xrdcp outputs to EOS), size them from
measurements, run one test job, then the campaign.
Field notes collected by DickyChant from about 25 Claude Code sessions running CMS work at CERN (Oct–Nov 2026). Every item was hit in practice; where sessions disagreed, both observations are kept.
.sub file for lxbatch (CPU or GPU)/afs/cern.ch/work/...) on the standard schedd. The standard schedds refuse /eos paths in the submit file.ls -d /afs/cern.ch/work/<u>/<user> fails; request it at the CERN resources portal). Submitting from the AFS home works (validated Nov 2026); check fs lq ~ first, since the home is small (~2 GB).xrdcp of the outputs to EOS at the end, with transfer_output_files = "" when nothing should come back.module load lxbatch/eossubmit, submit from an /eos dir): reports are mixed.
FILETRANSFER: plugin for type root not found (HoldReasonCode 13, subcode 11). Some workers (including GPU nodes) lack the xrootd plugin. should_transfer_files = NO doesn't help, because the schedd rewrites the executable to root://./eos;logs/x.$(ClusterId).log);transfer_input_files (send tarballs);queue can't sit inside if/else.periodic_release = (HoldReasonCode == 12 || HoldReasonCode == 13) && (NumJobStarts < 10), and expect churn.requirements is overwritten by the CERN schedd (only Hostgroup/PreLocalRequirements survive). A stringListMember("root", HasFileTransferPluginMethods) guard never applies. GPU-model requirements (TARGET.GPUs_DeviceName =?= "NVIDIA H100 NVL") were reported to work. Check what was kept with condor_q <id> -l | grep '^Requirements'; condor_q <id> -af Requirements printed false (it evaluates the expression instead of showing it).MY.SendCredential = True forwards a krb5 ccache. Don't export XrdSecPROTOCOL=krb5 (spurious [3012] Unable to open file; Bad address); let xrdcp negotiate. DAG POST scripts run on the schedd without that ccache, so EOS I/O there silently does nothing.condor_submit -dry-run /dev/stdout x.sub prints the job ads without submitting (-dry-run takes an output file, and the submit file must still be named: condor_submit -dry-run - < x.sub fails with "No submit filename was provided"). It shows the ads before the schedd's transforms, so a memory or CPU raise only appears in condor_q <id> -af RequestMemory RequestCpus after submitting. Run one short test job before any campaign.RequestCpus from RequestMemory at about 2–3 GB per core (ceil(mem/3072) measured once; ~2 GB/core reported elsewhere).
/usr/bin/time -v and read "Maximum resident set size" (KB). After jobs ran, use the "Partitionable Resources" table in the job log, or condor_history <id> -af MemoryUsage (which can hang for minutes; the log is faster). Never bid defensively.request_memory = 1000 was queued as 3000 MB (Nov 2026), with RequestCpus still 1. Below ~3 GB, bidding lower doesn't buy faster matching.condor_qedit <cluster> RequestMemory 2500. Use only the cluster id you just submitted: a constraint-based condor_qedit once rewrote 9,567 unrelated jobs. Preview the count and owners before any bulk qedit, rm or hold.condor_q <id> -af RequestMemory.request_memory holds the job via the cgroup, even after its useful work is done. Split memory-heavy post-steps into their own job. Pin the application's own parallelism (MadGraph without nb_core used every core of the node and blew the limit).request_gpus = 1 forces 8 CPUs per GPU, and a dynamic GPU slot has 16000 MB, so request_memory > 16000 never matches.RequestCpus >= 4.CUDADeviceName, GlobalMemoryMb); check the type at runtime instead (nvidia-smi --query-gpu=compute_cap).condor_status -af GPUs_DeviceName GPUs_GlobalMemoryMb | sort | uniq -c.+JobFlavour limits: espresso 20 m, microcentury 1 h, longlunch 2 h, workday 8 h, tomorrow 1 d, testmatch 3 d, nextweek 1 w. +MaxRuntime (seconds, under 14 days) is honoured on some schedds, but one GPU/EosSubmit session found it ignored (the schedd derives it from the flavour), and a later condor_qedit MaxRuntime didn't save a running job. Pick the flavour at submit and confirm with condor_q <id> -af MaxRuntime.Job removed by SYSTEM_PERIODIC_REMOVE due to wall time exceeded allowed max. The same rule applies to disk (... disk usage exceeded allowed max).workday and at 23.8 h under tomorrow.condor_q -hold -af HoldReason, condor_q -better-analyze <id> ("would match if drained" means wait), and condor_history <id> -af JobStatus ExitCode RemoveReason.RETRY doesn't cover them; add a periodic_release for the specific codes./usr/bin/python, or have a broken gfal-ls. A job that dies in the first minute on one node and succeeds on others is a node problem; resubmit.test -s. Validate content (event counts, a marker line), not existence. rc=0 is not proof: a generator printed "success" with an empty tarball.stream_output/stream_error, so stdout only comes back at the end. To watch progress, tee the log to EOS.mkdir them before submitting.transfer_input_remaps only renames outputs. transfer_input_files with root:// takes files only. executable, initialdir and log can't be xrootd URLs. condor_submit -spool keeps the sandbox off AFS.max_materialize, max_idle) keeps spawning jobs while the cluster is held: condor_rm a dead cluster instead of leaving it held.condor_submit_dag -maxidle 200 -maxjobs 500 -batch-name <name>; pass per-node values through VARS.More field notes, each from a real failure. EosSubmit specifics
transfer_output_files = "" (or +TransferOutput = ""). Otherwise the whole sandbox comes back, including the proxy and the <user>.cc Kerberos cache. That filled a quota (hold code 12), and concurrent jobs collided on "File exists".condor_submit to ≤ 500 jobs; 1000+ failed with "Failed to create proc". Release or resubmit in waves of ≲ 500 every ~10 min. A 5k-job burst caused an hour-long xrootd Operation expired storm.SYSTEM_PERIODIC_REMOVE removes a job after 11 starts, and every hold-and-release uses one. Watch NumJobStarts.Iwd is the spool and Err is a root:// URL, so match jobs on Err.max_materialize on bigbird103 (Nov 2026) applied the requirement transforms twice and left a loop that matched nothing (-better-analyze: "[1] never PreVerRequirements"). Submit without it, and always run -better-analyze right after submitting.next_job_start_delay is refused.condor_submit -spool ships it; CERN then requires an explicit transfer_output_files. condor_rm the completed spooled jobs afterwards, which removes the proxy copy.Software in jobs
OSError: [Errno 5] in ~half of 800 jobs, and the wrapper exited 0. Hundreds of jobs writing .pyc at once caused EIO too. Ship a tarball and unpack it in $_CONDOR_SCRATCH_DIR, or set PYTHONDONTWRITEBYTECODE=1 and precompile once.getenv = True ships values literally: $PYTHONPATH inside a value is never expanded. Write explicit export lines in the executable. Check with a test job that runs python -c 'import pkg; print(pkg.__file__)'.export PYTHONNOUSERSITE=1 in jobs too: the AFS ~/.local is visible on workers and shadows env packages.PYTHONHOME/PYTHONPATH, which break a venv or pixi Python; use env -u PYTHONHOME -u PYTHONPATH. A reproducible env that worked: pixi from cvmfs, with the package cache as a tarball on EOS and an offline pixi install per job (≈20 s).MY.WantOS = "el8" runs el8 builds on el9 workers. MY.SingularityImage = "/cvmfs/unpacked.cern.ch/..." runs in an image.-march=native binaries built on lxplus die with illegal instructions on older workers. Use -march=x86-64-v2.-B /afs -B /cvmfs/cms.cern.ch -B /tmp -B /eos/cms -B /eos/user -B /etc/sysconfig/ngbauth-submit -B $XDG_RUNTIME_DIR --env KRB5CCNAME=FILE:$XDG_RUNTIME_DIR/krb5cc.Robustness
RC=$? immediately after the payload. A stage-out block before if [ $? -eq 0 ] made failed jobs look successful.max_retries never sees a 0 exit.periodic_remove held jobs. An AFS volume outage held ~600 jobs, which were then deleted at once; release with a limit instead. During that outage the schedd also truncated output files at 512 KiB (vos examine showed "Volume is busy").exit 0, write a GUARD-FAIL marker, and count complete outputs between stages.condor_q can fail silently: "Could not fetch schedd mapping data" prints nothing. Accept a poll only on exit 0, and require the expected outputs (or two consecutive empty polls).queue ... from missing.txt). That catches held, evicted and lost jobs.RequestMemory = ifThenElse(isUndefined(MemoryUsage), <MB>, int(MemoryUsage*1.1)). Cap log verbosity: a looping job wrote a 3 GB log (combine -v ≤ 3).condor_ssh_to_job. Stream stdout with condor_tail -maxbytes N <id>. The cluster's user log is much faster than condor_history, and history rolls off after a few weeks, so record stats while it's fresh.errno 27 File too large. AFS is write-on-close: a file being written on node A reads as empty on node B. cp dir/* hits "argument list too long" at ~2 MB.condor_prio only orders one user's jobs; raising one campaign starves your others.MY.SendCredential = True is enough for CERN EOS from jobs (credmon renews it). A voms proxy is only needed for non-CERN storage. Jobs keep running ~31 h after the submitter's ticket expires.root://cmseos.fnal.gov//store/user/<user>/...) from lxbatch: keep the proxy on AFS (chmod 600), keep MY.SendCredential = True, and export X509_USER_PROXY=<afs path> in the job script; the worker reads it through the forwarded AFS token (validated Nov 2026). Check voms-proxy-info -timeleft covers the campaign.output, error, log) are relative to the submit directory (initialdir), and their directories must exist.What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/crabUse when submitting, monitoring or recovering CMS CRAB tasks on EL9: crab-setup and proxy delegation, sandbox size limits, memory/cores and maxJobRuntimeMin, site white/blacklists, crab resubmit vs recovery tasks with a lumiMask, PrivateMC seeds, CRAB as a backend for non-cmsRun payloads (law/dhi combine fits), or decoding CRAB failures such as SUBMITREFUSED, SUBMITFAILED, exit 50660, 50665, 50115, 8021, 8028, 60323, 60326, 60328, "Argument list too long", "A different CMSSW configuration was already cached" or "Problems delegating My-proxy"./eos-xrootdUse when reading, writing, copying, verifying or deleting files on CERN EOS (eoscms, eosuser) or FNAL EOS (cmseos) from login nodes, batch or grid jobs: building root:// URLs, xrdcp/xrdfs/eos CLI commands, checksum-verified copies, FUSE vs xrootd in jobs, quota checks (eos quota, inode quota), bulk deletes and the CMS recycle bin, sharing via the www area, uproot over root://, or errors such as "MGM root://localhost not online/reachable", "Operation expired", "Redirect limit has been reached", "No servers are available to read the file", "[3021] Unable to get quota space" or being mapped to user nobody./lxplus-accessUse when driving lxplus (or cmslpc) over ssh from an agent or script: non-interactive ssh with Kerberos/GSSAPI, lxtunnel jumps and 2FA, pinning an lxplus9NN node, files vanishing from /tmp between calls, nohup or setsid processes killed at logout, expired or non-renewable Kerberos tickets, AFS quota or token problems, apptainer not seeing /eos/user, or errors such as "Permission denied (publickey,gssapi-with-mic)", "Could not resolve hostname lxplus.cern.ch.cern.ch", ".bashrc: Permission denied", "kex_exchange_identification: Connection closed" or "COMPILER: unbound variable".npx claudepluginhub cms-ml/marketplace --plugin af-cern-lxplusOther plugins' skills for the same job