83 |
|
config = BetterConfigParser() |
84 |
|
config.read(configs) |
85 |
|
|
86 |
+ |
def dump_config(configs,output_file): |
87 |
+ |
""" |
88 |
+ |
Dump all the configs in a output file |
89 |
+ |
Args: |
90 |
+ |
output_file: the file where the log will be dumped |
91 |
+ |
configs: list of files (string) to be dumped |
92 |
+ |
Returns: |
93 |
+ |
nothing |
94 |
+ |
""" |
95 |
+ |
outf = open(output_file,'w') |
96 |
+ |
for i in configs: |
97 |
+ |
try: |
98 |
+ |
f=open(i,'r') |
99 |
+ |
outf.write(f.read()) |
100 |
+ |
except: print '@WARNING: Config' + i + ' not found. It will not be used.' |
101 |
|
|
102 |
|
def compile_macro(config,macro): |
103 |
|
""" |
150 |
|
repDict['name'] = '%(job)s_%(en)s%(task)s' %repDict |
151 |
|
command = 'qsub -V -cwd -q %(queue)s -l h_vmem=6G -N %(name)s -o %(logpath)s/%(timestamp)s_%(job)s_%(en)s_%(task)s.out -e %(logpath)s/%(timestamp)s_%(job)s_%(en)s_%(task)s.err runAll.sh %(job)s %(en)s ' %(repDict) + opts.task + ' ' + repDict['job_id'] + ' ' + repDict['additional'] |
152 |
|
print command |
153 |
+ |
dump_config(configs,"%(logpath)s/%(timestamp)s_%(job)s_%(en)s_%(task)s.config" %(repDict)) |
154 |
|
subprocess.call([command], shell=True) |
155 |
|
|
156 |
|
if opts.task == 'train': |
178 |
|
for item in Plot_vars: |
179 |
|
submit(item,repDict) |
180 |
|
|
181 |
+ |
if opts.task == 'trainReg': |
182 |
+ |
repDict['queue'] = 'all.q' |
183 |
+ |
submit('trainReg',repDict) |
184 |
+ |
|
185 |
|
|
186 |
|
elif opts.task == 'dc': |
187 |
|
repDict['queue'] = 'short.q' |