def getArgs(vals=None): import batchJobArgs parser = batchJobArgs.argParser('Initialize grid using settings file') parser.add_argument('batchPath', help='root directory containing/to contain the grid (e.g. ./PLA where directories base, base_xx etc are under ./PLA)') parser.add_argument('settingName', nargs='?', help='python setting file (without .py) for making or updating a grid, usually found as python/settingName.py') parser.add_argument('--readOnly', action='store_true', help='option to configure an already-run existing grid') return parser.parse_args(vals)
#!/usr/bin/env python import os, jobQueue, batchJobArgs parser = batchJobArgs.argParser("Submit a single job to queue") parser.add_argument('iniFile', nargs='+') jobQueue.addArguments(parser) args = parser.parse_args() ini = [ini.replace('.ini', '') for ini in args.iniFile] jobQueue.submitJob(os.path.basename(ini[0]), ini, msg=True, **args.__dict__)