Skip to content
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

Inverted definition of allocation and utilization #87

Open
tfesenbecker opened this issue Jan 28, 2020 · 2 comments · May be fixed by #94
Open

Inverted definition of allocation and utilization #87

tfesenbecker opened this issue Jan 28, 2020 · 2 comments · May be fixed by #94
Labels
bug Something isn't working question Further information is requested

Comments

@tfesenbecker
Copy link
Contributor

I am currently under the impression that the definition of allocation and utilization might be inverted in

lapis/lapis/drone.py

Lines 88 to 96 in 989b805

def _init_allocation_and_utilisation(self):
levels = self.resources.levels
resources = []
for resource_key in self._valid_resource_keys:
resources.append(
getattr(levels, resource_key) / self.pool_resources[resource_key]
)
self._allocation = max(resources)
self._utilisation = min(resources)

As levels is aequivalent to the amount of unallocated resources on the machine, the allocation and utilization should be given by
self._allocation = min(resources) and self._utilisation = max(resources) respectively or am I mistaken?

@tfesenbecker tfesenbecker added bug Something isn't working question Further information is requested labels Jan 28, 2020
@mschnepf
Copy link
Member

The definition in the code seam correct according to the definition in the docu:
https://cobald.readthedocs.io/en/latest/source/model/pool_model.html#allocation-versus-utilisation

@rcaspart
Copy link
Member

From what I see and understood from having had a quick look at it on Monday, the problem is not simply a mixup of min vs max. Rather the problem, as mentioned be Tabea, is that the levels give the amount of unused resources.
As a result, allocation and utilisation are wrong here and should rather be self._allocation = 1 - min(resources) and self._utilisation = 1 - max(resources) or, to have the representation more consistent with the documentation, the calculation for the resources can be changed respectively.
@maxfischer2781 @eileen-kuehn, any input?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants