Skip to content

Field off option#36

Merged
oksuzian merged 2 commits intoMu2e:mainfrom
oksuzian:field-off-option
Apr 29, 2026
Merged

Field off option#36
oksuzian merged 2 commits intoMu2e:mainfrom
oksuzian:field-off-option

Conversation

@oksuzian
Copy link
Copy Markdown
Collaborator

No description provided.

oksuzian and others added 2 commits April 28, 2026 08:54
g4bl runner integration:
- New runner: 'g4bl' field in jobdesc routes through validate_jobdesc to
  process_g4bl_jobdef in utils/prod_utils.py. Apptainer-wrapped SL7
  execution with --cleanenv (env-leak fix: AL9 PYTHONHOME / UPS_DIR /
  PRODUCTS otherwise leak in and break setupmu2e-art.sh's UPS init).
- DEFAULT_G4BL_CONTAINER constant + new poms/g4bl.cfg with SL7
  +SingularityImage so grid jobs run directly in SL7 (no nesting).
- _is_inside_sl7() runtime detect skips the apptainer wrap when the
  outer Condor container is already SL7.
- JSON shape: runner, embed_dir, main_input, events_per_job, njobs.
- Smoke verified: 81KB ROOT written, 0 fatal exceptions.
- Files: data/mdc2025/g4bl.json, test/g4bl_smoke_jobdesc.json.

Repo hygiene:
- Mu2eFilename consolidated to utils/job_common.py (relpathname()
  method added). utils/datasetFileList.py imports the canonical class.
  Hash output byte-identical, all 181 unit tests still pass.
- Dead code removed from utils/prod_utils.py: parse_jobdef_fields(),
  make_jobdefs_list() — zero external callers.
- Untracked duplicates removed from bin/: listMcsDefs (byte-identical
  to listRelatedDefs), listRelatedDefs (per option C), and the
  abandoned smolagents experiment json2jobdef_agent.py + README.
- CLAUDE.md prodtools list trimmed accordingly.
- .gitignore: root-anchored entries for scratch files (os, sys,
  test2/, test_runmu2e/, test_reco/, prompts*.txt, mu2e_common.gdml,
  MDC*-test.json, momentum_resolution_*.png, poms_data.db).

Skills:
- /parallel-audit: spawn N parallel Explore agents on independent
  slices, synthesize findings into a prioritized punch list. Inspired
  by Hermes Agent's subagent-driven-development. Default Mu2e 4-slice
  cut documented (utils+bin / CLI / DB+JSON / tests+hygiene).

Wiki: log entries for skill commissions, repo hygiene, ~/.claude move
to /exp/mu2e/app, g4bl runner integration. Raw source staged for the
next ingest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
g4bl runner architecture (was SL7 container, now native AL9):
- process_g4bl_jobdef in utils/prod_utils.py simplified ~50 LOC. Was:
  apptainer exec --cleanenv against fnal-dev-sl7, with HOME / /tmp /
  embed_dir binds + PYTHONHOME/PATH + --cleanenv to dodge env leaks.
  Now: bash -c 'unset SPACK_ENV PYTHON*; source mu2e-art.sh; eval
  $(spack load --sh g4beamline); cd embed_dir; g4bl ...'. No container,
  no nested wrap — workers run in the standard fnal-wn-el9 outer
  container set by poms/fermigrid.cfg.
- _is_inside_sl7() helper and DEFAULT_G4BL_CONTAINER constant removed.
- poms/g4bl.cfg deleted (was the SL7 outer container override; redundant
  with fermigrid.cfg now).
- runmu2e.py refactored: dispatch logic extracted into
  _dispatch_and_execute() helper (Option E in the architecture
  discussion); removes the early sys.exit(0) g4bl branch and consolidates
  the per-runner switch in one function. New build_mu2e_cmd() helper
  packages the art-side mu2e -c command as a shell=False arg list,
  closing the shell=True quoting hazard while preserving && semantics.

Output naming + map shape:
- Output renamed from g4bl.mu2e.* to nts.mu2e.* (canonical Mu2e ntuple
  tier; matches metacat convention).
- desc renamed Mu2EBeamline* -> G4blPOT (descriptive of POT physics,
  not art-side musing tag).
- dsconf -> TESTaa (test marker; clearly out-of-band of MDC campaigns).
- POMS map shape minimized to 5 fields (tarball, njobs, runner, inloc,
  outputs) matching MDC2025-NNN convention. Runtime config (desc,
  dsconf, main_input, events_per_job) lives in jobpars.json INSIDE the
  tarball — the tarball is self-describing for grid replay. Embed_dir
  mode (local smoke) keeps the full schema since there's no tarball.
- validate_jobdesc relaxed to require only `outputs` for g4bl tarball
  mode; full set for embed_dir mode. No fallbacks: missing fields fail
  loudly per the no-fallbacks rule.

Two non-obvious gotchas captured in code comments + memory:
- `unset SPACK_ENV` is mandatory before sourcing in subprocess scripts.
  bin/runmu2e does `muse setup ops` before invoking Python, which
  activates the ops-019 spack env; subprocess inherits SPACK_ENV;
  `spack load g4beamline` then searches only ops-019 (no g4beamline) and
  fails with "matches no installed packages". Mu2e wiki documents this.
- g4bl 3.08b on AL9 requires plain `key=value` CLI syntax, NOT
  `param key=value` — the `param` form is input-file-only. The older
  3.08 SL7 build was lenient.

Wiki ingest: github.com/fermitools/poms research → wiki/pages/
poms-reference.md (synthesized data model + Mu2e conventions + dispatch
lifecycle) + 3 raw sources at wiki/raw/2026-04-28-poms-*.

Memories: reference_spack_env_after_muse_setup.md, feedback_no_fallbacks
.md, feedback_no_voms_proxy_init.md, reference_g4bl_param_unset_semantics
.md.

181/181 unit tests pass. Both smoke modes (embed_dir + tarball) produce
SAM-named nts.*.root + log.*.log with 0 fatal exceptions. Demonstrator
artifacts staged: tarball at /pnfs/mu2e/tape/phy-etc/cnf/mu2e/G4blPOT/
TESTaa/tar/c7/74/, POMS map at .../poms_map/G4BL-000.json, SAM index
def iG4BL-000 (1 file). Pending grid push: cvmfs prodtools deployment +
POMS-side stage configuration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@oksuzian oksuzian merged commit 68e32ae into Mu2e:main Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant