Skip to content
Snippets Groups Projects

Add submit pol wrapper

Merged Matthew K Defenderfer requested to merge add-submit-pol-wrapper into main
1 unresolved thread
1 file
+ 8
4
Compare changes
  • Side-by-side
  • Inline
@@ -8,7 +8,8 @@ from exceptions import InvalidDeviceError, ValueError
description = """
Interface for non-privileged users to execute the run-mmpol.sh script with elevated permissions. Calls the
submit-pol-job wrapper
submit-pol-job wrapper. The default applied policy is ./policy-def/list-path-external but can be changed to
./policy-def/list-path-dirplus using the --with-dirs flag. No other policy is available via this script.
"""
def parse_args():
@@ -128,9 +129,12 @@ def main():
if args['outfile'] is None:
args['outfile'] = create_default_outfile(args['device'])
cmd = "./submit-pol-job -o {outdir} -f {outfile} -N {nodes} -c {cores} -p {partition} -t {time} -m {mem_per_cpu} {device}".format(**args)
if args['with_dirs']:
cmd = f'{cmd} --with-dirs'
if args['with_dir']:
args['policy'] = './policy-def/list-path-dirplus'
else:
args['policy'] = './policy-def/list-path-external'
cmd = "./submit-pol-job -o {outdir} -f {outfile} -P {policy} -N {nodes} -c {cores} -p {partition} -t {time} -m {mem_per_cpu} {device}".format(**args)
print(f"Command: {cmd}")
subprocess.run(cmd,shell=True)
Loading