def submitJob(ini): global iniFiles ini = ini.replace('.ini', '') if not args.dryrun: print 'Submitting...' + ini else: print '... ' + ini iniFiles.append(ini) if args.combineOneJobName: return if len(iniFiles) >= args.runsPerJob: if args.runsPerJob > 1: print '--> jobName: ', jobName() jobQueue.submitJob(jobName(), iniFiles, **args.__dict__) iniFiles = []
#!/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__)
if not args.dryrun: print 'Submitting...' + ini else: print '... ' + ini iniFiles.append(ini) if args.combineOneJobName: return if len(iniFiles) >= args.runsPerJob: if args.runsPerJob > 1: print '--> jobName: ', jobName() jobQueue.submitJob(jobName(), iniFiles, **args.__dict__) iniFiles = [] for jobItem in Opts.filteredBatchItems(wantSubItems=args.subitems): if ((not args.notexist or isMinimize and not jobItem.chainMinimumExists() or not isMinimize and not jobItem.chainExists()) and (not args.minimize_failed or not jobItem.chainMinimumConverged()) and (isMinimize or args.notall is None or not jobItem.allChainExists(args.notall))) \ and (not isMinimize or getattr(jobItem, 'want_minimize', True)): if not args.parent_converge or not jobItem.isImportanceJob or jobItem.parent.hasConvergeBetterThan(args.parent_converge): if args.converge == 0 or not jobItem.hasConvergeBetterThan(args.converge, returnNotExist=True): if args.checkpoint_run is None or jobItem.wantCheckpointContinue(args.checkpoint_run) and jobItem.notRunning(): if (not jobItem.isImportanceJob or isMinimize or (args.importance_ready and jobItem.parent.chainFinished() or not args.importance_ready and jobItem.parent.chainExists()) and (not args.importance_changed or jobItem.parentChanged()) and (not args.parent_stopped or jobItem.parent.notRunning())): if not args.not_queued or notQueued(jobItem.name): submitJob(jobItem.iniFile(variant)) if len(iniFiles) > 0: if args.runsPerJob > 1: print '--> jobName: ', jobName() jobQueue.submitJob(args.combineOneJobName or jobName(), iniFiles, sequential=args.combineOneJobName is not None, **args.__dict__)