JobParameters
DIRAC Workload Management System utility module to get available memory and processors
- DIRAC.WorkloadManagementSystem.Utilities.JobParameters.getAvailableRAM(siteName=None, gridCE=None, queue=None)
Gets the available RAM on a certain CE/queue/node (what the pilot administers)
The siteName/gridCE/queue parameters are normally not necessary.
Tries to find it in this order: 1) from the /Resources/Computing/CEDefaults/MaxRAM (which is what the pilot might fill up) 2) if not present looks in CS for “MemoryLimitMB” Queue or CE or site option 3) if not present but there’s WholeNode tag, look what the WN provides using _getMemoryFromProc() 4) return 0
- DIRAC.WorkloadManagementSystem.Utilities.JobParameters.getJobParameters(jobIDs: list[int], parName: str | None, vo: str = '') dict
Utility to get a job parameter for a list of jobIDs pertaining to a VO. If the jobID is not in the JobParametersDB, it will be looked up in the JobDB.
Requires direct access to the JobParametersDB and JobDB.
- Parameters:
jobIDs – list of jobIDs
parName – name of the parameter to be retrieved
vo – VO of the jobIDs
- Returns:
dictionary with jobID as key and the parameter as value
- Return type:
- DIRAC.WorkloadManagementSystem.Utilities.JobParameters.getMemoryFromProc()
- DIRAC.WorkloadManagementSystem.Utilities.JobParameters.getNumberOfGPUs(siteName=None, gridCE=None, queue=None)
Gets GPUs on a certain CE/queue/node (what the pilot administers)
The siteName/gridCE/queue parameters are normally not necessary.
Tries to find it in this order: 1) from the /Resources/Computing/CEDefaults/GPUs (which is what the pilot might fill up) 2) if not present looks in CS for “NumberOfGPUs” Queue or CE option 3) return 0
- DIRAC.WorkloadManagementSystem.Utilities.JobParameters.getNumberOfJobProcessors(jobID)
Gets the number of processors allowed for the job. This can be used to communicate to your job payload the number of processors it’s allowed to use, so this function should be called from your extension.
If the JobAgent is using “InProcess” CE (which is the default), then what’s returned will basically be the same of what’s returned by the getNumberOfProcessors() function above
- DIRAC.WorkloadManagementSystem.Utilities.JobParameters.getNumberOfProcessors(siteName=None, gridCE=None, queue=None)
gets the number of processors on a certain CE/queue/node (what the pilot administers)
The siteName/gridCE/queue parameters are normally not necessary.
Tries to find it in this order: 1) from the /Resources/Computing/CEDefaults/NumberOfProcessors (which is what the pilot fills up) 2) if not present looks in CS for “NumberOfProcessors” Queue or CE option 3) if not present but there’s WholeNode tag, look what the WN provides using multiprocessing.cpu_count() 4) return 1
- DIRAC.WorkloadManagementSystem.Utilities.JobParameters.getRAMForJob(jobID)
Gets the RAM allowed for the job. This can be used to communicate to your job payload the RAM it’s allowed to use, so this function should be called from your extension.
If the JobAgent is using “InProcess” CE (which is the default), then what’s returned will basically be the same of what’s returned by the getAvailableRAM() function above