From 7e02181d201e4902cec18c23d502891065a15caf Mon Sep 17 00:00:00 2001 From: Rendani Gangazhe Date: Sat, 27 May 2023 14:04:49 +0200 Subject: [PATCH] Make memory allocated nullable and correctly calculated normalized TDP per core --- client/src/components/CarbonEmissions/CarbonEmissions.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/CarbonEmissions/CarbonEmissions.vue b/client/src/components/CarbonEmissions/CarbonEmissions.vue index 3b854ce7b94..2a890290700 100644 --- a/client/src/components/CarbonEmissions/CarbonEmissions.vue +++ b/client/src/components/CarbonEmissions/CarbonEmissions.vue @@ -20,7 +20,7 @@ export interface CarbonEmissionsProps { }; jobRuntime: number; coresAllocated: number; - memoryAllocated: number; + memoryAllocated?: number; } const props = withDefaults(defineProps(), { @@ -38,7 +38,7 @@ const carbonEmissions = computed(() => { const runtime = props.jobRuntime / (60 * 60); // Convert to hours const memoryAllocated = props.memoryAllocated / 1024; // Convert to gibibyte const tdpPerCore = cpu.tdp / cpu.coreCount; - const normalizedTdpPerCore = tdpPerCore * props.jobRuntime; + const normalizedTdpPerCore = tdpPerCore * props.coresAllocated; // Power needed in Watt const powerNeededCpu = powerUsageEffectiveness * normalizedTdpPerCore;