P9: scaling on a RAM disk (bench --work/--clean, cloud task p9b)
This commit is contained in:
1 parent
f0d3739493
commit
d40da1d670
2 files changed
+35
-1
No files matched your search
+6
-1
@@ -15,6 +15,7 @@ import argparse
|
||||
import datetime as dt
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
@@ -61,6 +62,8 @@ def main() -> int:
|
||||
ap.add_argument("--samples", type=int, default=0, help="use the first N samples (0 = all)")
|
||||
ap.add_argument("--simurg", default=str(Path(sys.executable).with_name("simurg")))
|
||||
ap.add_argument("--pure-python", action="store_true", help="run with SIMURG_PURE_PYTHON=1")
|
||||
ap.add_argument("--work", type=Path, help="folder for the GTC outputs (e.g. a tmpfs); default: --out")
|
||||
ap.add_argument("--clean", action="store_true", help="delete each run's GTCs after timing it")
|
||||
a = ap.parse_args()
|
||||
a.out.mkdir(parents=True, exist_ok=True)
|
||||
idats = subset(a.idats, a.samples, a.out / "idats")
|
||||
@@ -68,7 +71,7 @@ def main() -> int:
|
||||
env = {**os.environ, "SIMURG_PURE_PYTHON": "1" if a.pure_python else "0"}
|
||||
runs = []
|
||||
for t in (int(x) for x in a.threads.split(",")):
|
||||
out = a.out / f"t{t}"
|
||||
out = (a.work or a.out) / f"t{t}"
|
||||
t0 = time.time()
|
||||
cmd = [a.simurg, "genotype", "--bpm", a.bpm, "--egt", a.egt, "--idats", str(idats), "--out", str(out),
|
||||
"--threads", str(t), "--no-cohort-qc", "--autocall-date", "1/1/2026 12:00:00 AM",
|
||||
@@ -76,6 +79,8 @@ def main() -> int:
|
||||
rc = subprocess.run(cmd, env=env).returncode
|
||||
wall = time.time() - t0
|
||||
setup, phase = phase_seconds(out / "logs" / "genotype.log")
|
||||
if a.clean:
|
||||
shutil.rmtree(out / "samples", ignore_errors=True)
|
||||
runs.append(
|
||||
{
|
||||
"threads": t,
|
||||
|
||||
Reference in new issue
Block a user