From f5e899abd682eb6206e5011614e4c60f8a082d7c Mon Sep 17 00:00:00 2001 From: hanjun996 Date: Tue, 28 Jul 2020 19:23:33 +0800 Subject: [PATCH] sync tdt --- mindspore/ccsrc/utils/context/ms_context.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/utils/context/ms_context.cc b/mindspore/ccsrc/utils/context/ms_context.cc index d6381ec7e8..4a9be65869 100644 --- a/mindspore/ccsrc/utils/context/ms_context.cc +++ b/mindspore/ccsrc/utils/context/ms_context.cc @@ -192,18 +192,22 @@ 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; } - tdt_print_ = std::thread(TensorPrint()); +#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 << "."; return false; } tsd_ref_++; +#ifdef ENABLE_TDTQUE + tdt_print_ = std::thread(TensorPrint()); +#endif MS_LOG(INFO) << "Open and init tsd successful, tsd reference = " << tsd_ref_ << "."; return true; }