forked from NSAPH-Projects/space
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSnakefile
More file actions
53 lines (43 loc) · 1.31 KB
/
Snakefile
File metadata and controls
53 lines (43 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# This file is used to generate all the baselines for the paper.
from omegaconf import OmegaConf
conda: "benchmarks/conda.yaml"
# == Load configs ==
if len(config) == 0:
raise Exception(
"No config file passed to snakemake."
" Use flag --configfile benchmarks/conf/pipeline.yaml"
)
# make target files
targets = []
for t_type in ("disc", "cont"):
envs = config["spaceenvs"][t_type]
algos = config["algorithms"][t_type]
for env in envs:
for algo in algos:
logfile = f"{config['logdir']}/{env}/{algo}.jsonl"
targets.append(logfile)
# == Define rules ==
rule all:
input:
targets,
rule train_spaceenv:
output:
config["logdir"] + "/{spaceenv}/{algo}.jsonl",
threads: config["concurrency"] * config["cpus_per_task"]
resources:
mem_mb=config["mem_mb"],
params:
concurrency=config["concurrency"],
overwrite=config["overwrite"],
log:
err="logs/{spaceenv}/{algo}.err",
shell:
"""
python benchmarks/run.py \
algo={wildcards.algo} \
spaceenv={wildcards.spaceenv} \
concurrency={params.concurrency} \
overwrite={params.overwrite} \
hydra.run.dir=logs/{wildcards.spaceenv}/{wildcards.algo} \
2> {log.err}
"""