-
Notifications
You must be signed in to change notification settings - Fork 184
[9.0] more on RAM matching #8414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
301496f
d55bd71
057f8a5
e3a310d
8b7fef4
4eaa121
d3c8663
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,11 @@ | |
| from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB | ||
| from DIRAC.WorkloadManagementSystem.DB.JobLoggingDB import JobLoggingDB | ||
| from DIRAC.WorkloadManagementSystem.DB.PilotAgentsDB import PilotAgentsDB | ||
| from DIRAC.WorkloadManagementSystem.DB.TaskQueueDB import TaskQueueDB, multiValueMatchFields, singleValueDefFields | ||
| from DIRAC.WorkloadManagementSystem.DB.TaskQueueDB import ( | ||
| TaskQueueDB, | ||
| multiValueMatchFields, | ||
| singleValueDefFields, | ||
| ) | ||
|
|
||
|
|
||
| class PilotVersionError(Exception): | ||
|
|
@@ -69,8 +73,8 @@ def selectJob(self, resourceDescription, credDict): | |
|
|
||
| # Make a nice print of the resource matching parameters | ||
| toPrintDict = dict(resourceDict) | ||
| if "MaxRAM" in resourceDescription: | ||
| toPrintDict["MaxRAM"] = resourceDescription["MaxRAM"] | ||
| if "MaxRAM" in resourceDict: | ||
| toPrintDict["MaxRAM"] = resourceDict["MaxRAM"] | ||
| if "NumberOfProcessors" in resourceDescription: | ||
| toPrintDict["NumberOfProcessors"] = resourceDescription["NumberOfProcessors"] | ||
| toPrintDict["Tag"] = [] | ||
|
|
@@ -167,11 +171,7 @@ def _processResourceDescription(self, resourceDescription): | |
| """ | ||
|
|
||
| resourceDict = {} | ||
| for name in singleValueDefFields: | ||
| if name in resourceDescription: | ||
| resourceDict[name] = resourceDescription[name] | ||
|
|
||
| for name in multiValueMatchFields: | ||
| for name in singleValueDefFields + multiValueMatchFields + ("MaxRAM",): | ||
| if name in resourceDescription: | ||
| resourceDict[name] = resourceDescription[name] | ||
|
|
||
|
|
@@ -192,25 +192,18 @@ def _processResourceDescription(self, resourceDescription): | |
| if "JobID" in resourceDescription: | ||
| resourceDict["JobID"] = resourceDescription["JobID"] | ||
|
|
||
| # Convert MaxRAM and NumberOfProcessors parameters into a list of tags | ||
| maxRAM = resourceDescription.get("MaxRAM") | ||
| if maxRAM: | ||
| try: | ||
| maxRAM = int(maxRAM) | ||
| except ValueError: | ||
| maxRAM = None | ||
| # Convert NumberOfProcessors parameters into a list of tags | ||
| nProcessors = resourceDescription.get("NumberOfProcessors") | ||
| if nProcessors: | ||
| try: | ||
| nProcessors = int(nProcessors) | ||
| except ValueError: | ||
| nProcessors = None | ||
| for param, key, limit, increment in [(maxRAM, "MB", 1024 * 1024, 256), (nProcessors, "Processors", 1024, 1)]: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious, don't you need that mechanism anymore?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update: I think I get it, it's because you now define range values, right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The mechanism is still there, just it's only needed for Processors (since RAM requirements are not stored anymore as tags). |
||
| if param and param <= limit: | ||
| paramList = list(range(increment, param + increment, increment)) | ||
| paramTags = ["%d%s" % (par, key) for par in paramList] | ||
| if paramTags: | ||
| resourceDict.setdefault("Tag", []).extend(paramTags) | ||
| if nProcessors and nProcessors <= 1024: | ||
| paramList = list(range(1, nProcessors + 1, 1)) | ||
| paramTags = ["%d%s" % (par, "Processors") for par in paramList] | ||
| if paramTags: | ||
| resourceDict.setdefault("Tag", []).extend(paramTags) | ||
|
|
||
| # Add 'MultiProcessor' to the list of tags | ||
| if nProcessors and nProcessors > 1: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for not having a
rangeValueMatchFieldsinTaskQueueDBthat would containMaxRAM?So that we avoid having hardcoded value like
MaxRAMspread throughout the code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rangeValueMatchFieldsalso includesMinRAM, which here is not needed.