def getCondorStatus(collector_names, constraint=None, format_list=None, want_format_completion=True, want_glideins_only=True): type_constraint = '(True)' if format_list is not None: if want_format_completion: format_list = condorMonitor.complete_format_list( format_list, [('State', 's'), ('Activity', 's'), ('EnteredCurrentState', 'i'),('EnteredCurrentActivity', 'i'), ('LastHeardFrom', 'i'), ('GLIDEIN_Factory', 's'), ('GLIDEIN_Name', 's'), ('GLIDEIN_Entry_Name', 's'), ('GLIDECLIENT_Name', 's'), ('GLIDECLIENT_ReqNode','s'), ('GLIDEIN_Schedd', 's')]) ########################################################################### # Parag: Nov 24, 2014 # To get accounting info related to idle/running/total cores, you need to # get the partitionable slot (ie parent slot) classads as well. # Move the type_constraint below to individual getCondorStatus* filtering # # Partitionable slots are *always* idle # The frontend only counts them when all the subslots have been # reclaimed (HTCondor sets TotalSlots == 1) #type_constraint = '(PartitionableSlot =!= True || TotalSlots =?= 1)' ########################################################################### if want_glideins_only: type_constraint += '&&(IS_MONITOR_VM=!=True)&&(GLIDEIN_Factory=!=UNDEFINED)&&(GLIDEIN_Name=!=UNDEFINED)&&(GLIDEIN_Entry_Name=!=UNDEFINED)' return getCondorStatusConstrained(collector_names, type_constraint, constraint, format_list)
def getCondorStatus(collector_names, constraint=None, format_list=None): if format_list is not None: format_list = condorMonitor.complete_format_list(format_list, [('State', 's'), ('Activity', 's'), ('EnteredCurrentState', 'i'), ('EnteredCurrentActivity', 'i'), ('LastHeardFrom', 'i'), ('GLIDEIN_Factory', 's'), ('GLIDEIN_Name', 's'), ('GLIDEIN_Entry_Name', 's'), ('GLIDECLIENT_Name', 's'), ('GLIDECLIENT_ReqNode','s'), ('GLIDEIN_Schedd', 's')]) type_constraint = '(IS_MONITOR_VM=!=True)&&(GLIDEIN_Factory=!=UNDEFINED)&&(GLIDEIN_Name=!=UNDEFINED)&&(GLIDEIN_Entry_Name=!=UNDEFINED)' # Partitionable slots are *always* idle -- the frontend only counts them when # all the subslots have been reclaimed (HTCondor sets TotalSlots == 1) type_constraint += '&& (PartitionableSlot =!= True || TotalSlots =?= 1)' return getCondorStatusConstrained(collector_names, type_constraint, constraint, format_list)
def getCondorStatusSchedds(collector_names, constraint=None, format_list=None, want_format_completion=True): if format_list is not None: if want_format_completion: format_list = condorMonitor.complete_format_list( format_list, [('TotalRunningJobs', 'i'), ('TotalSchedulerJobsRunning', 'i'), ('TransferQueueNumUploading', 'i'), ('MaxJobsRunning', 'i'), ('TransferQueueMaxUploading', 'i'), ('CurbMatchmaking', 'i')]) type_constraint = 'True' return getCondorStatusConstrained(collector_names, type_constraint, constraint, format_list, subsystem_name="schedd")
def getCondorStatusSchedds(collector_names, constraint=None, format_list=None, want_format_completion=True): if format_list is not None: if want_format_completion: format_list = condorMonitor.complete_format_list( format_list, [('TotalRunningJobs', 'i'), ('TotalSchedulerJobsRunning', 'i'), ('TransferQueueNumUploading','i'), ('MaxJobsRunning','i'), ('TransferQueueMaxUploading','i'), ('CurbMatchmaking','i')]) type_constraint = 'True' return getCondorStatusConstrained(collector_names, type_constraint, constraint, format_list, subsystem_name="schedd")
def getCondorQ(schedd_names, constraint=None, format_list=None, want_format_completion=True, job_status_filter=(1, 2)): if format_list is not None: if want_format_completion: format_list = condorMonitor.complete_format_list( format_list, [("JobStatus", "i"), ("EnteredCurrentStatus", "i"), ("ServerTime", "i"), ("RemoteHost", "s")], ) if not job_status_filter: # if nothing specified, assume it wants all of them js_constraint = "True" else: js_arr = [] for n in job_status_filter: js_arr.append("(JobStatus=?=%i)" % n) js_constraint = string.join(js_arr, "||") return getCondorQConstrained(schedd_names, js_constraint, constraint, format_list)
def getCondorQ(schedd_names, constraint=None, format_list=None, want_format_completion=True, job_status_filter=(1, 2)): if format_list is not None: if want_format_completion: format_list = condorMonitor.complete_format_list( format_list, [('JobStatus', 'i'), ('EnteredCurrentStatus', 'i'), ('ServerTime', 'i'), ('RemoteHost', 's')]) if not job_status_filter: # if nothing specified, assume it wants all of them js_constraint="True" else: js_arr=[] for n in job_status_filter: js_arr.append('(JobStatus=?=%i)'%n) js_constraint=string.join(js_arr, '||') return getCondorQConstrained(schedd_names, js_constraint, constraint, format_list)
def getCondorQ(schedd_names, constraint=None, format_list=None, want_format_completion=True, job_status_filter=(1,2)): if format_list is not None: if want_format_completion: format_list = condorMonitor.complete_format_list( format_list, [('JobStatus', 'i'), ('EnteredCurrentStatus', 'i'), ('ServerTime', 'i'), ('RemoteHost', 's')]) if not job_status_filter: # if nothing specified, assume it wants all of them js_constraint="True" else: js_arr=[] for n in job_status_filter: js_arr.append('(JobStatus=?=%i)'%n) js_constraint=string.join(js_arr,'||') return getCondorQConstrained(schedd_names, js_constraint, constraint, format_list)
def getCondorStatus(collector_names, constraint=None, format_list=None, want_format_completion=True, want_glideins_only=True): """ Return a dictionary of collectors containing interesting classads Each element is a condorStatus @param collector_names: @param constraint: @param format_list: @param want_format_completion: @param want_glideins_only: @return: """ type_constraint = '(True)' if format_list is not None: if want_format_completion: format_list = condorMonitor.complete_format_list( format_list, [('State', 's'), ('Activity', 's'), ('EnteredCurrentState', 'i'), ('EnteredCurrentActivity', 'i'), ('LastHeardFrom', 'i'), ('GLIDEIN_Factory', 's'), ('GLIDEIN_Name', 's'), ('GLIDEIN_Entry_Name', 's'), ('GLIDECLIENT_Name', 's'), ('GLIDECLIENT_ReqNode', 's'), ('GLIDEIN_Schedd', 's')]) ########################################################################### # Parag: Nov 24, 2014 # To get accounting info related to idle/running/total cores, you need to # get the partitionable slot (ie parent slot) classads as well. # Move the type_constraint below to individual getCondorStatus* filtering # # Partitionable slots are *always* idle # The frontend only counts them when all the subslots have been # reclaimed (HTCondor sets TotalSlots == 1) # type_constraint = '(PartitionableSlot =!= True || TotalSlots =?= 1)' ########################################################################### if want_glideins_only: type_constraint += '&&(IS_MONITOR_VM=!=True)&&(GLIDEIN_Factory=!=UNDEFINED)&&(GLIDEIN_Name=!=UNDEFINED)&&(GLIDEIN_Entry_Name=!=UNDEFINED)' return getCondorStatusConstrained(collector_names, type_constraint, constraint, format_list)
def getCondorQ(schedd_names, constraint=None, format_list=None): if format_list is not None: format_list = condorMonitor.complete_format_list(format_list, [('JobStatus', 'i'), ('EnteredCurrentStatus', 'i'), ('ServerTime', 'i'), ('RemoteHost', 's')]) return getCondorQConstrained(schedd_names, "(JobStatus=?=1)||(JobStatus=?=2)", constraint, format_list)