def try_boost_resource()

in smallpond/execution/scheduler.py [0:0]


    def try_boost_resource(self, item: WorkItem, executor: RemoteExecutor):
        if (
            item._cpu_boost == 1
            and item._memory_boost == 1
            and isinstance(item, Task)
            and item.node_id in self.logical_nodes
            and self.logical_nodes[item.node_id].enable_resource_boost
        ):
            boost_cpu = max(
                item._cpu_limit,
                min(
                    item._cpu_limit * 2,
                    executor.available_cpus,
                    executor.cpu_count // 2,
                ),
            )
            boost_mem = max(
                item._memory_limit,
                min(
                    item._memory_limit * 2,
                    executor.available_memory,
                    executor.memory_size // 2,
                ),
            )
            if item._cpu_limit < boost_cpu or item._memory_limit < boost_mem:
                item._cpu_boost = boost_cpu / item._cpu_limit
                item._memory_boost = boost_mem / item._memory_limit
                logger.info(f"boost resource usage of {repr(item)}: {item.cpu_limit} CPUs, {item.memory_limit/GB:.3f}GB")