-
Notifications
You must be signed in to change notification settings - Fork 0
/
execute.smk
31 lines (29 loc) · 1.6 KB
/
execute.smk
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
rule execute:
input:
pfile=f"results/{paramspace.wildcard_pattern}.preped",
prepedcase = [f"results/simulations/{paramspace.wildcard_pattern}/processor{pid}/constant" for pid in range(config["processors"])]
output:
resfile=f"results/{paramspace.wildcard_pattern}.res",
results_pressurefield= protected([f"results/simulations/{paramspace.wildcard_pattern}/{proc}/{config['endtime']}/p"
for proc in[f"processor{id}" for id in range(config["processors"])]]),
results_temperaturefield= protected([f"results/simulations/{paramspace.wildcard_pattern}/{proc}/{config['endtime']}/T"
for proc in[f"processor{id}" for id in range(config["processors"])]]),
results_velocityfield= protected([f"results/simulations/{paramspace.wildcard_pattern}/{proc}/{config['endtime']}/U"
for proc in[f"processor{id}" for id in range(config["processors"])]]),
results_densityfield= protected([f"results/simulations/{paramspace.wildcard_pattern}/{proc}/{config['endtime']}/rho"
for proc in[f"processor{id}" for id in range(config["processors"])]]),
params:
casedirs = f"results/simulations/{paramspace.wildcard_pattern}/",
log: f"logs/{paramspace.wildcard_pattern}/execute.log"
container:
"docker://openfoamplus/of_v2006_centos73"
threads: config["processors"]
shell:
"""
(
touch {output.resfile}
cd {params.casedirs}
set +euo pipefail;. /opt/OpenFOAM/setImage_v2006.sh ;set -euo pipefail;
mpirun --oversubscribe -n {threads} rhoPimpleFoam -parallel
) 2> {log}
"""