Skip to content
Snippets Groups Projects
Commit 70cefbac authored by Yngve Levinsen's avatar Yngve Levinsen
Browse files

added supporting templates

if you have templates head.tmp, queue.tmp in
running directory then these are used instead..
parent d416bd14
No related branches found
No related tags found
No related merge requests found
......@@ -233,3 +233,59 @@ if __name__=="__main__":
setup(args)
ask(args)
execute(args.calc_dir,args.multi>1)
# supporting templates..
HEAD_TEMPLATE='''
universe = Vanilla
# Without this, condor does not transfer files to tmp directory, and PWD is submit directory when running on localhost
should_transfer_files = yes
initialdir = {args.calc_dir}/Local_TraceWin_$(Process)
transfer_input_files = {input_files}
requirements = ( OpSys == "LINUX" || OpSys == "OSX" )
log = condor.log
executable = TraceWin_exe/tracewin.$$(OpSys).$$(Arch)
'''
HEAD_MULTI_TEMPLATE='''
universe = Vanilla
# Without this, condor does not transfer files to tmp directory, and PWD is submit directory when running on localhost
should_transfer_files = yes
initialdir = {args.calc_dir}/Local_TraceWin_$(Process)
requirements = ( OpSys == "LINUX" || OpSys == "OSX" )
log = condor.log
executable = TraceWin_exe/tracewin.$$(OpSys).$$(Arch)
'''
QUEUE_TEMPLATE='''
priority = {q_priority}
arguments = 1 {stat_study} {rand}
queue 1
'''
QUEUE_MULTI_TEMPLATE='''
initialdir = {args.calc_dir}/{job_folder}
transfer_input_files = {input_files}
priority = {q_priority}
arguments = 1 {stat_study} {rand}
queue 1
'''
def get_head_template(filename='head.tmp'):
return _get_template(filename,QUEUE_TEMPLATE)
def get_head_multi_template(filename='head.multi.tmp'):
return _get_template(filename,QUEUE_MULTI_TEMPLATE)
def get_queue_template(filename='queue.tmp'):
return _get_template(filename,QUEUE_TEMPLATE)
def get_queue_multi_template(filename='queue.multi.tmp'):
return _get_template(filename,QUEUE_MULTI_TEMPLATE)
def _get_template(filename, template):
'''
Only to be used by get_NN_template()
'''
import os
if os.path.exists(filename):
return file(filename).read()
else:
return template
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment