diff --git a/data/alibaba_loader.py b/data/alibaba_loader.py index 52005f3c..50a0cb5f 100644 --- a/data/alibaba_loader.py +++ b/data/alibaba_loader.py @@ -114,6 +114,7 @@ def __init__( 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 self._task_cpu_usage_random = self._flags.alibaba_loader_task_cpu_usage_random + self._alibaba_bump_resources_of_low_duration_task = self._flags.alibaba_bump_resources_of_low_duration_task def _construct_workload_definitions( self, @@ -549,6 +550,10 @@ def _convert_job_data_to_job_graph( ) * self._task_cpu_multiplier ) + # bump up the resources of low duration tasks + if self._alibaba_bump_resources_of_low_duration_task and task.actual_duration < 4: + resource_usage = self._task_cpu_usage_max + job_resources_1 = Resources( resource_vector={ Resource(name="Slot_1", _id="any"): resource_usage, diff --git a/main.py b/main.py index 3ff454b1..3bc974d7 100644 --- a/main.py +++ b/main.py @@ -160,6 +160,11 @@ "The divisor used when converting alibaba trace tasks task.cpu to slot. The lower " "the number, the higher the slots.", ) +flags.DEFINE_bool( + "alibaba_bump_resources_of_low_duration_task", + False, + "If True, the lower duration task resources would be bumped to max", +) flags.DEFINE_bool( "alibaba_loader_task_cpu_usage_random", False,