forked from adjtomo/seisflows
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsfsubmit
More file actions
executable file
·45 lines (29 loc) · 1.01 KB
/
Copy pathsfsubmit
File metadata and controls
executable file
·45 lines (29 loc) · 1.01 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
#!/usr/bin/env python
import argparse, os, sys
from seisflows.config import config, loadpy, tilde_expand, Dict
from seisflows.tools import unix
def getargs():
parser = argparse.ArgumentParser()
parser.add_argument('--workdir', nargs='?',
default=os.getcwd())
parser.add_argument('--parameter_file', nargs='?',
default='parameters.py')
parser.add_argument('--path_file', nargs='?',
default='paths.py')
return parser.parse_args()
if __name__ == "__main__":
### workflow submission script
args = getargs()
# register parameters
parameters = loadpy(args.parameter_file)
sys.modules['seisflows_parameters'] = Dict(parameters)
# register paths
paths = tilde_expand(loadpy(args.path_file))
sys.modules['seisflows_paths'] = Dict(paths)
unix.mkdir(args.workdir)
unix.cd(args.workdir)
config()
# submit workflow
workflow = sys.modules['seisflows_workflow']
system = sys.modules['seisflows_system']
system.submit(workflow)