!4951 Fix missing symbol, build failure issue with -B on

Merge pull request !4951 from HarshvardhanGupta/multi_fix
This commit is contained in:
mindspore-ci-bot 2020-08-22 04:49:43 +08:00 committed by Gitee
commit 04decda0c5
3 changed files with 29 additions and 28 deletions

View File

@ -73,6 +73,7 @@ void DebugServices::CheckWatchpoints(std::vector<std::string> *name, std::vector
std::string current_tensor_name; std::string current_tensor_name;
std::unordered_map<unsigned int, watchpoint_t> watchpoints_to_check_table; std::unordered_map<unsigned int, watchpoint_t> watchpoints_to_check_table;
const size_t location = 0;
for (std::size_t i = 0; i < tensor_list.size(); i++) { for (std::size_t i = 0; i < tensor_list.size(); i++) {
current_tensor_name = tensor_list[i]->GetName(); current_tensor_name = tensor_list[i]->GetName();
@ -102,7 +103,7 @@ void DebugServices::CheckWatchpoints(std::vector<std::string> *name, std::vector
// check if the current node tensor name is included the watchpoint // check if the current node tensor name is included the watchpoint
std::string current_node_name = current_tensor_name.substr(0, current_tensor_name.find_first_of(":")); std::string current_node_name = current_tensor_name.substr(0, current_tensor_name.find_first_of(":"));
if ((w_type == true && (current_tensor_name.find(w_name) != string::npos || w_name == "*")) || if ((w_type == true && (current_tensor_name.find(w_name) == location || w_name == "*")) ||
(w_type == false && current_node_name == w_name)) { (w_type == false && current_node_name == w_name)) {
watchpoints_to_check_table[w_table_item.second.id] = w_table_item.second; watchpoints_to_check_table[w_table_item.second.id] = w_table_item.second;
break; break;

View File

@ -151,35 +151,34 @@ void Debugger::EnableDebugger() {
MS_LOG(WARNING) << "Memory Reuse is disabled. Set environment variable MS_DEBUGGER_PARTIAL_MEM=1 to reduce memory " MS_LOG(WARNING) << "Memory Reuse is disabled. Set environment variable MS_DEBUGGER_PARTIAL_MEM=1 to reduce memory "
"usage for large models."; "usage for large models.";
} }
#ifdef ENABLE_D
if (device_target_ == kAscendDevice) { // set operation overflow info
// set operation overflow info overflow_bin_path_ = DataDumpParser::GetInstance().GetOpOverflowBinPath(graph_ptr_->graph_id(), device_id_);
overflow_bin_path_ = DataDumpParser::GetInstance().GetOpOverflowBinPath(graph_ptr_->graph_id(), device_id_); // new overflow dump files will have a timestamp greater than last_overflow_bin_
// new overflow dump files will have a timestamp greater than last_overflow_bin_ last_overflow_bin_ = 0;
last_overflow_bin_ = 0; DIR *d;
DIR *d; d = opendir(overflow_bin_path_.c_str());
d = opendir(overflow_bin_path_.c_str()); if (d != nullptr) {
if (d != nullptr) { struct dirent *dir;
struct dirent *dir; while ((dir = readdir(d)) != NULL) {
while ((dir = readdir(d)) != NULL) { if (dir->d_type == DT_REG) {
if (dir->d_type == DT_REG) { std::string file_path = overflow_bin_path_;
std::string file_path = overflow_bin_path_; file_path.append(dir->d_name);
file_path.append(dir->d_name); std::size_t found = file_path.find_last_of(".");
std::size_t found = file_path.find_last_of("."); if (found == std::string::npos) {
if (found == std::string::npos) { continue;
continue;
}
std::string overflow_time = file_path.substr(found + 1);
if (stod(overflow_time) <= last_overflow_bin_) {
MS_LOG(INFO) << "Old op overflow bin folder" << file_path;
continue;
}
last_overflow_bin_ = stod(overflow_time);
} }
std::string overflow_time = file_path.substr(found + 1);
if (stod(overflow_time) <= last_overflow_bin_) {
MS_LOG(INFO) << "Old op overflow bin folder" << file_path;
continue;
}
last_overflow_bin_ = stod(overflow_time);
} }
MS_LOG(INFO) << "last op overflow bin folder" << last_overflow_bin_;
} }
MS_LOG(INFO) << "last op overflow bin folder" << last_overflow_bin_;
} }
#endif
// initialize grpc client // initialize grpc client
if (debugger_enabled_) { if (debugger_enabled_) {
@ -554,8 +553,9 @@ std::list<WatchpointHit> Debugger::CheckWatchpoints() {
std::vector<int> condition; std::vector<int> condition;
std::vector<unsigned int> watchpoint_id; std::vector<unsigned int> watchpoint_id;
std::vector<std::string> overflow_ops; std::vector<std::string> overflow_ops;
#ifdef ENABLE_D
overflow_ops = CheckOpOverflow(); overflow_ops = CheckOpOverflow();
#endif
debug_services_->CheckWatchpoints(&name, &slot, &condition, &watchpoint_id, overflow_ops); debug_services_->CheckWatchpoints(&name, &slot, &condition, &watchpoint_id, overflow_ops);
std::list<WatchpointHit> hits; std::list<WatchpointHit> hits;
for (unsigned int i = 0; i < name.size(); i++) { for (unsigned int i = 0; i < name.size(); i++) {

View File

@ -117,7 +117,7 @@ void GrpcClient::Init(const std::string &host, const std::string &port, const bo
int dwcaLen = i2d_X509(sk_X509_value(ca, 0), NULL); // get the length of private key int dwcaLen = i2d_X509(sk_X509_value(ca, 0), NULL); // get the length of private key
unsigned char *cabuf = (unsigned char *)malloc(sizeof(unsigned char) * dwcaLen); unsigned char *cabuf = (unsigned char *)malloc(sizeof(unsigned char) * dwcaLen);
i2d_X509(sk_X509_value(ca, 0), &cabuf); // PrivateKey DER code i2d_X509(sk_X509_value(ca, 0), &cabuf); // PrivateKey DER code
strcat = std::string(reinterpret_cast<char const *>(cabuf), dwcaLen); strca = std::string(reinterpret_cast<char const *>(cabuf), dwcaLen);
free(pribuf); free(pribuf);
free(certbuf); free(certbuf);