diff options
author | Ola Aunronning <olaa@yahooinc.com> | 2023-09-20 11:45:46 +0200 |
---|---|---|
committer | Ola Aunronning <olaa@yahooinc.com> | 2023-09-20 11:45:46 +0200 |
commit | e25bef15919124ccad19736f9ced8a06e14222a0 (patch) | |
tree | c255b243627ce2c0bbf58f3affc7d42e897173e0 /config-provisioning | |
parent | e87678f04fe3d0df67c226e0a8ef1ce0a4a4b4d3 (diff) |
Consider 'zero' GpuResources when accumulating
Diffstat (limited to 'config-provisioning')
-rw-r--r-- | config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java b/config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java index f9e6da14493..0d21b155571 100644 --- a/config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java @@ -144,12 +144,14 @@ public class NodeResources { public static GpuResources getDefault() { return zero; } public GpuResources plus(GpuResources other) { + if (other.isZero()) return this; var thisMem = this.count() * this.memoryGb(); var otherMem = other.count() * other.memoryGb(); return new NodeResources.GpuResources(1, thisMem + otherMem); } public GpuResources minus(GpuResources other) { + if (other.isZero()) return this; var thisMem = this.count() * this.memoryGb(); var otherMem = other.count() * other.memoryGb(); return new NodeResources.GpuResources(1, thisMem - otherMem); |