Commit 021072ae authored by Lukas Weber's avatar Lukas Weber

export more job information to custom cmds to enable self restarting

jobs
parent 53e01627
......@@ -35,17 +35,19 @@ def generate_batchscript_claix18(cmd, jobname, jobconfig):
custom_cmds += jobconfig.get('custom_cmds', '')
custom_post_cmds = jobconfig.get('custom_post_cmds', '')
job_parameters = {
'jobname': jobname,
'mpirun': jobconfig.get('mpirun','mpirun'),
'mem_per_cpu': jobconfig.get('mem_per_cpu','2G'),
'walltime': jobconfig['mc_walltime'],
'num_cores': jobconfig['num_cores'],
'mc_cmd': ' '.join(cmd),
}
job_parameters['custom_cmds'] = custom_cmds.format(**job_parameters)
job_parameters['custom_post_cmds'] = custom_post_cmds.format(**job_parameters)
try:
return template.format(
jobname=jobname,
mpirun=jobconfig.get('mpirun','mpirun'),
mem_per_cpu=jobconfig.get('mem_per_cpu','2G'),
walltime=jobconfig['mc_walltime'],
num_cores=jobconfig['num_cores'],
custom_cmds=custom_cmds,
custom_post_cmds=custom_post_cmds,
mc_cmd=' '.join(cmd)
)
return template.format(**job_parameters)
except KeyError as e:
raise Exception('Error: required key "{}" missing in jobconfig'.format(e.args[0]))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment