about summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorPjotr Prins <pjotr.public01@thebird.nl>2026-11-14 04:14:07 +0000
committerPjotr Prins <pjotr.public01@thebird.nl>2026-11-14 04:14:07 +0000
commit0e017416628d72ae9814b8225d17f62b28f855ee (patch)
treea073e1f8dd009b548cab0cb0bfc95904c3b3d77f /docs
parentf8b34ca82b40f9eda65fa3abab580a0ca8e66f49 (diff)
downloadgenenetwork4-0e017416628d72ae9814b8225d17f62b28f855ee.tar.gz
ravanan+gemma: call gemma itself, not gemma-wrapper
gemma-wrapper was doing two things ravanan now does or GEMMA already
does: the parallel fan-out (ravanan's CWL scatter replaced it long ago,
which is why every job passed --no-parallel) and LOCO orchestration --
gemma 0.98.6 documents `-loco [chr]` natively for both -gk and -lmm and
takes the annotation file it needs. What was left was a content-hash K
cache and a --json record with results packed into .tar.xz archives.

So cwl/gemma/gemma-loco.scm now runs two gemma invocations per
chromosome: `-gk -loco <chr> -o <chr>-kin`, then `-k <that matrix>
-lmm <n> -loco <chr> -pve -o <chr>-gwa`, with `-outdir .` for flat,
deterministic names. The kinship matrix travels from one step to the
other as a CWL File output, and each job's .assoc.txt and .log.txt are
the workflow's outputs -- so compute_ravanan reads files instead of
parsing a wrapper JSON record and unpacking archives, and the pve note
comes straight out of the jobs' logs.

Measured on tests/test_data/BXD (chr 1 and chr 2): identical rows --
636/636 and 583/583 on beta, se, l_mle, p_lrt. One chromosome end to
end: 496 ms (gemma) vs 1140 ms (wrapper), 2.3x per job. The wrapper
also needed Ruby and pfff on PATH, and named its outputs with the
extension doubled (...1.assoc.txt.assoc.txt).

/compute/gemma keeps gemma-wrapper, deliberately: that is what makes
the two endpoints comparable rather than two copies of one stack.
scripts/gemma-compare.py runs the same body through both and reports
row-level differences and timings.

The gemma-wrapper content-hash K cache is the one thing given up;
a repeat request recomputes (271 ms of kinship on this fixture).
Diffstat (limited to 'docs')
-rw-r--r--docs/ravanan-slurm.md39
1 files changed, 19 insertions, 20 deletions
diff --git a/docs/ravanan-slurm.md b/docs/ravanan-slurm.md
index 69e1bc1..d8b40bf 100644
--- a/docs/ravanan-slurm.md
+++ b/docs/ravanan-slurm.md
@@ -43,8 +43,9 @@ the safe choice).
 
 Two things the cluster needs that a plain dev box may not have:
 
-- `gemma-wrapper` (and the `gemma` it wraps) reachable in the profile
-  ravanan builds from `GEMMA_RAVANAN_MANIFEST`; ravanan resolves that
+- `gemma` reachable in the profile ravanan builds from
+  `GEMMA_RAVANAN_MANIFEST` (the workflow invokes `gemma` itself, not
+  `gemma-wrapper` -- see `cwl/gemma/gemma-loco.scm`); ravanan resolves that
   manifest against the *ambient* Guix process, so `GUIX_PACKAGE_PATH`
   (or a pulled `guix-bioinformatics` channel) must be set in the
   server's environment, as it already must for the single-machine
@@ -69,14 +70,10 @@ the fail-closed cases (`ravanan_batch_*`).
 ## Variance components (`pve`) on this path
 
 `gemma-loco.scm`'s `gwa` step passes `-pve`, as the direct path does, and
-`compute_ravanan` reads the components back **out of each chromosome's
-extracted GWA archive**, not from the copy gemma-wrapper keeps beside it.
-
-That difference is deliberate. The copy beside the archive is a gemma-wrapper
-5eb53fa feature, and a ravanan job runs whatever `gemma-wrapper` its own Guix
-manifest resolves -- which need not be that new. The `.log.txt` has been inside
-the archive all along, and the archive is unpacked anyway to read the
-chromosome's `.assoc.txt`, so reading it costs nothing extra.
+`compute_ravanan` reads the components back **out of each job's own
+`.log.txt`**, which the workflow returns as a first-class CWL output
+(`gwa_log`). No archive is unpacked and no wrapper-named copy is involved:
+the workflow runs `gemma` itself, so the log is just a file it produced.
 
 The note is the same shape as `/compute/gemma`'s: every chromosome's `pve` and
 `se(pve)`, the lowest and highest with their `vg`/`ve`. Each log is labelled by
@@ -88,17 +85,16 @@ with `ccwl compile --output=/tmp/w.cwl cwl/gemma/gemma-loco.scm`), the archive
 reader is unit-tested, and a real archive from this deployment does carry the
 `pve` block -- but a full ravanan request could not be completed here:
 ravanan's own Guix evaluation of the manifest and its intern of the input files
-fail (see below), and a job that did start sat "Waiting for lock" on
-gemma-wrapper's `$HOME/<hash>.lck` until the call timed out. None of that is
-about `-pve`, and all of it would show up identically on a run without it.
+fail (see below). None of that is about `-pve`, and all of it would show up
+identically on a run without it.
 
 Two environment facts found while trying, both worth fixing before this path is
 trusted:
 
 - `GUIX_PACKAGE_PATH` must be in the **server's** environment, since ravanan
   resolves `--guix-manifest` against the ambient Guix; the production process
-  does not set it, so `/compute/gemma/ravanan` cannot resolve `gemma-wrapper` at
-  all there. Without it the manifest fails with a message about an unrelated
+  does not set it, so `/compute/gemma/ravanan` cannot resolve `gemma` at all
+  there. Without it the manifest fails with a message about an unrelated
   package (`rust-pyo3-0.26.0: unbound variable`) from the user's channel config.
 - ravanan interns each input file into `--store` with a hard link, so the store
   and every input path must be on the same filesystem; `/tmp` and the
@@ -127,11 +123,14 @@ Four things had to be right, and three of them were not obvious:
   an older ravanan.
 - **The server's `HOME` must be writable by the job user inside the
   cluster.** ravanan forwards the submitting process's `HOME` into every
-  job (as `sbatch` would), and `gemma-wrapper` locks
-  `$HOME/.<hash>.lck`; inside the container there is no `/home/wrk`, so
-  every kinship job failed with `can not release ... .lck because it is not
-  owned by me` / `EACCES`. Starting the API with
-  `HOME=<a directory on the shared mount>` fixed it. This is a
+  job (as `sbatch` would) and jobs inherit it. This mattered when the jobs
+  ran `gemma-wrapper`, which locks `$HOME/.<hash>.lck`: inside the container
+  there is no `/home/wrk`, so every kinship job failed with `can not
+  release ... .lck because it is not owned by me` / `EACCES`, and starting
+  the API with `HOME=<a directory on the shared mount>` fixed it. The
+  workflow now runs `gemma` itself, which takes no such lock -- the
+  requirement is kept here because ravanan still forwards `HOME` and a
+  future step could assume it. This is a
   *server-side* setting, not a node one.
 - **`GUIX_PACKAGE_PATH`**, as above: ravanan resolves the manifest against
   the ambient Guix, so without it the manifest cannot see