提交 6d77435d 编写于 作者: Z zhangchaoltt 提交者: Jiangtao Hu

framework: set default processor num when there is no process sched conf (#1946)

上级 7c7f3f9f
......@@ -41,6 +41,7 @@ record_conf {
scheduler_conf {
routine_num: 100
default_proc_num: 2
}
perf_conf {
......
......@@ -8,6 +8,7 @@ import "cyber/proto/choreography_conf.proto";
message SchedulerConf {
optional string policy = 1;
optional uint32 routine_num = 2;
optional ClassicConf classic_conf = 3;
optional ChoreographyConf choreography_conf = 4;
optional uint32 default_proc_num = 3;
optional ClassicConf classic_conf = 4;
optional ChoreographyConf choreography_conf = 5;
}
......@@ -59,10 +59,13 @@ SchedulerClassic::SchedulerClassic() {
}
}
} else {
// fallback default sched config. To avoid every process launchs
// too many threads, limit to 2 cpus for process w/o explicit config.
proc_num_ = 2;
// FIXME: other vals ... ?
auto& global_conf = GlobalData::Instance()->Config();
if (global_conf.has_scheduler_conf() &&
global_conf.scheduler_conf().has_default_proc_num()) {
proc_num_ = global_conf.scheduler_conf().default_proc_num();
} else {
proc_num_ = 2;
}
}
// Currently for compatible with task/task_manager.cc:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册