diff --git a/mindspore/ccsrc/debug/debugger/debugger.cc b/mindspore/ccsrc/debug/debugger/debugger.cc index 31315e603bb..9b509f4e729 100644 --- a/mindspore/ccsrc/debug/debugger/debugger.cc +++ b/mindspore/ccsrc/debug/debugger/debugger.cc @@ -147,22 +147,8 @@ void Debugger::EnableDebugger() { } if (debugger_enabled_) { - // configure grpc host - std::string env_host_str = common::GetEnv("MS_DEBUGGER_HOST"); - std::string host; - if (!env_host_str.empty()) { - if (CheckIp(env_host_str)) { - MS_LOG(INFO) << "Getenv MS_DEBUGGER_HOST: " << env_host_str; - host = env_host_str; - } else { - debugger_enabled_ = false; - MS_EXCEPTION(ValueError) << "Environment variable MS_DEBUGGER_HOST isn't a valid IP address. " - "Please set environment variable MS_DEBUGGER_HOST=x.x.x.x to a valid IP"; - } - } else { - MS_LOG(INFO) << "Environment variable MS_DEBUGGER_HOST doesn't exist. Using default debugger host: localhost"; - host = "localhost"; - } + std::string host = "localhost"; + // configure grpc port std::string env_port_str = common::GetEnv("MS_DEBUGGER_PORT"); std::string port; @@ -1134,17 +1120,6 @@ bool Debugger::CheckPort(const std::string &port) const { return true; } -bool Debugger::CheckIp(const std::string &host) const { - std::regex reg_ip( - "(25[0-4]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9])" - "[.](25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])" - "[.](25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])" - "[.](25[0-4]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[1-9])"); - std::smatch smat; - std::string host_str = host; - return std::regex_match(host_str, smat, reg_ip); -} - uint32_t Debugger::GetFirstRunGraphId() const { return rungraph_id_list_.front(); } void Debugger::LoadSingleAnfnode(const AnfNodePtr &anf_node, const size_t output_index) { diff --git a/mindspore/ccsrc/debug/debugger/debugger.h b/mindspore/ccsrc/debug/debugger/debugger.h index de1c8668b9c..49e103ea082 100644 --- a/mindspore/ccsrc/debug/debugger/debugger.h +++ b/mindspore/ccsrc/debug/debugger/debugger.h @@ -235,9 +235,6 @@ class Debugger : public std::enable_shared_from_this { // Check if the port is valid bool CheckPort(const std::string &port) const; - // Check if the IP is valid - bool CheckIp(const std::string &host) const; - void LoadSingleAnfnode(const AnfNodePtr &anf_node, const size_t output_index); // class members