def submit(N, K): jobs = [] for i in range(K): j = Job() j._auto__init__() j.backend = LCG() j.backend.middleware = 'GLITE' j.splitter = GenericSplitter() j.splitter.attribute = 'application.args' j.splitter.values = [['x']] * N j.submit() jobs.append(j) import time def finished(): for j in jobs: if not j.status in ['failed', 'completed']: return False return True while not finished(): time.sleep(1) return jobs
def makeRegisteredJob(): """Makes a new Job and registers it with the Registry""" from Ganga.GPIDev.Lib.Job.Job import Job j = Job() j._auto__init__() return j