From 53474b5cee0b877b14d9504f22b99f603915709a Mon Sep 17 00:00:00 2001 From: hanjun996 Date: Tue, 4 Aug 2020 20:09:31 +0800 Subject: [PATCH] Modify interface of open and close of tdt --- mindspore/ccsrc/utils/context/ms_context.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/utils/context/ms_context.cc b/mindspore/ccsrc/utils/context/ms_context.cc index b3320b03607..c0ce5c45fed 100644 --- a/mindspore/ccsrc/utils/context/ms_context.cc +++ b/mindspore/ccsrc/utils/context/ms_context.cc @@ -192,7 +192,7 @@ bool MsContext::OpenTsd() { } 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 = TsdOpen(device_id, rank_size); if (status != TDT_OK) { MS_LOG(EXCEPTION) << "Device " << device_id << " is occupied, open tsd failed, status = " << status << "."; return false; @@ -238,7 +238,9 @@ bool MsContext::CloseTsd(bool force) { MS_LOG(ERROR) << "tdt thread join failed: " << e.what(); } #endif - TDT_StatusT status = tdt::TsdClient::GetInstance()->Close(); + unsigned int device_id; + device_id = device_id_; + TDT_StatusT status = TsdClose(device_id); if (status != TDT_OK) { MS_LOG(EXCEPTION) << "Close tsd failed, status = " << status << "."; return false;