-
Notifications
You must be signed in to change notification settings - Fork 15
/
HB
executable file
·45 lines (40 loc) · 1.22 KB
/
HB
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
#!/usr/bin/env python
import sys
import getopt
from mpi4py import MPI
comm = MPI.COMM_WORLD
#size = comm.Get_size()
#rank = comm.Get_rank()
#name = MPI.Get_processor_name()
def main(argv):
edir = ''
try:
opts, args = getopt.getopt(argv,"hm:t:",["mfile=","mtype="])
except getopt.GetoptError:
print('HB -m <mfile> -t <mtype>')
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
print('HB -m <mfile> -t <mtype>')
sys.exit()
elif opt in ("-m", "--mfile"):
mfile = arg
elif opt in ("-t", "--mtype"):
mtype = arg
if mtype == 'preprocess':
print("HydroBlocks: Preprocess",flush=True)
import preprocessing.preprocessing
preprocessing.preprocessing.driver(comm,mfile)
#preprocessing.driver(comm,edir)
elif mtype == 'model':
print("HydroBlocks: Model",flush=True)
import model.model
model.model.run(comm,mfile)
elif mtype == 'postprocess':
print("HydroBlocks: Postprocess",flush=True)
import postprocessing.postprocessing
postprocessing.postprocessing.driver(comm,mfile)
else:
print("The mtype provided is not an option")
if __name__ == "__main__":
main(sys.argv[1:])