Skip to content

Commit cdca59b

Browse files
committed
feat: remove PilotManager dependency from HTCondorCE
1 parent 889337e commit cdca59b

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

src/DIRAC/Resources/Computing/HTCondorCEComputingElement.py

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
from DIRAC.Resources.Computing.BatchSystems.Condor import HOLD_REASON_SUBCODE, parseCondorStatus, subTemplate
6767
from DIRAC.Resources.Computing.ComputingElement import ComputingElement
6868
from DIRAC.WorkloadManagementSystem.Client import PilotStatus
69-
from DIRAC.WorkloadManagementSystem.Client.PilotManagerClient import PilotManagerClient
7069

7170
MANDATORY_PARAMETERS = ["Queue"]
7271
DEFAULT_WORKINGDIRECTORY = "/opt/dirac/pro/runit/WorkloadManagement/SiteDirectorHT"
@@ -386,33 +385,10 @@ def killJob(self, jobIDList):
386385

387386
#############################################################################
388387
def getCEStatus(self):
389-
"""Method to return information on running and pending jobs.
390-
391-
Warning: information currently returned depends on the PilotManager and not HTCondor.
392-
Results might be wrong if pilots or jobs are submitted manually via the CE.
393-
"""
394-
result = S_OK()
395-
result["SubmittedJobs"] = 0
396-
result["RunningJobs"] = 0
397-
result["WaitingJobs"] = 0
398-
399-
# getWaitingPilots
400-
condDict = {"DestinationSite": self.ceName, "Status": PilotStatus.PILOT_WAITING_STATES}
401-
res = PilotManagerClient().countPilots(condDict)
402-
if res["OK"]:
403-
result["WaitingJobs"] = int(res["Value"])
404-
else:
405-
self.log.warn(f"Failure getting pilot count for {self.ceName}: {res['Message']} ")
406-
407-
# getRunningPilots
408-
condDict = {"DestinationSite": self.ceName, "Status": PilotStatus.RUNNING}
409-
res = PilotManagerClient().countPilots(condDict)
410-
if res["OK"]:
411-
result["RunningJobs"] = int(res["Value"])
412-
else:
413-
self.log.warn(f"Failure getting pilot count for {self.ceName}: {res['Message']} ")
414-
415-
return result
388+
"""Method to return information on running and pending jobs."""
389+
return S_ERROR(
390+
"getCEStatus() not supported for HTCondorCEComputingElement: HTCondor does not expose this information"
391+
)
416392

417393
def getJobStatus(self, jobIDList):
418394
"""Get the status information for the given list of jobs"""

src/DIRAC/WorkloadManagementSystem/Agent/SiteDirector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from typing import Any
1515

1616
import DIRAC
17-
from DIRAC import S_ERROR, S_OK, gConfig
17+
from DIRAC import S_ERROR, S_OK
1818
from DIRAC.AccountingSystem.Client.DataStoreClient import gDataStoreClient
1919
from DIRAC.AccountingSystem.Client.Types.Pilot import Pilot as PilotAccounting
2020
from DIRAC.AccountingSystem.Client.Types.PilotSubmission import (

0 commit comments

Comments
 (0)