| 91 | } |
| 92 | |
| 93 | void CompleteEnvProto(of::EnvProto& env_proto) { |
| 94 | auto bootstrap_conf = env_proto.mutable_ctrl_bootstrap_conf(); |
| 95 | auto master_addr = bootstrap_conf->mutable_master_addr(); |
| 96 | const std::string addr = GetEnvVar("MASTER_ADDR", "127.0.0.1"); |
| 97 | master_addr->set_host(addr); |
| 98 | master_addr->set_port(GetEnvVar("MASTER_PORT", FindFreePort(addr))); |
| 99 | bootstrap_conf->set_world_size(GetEnvVar("WORLD_SIZE", 1)); |
| 100 | bootstrap_conf->set_rank(GetEnvVar("RANK", 0)); |
| 101 | |
| 102 | auto cpp_logging_conf = env_proto.mutable_cpp_logging_conf(); |
| 103 | if (HasEnvVar("GLOG_log_dir")) { cpp_logging_conf->set_log_dir(GetEnvVar("GLOG_log_dir", "")); } |
| 104 | if (HasEnvVar("GLOG_logtostderr")) { |
| 105 | cpp_logging_conf->set_logtostderr(GetEnvVar("GLOG_logtostderr", -1)); |
| 106 | } |
| 107 | if (HasEnvVar("GLOG_logbuflevel")) { |
| 108 | cpp_logging_conf->set_logbuflevel(GetEnvVar("GLOG_logbuflevel", -1)); |
| 109 | } |
| 110 | if (HasEnvVar("GLOG_minloglevel")) { |
| 111 | cpp_logging_conf->set_minloglevel(GetEnvVar("GLOG_minloglevel", -1)); |
| 112 | } |
| 113 | } |
| 114 | } // namespace |
| 115 | |
| 116 | OneFlowEnv::OneFlowEnv() { |
no test coverage detected