diff --git a/src/lib/ptree/ptree.lua b/src/lib/ptree/ptree.lua index 0fe4f348ea..f1add44a15 100644 --- a/src/lib/ptree/ptree.lua +++ b/src/lib/ptree/ptree.lua @@ -64,6 +64,7 @@ local manager_config_spec = { } local worker_opt_spec = { + acquire_cpu = {default=true}, -- Needs dedicated CPU core? restart_intensity = {default=0}, -- How many restarts are permitted... restart_period = {default=0} -- ...within period seconds. } @@ -303,6 +304,7 @@ function Manager:compute_workers_aux (worker_app_graphs, worker_opts) for id in pairs(worker_app_graphs) do local worker_opt = lib.parse(worker_opts[id] or {}, worker_opt_spec) local worker_aux = { + acquire_cpu = worker_opt.acquire_cpu, restart = { period = worker_opt.restart_period, intensity = worker_opt.restart_intensity, @@ -373,7 +375,9 @@ end function Manager:compute_scheduling_for_worker(id, app_graph) local ret = {} for k, v in pairs(self.worker_default_scheduling) do ret[k] = v end - ret.cpu = self:acquire_cpu_for_worker(id, app_graph) + if self.workers_aux[id].acquire_cpu then + ret.cpu = self:acquire_cpu_for_worker(id, app_graph) + end return ret end