From d3323cb2ec10f3fc2873b8547e7a596d5542f9f5 Mon Sep 17 00:00:00 2001 From: Sukrit Kalra Date: Thu, 28 Mar 2024 09:02:27 -0700 Subject: [PATCH] Implement CPU multiplier for Alibaba trace. --- data/alibaba_loader.py | 8 ++++++-- main.py | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/data/alibaba_loader.py b/data/alibaba_loader.py index 23d5076e..24b1e986 100644 --- a/data/alibaba_loader.py +++ b/data/alibaba_loader.py @@ -107,6 +107,7 @@ def __init__( self._workload = Workload.empty(flags) self._heterogeneous = self._flags.alibaba_enable_heterogeneous_resource_type + self._task_cpu_multiplier = self._flags.alibaba_loader_task_cpu_multiplier self._task_cpu_divisor = self._flags.alibaba_loader_task_cpu_divisor self._task_cpu_usage_min = self._flags.alibaba_loader_task_cpu_usage_min self._task_cpu_usage_max = self._flags.alibaba_loader_task_cpu_usage_max @@ -540,8 +541,11 @@ def _convert_job_data_to_job_graph( if self._task_cpu_usage_random: # We randomly generate the task CPU utilization between the bounds. - resource_usage = self._rng.randint( - self._task_cpu_usage_min, self._task_cpu_usage_max + resource_usage = ( + self._rng.randint( + self._task_cpu_usage_min, self._task_cpu_usage_max + ) + * self._task_cpu_multiplier ) job_resources_1 = Resources( resource_vector={ diff --git a/main.py b/main.py index fb5e9b19..3ff454b1 100644 --- a/main.py +++ b/main.py @@ -148,6 +148,12 @@ ) # AlibabaLoader related flags. +flags.DEFINE_integer( + "alibaba_loader_task_cpu_multiplier", + 1, + "The multiplier used on the resources after all the minimum and maximum clipping " + "has been done.", +) flags.DEFINE_integer( "alibaba_loader_task_cpu_divisor", 25,