diff --git a/src/run-policy/run-submit-pol-job.py b/src/run-policy/run-submit-pol-job.py index d9fdf1728df917adf5a39abcab0a17db1c305599..716784c2ee445fc1358efe560b3f7a1f031d44d4 100755 --- a/src/run-policy/run-submit-pol-job.py +++ b/src/run-policy/run-submit-pol-job.py @@ -20,10 +20,8 @@ def parse_args(): parser.add_argument('-o','--outdir', type=str, help="Directory to store the policy output in", default='/data/rc/gpfs-policy/data') - parser.add_argument('-f','--outfile', type=str, - help="Base name of the output file. Defaults to 'list-policy_[device-id]' where 'device-id'" - "is the device stem when device is a path or just device when it is a fileset. The final" - "file name will have the policy type, the job ID, and the run date tagged on the end") + parser.add_argument('-f','--log-prefix', type=str, + help="Prefix for the policy output file. Defaults to 'list-policy_[device-id]' where 'device-id' is the device stem when device is a path or just device when it is a fileset. The final file name will have the policy type, the job ID, and the run date tagged on the end") parser.add_argument('--with-dirs', action='store_true', help="Include directories as entries in the policy output (Default: false)") @@ -107,12 +105,12 @@ def validate_output_directory(outdir): raise ValueError(f"{p} is not a valid output directory") return p -def create_default_outfile(device): +def create_default_log_prefix(device): if device.match('/data/user'): - outfile = 'list-policy_data_user' + log_prefix = 'list-policy_data_user' else: - outfile = f'list-policy_{device.stem}' - return outfile + log_prefix = f'list-policy_{device.stem}' + return log_prefix def main(): args = parse_args() @@ -126,15 +124,15 @@ def main(): args['outdir'] = validate_output_directory(args['outdir']) - if args['outfile'] is None: - args['outfile'] = create_default_outfile(args['device']) + if args['log_prefix'] is None: + args['log_prefix'] = create_default_log_prefix(args['device']) if args['with_dirs']: 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) + cmd = "./submit-pol-job -o {outdir} -f {log_prefix} -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)