-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinitialise_site_runs.py
executable file
·82 lines (61 loc) · 2.01 KB
/
initialise_site_runs.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env python
"""
Checkout CABLE repositories, build executables and generate a qsub script to
wrap cable benchmarking scripts when used on raijin.
We can't use the run_comparison script as raijin nodes have no internet
connection.
That's all folks.
"""
__author__ = "Martin De Kauwe"
__version__ = "1.0 (16.06.2020)"
__email__ = "[email protected]"
import os
import sys
import datetime
import subprocess
from optparse import OptionParser
from user_options import *
sys.path.append("scripts")
from get_cable import GetCable
from build_cable import BuildCable
from generate_qsub_script import create_qsub_script
# i.e. if on NCI
if ("Mac" not in nodename and
"MacBook" not in nodename and
"imac" not in nodename and
"unsw" not in nodename):
create_qsub_script(qsub_fname, ncpus, mem, wall_time, project,
email_address)
parser = OptionParser()
parser.add_option("-s", "--skipbuild", action="store_true", default=False,
help="Rebuild src?")
parser.add_option("-g", "--skipget", action="store_true", default=False,
help="Get src?")
(options, args) = parser.parse_args()
if options.skipget == False:
#
## Get CABLE ...
#
G = GetCable(src_dir=src_dir, user=user)
G.main(repo_name=repos[0], trunk=trunk) # Default is True
# Run on a users branch, not integration
if repos[1] != "integration":
get_user_branch = True
else:
get_user_branch = False
if share_branch:
get_user_branch = False
G.main(repo_name=repos[1], trunk=False, user_branch=get_user_branch,
share_branch=share_branch) # integration branch
if options.skipbuild == False:
#
## Build CABLE ...
#
B = BuildCable(src_dir=src_dir, NCDIR=NCDIR, NCMOD=NCMOD, FC=FC,
CFLAGS=CFLAGS, LD=LD, LDFLAGS=LDFLAGS)
B.main(repo_name=repos[0])
if share_branch:
#print(os.path.basename(repos[1]))
B.main(repo_name=os.path.basename(repos[1]))
else:
B.main(repo_name=repos[1])