from pandajedi.jedicore.JediTaskBufferInterface import JediTaskBufferInterface from pandajedi.jediorder.JobThrottler import JobThrottler tbIF = JediTaskBufferInterface() tbIF.setupInterface() vo = 'atlas' prodSourceLabel = 'managed' cloud = 'WORLD' # get SiteMapper siteMapper = tbIF.getSiteMapper() wqMap = tbIF.getWorkQueueMap() jt = JobThrottler(vo, prodSourceLabel) jt.initializeMods(tbIF) workQueues = wqMap.getAlignedQueueList(vo, prodSourceLabel) resource_types = tbIF.load_resource_types() for workQueue in workQueues: for resource_type in resource_types: print( jt.toBeThrottled(vo, prodSourceLabel, cloud, workQueue, resource_type.resource_name))
jediTaskID = int(sys.argv[1]) datasetIDs = None if len(sys.argv) > 2: datasetIDs = [int(sys.argv[2])] s, taskSpec = tbIF.getTaskWithID_JEDI(jediTaskID) cloudName = taskSpec.cloud vo = taskSpec.vo prodSourceLabel = taskSpec.prodSourceLabel queueID = taskSpec.workQueue_ID gshare_name = taskSpec.gshare workQueue = tbIF.getWorkQueueMap().getQueueWithID(queueID, gshare_name) threadPool = ThreadPool() # get typical number of files #typicalNumFilesMap = tbIF.getTypicalNumInput_JEDI(vo,prodSourceLabel,workQueue, # useResultCache=600) typicalNumFilesMap = {} tmpListList = tbIF.getTasksToBeProcessed_JEDI( None, vo, workQueue, prodSourceLabel, cloudName,
import sys jediTaskID = int(sys.argv[1]) try: datasetID = [int(sys.argv[2])] except: datasetID = None s,taskSpec = tbIF.getTaskWithID_JEDI(jediTaskID) cloudName = taskSpec.cloud vo = taskSpec.vo prodSourceLabel = taskSpec.prodSourceLabel queueID = taskSpec.workQueue_ID workQueue = tbIF.getWorkQueueMap().getQueueWithID(queueID) brokerageLockIDs = ListWithLock([]) threadPool = ThreadPool() # get typical number of files typicalNumFilesMap = tbIF.getTypicalNumInput_JEDI(vo,prodSourceLabel,workQueue, useResultCache=600) tmpListList = tbIF.getTasksToBeProcessed_JEDI(None,vo,workQueue, prodSourceLabel, cloudName,nFiles=10,simTasks=[jediTaskID], fullSimulation=True, typicalNumFilesMap=typicalNumFilesMap, simDatasets=datasetID)
from pandajedi.jedicore.JediTaskBufferInterface import JediTaskBufferInterface tbIF = JediTaskBufferInterface() tbIF.setupInterface() vo = 'atlas' prodSourceLabel = 'managed' # get SiteMapper siteMapper = tbIF.getSiteMapper() wqMap = tbIF.getWorkQueueMap() tmpSt,jobStat = tbIF.getJobStatWithWorkQueuePerCloud_JEDI(vo,prodSourceLabel) from pandajedi.jedithrottle.JobThrottler import JobThrottler jt = JobThrottler(vo,prodSourceLabel) jt.initialize(tbIF) print jt.toBeThrottled(vo,'US',wqMap.getQueueWithID(3),jobStat)
import sys jediTaskID = int(sys.argv[1]) try: datasetID = [int(sys.argv[2])] except: datasetID = None s, taskSpec = tbIF.getTaskWithID_JEDI(jediTaskID) cloudName = taskSpec.cloud vo = taskSpec.vo prodSourceLabel = taskSpec.prodSourceLabel queueID = taskSpec.workQueue_ID workQueue = tbIF.getWorkQueueMap().getQueueWithID(queueID) brokerageLockIDs = ListWithLock([]) threadPool = ThreadPool() # get typical number of files typicalNumFilesMap = tbIF.getTypicalNumInput_JEDI(vo, prodSourceLabel, workQueue, useResultCache=600) tmpListList = tbIF.getTasksToBeProcessed_JEDI( None, vo, workQueue,
ddmIF.setupInterface() jediTaskID = int(sys.argv[1]) s, taskSpec = tbIF.getTaskWithID_JEDI(jediTaskID, False) body = TaskBroker(None, tbIF, ddmIF, taskSpec.vo, taskSpec.prodSourceLabel) body.initializeMods(tbIF, ddmIF) taskParam = tbIF.getTaskParamsWithID_JEDI(jediTaskID) taskParamMap = RefinerUtils.decodeJSON(taskParam) vo = taskParamMap['vo'] prodSourceLabel = taskParamMap['prodSourceLabel'] taskType = taskParamMap['taskType'] workQueueMapper = tbIF.getWorkQueueMap() workQueue = workQueueMapper.getQueueWithIDGshare(taskSpec.workQueue_ID, taskSpec.gshare) impl = body.getImpl(vo, prodSourceLabel) tmpListItem = tbIF.getTasksToBeProcessed_JEDI(None, None, None, None, None, simTasks=[jediTaskID], readMinFiles=True) impl.doBrokerage(tmpListItem, taskSpec.vo, taskSpec.prodSourceLabel, workQueue, taskSpec.resource_type)
tbIF.setupInterface() siteMapper = tbIF.getSiteMapper() ddmIF = DDMInterface() ddmIF.setupInterface() jediTaskID = int(sys.argv[1]) # get task attributes s, taskSpec = tbIF.getTaskWithID_JEDI(jediTaskID) pid = '{0}-{1}_{2}-sgen'.format(socket.getfqdn().split('.')[0], os.getpid(), os.getpgrp()) vo = taskSpec.vo prodSourceLabel = taskSpec.prodSourceLabel workQueue = tbIF.getWorkQueueMap().getQueueWithIDGshare( taskSpec.workQueue_ID, taskSpec.gshare) # get inputs tmpList = tbIF.getTasksToBeProcessed_JEDI(pid, None, workQueue, None, None, nFiles=1000, target_tasks=[jediTaskID]) inputList = ListWithLock(tmpList) # create thread threadPool = ThreadPool() taskSetupper = TaskSetupper(vo, prodSourceLabel) taskSetupper.initializeMods(tbIF, ddmIF)
import sys jediTaskID = int(sys.argv[1]) datasetIDs = None if len(sys.argv) > 2: datasetIDs = [int(sys.argv[2])] s,taskSpec = tbIF.getTaskWithID_JEDI(jediTaskID) cloudName = taskSpec.cloud vo = taskSpec.vo prodSourceLabel = taskSpec.prodSourceLabel queueID = taskSpec.workQueue_ID gshare_name = taskSpec.gshare workQueue = tbIF.getWorkQueueMap().getQueueWithID(queueID, gshare_name) threadPool = ThreadPool() # get typical number of files #typicalNumFilesMap = tbIF.getTypicalNumInput_JEDI(vo,prodSourceLabel,workQueue, # useResultCache=600) typicalNumFilesMap = {} tmpListList = tbIF.getTasksToBeProcessed_JEDI(None,vo,workQueue, prodSourceLabel, cloudName,nFiles=10,simTasks=[jediTaskID], fullSimulation=True, typicalNumFilesMap=typicalNumFilesMap, simDatasets=datasetIDs)