Warning, /epic-lfhcal-tbana/examples/yall/SETUP.md is written in an unsupported language. File is not indexed.
0001 # BNL setup: local LFHCal test, Condor test, then scan-set-1
0002
0003 **[TL;DR — the commands to install and run the small tests](SETUP_TLDR.md)**
0004 Add yall-run → get the integration examples → set paths → test.
0005
0006 **Already installed LFHCal using Fredi's instructions? Start below.** Keep your
0007 working installation. The optional [new-workspace installer](#install-in-a-new-workspace)
0008 is for a fresh installation, not a prerequisite for using these examples.
0009
0010 Use the normal BNL tcsh login/submit session for installation and Condor work.
0011 The small `lfhcal-simple` test is deliberately wrapper-free: run it in your
0012 working LFHCal/ROOT environment. The fresh-installation route below uses
0013 `eic-shell` (bash). Do not submit Condor jobs from inside the container.
0014 Yall is optional; it does not replace the analysis software or change its fitter.
0015
0016 ## Add yall-run to an existing LFHCal installation
0017
0018 ### 1. Download and install yall-run
0019
0020 Having LFHCal installed does not mean yall-run is installed. In host tcsh,
0021 with Git and Python 3.8 or newer plus pip available:
0022
0023 ```tcsh
0024 setenv YALL_RUN_REPO "$HOME/yall-run"
0025 git clone --branch main https://github.com/paulnord/yall-run.git "$YALL_RUN_REPO"
0026 python3 -m pip install --user -e "$YALL_RUN_REPO"
0027 setenv PATH "`python3 -m site --user-base`/bin:$PATH"
0028 rehash
0029 which yall-run
0030 yall-run --version
0031 ```
0032
0033 Stop on errors. If you already have yall-run, keep its existing checkout and
0034 skip cloning/installing it again. `$HOME/yall-run` is an example destination,
0035 not a required sibling of LFHCal. Keep it in place because `-e` uses that source
0036 checkout. Retain the PATH setting in your normal shell setup after it works.
0037 If your Python disallows `--user`, use a site-supported Python environment;
0038 do not use sudo or bypass package-management protections.
0039
0040 ### 2. Fetch and switch to the LFHCal integration branch
0041
0042 **Before upstream PR #82 is merged, an upstream LFHCal checkout does not have
0043 these examples.** Installing yall-run or setting `LFHCAL_REPO` will not add them.
0044
0045 Change directory to your existing LFHCal Git repository, the one containing
0046 `NewStructure/`, then run:
0047
0048 ```tcsh
0049 setenv LFHCAL_REPO "`git rev-parse --show-toplevel`"
0050 cd "$LFHCAL_REPO"
0051 git status --short
0052 ```
0053
0054 Stop if you are in the wrong repository or have local changes to preserve.
0055 Do not switch or update a checkout used by running jobs. Fetch from Paul's fork
0056 explicitly, without assuming that your `origin` points there:
0057
0058 ```tcsh
0059 git fetch https://github.com/paulnord/epic-lfhcal-tbana.git yall-integration-upstream
0060 git diff --stat HEAD FETCH_HEAD -- NewStructure OldStructure configs calibrations .gitmodules
0061 ```
0062
0063 Stop if fetch fails. A nonempty diff means the review branch also differs from
0064 your installed analysis/configuration version; review it and ensure your build
0065 matches before running. Adding only workflow files requires no C++ rebuild,
0066 but switching to different analysis sources does not update existing binaries.
0067
0068 For the first checkout of this local review branch:
0069
0070 ```tcsh
0071 git switch --no-track -c yall-integration-upstream FETCH_HEAD
0072 ls examples/yall/lfhcal-simple/Yallfile examples/yall/scan-set-1/Yallfile
0073 ```
0074
0075 If that local branch already exists, use `git switch yall-integration-upstream`
0076 instead of `switch -c`; after the switch succeeds, update it with:
0077
0078 ```tcsh
0079 git pull --ff-only https://github.com/paulnord/epic-lfhcal-tbana.git yall-integration-upstream
0080 ```
0081
0082 Do not pull this branch into an unrelated current branch. Stop on errors or a
0083 refused fast-forward; do not reset or force an update. These commands leave
0084 `origin` and your original branch in place. After PR #82 is merged, update
0085 upstream `main` through your usual upstream remote instead.
0086
0087 ### 3. Set paths and use the existing build
0088
0089 Continue with [Use your existing LFHCal paths](QUICKSTART.md#use-your-existing-lfhcal-paths)
0090 now that the example files actually exist. `LFHCAL_DATA` must directly contain
0091 `Run*.h2g`; the BNL shared location is `/gpfs01/star/pwg/pnord/eic/2026TBdata/raw`.
0092 Choose your own writable `LFHCAL_WORK`. For EIC-wrapped batch workflows,
0093 `EIC_SHELL` must point to your working launcher.
0094
0095 The examples default to `../../../NewStructure/build`. If your executables are
0096 elsewhere, change the example's `@set BUILD` to that existing build directory;
0097 an in-source build uses `../../../NewStructure`. Do not rebuild just to satisfy
0098 a directory convention. Run the bounded [lfhcal-simple](lfhcal-simple/README.md)
0099 test in the same runtime environment as the existing build before a full scan.
0100
0101 **Do not source bootstrap-generated activation files for an unrelated existing
0102 installation.** The `env.tcsh` and `lfhcal-simple/env-eic.sh` conveniences assume
0103 the new-workspace layout. The detailed [existing-installation guide](QUICKSTART.md#existing-installation-do-not-run-the-bootstrap-just-to-submit)
0104 explains the manual route. The rest of this page describes the optional fresh
0105 BNL installation and its tests; it is not a second installation to perform.
0106
0107 ## Install in a new workspace
0108
0109 The installer creates/updates checkouts and builds LFHCal. It is not the command
0110 to use merely to start another campaign. Use a new workspace for this preview,
0111 not a checkout used by running jobs. Commands below download the installer to a
0112 file so it can be inspected before execution.
0113
0114 The two installation blocks below are alternatives. The directory names are
0115 examples of a parent workspace, not required names; do not run both blocks.
0116 If this installer has already completed in your chosen workspace, continue
0117 with the preflight checks rather than rerunning it.
0118
0119 **Before this contribution is merged upstream**, use the review branch explicitly:
0120
0121 ```tcsh
0122 mkdir -p "$HOME/lfhcal-yall-review"
0123 cd "$HOME/lfhcal-yall-review"
0124 curl -fL https://raw.githubusercontent.com/paulnord/epic-lfhcal-tbana/yall-integration-upstream/tools/bootstrap-yall-integration.sh -o bootstrap-yall-integration.sh
0125 less bootstrap-yall-integration.sh
0126 env LFHCAL_REPO_URL=https://github.com/paulnord/epic-lfhcal-tbana.git LFHCAL_BRANCH=yall-integration-upstream bash bootstrap-yall-integration.sh
0127 ```
0128
0129 **After upstream merges this contribution**, a fresh installation can use:
0130
0131 ```tcsh
0132 mkdir -p "$HOME/lfhcal-yall"
0133 cd "$HOME/lfhcal-yall"
0134 curl -fL https://raw.githubusercontent.com/eic/epic-lfhcal-tbana/main/tools/bootstrap-yall-integration.sh -o bootstrap-yall-integration.sh
0135 less bootstrap-yall-integration.sh
0136 bash bootstrap-yall-integration.sh
0137 ```
0138
0139 The installer defaults to `eic/epic-lfhcal-tbana` on `main` and
0140 `paulnord/yall-run` on `main`. `LFHCAL_REPO_URL`, `LFHCAL_BRANCH`,
0141 `YALL_REPO_URL`, `YALL_BRANCH`, and `LFHCAL_BUILD_JOBS` override those defaults.
0142 `--prefix /path/to/workspace` overrides the installation directory. It initializes
0143 the decoder submodule at the revision recorded by LFHCal, installs yall-run for
0144 the host Python with `pip --user -e`, and builds LFHCal in the EIC environment.
0145 It does not install Condor or upgrade pip.
0146
0147 The larger Yallfiles require yall-run **0.12.0a7** with PR #45 or newer.
0148 They explicitly set `%account-provenance off`; set it to `full` only when
0149 operator attribution is needed and permitted by your site's privacy policy.
0150 This does not anonymize paths or logs. See [account provenance](README.md#account-provenance).
0151
0152 The layout is:
0153
0154 ```text
0155 workspace/
0156 eic-shell
0157 yall-run/
0158 epic-lfhcal-tbana/
0159 activate.tcsh
0160 site-env.tcsh
0161 ```
0162
0163 Inside the interactive EIC shell, `lfhcal-simple/env-eic.sh` uses the yall-run
0164 source checkout with the container's Python. There is no separate container pip
0165 installation. The `.sh` installer and payload wrapper are implementation scripts,
0166 not instructions to change the host login shell.
0167
0168 ## Storage: shared input, personal output
0169
0170 New BNL installations default to:
0171
0172 ```text
0173 LFHCAL_DATA=/gpfs01/star/pwg/pnord/eic/2026TBdata/raw
0174 LFHCAL_WORK=/gpfs01/star/scratch/<your-login-name>/lfhcal
0175 ```
0176
0177 `LFHCAL_DATA` must name the directory directly containing `Run*.h2g`, not its
0178 parent. The shared data area now has `raw/`, `converted/`, and `merged/`
0179 subdirectories; these recipes read the raw files and write new products under
0180 `LFHCAL_WORK`. They do not modify the shared converted or merged data.
0181
0182 The shared PWG path is a site-specific convenience, not part of the distribution
0183 and not guaranteed readable by every collaborator. Obtain access or set
0184 `LFHCAL_DATA` to your own complete input files. Setup does not write into that
0185 input directory or change its permissions. Edit `site-env.tcsh` for other paths;
0186 existing settings are preserved. Do not append an example name to `LFHCAL_WORK`:
0187 the Yallfiles do that themselves.
0188
0189 The work root, software, inputs, campaign records and EIC launcher must be visible
0190 on worker nodes and inside the container. For a second run, use a fresh work root
0191 rather than letting two campaigns write to the same output paths.
0192
0193 ### Already installed with the old raw-data path?
0194
0195 Older setup versions used the parent `2026TBdata` directory, sometimes with
0196 an extra `/gpfs/mnt` prefix. The raw files are now under `2026TBdata/raw`.
0197 A pull updates defaults, but intentionally does not rewrite your generated
0198 `site-env.tcsh` outside the repository. Correct only the old shared-data values,
0199 retaining all other settings and a backup (BNL/Linux, host tcsh):
0200
0201 ```tcsh
0202 setenv LFHCAL_DATA "/gpfs01/star/pwg/pnord/eic/2026TBdata/raw"
0203 sed -i.bnl-raw-backup -E 's|"/(gpfs/mnt/)?gpfs01/star/pwg/pnord/eic/2026TBdata(/raw)?"|"/gpfs01/star/pwg/pnord/eic/2026TBdata/raw"|g' "$LFHCAL_HOME/site-env.tcsh"
0204 ```
0205
0206 Run this migration once; choose another backup suffix if that backup already
0207 exists. The replacement matches complete double-quoted values; it does not
0208 append a second `/raw`. No reinstall or C++ rebuild is needed. Keep custom data
0209 locations as chosen; do not rewrite arbitrary paths or old campaign/provenance
0210 records. Verify the required files both on the host and inside eic-shell.
0211
0212 ## 1. Preflight checks
0213
0214 From the software workspace:
0215
0216 ```tcsh
0217 source ./activate.tcsh
0218 which python3
0219 which yall-run
0220 which condor_submit
0221 which condor_submit_dag
0222 echo 'root-config --version' | "$EIC_SHELL"
0223 python3 "$LFHCAL_REPO/examples/yall/check_shared_conversions.py" -v
0224 ```
0225
0226 Stop on a failed check. Graph tests use no raw data, ROOT or scheduler. Read the
0227 [yall-run quick start](https://github.com/paulnord/yall-run/blob/main/docs/QUICKSTART.md)
0228 for the `validate -> plan -> create -> start -> status` lifecycle.
0229
0230 ## 2. Small local LFHCal test inside eic-shell
0231
0232 From the host tcsh session:
0233
0234 ```tcsh
0235 cd "$LFHCAL_REPO/examples/yall/lfhcal-simple"
0236 source env.tcsh
0237 foreach r (296 298 299 300 303 304)
0238 ls -lh "$LFHCAL_DATA/Run${r}.h2g"
0239 end
0240 $EIC_SHELL
0241 ```
0242
0243 Inside `eic-shell` (bash):
0244
0245 ```bash
0246 source ./env-eic.sh
0247 ls -lh "$LFHCAL_DATA"/Run{296,298,299,300,303,304}.h2g
0248 yall-run validate
0249 yall-run plan
0250 C=$(yall-run create --campaigns-dir "$LFHCAL_WORK/campaigns" -j 1)
0251 yall-run start "$C"
0252 yall-run status "$C"
0253 exit
0254 ```
0255
0256 This converts three pedestal/MIP pairs and extracts their pedestals with a
0257 1000-event limit. It does not attempt MIP calibration or waveform-summary fits.
0258 Use a site-approved interactive allocation; even bounded work is not permission
0259 to run heavy jobs on a login node. `-j 1` limits local concurrency.
0260
0261 ## 3. Small Condor + EIC test
0262
0263 Back on the host, run the no-data EIC-shell example supplied with yall-run:
0264
0265 ```tcsh
0266 cd "$YALL_RUN_REPO/examples/eic-shell"
0267 yall-run validate
0268 yall-run plan
0269 set C = `yall-run create --campaigns-dir "$LFHCAL_WORK/campaigns"`
0270 yall-run start "$C"
0271 yall-run status "$C" -vv
0272 ```
0273
0274 It tests ROOT and Python on worker nodes plus dependency execution, without
0275 processing detector data. Wait for success before a production workflow.
0276
0277 ## 4. Scan set 1
0278
0279 ```tcsh
0280 cd "$LFHCAL_REPO/examples/yall/scan-set-1"
0281 source env.tcsh
0282 foreach r (296 298 299 300 303 304 307 308 309 310)
0283 ls -lh "$LFHCAL_DATA/Run${r}.h2g"
0284 end
0285 yall-run validate
0286 yall-run plan
0287 ```
0288
0289 After checking all ten files, paths and resources:
0290
0291 ```tcsh
0292 set C = `yall-run create --campaigns-dir "$LFHCAL_WORK/campaigns"`
0293 echo "$C"
0294 yall-run start "$C"
0295 yall-run status "$C" -vv
0296 ```
0297
0298 Results go under `$LFHCAL_WORK/scan-set-1`. Campaign records are under
0299 `$LFHCAL_WORK/campaigns`. The 14 FullSet workflows and HV scan are later, larger
0300 exercises; they are not the installation smoke test.
0301
0302 ## Updating and restarting
0303
0304 A campaign uses the existing `NewStructure/build` executables. These examples
0305 contain no build jobs. Rebuild only after analysis code, build configuration,
0306 decoder revision or runtime ABI changes; editing a Yallfile does not require a
0307 C++ rebuild. Never update or rebuild a shared checkout while jobs use it.
0308
0309 Re-running the bootstrap does update/build work; use it deliberately, not for
0310 every campaign. In a preview workspace, retain the same explicit fork/branch
0311 overrides when doing so. The updater preserves each checkout's existing origin;
0312 it does not silently replace a fork remote with the upstream remote.
0313
0314 To restart unfinished tasks, first fix the cause and inspect partial outputs,
0315 then use `yall-run resume "$C" --dry-run` followed by `yall-run resume "$C"`.
0316 Do not rerun `start` on an already-started campaign. Resume preserves completed
0317 tasks and restarts unfinished programs from the beginning, not their last event.
0318 Consult the runner's [resume documentation](https://github.com/paulnord/yall-run/blob/main/docs/RESUME.md)
0319 for overwrite and queued-backend restrictions. Changed task resources require a
0320 new campaign with versions that support command-only amendments.