-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_simulations_swift.py
60 lines (48 loc) · 1.54 KB
/
prepare_simulations_swift.py
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
54
55
56
57
58
59
60
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 22 16:59:03 2022
@author: ben
"""
from sys import argv
from write_monofonic_conf import generate_config
from pathlib import Path
from create_dir_and_write_params_swift import create_dir_and_write_params_swift
from directories import swift_output_basedir
from write_job_script_swift import write_job_script
def main(Nres: int, Lbox: float, waveforms: list):
for form in waveforms:
#write monofonic conf from template file
generate_config(
Nres = Nres,
Lbox = Lbox,
outputdir = Path(f"/gpfs/data/fs71636/fglatter/monofonic_exp_{form}/"),
waveform = form
)
#create directory in swift_output_basedir and write param file for swift there
create_dir_and_write_params_swift(
Nres = Nres,
Lbox = Lbox,
waveform = form,
output_basedir = swift_output_basedir
)
#write job scripts
write_job_script(
Nres = Nres,
Lbox = Lbox,
waveform = form,
output_dir = swift_output_basedir / f"{form}_{Nres}_{Lbox:.0f}"
)
if __name__ == "__main__":
if argv[3] == "all":
waveforms = ["DB2", "DB4", "DB6", "DB8", "DB10", "shannon"]
else:
waveforms = argv[3:len(argv)]
assert len(waveforms) <= 6
Nres = int(argv[1])
Lbox = float(argv[2])
main(
Nres=Nres,
Lbox=Lbox,
waveforms=waveforms
)