aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java2
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);