Browse Source

!293 Modify the order of init and open of TDT

Merge pull request !293 from hanjun996/modify_tdt
tags/v0.7.0-beta
mindspore-ci-bot Gitee 5 years ago
parent
commit
02f58cc91b
1 changed files with 5 additions and 7 deletions
  1. +5
    -7
      mindspore/ccsrc/utils/context/ms_context.cc

+ 5
- 7
mindspore/ccsrc/utils/context/ms_context.cc View File

@@ -192,13 +192,6 @@ bool MsContext::OpenTsd() {
}

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


Loading…
Cancel
Save