def startJobTree(self, options): """Runs jobtree using the given options (see Stack.getDefaultOptions and Stack.addJobTreeOptions). """ setLoggingFromOptions(options) options.jobTree = os.path.abspath(options.jobTree) if os.path.isdir(options.jobTree): config, batchSystem = reloadJobTree(options.jobTree) else: config, batchSystem = createJobTree(options) #Setup first job. command = self.makeRunnable(options.jobTree) memory = self.getMemory() cpu = self.getCpu() time = self.getRunTime() if memory != sys.maxint: if cpu != sys.maxint: createFirstJob(command, config, memory=memory, cpu=cpu, time=time) else: createFirstJob(command, config, memory=memory, time=time) else: if cpu != sys.maxint: createFirstJob(command, config, cpu=cpu, time=time) else: createFirstJob(command, config, time=time) loadEnvironment(config) return mainLoop(config, batchSystem)
def runJobTreeScript(options): """Builds the basic job tree, or takes an existing one and runs the job tree master script. """ setLoggingFromOptions(options) assert options.jobTree != None #We need a job tree, or a place to create one if os.path.isdir(options.jobTree): config, batchSystem = reloadJobTree(options.jobTree) else: assert options.command != None config, batchSystem = createJobTree(options) #Setup first job. createFirstJob(options.command, config) loadEnvironment(config) return mainLoop(config, batchSystem)
def startJobTree(self, options): """Runs jobtree using the given options (see Stack.getDefaultOptions and Stack.addJobTreeOptions). """ self.verifyJobTreeOptions(options) setLoggingFromOptions(options) options.jobTree = absSymPath(options.jobTree) if os.path.isdir(options.jobTree): config, batchSystem = reloadJobTree(options.jobTree) else: config, batchSystem = createJobTree(options) #Setup first job. command = self.makeRunnable(options.jobTree) memory = self.getMemory() cpu = self.getCpu() createFirstJob(command, config, memory=memory, cpu=cpu) loadEnvironment(config) return mainLoop(config, batchSystem)