!3664 Modify the order of init and open of TDT

Merge pull request !3664 from hanjun996/master
pull/3664/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 8f35d2ed29

@ -194,20 +194,20 @@ bool MsContext::OpenTsd() {
} }
MS_LOG(INFO) << "Device id = " << device_id << ", rank size = " << rank_size << "."; MS_LOG(INFO) << "Device id = " << device_id << ", rank size = " << rank_size << ".";
TDT_StatusT status = tdt::TsdClient::GetInstance()->Open(device_id, rank_size); TDT_StatusT status = tdt::TsdClient::GetInstance()->Open(device_id, rank_size);
if (status != TDT_OK) { if (status != TDT_OK) {
MS_LOG(EXCEPTION) << "Device " << device_id << " is occupied, open tsd failed, status = " << status << "."; MS_LOG(EXCEPTION) << "Device " << device_id << " is occupied, open tsd failed, status = " << status << ".";
return false; return false;
} }
tsd_ref_++;
#ifdef ENABLE_TDTQUE
int32_t initStatus = tdt::TdtHostInit(device_id); int32_t initStatus = tdt::TdtHostInit(device_id);
if (initStatus != TDT_OK_CODE) { if (initStatus != TDT_OK_CODE) {
MS_LOG(EXCEPTION) << "Init tsd failed, status = " << initStatus << "."; MS_LOG(EXCEPTION) << "Init tsd failed, status = " << initStatus << ".";
return false; return false;
} }
tdt_print_ = std::thread(TensorPrint()); tdt_print_ = std::thread(TensorPrint());
tsd_ref_++; #endif
MS_LOG(INFO) << "Open and init tsd successful, tsd reference = " << tsd_ref_ << "."; MS_LOG(INFO) << "Open and init tsd successful, tsd reference = " << tsd_ref_ << ".";
return true; return true;
} }

Loading…
Cancel
Save