Commit e6560aac authored by laochailan's avatar laochailan

make loadl utility react to bad returncodes

and disable python backtraces because it mostly gets in the way of the user
parent 932dcf29
......@@ -6,6 +6,8 @@ import subprocess
from loadleveller import jobfile
import os
sys.excepthook = lambda exception_type, exception, traceback: print(f'{exception_type.__name__}: {exception}')
parser = argparse.ArgumentParser(description='Helper script for running and managing loadleveller Monte Carlo jobs.', usage='''loadl <command> <jobscript> [<args>]
<jobscript> is an executable that prints the job parameter JSON-file to stdout. It is convenient to use the taskmaker python module for this purpose.
......@@ -73,7 +75,7 @@ def run():
if args_run.single:
cmd = '{} single "{}"'.format(job.jobconfig['mc_binary'], job_input_filename)
print('$ '+cmd), shell=True)
result =, shell=True, check=True)
else:, job.jobconfig, [job.jobconfig['mc_binary'], job_input_filename])
import tempfile
import os
import sys
import subprocess
batchscript_claix18 = '''#!/usr/bin/env zsh
......@@ -74,7 +75,7 @@ def run(jobname, jobconfig, cmd):
if sysinfo == 'local':
mpicmd = '{} -n {} {}'.format(jobconfig.get('mpirun', 'mpirun'), jobconfig['num_cores'], ' '.join(cmd))
print('$ '+mpicmd)
os.system(mpicmd), shell=True, check=True)
with tempfile.NamedTemporaryFile(mode='w',delete=False) as f:
batchscript = generate_batchscript(sysinfo, cmd, jobname, jobconfig)
......@@ -83,5 +84,6 @@ def run(jobname, jobconfig, cmd):
bscriptname =
mpicmd = batch_commands[sysinfo].format(batchscript=bscriptname)
print('$ '+mpicmd)
result =, shell=True)
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